text
stringlengths
4
6.14k
/* * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ #ifndef _JAVASOFT_WIN32_SOCKET_MD_H #include <jni.h> #include <sys/types.h> #include "sys.h" #include "socket_md.h" #define DBG_POLLIN 1 #define DBG_POLLOUT 2 #define DBG_EINPROGRESS -150 #define DBG_ETIMEOUT -200 int dbgsysSocketClose(int fd); int dbgsysConnect(int fd, struct sockaddr *him, int len); int dbgsysFinishConnect(int fd, long timeout); int dbgsysAccept(int fd, struct sockaddr *him, int *len); int dbgsysSendTo(int fd, char *buf, int len, int flags, struct sockaddr *to, int tolen); int dbgsysRecvFrom(int fd, char *buf, int nbytes, int flags, struct sockaddr *from, int *fromlen); int dbgsysListen(int fd, int backlog); int dbgsysRecv(int fd, char *buf, int nBytes, int flags); int dbgsysSend(int fd, char *buf, int nBytes, int flags); struct hostent *dbgsysGetHostByName(char *hostname); int dbgsysSocket(int domain, int type, int protocol); int dbgsysBind(int fd, struct sockaddr *name, int namelen); int dbgsysSetSocketOption(int fd, jint cmd, jboolean on, jvalue value); uint32_t dbgsysInetAddr(const char* cp); uint32_t dbgsysHostToNetworkLong(uint32_t hostlong); unsigned short dbgsysHostToNetworkShort(unsigned short hostshort); uint32_t dbgsysNetworkToHostLong(uint32_t netlong); unsigned short dbgsysNetworkToHostShort(unsigned short netshort); int dbgsysGetSocketName(int fd, struct sockaddr *him, int *len); int dbgsysConfigureBlocking(int fd, jboolean blocking); int dbgsysPoll(int fd, jboolean rd, jboolean wr, long timeout); int dbgsysGetLastIOError(char *buf, jint size); long dbgsysCurrentTimeMillis(); /* * TLS support */ int dbgsysTlsAlloc(); void dbgsysTlsFree(int index); void dbgsysTlsPut(int index, void *value); void* dbgsysTlsGet(int index); #endif
/* * This source code is a part of coLinux source package. * * Dan Aloni <da-x@colinux.org>, 2003 (c) * * The code is licensed under the GPL. See the COPYING file at * the root directory. */ #ifndef __CO_KERNEL_SYMBOLS_IMPORT_H__ #define __CO_KERNEL_SYMBOLS_IMPORT_H__ typedef struct { uintptr_t kernel_start; uintptr_t kernel_end; uintptr_t kernel_init_task_union; uintptr_t kernel_colinux_start; uintptr_t kernel_swapper_pg_dir; uintptr_t kernel_idt_table; uintptr_t kernel_gdt_table; uintptr_t kernel_co_arch_info; uintptr_t kernel_co_info; } co_symbols_import_t; #endif
#ifndef TONLEITER_MAINWIDGET_H #define TONLEITER_MAINWIDGET_H #include <qmainwindow.h> #include "fretboard.h" #include "menuwidget.h" #include "tonleiterdata.h" class MainWidget : public QMainWindow { Q_OBJECT private: Data::TonleiterData* data; Menu::MenuWidget* menuwidget; Graph::FretBoard* fretboard; bool showmenu; public: MainWidget(QWidget* parent=0,const char* name="MainWidget",WFlags f=0); virtual ~MainWidget(); static QString appName() { return QString::fromLatin1( QUICKAPP_NAME ); } private slots: void fretboardPressed(); }; #endif //TONLEITER_MAINWIDGET_H
/* * This file is part of libtile. * * Copyright (c) 2006 Novell, Inc. * * Libtile 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. * * Libtile 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 libslab; if not, write to the Free Software Foundation, Inc., 51 * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __APPLICATION_TILE_H__ #define __APPLICATION_TILE_H__ #include "nameplate-tile.h" #include <glib.h> #include <libmate-desktop/mate-desktop-item.h> G_BEGIN_DECLS #define APPLICATION_TILE_TYPE (application_tile_get_type ()) #define APPLICATION_TILE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), APPLICATION_TILE_TYPE, ApplicationTile)) #define APPLICATION_TILE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), APPLICATION_TILE_TYPE, ApplicationTileClass)) #define IS_APPLICATION_TILE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), APPLICATION_TILE_TYPE)) #define IS_APPLICATION_TILE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), APPLICATION_TILE_TYPE)) #define APPLICATION_TILE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), APPLICATION_TILE_TYPE, ApplicationTileClass)) #define APPLICATION_TILE_ACTION_START 0 #define APPLICATION_TILE_ACTION_HELP 1 #define APPLICATION_TILE_ACTION_UPDATE_MAIN_MENU 2 #define APPLICATION_TILE_ACTION_UPDATE_STARTUP 3 #define APPLICATION_TILE_ACTION_UPGRADE_PACKAGE 4 #define APPLICATION_TILE_ACTION_UNINSTALL_PACKAGE 5 typedef struct { NameplateTile nameplate_tile; gchar *name; gchar *description; } ApplicationTile; typedef struct { NameplateTileClass nameplate_tile_class; } ApplicationTileClass; GType application_tile_get_type (void); GtkWidget *application_tile_new (const gchar * desktop_item_id); GtkWidget *application_tile_new_full (const gchar * desktop_item_id, GtkIconSize icon_size, gboolean show_generic_name); MateDesktopItem *application_tile_get_desktop_item (ApplicationTile * tile); G_END_DECLS #endif /* __APPLICATION_TILE_H__ */
// SimpleVector class template #ifndef SIMPLEVECTOR_H #define SIMPLEVECTOR_H #include <iostream> #include <new> // Needed for bad_alloc exception #include <cstdlib> // Needed for the exit function using namespace std; template <class T> class SimpleVector { private: T *_buffer; // To point to the allocated array int _size; // Number of elements in the array int _capacity; void memError(); // Handles memory allocation errors void subError(); // Handles subscripts out of range public: // Default constructor SimpleVector() { _buffer = 0; _size = 0; } // Constructor declaration SimpleVector(int); // Copy constructor declaration SimpleVector(const SimpleVector &); // Destructor declaration ~SimpleVector(); // Add element T to the top of the array void push(const T &element); // Remove element that's at the top of the array void pull(); // Accessor to return the array size int size() const { return _size; } int capacity() const { return _capacity; } // Accessor to return a specific element T getElementAt(int position); // Overloaded [] operator declaration T &operator[](const int &); }; //*********************************************************** // Constructor for SimpleVector class. Sets the size of the * // array and allocates memory for it. * //*********************************************************** template <class T> SimpleVector<T>::SimpleVector(int s) { _size = s; _capacity = s; // Allocate memory for the array. try { _buffer = new T[s]; } catch (bad_alloc) { memError(); } // Initialize the array. for (int count = 0; count < _size; count++) *(_buffer + count) = 0; } //******************************************* // Copy Constructor for SimpleVector class. * //******************************************* template <class T> SimpleVector<T>::SimpleVector(const SimpleVector &obj) { // Copy the array size. _size = obj._size; // Allocate memory for the array. _buffer = new T[_size]; if (_buffer == 0) memError(); // Copy the elements of obj's array. for (int count = 0; count < _size; count++) *(_buffer + count) = *(obj._buffer + count); } //************************************** // Destructor for SimpleVector class. * //************************************** template <class T> SimpleVector<T>::~SimpleVector() { if (_size > 0) delete[] _buffer; } //******************************************************* // memError function. Displays an error message and * // terminates the program when memory allocation fails. * //******************************************************* template <class T> void SimpleVector<T>::memError() { cout << "ERROR:Cannot allocate memory.\n"; exit(EXIT_FAILURE); } //*********************************************************** // subError function. Displays an error message and * // terminates the program when a subscript is out of range. * //*********************************************************** template <class T> void SimpleVector<T>::subError() { cout << "ERROR: Subscript out of range.\n"; exit(EXIT_FAILURE); } template <class T> void SimpleVector<T>::push(const T &element) { // If the size of the array = its capacity... We need to expand its capacity by 1. So... if (_size == _capacity) { // ... expand array's capacity by 1 int newCapacity = _capacity + 1; // Create a temp array with capacty = new capacity // i.e. // old array = [][][][][] // capacity = 5 // new array = [][][][][][] // new capacity = capacity + 1 = 6 T *newBuffer = new T[newCapacity]; // Copy data from the old array into the temp array // i.e. // old array = [7][2][3][1][5] // new array = [7][2][3][1][5][] std::copy(_buffer, _buffer + _size, newBuffer); _capacity = newCapacity; // Swap data between old array and temp array // i.e. // old array = [7][2][3][1][5][] // new array = [7][2][3][1][5] std::swap(_buffer, newBuffer); // Temp array is no longer needed, so free up that space of memory delete[] newBuffer; } // Add the new element onto the top of the array // i.e. // old array = [7][2][3][1][5][] // new array = [7][2][3][1][5][new element] _buffer[_size++] = element; } template <class T> void SimpleVector<T>::pull() { // Create a new temporary array with new capacity = capacity -1 int newCapacity = _capacity - 1; T *newBuffer = new T[newCapacity]; // Define for the vector that its capacity and size are decreasing by 1 _capacity = newCapacity; _size--; // Copy data from old buffer to new buffer std::copy(_buffer, _buffer + _size, newBuffer); std::swap(_buffer, newBuffer); delete[] newBuffer; } //******************************************************* // getElementAt function. The argument is a subscript. * // This function returns the value stored at the sub- * // cript in the array. * //******************************************************* template <class T> T SimpleVector<T>::getElementAt(int sub) { if (sub < 0 || sub >= _size) subError(); return _buffer[sub]; } //******************************************************* // Overloaded [] operator. The argument is a subscript. * // This function returns a reference to the element * // in the array indexed by the subscript. * //******************************************************* template <class T> T &SimpleVector<T>::operator[](const int &sub) { if (sub < 0 || sub >= _size) subError(); return _buffer[sub]; } #endif
/***************************************************************************** * * userlist.c * Purpose ...............: Display Userlist * ***************************************************************************** * Copyright (C) 2013-2017 Robert James Clay <jame@rocasa.us> * Copyright (C) 1997-2007 Michiel Broek <mbse@mbse.eu> * * This file is part of FTNd. * * This is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2, or (at your option) any later * version. * * FTNd 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 FTNd; see the file COPYING. If not, write to the Free Software * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *****************************************************************************/ #include "../config.h" #include "../lib/ftndlib.h" #include "../lib/ftnd.h" #include "../lib/users.h" #include "userlist.h" #include "language.h" #include "input.h" #include "timeout.h" #include "term.h" #include "ttyio.h" extern int rows; extern int cols; void UserList(char *OpData) { FILE *pUsrConfig; int LineCount = 2, iFoundName = FALSE, iNameCount = 0; char ustr[128], *Name, *sTemp, *User, *temp, msg[81]; struct userhdr uhdr; struct userrec u; temp = calloc(PATH_MAX, sizeof(char)); Name = calloc(37, sizeof(char)); sTemp = calloc(81, sizeof(char)); User = calloc(81, sizeof(char)); if (utf8) chartran_init((char *)"CP437", (char *)"UTF-8", 'B'); strcpy(ustr, clear_str()); /* User List */ strncat(ustr, poutCR_str(WHITE, BLACK, (char *) Language(126)), 127); PUTSTR(chartran(ustr)); LineCount = 1; snprintf(temp, PATH_MAX, "%s/etc/users.data", getenv("FTND_ROOT")); if ((pUsrConfig = fopen(temp, "rb")) == NULL) { WriteError("UserList: Can't open file: %s", temp); return; } fread(&uhdr, sizeof(uhdr), 1, pUsrConfig); /* Enter Username search string or (Enter) for all users: */ language(WHITE, BLACK, 127); colour(CFG.InputColourF, CFG.InputColourB); alarm_on(); GetstrC(Name, 35); strcpy(ustr, clear_str()); /* Name Location Last On Calls */ strncat(ustr, poutCR_str(WHITE, BLACK, (char *) Language(128)), 127); PUTSTR(chartran(ustr)); strcpy(ustr, colour_str(GREEN, BLACK)); strncat(ustr, fLine_str(cols -1), 127); PUTSTR(chartran(ustr)); strcpy(ustr, colour_str(CYAN, BLACK)); PUTSTR(chartran(ustr)); while (fread(&u, uhdr.recsize, 1, pUsrConfig) == 1) { if ((strcmp(Name,"")) != 0) { if (((strcasecmp(OpData, "/H")) == 0) && strlen(u.sHandle)) snprintf(User, 36, "%s", u.sHandle); else if ((strcasecmp(OpData, "/U")) == 0) snprintf(User, 36, "%s", u.Name); else snprintf(User, 36, "%s", u.sUserName); if ((strstr(tl(User), tl(Name)) != NULL)) { if ((!u.Hidden) && (!u.Deleted)) { if ((strcasecmp(OpData, "/H")) == 0) { if ((strcmp(u.sHandle, "") != 0 && *(u.sHandle) != ' ')) snprintf(msg, 81, "%-25s", u.sHandle); else snprintf(msg, 81, "%-25s", u.sUserName); } else if (strcasecmp(OpData, "/U") == 0) { snprintf(msg, 81, "%-25s", u.Name); } else { snprintf(msg, 81, "%-25s", u.sUserName); } PUTSTR(msg); snprintf(msg, 81, "%-30s%-14s%-10d", u.sLocation, StrDateDMY(u.tLastLoginDate), u.iTotalCalls); PUTSTR(msg); iFoundName = TRUE; LineCount++; iNameCount++; Enter(1); } } } else if ((!u.Hidden) && (!u.Deleted) && (strlen(u.sUserName) > 0)) { if ((strcmp(OpData, "/H")) == 0) { if ((strcasecmp(u.sHandle, "") != 0 && *(u.sHandle) != ' ')) snprintf(msg, 81, "%-25s", u.sHandle); else snprintf(msg, 81, "%-25s", u.sUserName); } else if (strcasecmp(OpData, "/U") == 0) { snprintf(msg, 81, "%-25s", u.Name); } else { snprintf(msg, 81, "%-25s", u.sUserName); } PUTSTR(msg); snprintf(msg, 81, "%-30s%-14s%-10d", u.sLocation, StrDateDMY(u.tLastLoginDate), u.iTotalCalls); PUTSTR(msg); iFoundName = TRUE; LineCount++; iNameCount++; Enter(1); } if (LineCount >= rows - 2) { LineCount = 0; Pause(); colour(CYAN, BLACK); } } if (!iFoundName) { language(CYAN, BLACK, 129); Enter(1); } fclose(pUsrConfig); strcpy(ustr, colour_str(GREEN, BLACK)); strncat(ustr, fLine_str(cols -1), 127); PUTSTR(chartran(ustr)); free(temp); free(Name); free(sTemp); free(User); chartran_close(); Pause(); }
/*************************************************************************** * Copyright (C) 2010 Brian C. Milco * * bcmilco@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef HISTORY_H #define HISTORY_H #include <QUndoCommand> class BasketScene; class HistorySetBasket : public QUndoCommand { public: explicit HistorySetBasket(BasketScene *basket, QUndoCommand *parent = 0); void undo(); void redo(); private: QString m_folderNameOld; QString m_folderNameNew; }; #endif // HISTORY_H
/* * The ManaPlus Client * Copyright (C) 2011-2019 The ManaPlus Developers * Copyright (C) 2019-2022 Andrei Karas * * This file is part of The ManaPlus Client. * * 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 * 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/>. */ /* _______ __ __ __ ______ __ __ _______ __ __ * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson * * * Per Larsson a.k.a finalman * Olof Naessén a.k.a jansem/yakslem * * Visit: http://guichan.sourceforge.net * * License: (BSD) * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name of Guichan 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 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef EVENTS_EVENT_H #define EVENTS_EVENT_H #include "localconsts.h" class Widget; /** * Base class for all events. All events in Guichan should * inherit from this class. * * @author Olof Naessén */ class Event notfinal { public: /** * Constructor. * * @param source The source widget of the event. */ explicit Event(Widget *const source) : mSource(source) { } A_DELETE_COPY(Event) /** * Destructor. */ virtual ~Event() { } /** * Gets the source widget of the event. The function * is used to tell which widget fired an event. * * @return The source widget of the event. */ Widget* getSource() const noexcept2 A_WARN_UNUSED { return mSource; } protected: /** * Holds the source widget of the event. */ Widget* mSource; }; #endif // EVENTS_EVENT_H
// CkSpider.h: interface for the CkSpider class. // ////////////////////////////////////////////////////////////////////// #ifndef _CKSPIDER_H #define _CKSPIDER_H #pragma once #include "CkString.h" class CkSpiderProgress; /* IMPORTANT: Objects returned by methods as non-const pointers must be deleted by the calling application. */ #include "CkObject.h" #pragma pack (push, 8) // CLASS: CkSpider class CkSpider : public CkObject { private: CkSpiderProgress *m_callback; void *m_impl; bool m_utf8; // If true, all input "const char *" parameters are utf-8, otherwise they are ANSI strings. // Don't allow assignment or copying these objects. CkSpider(const CkSpider &) { } CkSpider &operator=(const CkSpider &) { return *this; } public: //void *getImpl(void) const { return m_impl; } //CkSpider(void *impl) : m_impl(impl) { } CkSpider(); virtual ~CkSpider(); CkSpiderProgress *get_EventCallbackObject(void) const; void put_EventCallbackObject(CkSpiderProgress *progress); // BEGIN PUBLIC INTERFACE bool SaveLastError(const char *filename); void LastErrorXml(CkString &str); void LastErrorHtml(CkString &str); void LastErrorText(CkString &str); bool get_Utf8(void) const; void put_Utf8(bool b); void SleepMs(long millisec); void get_LastHtmlDescription(CkString &strOut); void get_LastHtmlKeywords(CkString &strOut); void get_LastHtmlTitle(CkString &strOut); void get_LastHtml(CkString &strOut); bool get_LastFromCache(void); // SYSTEMTIME is defined in <windows.h> // For more information, Google "SYSTEMTIME" void get_LastModDate(SYSTEMTIME &sysTime); void get_LastUrl(CkString &strOut); void get_LastModDateStr(CkString &strOut); void SkipUnspidered(long index); bool FetchRobotsText(CkString &strOut); void get_Domain(CkString &strOut); void AddMustMatchPattern(const char *pattern); void AddAvoidOutboundLinkPattern(const char *pattern); bool GetAvoidPattern(long index, CkString &strOut); void AddAvoidPattern(const char *pattern); bool GetOutboundLink(long index, CkString &strOut); bool GetFailedUrl(long index, CkString &strOut); bool GetSpideredUrl(long index, CkString &strOut); bool GetUnspideredUrl(long index, CkString &strOut); bool RecrawlLast(void); void ClearOutboundLinks(); void ClearFailedUrls(); void ClearSpideredUrls(); int get_WindDownCount(void); void put_WindDownCount(long newVal); // These times are in milliseconds. long get_HeartbeatMs(void); void put_HeartbeatMs(long newVal); int get_NumAvoidPatterns(void); int get_NumOutboundLinks(void); int get_NumFailed(void); int get_NumSpidered(void); int get_NumUnspidered(void); bool CrawlNext(void); bool get_ChopAtQuery(void); void put_ChopAtQuery(bool newVal); bool get_AvoidHttps(void); void put_AvoidHttps(bool newVal); int get_MaxResponseSize(void); void put_MaxResponseSize(long newVal); int get_MaxUrlLen(void); void put_MaxUrlLen(long newVal); void get_CacheDir(CkString &strOut); void put_CacheDir(const char *dir); bool get_UpdateCache(void); void put_UpdateCache(bool newVal); bool get_FetchFromCache(void); void put_FetchFromCache(bool newVal); int get_ConnectTimeout(void); void put_ConnectTimeout(long numSeconds); void put_UserAgent(const char *ua); const char *userAgent(void); void get_UserAgent(CkString &strOut); int get_ReadTimeout(void); void put_ReadTimeout(long numSeconds); void AddUnspidered(const char *url); void Initialize(const char *domain); void GetDomain(const char *url, CkString &domainOut); void GetBaseDomain(const char *domain, CkString &domainOut); void CanonicalizeUrl(const char *url, CkString &urlOut); CkString m_resultString; const char *getDomain(const char *url); const char *getBaseDomain(const char *domain); const char *canonicalizeUrl(const char *url); const char *getAvoidPattern(long index); const char *getOutboundLink(long index); const char *getFailedUrl(long index); const char *getSpideredUrl(long index); const char *getUnspideredUrl(long index); const char *cacheDir(void); const char *avoidPattern(long index); const char *outboundLink(long index); const char *failedUrl(long index); const char *spideredUrl(long index); const char *unspideredUrl(long index); const char *domain(void); const char *lastHtmlDescription(void); const char *lastHtmlKeywords(void); const char *lastHtmlTitle(void); const char *lastHtml(void); const char *lastUrl(void); const char *lastModDateStr(void); const char *fetchRobotsText(void); const char *lastErrorText(void); const char *lastErrorXml(void); const char *lastErrorHtml(void); // PROXYDOMAIN_BEGIN void get_ProxyDomain(CkString &str); const char *proxyDomain(void); void put_ProxyDomain(const char *newVal); // PROXYDOMAIN_END // PROXYLOGIN_BEGIN void get_ProxyLogin(CkString &str); const char *proxyLogin(void); void put_ProxyLogin(const char *newVal); // PROXYLOGIN_END // PROXYPASSWORD_BEGIN void get_ProxyPassword(CkString &str); const char *proxyPassword(void); void put_ProxyPassword(const char *newVal); // PROXYPASSWORD_END // PROXYPORT_BEGIN int get_ProxyPort(void); void put_ProxyPort(int newVal); // PROXYPORT_END // SPIDER_INSERT_POINT // END PUBLIC INTERFACE }; #pragma pack (pop) #endif
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef PARAMS # if __STDC__ # define PARAMS(args) args # else # define PARAMS(args) () # endif #endif /* Encoding of locale name parts. */ #define CEN_REVISION 1 #define CEN_SPONSOR 2 #define CEN_SPECIAL 4 #define XPG_NORM_CODESET 8 #define XPG_CODESET 16 #define TERRITORY 32 #define CEN_AUDIENCE 64 #define XPG_MODIFIER 128 #define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE) #define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER) struct loaded_l10nfile { const char *filename; int decided; const void *data; struct loaded_l10nfile *next; struct loaded_l10nfile *successor[1]; }; extern const char *_nl_normalize_codeset PARAMS ((const unsigned char *codeset, size_t name_len)); extern struct loaded_l10nfile * _nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list, const char *dirlist, size_t dirlist_len, int mask, const char *language, const char *territory, const char *codeset, const char *normalized_codeset, const char *modifier, const char *special, const char *sponsor, const char *revision, const char *filename, int do_allocate)); extern const char *_nl_expand_alias PARAMS ((const char *name)); extern int _nl_explode_name PARAMS ((char *name, const char **language, const char **modifier, const char **territory, const char **codeset, const char **normalized_codeset, const char **special, const char **sponsor, const char **revision));
#include <stdio.h> #include "pmom_cat.h" #include "nvim.h" struct nv_icc_msg_name g_nv_msg_name_table[NV_ICC_MSG_TYPE_SUM] = { {NV_ICC_REQ_PRIORITY_HIGH_FLUSH, "CCPU", "req write high priority nv"}, {NV_ICC_REQ_PRIORITY1_FLUSH, "CCPU", "req write high priority1 nv"}, {NV_ICC_REQ_PRIORITY_MID_LOW_FLUSH, "CCPU", "req write low priority nv"}, {NV_ICC_REQ_SHUT_DOWN_FLUSH, "CCPU", "req flush nv"}, {NV_ICC_REQ_RESUME, "CCPU", "req resume all the nv data"}, {NV_ICC_REQ_RESUME_ITEM, "CCPU", "req resume single nv data"}, {NV_ICC_CNF, "ACPU", "cnf from ACPU"}, }; int nvim_msg_parse_acore( char *in_buf, unsigned int len, char *out_buf, unsigned int *out_ptr) { int data_len = 0; nv_icc_msg_single_t *log_msg = (nv_icc_msg_single_t *)in_buf; int temp = 0; /* step1: ÏûÏ¢ÀàÐͼì²é */ if(len != sizeof(*log_msg)) { return PMOM_ERR; } for(temp = 0; temp < NV_ICC_MSG_TYPE_SUM; temp++) { if(g_nv_msg_name_table[temp].msg_type == log_msg->msg_type) { break; } } if(temp < NV_ICC_MSG_TYPE_SUM) { /* step2: ¸ñʽ»¯ÏûÏ¢µ½out_buf: ÒԻسµ½áÊø */ data_len = snprintf(&out_buf[*out_ptr], PMOM_PARSE_STR_BUFSIZ, "[%s] [%s], nvid:0x%x, sn:0x%x, msg_type:0x%x, slice:0x%x\n", g_nv_msg_name_table[temp].cpu, g_nv_msg_name_table[temp].work, log_msg->data.itemid, log_msg->sn, log_msg->msg_type, log_msg->send_slice ); *out_ptr = *out_ptr + data_len; } return PMOM_OK; } int nvim_msg_parse_ccore(char *in_buf, unsigned int len, char *out_buf, unsigned int *out_ptr) { int data_len = 0; nv_icc_msg_t *log_msg = (nv_icc_msg_t *)in_buf; int temp = 0; /* step1: ÏûÏ¢ÀàÐͼì²é */ if(len != sizeof(*log_msg)) { return PMOM_ERR; } for(temp = 0; temp < NV_ICC_MSG_TYPE_SUM; temp++) { if(g_nv_msg_name_table[temp].msg_type == log_msg->msg_type) { break; } } if(temp < NV_ICC_MSG_TYPE_SUM) { /* step2: ¸ñʽ»¯ÏûÏ¢µ½out_buf: ÒԻسµ½áÊø */ data_len = snprintf(&out_buf[*out_ptr], PMOM_PARSE_STR_BUFSIZ, "[%s] [%s], ret:0x%x, sn:0x%x, msg_type:0x%x, slice:0x%x\n", g_nv_msg_name_table[temp].cpu, g_nv_msg_name_table[temp].work, log_msg->ret, log_msg->sn, log_msg->msg_type, log_msg->send_slice ); *out_ptr = *out_ptr + data_len; } return PMOM_OK; } int nvim_msg_parse(unsigned int typeid, char *in_buf, unsigned int len, char *out_buf, unsigned int *out_ptr) { int data_len = 0; nv_icc_msg_t *log_msg = (nv_icc_msg_t *)in_buf; int temp = 0; printf("info: nv type_id=0x%x", typeid); if (typeid == NV_ICC_MSG_ACORE) { return nvim_msg_parse_acore(in_buf, len, out_buf, out_ptr); } return nvim_msg_parse_ccore(in_buf, len, out_buf, out_ptr); }
/* <one line to give the library's name and an idea of what it does.> Copyright (C) 2012 Hong Jen Yee (PCMan) <pcman.tw@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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FM_FOLDERVIEW_H #define FM_FOLDERVIEW_H #include "libfmqtglobals.h" #include <QWidget> #include <QListView> #include <QTreeView> #include <QMouseEvent> #include <libfm/fm.h> #include "foldermodel.h" #include "proxyfoldermodel.h" class QTimer; namespace Fm { class FileMenu; class FolderMenu; class FileLauncher; class FolderViewStyle; class LIBFM_QT_API FolderView : public QWidget { Q_OBJECT public: enum ViewMode { FirstViewMode = 1, IconMode = FirstViewMode, CompactMode, DetailedListMode, ThumbnailMode, LastViewMode = ThumbnailMode, NumViewModes = (LastViewMode - FirstViewMode + 1) }; enum ClickType { ActivatedClick, MiddleClick, ContextMenuClick }; public: friend class FolderViewTreeView; friend class FolderViewListView; explicit FolderView(ViewMode _mode = IconMode, QWidget* parent = 0); virtual ~FolderView(); void setViewMode(ViewMode _mode); ViewMode viewMode() const; void setIconSize(ViewMode mode, QSize size); QSize iconSize(ViewMode mode) const; QAbstractItemView* childView() const; ProxyFolderModel* model() const; void setModel(ProxyFolderModel* _model); FmFolder* folder() { return model_ ? static_cast<FolderModel*>(model_->sourceModel())->folder() : NULL; } FmFileInfo* folderInfo() { FmFolder* _folder = folder(); return _folder ? fm_folder_get_info(_folder) : NULL; } FmPath* path() { FmFolder* _folder = folder(); return _folder ? fm_folder_get_path(_folder) : NULL; } QItemSelectionModel* selectionModel() const; FmFileInfoList* selectedFiles() const; FmPathList* selectedFilePaths() const; void selectAll(); void invertSelection(); void setFileLauncher(FileLauncher* launcher) { fileLauncher_ = launcher; } FileLauncher* fileLauncher() { return fileLauncher_; } int autoSelectionDelay() const { return autoSelectionDelay_; } void setAutoSelectionDelay(int delay); protected: virtual bool event(QEvent* event); virtual void contextMenuEvent(QContextMenuEvent* event); virtual void childMousePressEvent(QMouseEvent* event); virtual void childDragEnterEvent(QDragEnterEvent* event); virtual void childDragMoveEvent(QDragMoveEvent* e); virtual void childDragLeaveEvent(QDragLeaveEvent* e); virtual void childDropEvent(QDropEvent* e); void emitClickedAt(ClickType type, const QPoint& pos); QModelIndexList selectedRows ( int column = 0 ) const; QModelIndexList selectedIndexes() const; virtual void prepareFileMenu(Fm::FileMenu* menu); virtual void prepareFolderMenu(Fm::FolderMenu* menu); virtual bool eventFilter(QObject* watched, QEvent* event); void updateGridSize(); // called when view mode, icon size, or font size is changed public Q_SLOTS: void onItemActivated(QModelIndex index); void onSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected); virtual void onFileClicked(int type, FmFileInfo* fileInfo); private Q_SLOTS: void onAutoSelectionTimeout(); void onSelChangedTimeout(); Q_SIGNALS: void clicked(int type, FmFileInfo* file); void clickedBack(); void clickedForward(); void selChanged(int n_sel); void sortChanged(); private: QAbstractItemView* view; ProxyFolderModel* model_; ViewMode mode; QSize iconSize_[NumViewModes]; FileLauncher* fileLauncher_; int autoSelectionDelay_; QTimer* autoSelectionTimer_; QModelIndex lastAutoSelectionIndex_; QTimer* selChangedTimer_; }; } #endif // FM_FOLDERVIEW_H
/****************************************************************************** * * Copyright (c) 2000-2003 PalmSource, Inc. All rights reserved. * * File: LmGlue.h * * Release: Palm OS 5 SDK (68K) R3. * * Description: * Public header providing access to Locale Manager routines (independent of * Palm OS version). * *****************************************************************************/ #ifndef __LMGLUE_H__ #define __LMGLUE_H__ #include <LocaleMgr.h> /*********************************************************************** * Locale Manager glue routines **********************************************************************/ #ifdef __cplusplus extern "C" { #endif /* Return the current system locale in *<oSystemLocale>, and the system character encoding as the function result. */ CharEncodingType LmGlueGetSystemLocale( LmLocaleType* oSystemLocale); /* Return the number of known locales (maximum locale index + 1). */ UInt16 LmGlueGetNumLocales(void); /* Convert <iLocale> to <oLocaleIndex> by locating it within the set of known locales. */ Err LmGlueLocaleToIndex( const LmLocaleType* iLocale, UInt16* oLocaleIndex); /* Return in <oValue> the setting identified by <iChoice> which is appropriate for the locale identified by <iLocaleIndex>. Return lmErrSettingDataOverflow if the data for <iChoice> occupies more than <iValueSize> bytes. Display a non-fatal error if <iValueSize> is larger than the data for a fixed-size setting. */ Err LmGlueGetLocaleSetting( UInt16 iLocaleIndex, LmLocaleSettingChoice iChoice, void* oValue, UInt16 iValueSize); #ifdef __cplusplus } #endif #endif
// Copyright (c) 2014 Jiho Choi. All rights reserved. // To use this source, see LICENSE file. #pragma once namespace dg { template<class LeftType, class RightType> class Bidirectional { public: typedef typename TreeMap<LeftType, RightType>::Iterator LeftToRightIterator; typedef typename TreeMap<RightType, LeftType>::Iterator RightToLeftIterator; bool Remove(const LeftType& left); bool Remove(const RightType& right); void Insert(const LeftType& left, const RightType& right); void Reset(const LeftType& left, const RightType& right); const RightType& GetConst(const LeftType& key) const; const LeftType& GetConst(const RightType& key) const; bool IsFound(const LeftType& key) const; bool IsFound(const RightType& key) const; LeftToRightIterator Find(const LeftType& key) const; RightToLeftIterator Find(const RightType& key) const; LeftToRightIterator Begin() const; RightToLeftIterator BeginRight() const; LeftToRightIterator End() const; RightToLeftIterator EndRight() const; int Count() const { return left_to_right_.Count(); } private: TreeMap<LeftType, RightType> left_to_right_; TreeMap<RightType, LeftType> right_to_left_; }; template<class LeftType, class RightType> bool Bidirectional<LeftType, RightType>::IsFound(const LeftType& key) const { return left_to_right_.IsFound(key); } template<class LeftType, class RightType> bool Bidirectional<LeftType, RightType>::IsFound(const RightType& key) const { return right_to_left_.IsFound(key); } template<class LeftType, class RightType> void Bidirectional<LeftType, RightType>::Insert(const LeftType& left, const RightType& right) { left_to_right_.Insert(left, right); right_to_left_.Insert(right, left); } template<class LeftType, class RightType> const RightType& Bidirectional<LeftType, RightType>::GetConst(const LeftType& key) const { return left_to_right_.GetConst(key); } template<class LeftType, class RightType> const LeftType& Bidirectional<LeftType, RightType>::GetConst(const RightType& key) const { return right_to_left_.GetConst(key); } template<class LeftType, class RightType> bool Bidirectional<LeftType, RightType>::Remove(const LeftType& left) { LeftToRightIterator it = left_to_right_.Find(left); if (it != left_to_right_.End()) { return right_to_left_.Remove(it.Value()) && left_to_right_.Remove(left); } return left_to_right_.Remove(left); } template<class LeftType, class RightType> bool Bidirectional<LeftType, RightType>::Remove(const RightType& right) { RightToLeftIterator it = right_to_left_.Find(right); if (it != right_to_left_.End()) { return left_to_right_.Remove(it.Value()) && right_to_left_.Remove(right); } return right_to_left_.Remove(right); } template<class LeftType, class RightType> void Bidirectional<LeftType, RightType>::Reset(const LeftType& left, const RightType& right) { Remove(left); Remove(right); Insert(left, right); } template<class LeftType, class RightType> typename Bidirectional<LeftType, RightType>::LeftToRightIterator Bidirectional<LeftType, RightType>::Find(const LeftType& key) const { return left_to_right_.Find(key); } template<class LeftType, class RightType> typename Bidirectional<LeftType, RightType>::RightToLeftIterator Bidirectional<LeftType, RightType>::Find(const RightType& key) const { return right_to_left_.Find(key); } template<class LeftType, class RightType> typename Bidirectional<LeftType, RightType>::LeftToRightIterator Bidirectional<LeftType, RightType>::Begin() const { return left_to_right_.Begin(); } template<class LeftType, class RightType> typename Bidirectional<LeftType, RightType>::RightToLeftIterator Bidirectional<LeftType, RightType>::BeginRight() const { return right_to_left_.Begin(); } template<class LeftType, class RightType> typename Bidirectional<LeftType, RightType>::LeftToRightIterator Bidirectional<LeftType, RightType>::End() const { return left_to_right_.End(); } template<class LeftType, class RightType> typename Bidirectional<LeftType, RightType>::RightToLeftIterator Bidirectional<LeftType, RightType>::EndRight() const { return right_to_left_.End(); } } // namespace dg
#include "fdtd.h" /* update magnetic field */ void updateH(Grid *g){ int mm; for (mm = 0; mm < SizeX - 1; mm++) Hy(mm) = Chyh(mm) * Hy(mm) + Chye(mm) * (Ez(mm + 1) - Ez(mm)); //printf("Hy(0): %g, Hy(1): %g\t", Hy(0), Hy(1)); return; } /* update electric field */ void updateE(Grid *g){ int mm; for (mm = 1; mm < SizeX - 1; mm++) Ez(mm) = Ceze(mm) * Ez(mm) + Cezh(mm) * (Hy(mm) - Hy(mm - 1)); //printf("Ez(0): %g, Ez(1): %g\n", Ez(0), Ez(1)); return; }
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * GThumb * * Copyright (C) 2009 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 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 Street #330, Boston, MA 02111-1307, USA. */ #ifndef GTH_SIDEBAR_H #define GTH_SIDEBAR_H #include <gtk/gtk.h> #include "gth-file-data.h" G_BEGIN_DECLS #define GTH_TYPE_SIDEBAR (gth_sidebar_get_type ()) #define GTH_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTH_TYPE_SIDEBAR, GthSidebar)) #define GTH_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTH_TYPE_SIDEBAR, GthSidebarClass)) #define GTH_IS_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTH_TYPE_SIDEBAR)) #define GTH_IS_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTH_TYPE_SIDEBAR)) #define GTH_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTH_TYPE_SIDEBAR, GthSidebarClass)) #define GTH_TYPE_PROPERTY_VIEW (gth_property_view_get_type ()) #define GTH_PROPERTY_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTH_TYPE_PROPERTY_VIEW, GthPropertyView)) #define GTH_IS_PROPERTY_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTH_TYPE_PROPERTY_VIEW)) #define GTH_PROPERTY_VIEW_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTH_TYPE_PROPERTY_VIEW, GthPropertyViewIface)) typedef struct _GthSidebar GthSidebar; typedef struct _GthSidebarClass GthSidebarClass; typedef struct _GthSidebarPrivate GthSidebarPrivate; struct _GthSidebar { GtkNotebook __parent; GthSidebarPrivate *priv; }; struct _GthSidebarClass { GtkNotebookClass __parent_class; }; typedef struct _GthPropertyView GthPropertyView; typedef struct _GthPropertyViewIface GthPropertyViewIface; struct _GthPropertyViewIface { GTypeInterface parent_iface; void (*set_file) (GthPropertyView *self, GthFileData *file_data); }; GType gth_sidebar_get_type (void); GtkWidget * gth_sidebar_new (const char *name); void gth_sidebar_set_file (GthSidebar *sidebar, GthFileData *file_data); void gth_sidebar_show_properties (GthSidebar *sidebar); void gth_sidebar_show_tools (GthSidebar *sidebar); gboolean gth_sidebar_is_tool_active (GthSidebar *sidebar); void gth_sidebar_deactivate_tool (GthSidebar *sidebar); void gth_sidebar_update_sensitivity (GthSidebar *sidebar); GType gth_property_view_get_type (void); void gth_property_view_set_file (GthPropertyView *self, GthFileData *file_data); G_END_DECLS #endif /* GTH_SIDEBAR_H */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * GThumb * * Copyright (C) 2019 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 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef CALLBACKS_H #define CALLBACKS_H #include <gthumb.h> void image_viewer__gth_browser_construct_cb (GthBrowser *browser); #endif /* CALLBACKS_H */
/* * LPDDR2 data as per JESD209-2 * * Copyright (C) 2010 Texas Instruments, Inc. * * Aneesh V <aneesh@ti.com> * Santosh Shilimkar <santosh.shilimkar@ti.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <mach/lpddr2-jedec.h> #include <mach/emif.h> /* * Organization and refresh requirements for LPDDR2 devices of different * types and densities. Derived from JESD209-2 section 2.4 */ const struct lpddr2_addressing lpddr2_jedec_addressing_table[] = { /* Banks tREFIx10 rowx32,rowx16 colx32,colx16 density */ {BANKS4, T_REFI_15_6, {ROW_12, ROW_12}, {COL_7, COL_8} }, /*64M*/ {BANKS4, T_REFI_15_6, {ROW_12, ROW_12}, {COL_8, COL_9} }, /*128M*/ {BANKS4, T_REFI_7_8, {ROW_13, ROW_13}, {COL_8, COL_9} }, /*256M*/ {BANKS4, T_REFI_7_8, {ROW_13, ROW_13}, {COL_9, COL_10} }, /*512M*/ {BANKS8, T_REFI_7_8, {ROW_13, ROW_13}, {COL_9, COL_10} }, /*1GS4*/ {BANKS8, T_REFI_3_9, {ROW_14, ROW_14}, {COL_9, COL_10} }, /*2GS4*/ {BANKS8, T_REFI_3_9, {ROW_14, ROW_14}, {COL_10, COL_11} }, /*4G*/ {BANKS8, T_REFI_3_9, {ROW_15, ROW_15}, {COL_10, COL_11} }, /*8G*/ {BANKS4, T_REFI_7_8, {ROW_14, ROW_14}, {COL_9, COL_10} }, /*1GS2*/ {BANKS4, T_REFI_3_9, {ROW_15, ROW_15}, {COL_9, COL_10} }, /*2GS2*/ }; /* * Base AC Timing values specified by JESD209-2 for 400MHz operation * All devices will honour these timings at this frequency. * Some devices may have better timings. Using these timings is safe when the * timings are not available from the device data sheet. */ const struct lpddr2_timings lpddr2_jedec_timings_400_mhz = { .max_freq = 533000000, .RL = 6, .tRPab = 21, .tRCD = 18, .tWR = 15, .tRASmin = 42, .tRRD = 10, .tWTRx2 = 15, .tXSR = 140, .tXPx2 = 15, .tRFCab = 130, .tRTPx2 = 15, .tCKE = 3, .tCKESR = 15, .tZQCS = 90, .tZQCL = 360, .tZQINIT = 1000, .tDQSCKMAXx2 = 11, .tRASmax = 70, .tFAW = 50 }; /* Base AC Timing values specified by JESD209-2 for 333 MHz operation */ const struct lpddr2_timings lpddr2_jedec_timings_333_mhz = { .max_freq = 333000000, .RL = 5, .tRPab = 21, .tRCD = 18, .tWR = 15, .tRASmin = 42, .tRRD = 10, .tWTRx2 = 15, .tXSR = 140, .tXPx2 = 15, .tRFCab = 130, .tRTPx2 = 15, .tCKE = 3, .tCKESR = 15, .tZQCS = 90, .tZQCL = 360, .tZQINIT = 1000, .tDQSCKMAXx2 = 11, .tRASmax = 70, .tFAW = 50 }; /* Base AC Timing values specified by JESD209-2 for 200 MHz operation */ const struct lpddr2_timings lpddr2_jedec_timings_200_mhz = { .max_freq = 200000000, .RL = 3, .tRPab = 21, .tRCD = 18, .tWR = 15, .tRASmin = 42, .tRRD = 10, .tWTRx2 = 20, .tXSR = 140, .tXPx2 = 15, .tRFCab = 130, .tRTPx2 = 15, .tCKE = 3, .tCKESR = 15, .tZQCS = 90, .tZQCL = 360, .tZQINIT = 1000, .tDQSCKMAXx2 = 11, .tRASmax = 70, .tFAW = 50 }; /* * Min tCK values specified by JESD209-2 * Min tCK specifies the minimum duration of some AC timing parameters in terms * of the number of cycles. If the calculated number of cycles based on the * absolute time value is less than the min tCK value, min tCK value should * be used instead. This typically happens at low frequencies. */ const struct lpddr2_min_tck lpddr2_jedec_min_tck = { .tRL = 3, .tRP_AB = 3, .tRCD = 3, .tWR = 3, .tRAS_MIN = 3, .tRRD = 2, .tWTR = 2, .tXP = 2, .tRTP = 2, .tCKE = 3, .tCKESR = 3, .tFAW = 8 };
/*- * Copyright (c) <2015>, Intel Corporation * 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 Intel Corporation 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 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * Copyright (c) <2010-2014>, Wind River Systems, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * 1) Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2) Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation and/or * other materials provided with the distribution. * * 3) Neither the name of Wind River Systems nor the names of its contributors may be * used to endorse or promote products derived from this software without specific * prior written permission. * * 4) The screens displayed by the application must contain the copyright notice as defined * above and can not be removed 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. */ /* Created 2015 by abhinandan.gujjar@intel.com */ #ifndef _PKTGEN_GTPU_H_ #define _PKTGEN_GTPU_H_ #include <wr_inet.h> #include "pktgen-seq.h" #define GTPu_VERSION 0x30 /**************************************************************************//** * * pktgen_gtpu_hdr_ctor - GTP-U header constructor routine. * * DESCRIPTION * Construct the GTP-U header in a packer buffer. * * RETURNS: N/A * * SEE ALSO: */ extern void pktgen_gtpu_hdr_ctor(pkt_seq_t *pkt, gtpuHdr_t *guip, uint16_t ipProto); #endif /* _PKTGEN_GTPU_H_ */
/* * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * * 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 * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef NET_BUYSELLHANDLER_H #define NET_BUYSELLHANDLER_H #include "net/messagein.h" #include "shopitem.h" namespace Net { class BuySellHandler notfinal { public: virtual ~BuySellHandler() { } virtual void handleMessage(Net::MessageIn &msg) = 0; virtual void requestSellList(const std::string &nick) const = 0; virtual void requestBuyList(const std::string &nick) const = 0; virtual void sendBuyRequest(const std::string &nick, const ShopItem *const item, const int amount) const = 0; virtual void sendSellRequest(const std::string &nick, const ShopItem *const item, const int amount) const = 0; }; } // namespace Net #endif // NET_BUYSELLHANDLER_H
/*************************************************************************** * Copyright 2008 - 2009 VMware, Inc. All rights reserved. ***************************************************************************/ /* * @VMKAPIMOD_LICENSE@ */ /* *********************************************************************** * ISA */ /** * \addtogroup Device * @{ * \defgroup ISA ISA-Bus Interfaces * @{ *********************************************************************** */ #ifndef _VMKAPI_ISA_H_ #define _VMKAPI_ISA_H_ /** \cond never */ #define INCLUDE_ALLOW_VMKERNEL #define INCLUDE_ALLOW_VMK_MODULE #define INCLUDE_ALLOW_DISTRIBUTE #define INCLUDE_ALLOW_VMKDRIVERS #include "includeCheck.h" /** \endcond never */ #include "base/vmkapi_types.h" /* *********************************************************************** * vmk_ISAMapIRQToVector -- */ /** * * \ingroup ISA * \brief Retrieves the vector the kernel assigned for an isa IRQ * * \param[in] isaIRQ ISA IRQ value. * \param[out] vector Corresponding vector for specified IRQ. * * \retval VMK_BAD_PARAM isaIRQ is out of range. * \retval VMK_BAD_PARAM Vector was NULL. * *********************************************************************** */ VMK_ReturnStatus vmk_ISAMapIRQToVector(vmk_uint32 isaIRQ, vmk_uint32 *vector); #endif /* _VMKAPI_ISA_H_ */ /** @} */ /** @} */
/* * minimapdock.h * Copyright 2012, Christoph Schnackenberg <bluechs@gmx.de> * * This file is part of Tiled. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef MINIMAPDOCK_H #define MINIMAPDOCK_H #include <QDockWidget> namespace Tiled { namespace Internal { class MiniMap; class MapDocument; /** * Shows a mini-map. */ class MiniMapDock : public QDockWidget { Q_OBJECT public: MiniMapDock(QWidget *parent = 0); void setMapDocument(MapDocument *); protected: void changeEvent(QEvent *e); private: void retranslateUi(); MiniMap *mMiniMap; }; } // namespace Internal } // namespace Tiled #endif // MINIMAPDOCK_H
/*************************************************************************** C_SPICE.h - description -------------------------------------- begin : Fri Mar 9 2007 copyright : (C) 2007 by Gunther Kraut email : gn.kraut@t-online.de spice4qucs code added Fri. 2 March 2015 copyright : (C) 2015 by Mike Brinson email : mbrin72043@yahoo.co.uk ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef C_SPICE_H #define C_SPICE_H #include "components/component.h" class C_SPICE: public Component { public: C_SPICE(); ~C_SPICE(); Component* newOne(); static Element* info(QString&, char* &, bool getNewOne=false); protected: QString netlist(); QString spice_netlist(bool isXyce = false); }; #endif // C_SPICE_H
#include <pspuser.h> PSP_MODULE_INFO("mcid_cov", 0, 1, 0); PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU); PSP_HEAP_SIZE_KB(-1); int backXMB(int a, int b, void* c) { sceKernelExitGame(); return 0; } int thread(SceSize a, void* b) { sceKernelRegisterExitCallback( sceKernelCreateCallback("cov_back_xmb", backXMB, NULL)); sceKernelSleepThreadCB(); return 0; } void background(void) __attribute__((constructor)); void background(void) { int id = sceKernelCreateThread("cov_back_thread", thread, 0x11, 0x7D0, 0, 0); if (id >= 0) sceKernelStartThread(id, 0, 0); }
// // SRRefreshView.h // SlimeRefresh // // A refresh view looks like UIRefreshControl // // Created by zrz on 12-6-15. // Copyright (c) 2012年 zrz. All rights reserved. // #import <UIKit/UIKit.h> #import "SRSlimeView.h" @class SRRefreshView; typedef void (^SRRefreshBlock)(SRRefreshView* sender); @protocol SRRefreshDelegate; @interface SRRefreshView : UIView{ UIImageView *_refleshView; SRSlimeView *_slime; } //set the state loading or not. @property (nonatomic, assign) BOOL loading; - (void)setLoadingWithExpansion; //set the slime's style by this property. @property (nonatomic, strong, readonly) SRSlimeView *slime; //set your refresh icon. @property (nonatomic, strong, readonly) UIImageView *refleshView; //select one to receive the refreshing message. @property (nonatomic, copy) SRRefreshBlock block; @property (nonatomic, weak) id<SRRefreshDelegate> delegate; @property (nonatomic, readonly) UIActivityIndicatorView *activityIndicationView; //default is false, if true when slime go back it will have a alpha effect //to go to miss. @property (nonatomic, assign) BOOL slimeMissWhenGoingBack; // @property (nonatomic, assign) CGFloat upInset; // - (void)scrollViewDidScroll; - (void)scrollViewDidEndDraging; //as the name, called when loading over. - (void)endRefresh; // init default is 32 - (id)initWithHeight:(CGFloat)height; @end @protocol SRRefreshDelegate <NSObject> @optional //start refresh. - (void)slimeRefreshStartRefresh:(SRRefreshView*)refreshView; @end
#ifndef _MATRIX_H_ #define _MATRIX_H_ #define MATRIX_SIZE 400 #define MATRIX_ADD 0 #define MATRIX_MUL 1 #define MATRIX_DFT 0xBABE #define MATRIX_DFT2 0xCACA typedef unsigned int matrix[MATRIX_SIZE][MATRIX_SIZE]; extern void matrix_init(matrix *m); extern void matrix_add(matrix *dest, matrix *m1, matrix *m2); extern void matrix_mult(matrix *dest, matrix *m1, matrix *m2); extern unsigned matrix_checksum(matrix *m); #endif
//-------------------------------------------------------------------------- // Copyright (C) 2014-2016 Cisco and/or its affiliates. All rights reserved. // // This program is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License Version 2 as published // by the Free Software Foundation. You may not use, modify or distribute // this program under any other version of the GNU General Public License. // // This program is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- // nhttp_msg_body_cl.h author Tom Peters <thopeter@cisco.com> #ifndef NHTTP_MSG_BODY_CL_H #define NHTTP_MSG_BODY_CL_H #include "nhttp_msg_section.h" #include "nhttp_msg_body.h" #include "nhttp_field.h" //------------------------------------------------------------------------- // NHttpMsgBodyCl class //------------------------------------------------------------------------- class NHttpMsgBodyCl : public NHttpMsgBody { public: NHttpMsgBodyCl(const uint8_t* buffer, const uint16_t buf_size, NHttpFlowData* session_data_, NHttpEnums::SourceId source_id_, bool buf_owner, Flow* flow_, const NHttpParaList* params_) : NHttpMsgBody(buffer, buf_size, session_data_, source_id_, buf_owner, flow_, params_), data_length(session_data->data_length[source_id]) {} void update_flow() override; #ifdef REG_TEST void print_section(FILE* output) override; #endif protected: int64_t data_length; }; #endif
#ifndef __SKIN_MODEL_RENDER_BUFFER_INTERFACE_H__ #define __SKIN_MODEL_RENDER_BUFFER_INTERFACE_H__ #include "IRenderableBuffer.h" namespace gf { class IAnimatedMeshBuffer : public IRenderableBuffer { public: virtual void bindIndexBuffer() = 0; virtual void bindVertexBuffer(bool bAnimated) = 0; virtual void drawIndexed(u32 start, u32 count, u32 baseVertex) = 0; virtual E_BUFFER_TYPE getType() const { return EBT_ANIMATED_MESH_BUFFER; } }; } #endif
//////////////////////////////////////////////////////////////////////////////// /// /// A header file for detecting the Intel MMX instructions set extension. /// /// Please see 'mmx_win.cpp', 'mmx_cpp.cpp' and 'mmx_non_x86.cpp' for the /// routine implementations for x86 Windows, x86 gnu version and non-x86 /// platforms, respectively. /// /// Author : Copyright (c) Olli Parviainen /// Author e-mail : oparviai 'at' iki.fi /// SoundTouch WWW: http://www.surina.net/soundtouch /// //////////////////////////////////////////////////////////////////////////////// // // Last changed : $Date: 2006/02/05 16:44:06 $ // File revision : $Revision: 1.4 $ // // $Id: cpu_detect.h,v 1.4 2006/02/05 16:44:06 Olli Exp $ // //////////////////////////////////////////////////////////////////////////////// // // License : // // SoundTouch audio processing library // Copyright (c) Olli Parviainen // // 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 // //////////////////////////////////////////////////////////////////////////////// #ifndef _CPU_DETECT_H_ #define _CPU_DETECT_H_ #include "STTypes.h" #define SUPPORT_MMX 0x0001 #define SUPPORT_3DNOW 0x0002 #define SUPPORT_ALTIVEC 0x0004 #define SUPPORT_SSE 0x0008 #define SUPPORT_SSE2 0x0010 /// Checks which instruction set extensions are supported by the CPU. /// /// \return A bitmask of supported extensions, see SUPPORT_... defines. uint detectCPUextensions(void); /// Disables given set of instruction extensions. See SUPPORT_... defines. void disableExtensions(uint wDisableMask); #endif // _CPU_DETECT_H_
/*- * GPL LICENSE SUMMARY * * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * The full GNU General Public License is included in this distribution * in the file called LICENSE.GPL. * * Contact Information: * Intel Corporation */ #ifndef _KNI_DEV_H_ #define _KNI_DEV_H_ #include <linux/if.h> #include <linux/wait.h> #include <linux/sched.h> #include <linux/netdevice.h> #include <linux/spinlock.h> #include <linux/list.h> #ifdef RTE_KNI_VHOST #include <net/sock.h> #endif #include <exec-env/rte_kni_common.h> #define KNI_KTHREAD_RESCHEDULE_INTERVAL 5 /* us */ /** * A structure describing the private information for a kni device. */ struct kni_dev { /* kni list */ struct list_head list; struct net_device_stats stats; int status; uint16_t group_id; /* Group ID of a group of KNI devices */ unsigned core_id; /* Core ID to bind */ char name[RTE_KNI_NAMESIZE]; /* Network device name */ struct task_struct *pthread; /* wait queue for req/resp */ wait_queue_head_t wq; struct mutex sync_lock; /* PCI device id */ uint16_t device_id; /* kni device */ struct net_device *net_dev; struct net_device *lad_dev; struct pci_dev *pci_dev; /* queue for packets to be sent out */ void *tx_q; /* queue for the packets received */ void *rx_q; /* queue for the allocated mbufs those can be used to save sk buffs */ void *alloc_q; /* free queue for the mbufs to be freed */ void *free_q; /* request queue */ void *req_q; /* response queue */ void *resp_q; void * sync_kva; void *sync_va; void *mbuf_kva; void *mbuf_va; /* mbuf size */ unsigned mbuf_size; /* synchro for request processing */ unsigned long synchro; /* Persist netdev on /dev/kni close */ uint8_t netdev_persist : 1; /* /dev/kni is closed or not */ uint8_t kni_released : 1; #ifdef RTE_KNI_VHOST struct kni_vhost_queue* vhost_queue; volatile enum { BE_STOP = 0x1, BE_START = 0x2, BE_FINISH = 0x4, }vq_status; #endif }; #define KNI_ERR(args...) printk(KERN_DEBUG "KNI: Error: " args) #define KNI_PRINT(args...) printk(KERN_DEBUG "KNI: " args) #ifdef RTE_KNI_KO_DEBUG #define KNI_DBG(args...) printk(KERN_DEBUG "KNI: " args) #else #define KNI_DBG(args...) #endif #ifdef RTE_KNI_VHOST unsigned int kni_poll(struct file *file, struct socket *sock, poll_table * wait); int kni_chk_vhost_rx(struct kni_dev *kni); int kni_vhost_init(struct kni_dev *kni); int kni_vhost_backend_release(struct kni_dev *kni); struct kni_vhost_queue { struct sock sk; struct socket *sock; int vnet_hdr_sz; struct kni_dev *kni; int sockfd; unsigned int flags; struct sk_buff* cache; struct rte_kni_fifo* fifo; }; #endif #ifdef RTE_KNI_VHOST_DEBUG_RX #define KNI_DBG_RX(args...) printk(KERN_DEBUG "KNI RX: " args) #else #define KNI_DBG_RX(args...) #endif #ifdef RTE_KNI_VHOST_DEBUG_TX #define KNI_DBG_TX(args...) printk(KERN_DEBUG "KNI TX: " args) #else #define KNI_DBG_TX(args...) #endif #endif
/* pkg_src_list.h - the opkg package management system Carl D. Worth Copyright (C) 2001 University of Southern California This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef PKG_SRC_LIST_H #define PKG_SRC_LIST_H #ifdef __cplusplus extern "C" { #endif #include "pkg_src.h" #include "void_list.h" typedef struct void_list_elt pkg_src_list_elt_t; typedef struct void_list pkg_src_list_t; static inline int pkg_src_list_empty(pkg_src_list_t *list) { return void_list_empty((void_list_t *)list); } void pkg_src_list_elt_init(pkg_src_list_elt_t *elt, nv_pair_t *data); void pkg_src_list_elt_deinit(pkg_src_list_elt_t *elt); void pkg_src_list_init(pkg_src_list_t *list); void pkg_src_list_deinit(pkg_src_list_t *list); pkg_src_t *pkg_src_list_append(pkg_src_list_t *list, const char *name, const char *root_dir, const char *extra_data, int gzip); void pkg_src_list_push(pkg_src_list_t *list, pkg_src_t *data); pkg_src_list_elt_t *pkg_src_list_pop(pkg_src_list_t *list); #ifdef __cplusplus } #endif #endif /* PKG_SRC_LIST_H */
/************************************************************************ * Copyright(c) 2009, One Unified. All rights reserved. * * * * This file is provided as is WITHOUT ANY WARRANTY * * without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * * * This software may not be used nor distributed without proper license * * agreement. * * * * See the file LICENSE.txt for redistribution information. * ************************************************************************/ #pragma once #include <vector> #include <sstream> #include <typeinfo.h> #include <cassert> #include <boost/thread/mutex.hpp> #include <boost/thread/locks.hpp> // mechanism of re-usable buffers, removes the execution overhead of new/delete // has some thread safety // Use template style so that various types can be used // issue statistics at destruction stage as to how many buffers were allocated (max size queue reached) // this whole thing may be obsolete as CCharBuffer can be a vector<>, // and CReusableCharBuffers is only need when running with multiple threads // ====== // T is the type of buffer to be used // Thread safe // stats: #check ins, #check outs, #created, #destroyed, maxqsize // may be able to use LockFreeQueues: // http://www.ddj.com/hpc-high-performance-computing/208801974 // might use auto_ptr for this // uses a stack to optimize some re-use speed // BufferRepository // can the mutex be made compile-time conditional? // most usage may be single thread mode now, as buffers are being returned to the original // thread for storage (actually possibly no, cross thread returns are used) namespace ou { template<typename bufferT> class BufferRepository { public: typedef typename bufferT* buffer_t; BufferRepository(void); ~BufferRepository(void); inline void CheckIn( buffer_t Buffer ); inline buffer_t CheckOut(); void CheckInL( buffer_t Buffer ); // locked version buffer_t CheckOutL(); // locked version bool Outstanding( void ) { return ( cntCheckins != cntCheckouts ); }; protected: boost::mutex m_mutex; std::vector<buffer_t> m_vStack; private: size_t cntCheckins, cntCheckouts; #ifdef _DEBUG size_t cntCreated, cntDestroyed, maxQsize; bool m_bCheckingOut; bool m_bCheckingIn; std::string m_sType; #endif }; template<typename bufferT> BufferRepository<bufferT>::BufferRepository(void) : cntCheckins( 0 ), cntCheckouts( 0 ) #ifdef _DEBUG , cntCreated( 0 ), cntDestroyed( 0 ), maxQsize( 0 ), m_bCheckingOut( false ), m_bCheckingIn( false ) #endif { #ifdef _DEBUG m_sType = typeid( this ).name(); #endif } template<typename bufferT> BufferRepository<bufferT>::~BufferRepository(void) { bufferT* pBuffer; boost::mutex::scoped_lock lock(m_mutex); // for the methods requiring a lock while ( !m_vStack.empty() ) { pBuffer = m_vStack.back(); m_vStack.pop_back(); delete pBuffer; #ifdef _DEBUG ++cntDestroyed; #endif } #ifdef _DEBUG std::stringstream ss; ss << typeid( this ).name() << ": " << cntCreated << " Created, " << cntDestroyed << " Destroyed, " << cntCheckouts << " Checkouts, " << cntCheckins << " Checkins, " << maxQsize << " Max Q Size" << std::endl; // OutputDebugString( ss.str().c_str() ); ss.str() = ""; if ( cntCreated != cntDestroyed ) { // OutputDebugString( " ** Created != Destroyed\n" ); } if ( cntCheckins != cntCheckouts ) { // OutputDebugString( " ** Checkins != Checkouts\n" ); } #endif } template<typename bufferT> inline void BufferRepository<bufferT>::CheckInL(bufferT* pBuffer) { boost::mutex::scoped_lock lock(m_mutex); CheckIn( pBuffer ); } template<typename bufferT> inline void BufferRepository<bufferT>::CheckIn(bufferT* pBuffer) { #ifdef _DEBUG assert( !m_bCheckingIn && !m_bCheckingOut ); m_bCheckingIn = true; #endif m_vStack.push_back( pBuffer ); ++cntCheckins; #ifdef _DEBUG maxQsize = std::max<size_t>( maxQsize, m_vStack.size() ); m_bCheckingIn = false; #endif } template<typename bufferT> inline bufferT* BufferRepository<bufferT>::CheckOutL() { boost::mutex::scoped_lock lock(m_mutex); return CheckOut(); } template<typename bufferT> inline bufferT* BufferRepository<bufferT>::CheckOut() { bufferT* pBuffer; #ifdef _DEBUG assert( !m_bCheckingIn && !m_bCheckingOut ); m_bCheckingOut = true; #endif if ( m_vStack.empty() ) { pBuffer = new bufferT(); #ifdef _DEBUG ++cntCreated; #endif } else { pBuffer = m_vStack.back(); m_vStack.pop_back(); } ++cntCheckouts; #ifdef _DEBUG m_bCheckingOut = false; #endif return pBuffer; } } // ou
/********************************************************************** ** Author: Nicolas Remy ** Copyright (C) 2002-2004 The Board of Trustees of the Leland Stanford Junior ** University ** All rights reserved. ** ** This file is part of the "gui" module of the Geostatistical Earth ** Modeling Software (GEMS) ** ** This file may be distributed and/or modified under the terms of the ** license defined by the Stanford Center for Reservoir Forecasting and ** appearing in the file LICENSE.XFREE included in the packaging of this file. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.gnu.org/copyleft/gpl.html for GPL licensing information. ** ** Contact the Stanford Center for Reservoir Forecasting, Stanford University ** if any conditions of this licensing are not clear to you. ** **********************************************************************/ #ifndef __GSTLAPPLI_VARIOG_PLOT_H__ #define __GSTLAPPLI_VARIOG_PLOT_H__ #include <GsTLAppli/math/gstlvector.h> #include <GsTLAppli/math/gstlpoint.h> #include <GsTLAppli/extra/qwt/qwt_plot.h> #include <GsTLAppli/extra/qwt/qwt_plot_curve.h> #include <GsTL/geometry/covariance.h> #include <qapplication.h> #include <qpixmap.h> #include <qwidget.h> #include <qevent.h> #include <QMouseEvent> #include <vector> const int margin =40; class Model_manager; class Discrete_function; class Variog_plot : public QwtPlot { Q_OBJECT public: Variog_plot(){} Variog_plot( const Discrete_function& df, const Variogram_function_adaptor<Covariance<GsTLPoint> > *model, GsTLVector<double> angle, const std::vector<int>& pairs_count, const QString& title = QString::null, bool y_starts_at_zero = false, QWidget *parent=0, const char *name=0); public slots: void refresh(); //void show_pairs_count( const QMouseEvent& ); private: std::vector<int> pairs_; std::vector<double> pairs_coord_x_, pairs_coord_y_; bool pairs_shown_; GsTLVector<double> angle_; const Variogram_function_adaptor<Covariance<GsTLPoint> > *model1_; const Variogram_function_adaptor<Covariance<GsTLPoint> > *model2_; QwtPlotCurve * curve1_, *curve2_; double max_x_; protected: virtual void mouseReleaseEvent(QMouseEvent *); }; #endif
/* * RTEMS for Nintendo DS console driver. * * Copyright (c) 2008 by Renaud Voltz <renaud.voltz@gmail.com> * Matthieu Bucchianeri <mbucchia@gmail.com> * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * * http://www.rtems.org/license/LICENSE */ #include <bsp.h> #include <nds.h> #include <rtems/libio.h> #include <nds/arm9/console.h> #include <sys/iosupport.h> #include <rtems/mw_uid.h> /* * enables testsuite output to desmume. this is used to pass the rtems * testsuite. * comment the following line to disable (recommended). */ //#define TESTSUITE /* * printk support. */ /* from NDS support library */ extern void consolePrintChar(char c); void nds_putch (char c) { #ifdef TESTSUITE __asm__ volatile ("swi $0x1"); #endif consolePrintChar (c); } static volatile char ch = 0; void console_push (char c) { ch = c; } int nds_getch (void) { char c; while (ch == 0); c = ch; ch = 0; return c; } BSP_output_char_function_type BSP_output_char = nds_putch; BSP_polling_getchar_function_type BSP_poll_char = nds_getch; /* * console write operation. */ static ssize_t nds_write (int minor, const char *buf, size_t len) { int count; for (count = 0; count < len; count++) { nds_putch (buf[count]); } return 0; } /* * console read operation. */ static int nds_read (int minor) { return nds_getch (); } /* * from touchscreen/parser.c */ void register_kbd_msg_queue (char *q_name); void unregister_kbd_msg_queue (void); /* * Console driver */ rtems_device_driver console_initialize (rtems_device_major_number major, rtems_device_minor_number minor, void *arg) { rtems_status_code status; printk ("[+] console started\n"); rtems_termios_initialize (); status = rtems_io_register_name ("/dev/console", major, 0); if (status != RTEMS_SUCCESSFUL) { printk ("[!] error registering console\n"); rtems_fatal_error_occurred (status); } return (RTEMS_SUCCESSFUL); } rtems_device_driver console_open (rtems_device_major_number major, rtems_device_minor_number minor, void *arg) { rtems_status_code status; static rtems_termios_callbacks cb = { NULL, /* firstOpen */ NULL, /* lastClose */ nds_read, /* pollRead */ nds_write, /* write */ NULL, /* setAttributes */ NULL, /* stopRemoteTx */ NULL, /* startRemoteTx */ 0 /* 1 = outputUsesInterrupts */ }; status = rtems_termios_open (major, minor, arg, &cb); if (status != RTEMS_SUCCESSFUL) printk ("[!] error opening console\n"); return (status); } rtems_device_driver console_close (rtems_device_major_number major, rtems_device_minor_number minor, void *arg) { rtems_device_driver res = RTEMS_SUCCESSFUL; res = rtems_termios_close (arg); return res; } rtems_device_driver console_read (rtems_device_major_number major, rtems_device_minor_number minor, void *arg) { return rtems_termios_read (arg); } rtems_device_driver console_write (rtems_device_major_number major, rtems_device_minor_number minor, void *arg) { return rtems_termios_write (arg); } rtems_device_driver console_control (rtems_device_major_number major, rtems_device_minor_number minor, void *arg) { rtems_libio_ioctl_args_t *args = arg; switch (args->command) { case MW_UID_REGISTER_DEVICE: register_kbd_msg_queue (args->buffer); break; case MW_UID_UNREGISTER_DEVICE: unregister_kbd_msg_queue (); break; default: return rtems_termios_ioctl (arg); } args->ioctl_return = 0; return RTEMS_SUCCESSFUL; }
/* * copyright (c) 2003 Fabrice Bellard * * 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 */ #ifndef AVUTIL_VERSION_H #define AVUTIL_VERSION_H /** * @defgroup preproc_misc Preprocessor String Macros * * String manipulation macros * * @{ */ #define AV_STRINGIFY(s) AV_TOSTRING(s) #define AV_TOSTRING(s) #s #define AV_GLUE(a, b) a ## b #define AV_JOIN(a, b) AV_GLUE(a, b) #define AV_PRAGMA(s) _Pragma(#s) /** * @} */ /** * @defgroup version_utils Library Version Macros * * Useful to check and match library version in order to maintain * backward compatibility. * * @{ */ #define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c) #define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) /** * @} */ /** * @file * @ingroup lavu * Libavutil version macros */ /** * @defgroup lavu_ver Version and Build diagnostics * * Macros and function useful to check at compiletime and at runtime * which version of libavutil is in use. * * @{ */ #define LIBAVUTIL_VERSION_MAJOR 52 #define LIBAVUTIL_VERSION_MINOR 17 #define LIBAVUTIL_VERSION_MICRO 101 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \ LIBAVUTIL_VERSION_MICRO) #define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \ LIBAVUTIL_VERSION_MICRO) #define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT #define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION) /** * @} * * @defgroup depr_guards Deprecation guards * FF_API_* defines may be placed below to indicate public API that will be * dropped at a future version bump. The defines themselves are not part of * the public API and may change, break or disappear at any time. * * @{ */ #ifndef FF_API_GET_BITS_PER_SAMPLE_FMT #define FF_API_GET_BITS_PER_SAMPLE_FMT (LIBAVUTIL_VERSION_MAJOR < 53) #endif #ifndef FF_API_FIND_OPT #define FF_API_FIND_OPT (LIBAVUTIL_VERSION_MAJOR < 53) #endif #ifndef FF_API_OLD_AVOPTIONS #define FF_API_OLD_AVOPTIONS (LIBAVUTIL_VERSION_MAJOR < 53) #endif #ifndef FF_API_PIX_FMT #define FF_API_PIX_FMT (LIBAVUTIL_VERSION_MAJOR < 53) #endif #ifndef FF_API_CONTEXT_SIZE #define FF_API_CONTEXT_SIZE (LIBAVUTIL_VERSION_MAJOR < 53) #endif #ifndef FF_API_PIX_FMT_DESC #define FF_API_PIX_FMT_DESC (LIBAVUTIL_VERSION_MAJOR < 53) #endif #ifndef FF_API_AV_REVERSE #define FF_API_AV_REVERSE (LIBAVUTIL_VERSION_MAJOR < 53) #endif #ifndef FF_API_AUDIOCONVERT #define FF_API_AUDIOCONVERT (LIBAVUTIL_VERSION_MAJOR < 53) #endif #ifndef FF_API_CPU_FLAG_MMX2 #define FF_API_CPU_FLAG_MMX2 (LIBAVUTIL_VERSION_MAJOR < 53) #endif #ifndef FF_API_SAMPLES_UTILS_RETURN_ZERO #define FF_API_SAMPLES_UTILS_RETURN_ZERO (LIBAVUTIL_VERSION_MAJOR < 53) #endif /** * @} */ #endif /* AVUTIL_VERSION_H */
// // ESCBaseViewController.h // ESCDevelopTool // // Created by 程巍巍 on 12/19/14. // // #import <UIKit/UIKit.h> @interface ESCBaseViewController : UIViewController /** * 配制,init 时自动载入,配制为JSON文件,文件名与类名相同 */ @property (nonatomic, readonly) NSMutableDictionary *settings; /** * 子类中需重在此方法,根据不同的 serializedID ,实现不同的响应。 * @discussion 1~99保留,不可使用。如果为 action 设置了 URI 则会发出一个 NURLRequest 请求,参数为 param 内容,可通过 NSURLProtocol 获取事件 */ - (void)navigationItemSelected:(NSInteger)serializedID; /** * 当键盘发生变化时,改变 view 的大小,使其不被键盘遮挡。Default YES */ @property (nonatomic) BOOL reFrameForKeyboardFrameChanged; @end
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ /* * Copyright (c) 2015 KTH * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation; * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: * Igor Di Paolo <igor.di.paolo@gmail.com> */ #ifndef HR_WPAN_TIMESTAMPTAG_H #define HR_WPAN_TIMESTAMPTAG_H #include <ns3/object.h> #include <ns3/tag.h> #include <ns3/nstime.h> namespace ns3 { class TimestampTag : public Tag { public: static TypeId GetTypeId(void); virtual TypeId GetInstanceTypeId(void) const; virtual uint32_t GetSerializedSize(void) const; virtual void Serialize(TagBuffer i) const; virtual void Deserialize(TagBuffer i); // these are our accessors to our tag structure void SetTimestamp(Time time); Time GetTimestamp(void) const; void Print(std::ostream &os) const; private: Time m_timestamp; }; } #endif
/* Copyright (C) 2013 Calpont Corp. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef QFE_SOCKETIO_H__ #define QFE_SOCKETIO_H__ #ifdef _MSC_VER #define WIN32_LEAN_AND_MEAN #define NOMINMAX #include <windows.h> #else #include <stdint.h> #endif #include <unistd.h> #include <string> #include "socktype.h" namespace qfe { namespace socketio { #ifndef _MSC_VER void readn(int fd, void* buf, const size_t wanted); size_t writen(int fd, const void* data, const size_t nbytes); #else void reads(SOCKET fd, void* buf, const size_t wanted); size_t writes(SOCKET fd, const void* buf, const size_t len); #endif uint32_t readNumber32(SockType); std::string readString(SockType); void writeString(SockType, const std::string&); } //namespace qfe::socketio } //namespace qfe #endif
/* ***** BEGIN LICENSE BLOCK ***** * This file is part of Natron <http://www.natron.fr/>, * Copyright (C) 2013-2017 INRIA and Alexandre Gauthier-Foichat * * Natron 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. * * Natron 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 Natron. If not, see <http://www.gnu.org/licenses/gpl-2.0.html> * ***** END LICENSE BLOCK ***** */ #ifndef GENERICSCHEDULERTHREADWATCHER_H #define GENERICSCHEDULERTHREADWATCHER_H // ***** BEGIN PYTHON BLOCK ***** // from <https://docs.python.org/3/c-api/intro.html#include-files>: // "Since Python may define some pre-processor definitions which affect the standard headers on some systems, you must include Python.h before any standard headers are included." #include <Python.h> // ***** END PYTHON BLOCK ***** #include "Global/Macros.h" #include <list> #if !defined(Q_MOC_RUN) && !defined(SBK_RUN) #include <boost/shared_ptr.hpp> #include <boost/scoped_ptr.hpp> #include <boost/shared_ptr.hpp> #endif #include <QtCore/QThread> #include "Engine/EngineFwd.h" NATRON_NAMESPACE_ENTER; /** * @brief The purpose of this class is to safely destroy a GenericSchedulerThread and to get notify whenever the GenericSchedulerThread abortion is complete * or whenever it is finished (i.e: waitForThreadToQuit() has returned true) * * Basically, if you need to ensure that a GenericSchedulerThread has finished, you would create a GenericSchedulerThreadWatcher with the thread in parameter * and connect a slot to the threadFinished() signal. Whenever executing this slot, it is then safe to assume that the thread is finished and you can also * destroy the watcher. * * You should never use the GenericSchedulerThreadWatcher to perform multiple tasks, because it is then uncertain for which task, which slot you are going to be receving, * even though the class is safely implemented to support multiple tasks. * * Note: the GenericSchedulerThread object should live as long as this object lives. **/ class GenericWatcherCallerArgs { public: GenericWatcherCallerArgs() { } virtual ~GenericWatcherCallerArgs() { } }; struct GenericWatcherPrivate; class GenericWatcher : public QThread { GCC_DIAG_SUGGEST_OVERRIDE_OFF Q_OBJECT GCC_DIAG_SUGGEST_OVERRIDE_ON public: GenericWatcher(); ~GenericWatcher(); /** * @brief Start watching the given taskID. In derived implementation taskID should be handled in handleBlockingTask() and typically casted to an enum for clarity. * @params inArgs This can be derived from GenericWatcherCallerArgs to store any arguments relevant to the local function you were in when calling scheduleBlockingTask() * and that you want to retrieve when the taskFinished() signal is emitted. **/ void scheduleBlockingTask( int taskID, const WatcherCallerArgsPtr& inArgs = WatcherCallerArgsPtr() ); void stopWatching(); Q_SIGNALS: void taskFinished(int taskID, WatcherCallerArgsPtr args); protected: virtual void handleBlockingTask(int taskID) = 0; private: virtual void run() OVERRIDE FINAL; boost::scoped_ptr<GenericWatcherPrivate> _imp; }; class GenericSchedulerThreadWatcher : public GenericWatcher { public: // The kind of tasks that this watcher supports, each of them will call the corresponding wait function on the GenericSchedulerThread // and emit the signal when appropriate enum BlockingTaskEnum { eBlockingTaskWaitForAbort, eBlockingTaskWaitForQuitDisallowRestart, eBlockingTaskWaitForQuitAllowRestart, }; GenericSchedulerThreadWatcher(GenericSchedulerThread* thread) : GenericWatcher() , _thread(thread) { } virtual ~GenericSchedulerThreadWatcher() { } private: virtual void handleBlockingTask(int taskID) OVERRIDE FINAL; GenericSchedulerThread* _thread; }; class RenderEngineWatcher : public GenericWatcher { public: // The kind of tasks that this watcher supports, each of them will call the corresponding wait function on the GenericSchedulerThread // and emit the signal when appropriate enum BlockingTaskEnum { eBlockingTaskWaitForAbort, eBlockingTaskWaitForQuitDisallowRestart, eBlockingTaskWaitForQuitAllowRestart, }; RenderEngineWatcher(RenderEngine* engine) : GenericWatcher() , _engine(engine) { } virtual ~RenderEngineWatcher() { } private: virtual void handleBlockingTask(int taskID) OVERRIDE FINAL; RenderEngine* _engine; }; class NodeRenderWatcher : public GenericWatcher { public: // The kind of tasks that this watcher supports, each of them will call the corresponding wait function on the GenericSchedulerThread // and emit the signal when appropriate enum BlockingTaskEnum { eBlockingTaskQuitAnyProcessing, eBlockingTaskAbortAnyProcessing }; NodeRenderWatcher(const NodePtr& node) : GenericWatcher() { _nodes.push_back(node); } NodeRenderWatcher(const NodesList& nodes) : GenericWatcher() , _nodes(nodes) { } virtual ~NodeRenderWatcher() { } private: virtual void handleBlockingTask(int taskID) OVERRIDE FINAL; NodesList _nodes; }; NATRON_NAMESPACE_EXIT; #endif // GENERICSCHEDULERTHREADWATCHER_H
char SOME_STRING[1000] = "kdlsjfklds;fjkls;djflksdjflkdsjfklsdjfkl;sjfklsdjfkl;jsdflk;jsdl;fjsdlkfjsdklf;jds;lfjskdl;fjkls;dfjlkds;jfkl;sjdfk;ldsjklnvklsnbklsdnblkdlsjfklds;fjkls;djflksdjflkdsjfklsdjfkl;sjfklsdjfkl;jsdflk;jsdl;fjsdlkfjsdklf;jds;lfjskdl;fjkls;dfjlkds;jfkl;sjdfk;ldsjklnvklsnbklsdnblkdlsjfklds;fjkls;djflksdjflkdsjfklsdjfkl;sjfklsdjfkl;jsdflk;jsdl;fjsdlkfjsdklf;jds;lfjskdl;fjkls;dfjlkds;jfkl;sjdfk;ldsjklnvklsnbklsdnblkdlsjfklds;fjkls;djflksdjflkdsjfklsdjfkl;sjfklsdjfkl;jsdflk;jsdl;fjsdlkfjsdklf;jds;lfjskdl;fjkls;dfjlkds;jfkl;sjdfk;ldsjklnvklsnbklsdnbl"; void funcGood(char *str) { char buffer[256]; strncpy (buffer, SOME_STRING, 255); buffer[255] = '\0'; strncat(buffer, str, (sizeof(buffer) - (strlen(buffer) + 1 ) ) ); return; }
#if defined(ENABLE_EDIT_ROM) /*/ frameTableEditor.h (2006.01.21) /*/ #pragma once #include <wfc.h> #include "stdafx.h" #include "definitionLocal.h" #include "ecuExplorer.h" #include "frameGrid.h" class frameTableEditor : public CFrameWnd { protected: DECLARE_DYNCREATE(frameTableEditor) public: frameTableEditor(); virtual ~frameTableEditor(); BOOL PostCreateClient(CRect* lpRect); // long LoadRomTable(int fhROM); public: CFont* lpFont; ecuExplorer* lpParent; LPSTRUCT_MAPITEM lpMapItem; LPSTRUCT_ROMITEM lpRomItem; int iOffset_ram; frameGrid* lpGrid; private: unsigned char* buffer_xAxis; unsigned char* buffer_yAxis; unsigned char* buffer_zAxis; public: //{{AFX_VIRTUAL(frameRomTable) virtual BOOL PreCreateWindow(CREATESTRUCT& cs); virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs,CCreateContext* pContext); //}}AFX_VIRTUAL protected: //{{AFX_MSG(frameTableEditor) afx_msg void OnSize(UINT nType,int cx,int cy); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; #endif
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ /* { dg-options "-O2 -msse2 -march=k8" } */ /* { dg-final { scan-assembler "pand\[^\\n\]*magic" } } */ /* { dg-final { scan-assembler "pandn\[^\\n\]*magic" } } */ /* { dg-final { scan-assembler "pxor\[^\\n\]*magic" } } */ /* { dg-final { scan-assembler "por\[^\\n\]*magic" } } */ /* { dg-final { scan-assembler "movdqa" } } */ /* { dg-final { scan-assembler-not "movaps\[^\\n\]*magic" } } */ /* Verify that we generate proper instruction with memory operand. */ #include <xmmintrin.h> __m128i magic_a, magic_b; __m128i t1(void) { return _mm_and_si128 (magic_a,magic_b); } __m128i t2(void) { return _mm_andnot_si128 (magic_a,magic_b); } __m128i t3(void) { return _mm_or_si128 (magic_a,magic_b); } __m128i t4(void) { return _mm_xor_si128 (magic_a,magic_b); }
/* * mac-part.h - Structure of Apple partition tables * * Copyright (C) 1996 Paul Mackerras * * 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. */ #define MAC_PARTITION_MAGIC 0x504d /* type field value for A/UX or other Unix partitions */ #define APPLE_AUX_TYPE "Apple_UNIX_SVR2" struct mac_partition { u16 signature; /* expected to be MAC_PARTITION_MAGIC */ u16 res1; u32 map_count; /* # blocks in partition map */ u32 start_block; /* absolute starting block # of partition */ u32 block_count; /* number of blocks in partition */ char name[32]; /* partition name */ char type[32]; /* string type description */ u32 data_start; /* rel block # of first data block */ u32 data_count; /* number of data blocks */ u32 status; /* partition status */ u32 boot_start; /* logical start block no. of bootstrap */ u32 boot_size; /* no. of bytes in bootstrap */ u32 boot_load; /* bootstrap load address in memory */ u32 boot_load2; /* reserved for extension of boot_load */ u32 boot_entry; /* entry point address for bootstrap */ u32 boot_entry2; /* reserved for extension of boot_entry */ u32 boot_cksum; char processor[16]; /* name of processor that boot is for */ }; /* Bit in status field */ #define STATUS_BOOTABLE 8 /* partition is bootable */ #define MAC_DRIVER_MAGIC 0x4552 /* Driver descriptor structure, in block 0 */ struct mac_driver_desc { u16 signature; /* expected to be MAC_DRIVER_MAGIC */ u16 block_size; u32 block_count; u16 dev_type; u16 dev_id; u32 data; u16 driver_count; u8 driverlist[488]; u16 padding[3]; };
/* * Copyright (C) 2005-2013 Team XBMC * http://kodi.tv * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XBMC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #pragma once #include "GUIControl.h" #include "TextureManager.h" #include "GUIImage.h" class CGUIBorderedImage : public CGUIImage { public: CGUIBorderedImage(int parentID, int controlID, float posX, float posY, float width, float height, const CTextureInfo& texture, const CTextureInfo& borderTexture, const CRect &borderSize); CGUIBorderedImage(const CGUIBorderedImage &right); ~CGUIBorderedImage(void) override; CGUIBorderedImage *Clone() const override { return new CGUIBorderedImage(*this); }; void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) override; void Render() override; void AllocResources() override; void FreeResources(bool immediately = false) override; void DynamicResourceAlloc(bool bOnOff) override; CRect CalcRenderRegion() const override; protected: CGUITexture m_borderImage; CRect m_borderSize; };
/* AbiWord * Copyright (C) 1998 AbiSource, 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 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA. */ #ifndef AP_DIALOG_MERGECELLS_H #define AP_DIALOG_MERGECELLS_H #include "ut_types.h" #include "xap_Frame.h" #include "xap_Dialog.h" #include "xav_View.h" #include "pt_Types.h" class UT_Timer; class XAP_Frame; class fp_TableContainer; class ABI_EXPORT AP_Dialog_MergeCells : public XAP_Dialog_Modeless { public: AP_Dialog_MergeCells(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); virtual ~AP_Dialog_MergeCells(void); virtual void runModeless(XAP_Frame * pFrame) = 0; typedef enum { a_OK, a_CANCEL } tAnswer; typedef enum { radio_left, radio_right, radio_above, radio_below } mergeWithCell; AP_Dialog_MergeCells::tAnswer getAnswer(void) const; PT_DocPosition getCellSource(void); PT_DocPosition getCellDestination(void); virtual void startUpdater(void); virtual void stopUpdater(void); static void autoUpdateMC(UT_Worker * pTimer); virtual void setSensitivity( mergeWithCell mergeThis, bool bSens) = 0; virtual void setActiveFrame(XAP_Frame *pFrame); void ConstructWindowName(void); void setAllSensitivities(void); void event_update(void); void finalize(void); void setMergeType( mergeWithCell iMergeType); void onMerge(void); protected: AP_Dialog_MergeCells::tAnswer m_answer; char m_WindowName[100]; private: void _generateSrcDest(void); PT_DocPosition m_iCellSource; PT_DocPosition m_iCellDestination; AP_Dialog_MergeCells::mergeWithCell m_mergeType; UT_sint32 m_iLeft; UT_sint32 m_iRight; UT_sint32 m_iTop; UT_sint32 m_iBot; UT_sint32 m_iNumRows; UT_sint32 m_iNumCols; fp_TableContainer * m_pTab; UT_Timer * m_pAutoUpdaterMC; // Handshake variables bool m_bDestroy_says_stopupdating; bool m_bAutoUpdate_happening_now; }; #endif /* AP_DIALOG_MERGECELLS_H */
#ifndef _NET_SUNRPC_SUNRPC_H #define _NET_SUNRPC_SUNRPC_H #include <linux/net.h> struct rpc_buffer { size_t len; char data[]; }; static inline int rpc_reply_expected(struct rpc_task *task) { return (task->tk_msg.rpc_proc != NULL) && (task->tk_msg.rpc_proc->p_decode != NULL); } int svc_send_common(struct socket *sock, struct xdr_buf *xdr, struct page *headpage, unsigned long headoffset, struct page *tailpage, unsigned long tailoffset); #endif
/* * Various utilities for ffmpeg system * Copyright (c) 2000, 2001, 2002 Fabrice Bellard * * 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 */ #include "config.h" #include "avformat.h" #if defined(CONFIG_WINCE) /* Skip includes on WinCE. */ #elif defined(__MINGW32__) #include <sys/types.h> #include <sys/timeb.h> #elif defined(CONFIG_OS2) #include <string.h> #include <sys/time.h> #else #include <unistd.h> #include <fcntl.h> #include <sys/time.h> #endif #include <time.h> /** * gets the current time in micro seconds. */ int64_t av_gettime(void) { #if defined(CONFIG_WINCE) return timeGetTime() * int64_t_C(1000); #elif defined(__MINGW32__) struct timeb tb; _ftime(&tb); return ((int64_t)tb.time * int64_t_C(1000) + (int64_t)tb.millitm) * int64_t_C(1000); #else struct timeval tv; gettimeofday(&tv,NULL); return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec; #endif } #if !defined(CONFIG_WINCE) #if !defined(HAVE_LOCALTIME_R) struct tm *localtime_r(const time_t *t, struct tm *tp) { struct tm *l; l = localtime(t); if (!l) return 0; *tp = *l; return tp; } #endif /* !defined(HAVE_LOCALTIME_R) */ #endif /* !defined(CONFIG_WINCE) */
/* Copyright (C) 2001 Tensilica, Inc. All Rights Reserved. Revised to support Tensilica processors and to improve overall performance */ /* Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of version 2.1 of the GNU Lesser General Public License as published by the Free Software Foundation. This program is distributed in the hope that it would be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Further, this software is distributed without any warranty that it is free of the rightful claim of any third person regarding infringement or the like. Any license provided herein, whether implied or otherwise, applies only to this software file. Patent licenses, if any, provided herein do not apply to combinations of this program with other software, or any other product whatsoever. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, Mountain View, CA 94043, or: http://www.sgi.com For further information regarding this notice, see: http://oss.sgi.com/projects/GenInfo/NoticeExplan */ /* ==================================================================== * ==================================================================== * * Module: atan2ftab.c * $Revision: 1.9 $ * $Date: 2000/04/14 21:19:38 $ * $Author: vegas $ * $Source: /isms/cmplrs.src/osprey1.0/libm/RCS/atan2ftab.c,v $ * * Revision history: * 09-Jun-93 - Original Version * * Description: error tables for atan2f function * * ==================================================================== * ==================================================================== */ static char *rcs_id = "$Source: /isms/cmplrs.src/osprey1.0/libm/RCS/atan2ftab.c,v $ $Revision: 1.9 $"; #include "libm.h" const fu _atan2fres0[] = { {0x00000000}, {0x80000000}, {0x40490fdb}, {0xc0490fdb}, }; const fu _atan2fres1[] = { {0x3fc90fdb}, {0xbfc90fdb}, {0x3fc90fdb}, {0xbfc90fdb}, }; const fu _atan2fres2[] = { {0x00000000}, {0x80000000}, {0x40490fdb}, {0xc0490fdb}, }; const fu _atan2fres4[] = { {0x00000000}, {0x00000000}, {0x3fc90fdb}, {0xbfc90fdb}, {0x00000000}, {0x00000000}, {0x3fc90fdb}, {0xbfc90fdb}, {0x00000000}, {0x80000000}, {0x3f490fdb}, {0xbf490fdb}, {0x40490fdb}, {0xc0490fdb}, {0x4016cbe4}, {0xc016cbe4}, };
/*************************************************************************** kompare.h - description ------------------- begin : Sun Mar 4 2001 Copyright 2001-2003 Otto Bruggeman <otto.bruggeman@home.nl> Copyright 2001-2003 John Firebaugh <jfirebaugh@kde.org> ****************************************************************************/ /*************************************************************************** ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ***************************************************************************/ #ifndef KOMPARE_H #define KOMPARE_H #include <kurl.h> #include "diff2export.h" // Forward declaration needed class KTempDir; namespace Kompare { enum Format { Context = 0, Ed = 1, Normal = 2, RCS = 3, Unified = 4, SideBySide = 5, UnknownFormat = -1 }; enum Generator { CVSDiff = 0, Diff = 1, Perforce = 2, SubVersion = 3, Reserved2 = 4, Reserved3 = 5, Reserved4 = 6, Reserved5 = 7, Reserved6 = 8, Reserved7 = 9, UnknownGenerator = -1 }; enum Mode { ComparingFiles, // compareFiles ComparingFileString, // Compare a source file with a destination string ComparingStringFile, // Compare a source string with a destination file ComparingDirs, // compareDirs ShowingDiff, // openDiff BlendingDir, // openDirAnfDiff BlendingFile, // openFileAndDiff UnknownMode // Used to initialize the Infoi struct }; enum DiffMode { Default, Custom, UnknownDiffMode // Use to initialize the Info struct }; enum Status { RunningDiff, Parsing, FinishedParsing, FinishedWritingDiff, ReRunningDiff // When a change has been detected after diff has run }; enum Target { Source, Destination }; struct Info { Info ( enum Mode _mode = UnknownMode, enum DiffMode _diffMode = UnknownDiffMode, enum Format _format = UnknownFormat, enum Generator _generator = UnknownGenerator, KUrl _source = KUrl(), KUrl _destination = KUrl(), QString _localSource = "", QString _localDestination = "", KTempDir* _sourceKTempDir = 0, KTempDir* _destinationKTempDir = 0, uint _depth = 0, bool _applied = true ) { mode = _mode; diffMode = _diffMode; format = _format; generator = _generator; source = _source; destination = _destination; localSource = _localSource; localDestination = _localDestination; sourceKTempDir = _sourceKTempDir; destinationKTempDir = _destinationKTempDir; depth = _depth; applied = _applied; } void swapSourceWithDestination() { KUrl url = source; source = destination; destination = url; QString string = localSource; localSource = localDestination; localDestination = string; KTempDir* tmpDir = sourceKTempDir; sourceKTempDir = destinationKTempDir; destinationKTempDir = tmpDir; } enum Mode mode; enum DiffMode diffMode; enum Format format; enum Generator generator; KUrl source; KUrl destination; QString localSource; QString localDestination; KTempDir* sourceKTempDir; KTempDir* destinationKTempDir; uint depth; bool applied; }; } // End of namespace Kompare /* ** This should be removed and put somewhere else */ class DIFF2_EXPORT KompareFunctions { public: static QString constructRelativePath( const QString& from, const QString& to ) { KUrl fromURL( from ); KUrl toURL( to ); KUrl root; int upLevels = 0; // Find a common root. root = from; while( root.isValid() && !root.isParentOf( toURL ) ) { root = root.upUrl(); upLevels++; } if( !root.isValid() ) return to; QString relative; for( ; upLevels > 0; upLevels-- ) { relative += "../"; } relative += QString( to ).replace( 0, root.path( KUrl::LeaveTrailingSlash ).length(), "" ); return relative; } }; #endif
/* Copyright Statement: * * This software/firmware and related documentation ("MediaTek Software") are * protected under relevant copyright laws. The information contained herein * is confidential and proprietary to MediaTek Inc. and/or its licensors. * Without the prior written permission of MediaTek inc. and/or its licensors, * any reproduction, modification, use or disclosure of MediaTek Software, * and information contained herein, in whole or in part, shall be strictly prohibited. * * MediaTek Inc. (C) 2010. All rights reserved. * * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. * * The following software/firmware and/or related documentation ("MediaTek Software") * have been modified by MediaTek Inc. All revisions are subject to any receiver's * applicable license agreements with MediaTek Inc. */ /* * (C) Copyright 2002 * Sysgo Real-Time Solutions, GmbH <www.elinos.com> * Marius Groeger <mgroeger@sysgo.de> * * (C) Copyright 2002 * Sysgo Real-Time Solutions, GmbH <www.elinos.com> * Alex Zuepke <azu@sysgo.de> * * (C) Copyright 2002 * Gary Jennejohn, DENX Software Engineering, <gj@denx.de> * * (C) Copyright 2009 * Ilya Yanok, Emcraft Systems Ltd, <yanok@emcraft.com> * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ #include <common.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> /* * Reset the cpu by setting up the watchdog timer and let it time out */ void reset_cpu (ulong ignored) { struct wdog_regs *regs = (struct wdog_regs *)IMX_WDT_BASE; /* Disable watchdog and set Time-Out field to 0 */ writel (0x00000000, &regs->wcr); /* Write Service Sequence */ writel (0x00005555, &regs->wsr); writel (0x0000AAAA, &regs->wsr); /* Enable watchdog */ writel (WCR_WDE, &regs->wcr); while (1) ; }
/* This file is part of Datagrind, a tool for tracking data accesses. Copyright (C) 2010 Bruce Merry bmerry@users.sourceforge.net This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. The GNU General Public License is contained in the file COPYING. */ #ifndef DG_VIEW_PARSE_H #define DG_VIEW_PARSE_H #include <stdint.h> #include <cstdio> #include <cstddef> #include <stdexcept> #include <string> #include "dg_view_base.h" class record_parser_error : public std::runtime_error { public: record_parser_error(const std::string &msg) throw() : std::runtime_error(msg) {} }; class record_parser_content_error : public record_parser_error { public: record_parser_content_error(const std::string &msg) : record_parser_error(msg) {} }; class record_parser_length_error : public record_parser_content_error { public: record_parser_length_error(const std::string &msg) throw() : record_parser_content_error(msg) {} }; class record_parser_string_error : public record_parser_content_error { public: record_parser_string_error() throw() : record_parser_content_error("") {} virtual const char *what() const throw() { return "Error: string was not terminated"; } }; class record_parser_ferror : public record_parser_error { public: record_parser_ferror() throw() : record_parser_error("") {} virtual const char *what() const throw() { return "Error reading file"; } }; class record_parser_feof : public record_parser_error { public: record_parser_feof() throw() : record_parser_error("") {} virtual const char *what() const throw() { return "Unexpected end of file"; } }; /* Main parser class for the file format. For details of the format, refer to * the datagrind documentation. * * This is a low-level class for reading individual fields of a single record. * Knowledge of the record formats is in dg_view_core.cpp. */ class record_parser { private: uint8_t type; /* Record type - see dg_record.h */ uint64_t size; /* Stated size of the record */ uint64_t offset; /* How much into the payload we've read */ std::FILE *file; /* Backing file */ /* Prevent copying */ record_parser(const record_parser &); record_parser &operator=(const record_parser &); /* Construction is private - use record_parser::create instead */ record_parser(uint8_t type, uint64_t size, std::FILE *file); public: /* Factory to create a record parser. If EOF is encountered before reading * anything, returns NULL. Otherwise, the record header is consumed from * the file. If the record header is incomplete or invalid, an exception is * thrown. */ static record_parser *create(std::FILE *f); /* Record type */ uint8_t get_type() const; /* Extraction methods. These methods will all throw an exception if the * record ends unexpectedly. */ uint8_t extract_byte(); template<typename T> T extract_word(); void extract_bytes(uint8_t *buffer, std::size_t len); /* Assumes string is in the standard Datagrind encoding */ std::string extract_string(); /* Number of bytes remaining */ uint64_t remain() const; /* Checks that the whole block has been consumed (throws an exception * if not). */ void finish(); /* Discard the rest of the record. */ void discard(); }; #endif /* DG_VIEW_PARSE_H */
/* * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2015 The ManaPlus Developers * * This file is part of The ManaPlus Client. * * 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 * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef GUI_WINDOWS_SETUPWINDOW_H #define GUI_WINDOWS_SETUPWINDOW_H #include "gui/widgets/window.h" #include "listeners/actionlistener.h" class Button; class Label; class SetupTab; class TabbedArea; /** * The setup dialog. Displays several tabs for configuring different aspects * of the game. * * \ingroup GUI */ class SetupWindow final : public Window, public ActionListener { public: SetupWindow(); A_DELETE_COPY(SetupWindow) ~SetupWindow(); void postInit() override final; void action(const ActionEvent &event) override final; void setInGame(const bool inGame); void externalUpdate(); void externalUnload(); void registerWindowForReset(Window *const window); void unregisterWindowForReset(const Window *const window); void hideWindows(); void clearWindowsForReset() { mWindowsToReset.clear(); } void doCancel(); void activateTab(const std::string &name); void setVisible(Visible visible) override final; void widgetResized(const Event &event) override final; private: void unloadAdditionalTabs(); void unloadTab(SetupTab *page); std::list<SetupTab*> mTabs; std::list<Window*> mWindowsToReset; std::vector<Button*> mButtons; SetupTab *mModsTab; SetupTab *mQuickTab; Button *mResetWindows; TabbedArea *mPanel; Label *mVersion; int mButtonPadding; }; extern SetupWindow* setupWindow; #endif // GUI_WINDOWS_SETUPWINDOW_H
/* * Copyright (c) 2014 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * * EXYNOS - CHIP ID support * Author: Pankaj Dubey <pankaj.dubey@samsung.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/io.h> #include <linux/of.h> #include <linux/of_address.h> #include <linux/of_platform.h> #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/sys_soc.h> #include <linux/soc/samsung/exynos-soc.h> #define EXYNOS_SUBREV_MASK (0xF << 4) #define EXYNOS_MAINREV_MASK (0xF << 0) #define EXYNOS_REV_MASK (EXYNOS_SUBREV_MASK | EXYNOS_MAINREV_MASK) static void __iomem *exynos_chipid_base; struct exynos_chipid_info exynos_soc_info; EXPORT_SYMBOL(exynos_soc_info); static const char * __init product_id_to_name(unsigned int product_id) { const char *soc_name; unsigned int soc_id = product_id & EXYNOS_SOC_MASK; switch (soc_id) { case EXYNOS3250_SOC_ID: soc_name = "EXYNOS3250"; break; case EXYNOS4210_SOC_ID: soc_name = "EXYNOS4210"; break; case EXYNOS4212_SOC_ID: soc_name = "EXYNOS4212"; break; case EXYNOS4412_SOC_ID: soc_name = "EXYNOS4412"; break; case EXYNOS4415_SOC_ID: soc_name = "EXYNOS4415"; break; case EXYNOS5250_SOC_ID: soc_name = "EXYNOS5250"; break; case EXYNOS5260_SOC_ID: soc_name = "EXYNOS5260"; break; case EXYNOS5420_SOC_ID: soc_name = "EXYNOS5420"; break; case EXYNOS5440_SOC_ID: soc_name = "EXYNOS5440"; break; case EXYNOS5800_SOC_ID: soc_name = "EXYNOS5800"; break; case EXYNOS7870_SOC_ID: soc_name = "EXYNOS7870"; break; case EXYNOS8890_SOC_ID: soc_name = "EXYNOS8890"; break; default: soc_name = "UNKNOWN"; } return soc_name; } static const struct of_device_id of_exynos_chipid_ids[] __initconst = { { .compatible = "samsung,exynos4210-chipid", }, {}, }; /** * exynos_chipid_early_init: Early chipid initialization * @dev: pointer to chipid device */ void __init exynos_chipid_early_init(struct device *dev) { struct device_node *np; const struct of_device_id *match; if (exynos_chipid_base) return; if (!dev) np = of_find_matching_node_and_match(NULL, of_exynos_chipid_ids, &match); else np = dev->of_node; if (!np) panic("%s, failed to find chipid node\n", __func__); exynos_chipid_base = of_iomap(np, 0); if (!exynos_chipid_base) panic("%s: failed to map registers\n", __func__); exynos_soc_info.product_id = __raw_readl(exynos_chipid_base); exynos_soc_info.lot_id = __raw_readl(exynos_chipid_base + UNIQUE_ID1) & EXYNOS_LOTID_MASK; exynos_soc_info.unique_id = __raw_readl(exynos_chipid_base + UNIQUE_ID1); exynos_soc_info.unique_id |= (u64)__raw_readl(exynos_chipid_base + UNIQUE_ID2) << 32; exynos_soc_info.revision = exynos_soc_info.product_id & EXYNOS_REV_MASK; } static int __init exynos_chipid_probe(struct platform_device *pdev) { struct soc_device_attribute *soc_dev_attr; struct soc_device *soc_dev; struct device_node *root; int ret; exynos_chipid_early_init(&pdev->dev); soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); if (!soc_dev_attr) return -ENODEV; soc_dev_attr->family = "Samsung Exynos"; root = of_find_node_by_path("/"); ret = of_property_read_string(root, "model", &soc_dev_attr->machine); of_node_put(root); if (ret) goto free_soc; soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%d", exynos_soc_info.revision); if (!soc_dev_attr->revision) goto free_soc; soc_dev_attr->soc_id = product_id_to_name(exynos_soc_info.product_id); soc_dev = soc_device_register(soc_dev_attr); if (IS_ERR(soc_dev)) goto free_rev; soc_device_to_device(soc_dev); dev_info(&pdev->dev, "Exynos: CPU[%s] CPU_REV[0x%x] Detected\n", product_id_to_name(exynos_soc_info.product_id), exynos_soc_info.revision); return 0; free_rev: kfree(soc_dev_attr->revision); free_soc: kfree(soc_dev_attr); return -EINVAL; } static struct platform_driver exynos_chipid_driver __refdata = { .driver = { .name = "exynos-chipid", .of_match_table = of_exynos_chipid_ids, }, .probe = exynos_chipid_probe, }; static int __init exynos_chipid_init(void) { return platform_driver_register(&exynos_chipid_driver); } core_initcall(exynos_chipid_init); /* * sysfs implementation for exynos-snapshot * you can access the sysfs of exynos-snapshot to /sys/devices/system/chip-id * path. */ static struct bus_type chipid_subsys = { .name = "chip-id", .dev_name = "chip-id", }; static ssize_t chipid_product_id_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { return snprintf(buf, 10, "%08X\n", exynos_soc_info.product_id); } static ssize_t chipid_lot_id_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { return snprintf(buf, 14, "%08X\n", exynos_soc_info.lot_id); } static ssize_t chipid_revision_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { return snprintf(buf, 14, "%08X\n", exynos_soc_info.revision); } static struct kobj_attribute chipid_product_id_attr = __ATTR(product_id, 0644, chipid_product_id_show, NULL); static struct kobj_attribute chipid_lot_id_attr = __ATTR(lot_id, 0644, chipid_lot_id_show, NULL); static struct kobj_attribute chipid_revision_attr = __ATTR(revision, 0644, chipid_revision_show, NULL); static struct attribute *chipid_sysfs_attrs[] = { &chipid_product_id_attr.attr, &chipid_lot_id_attr.attr, &chipid_revision_attr.attr, NULL, }; static struct attribute_group chipid_sysfs_group = { .attrs = chipid_sysfs_attrs, }; static const struct attribute_group *chipid_sysfs_groups[] = { &chipid_sysfs_group, NULL, }; static int __init chipid_sysfs_init(void) { int ret = 0; ret = subsys_system_register(&chipid_subsys, chipid_sysfs_groups); if (ret) pr_err("fail to register exynos-snapshop subsys\n"); return ret; } late_initcall(chipid_sysfs_init);
struct sb_card_config { struct address_info conf; struct address_info mpucnf; const char *card_id; const char *dev_id; int mpu; }; #ifdef CONFIG_PNP /* Card PnP ID Table */ static struct pnp_card_device_id sb_pnp_card_table[] = { /* Sound Blaster 16 */ {.id = "CTL0024", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster 16 */ {.id = "CTL0025", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster 16 */ {.id = "CTL0026", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster 16 */ {.id = "CTL0027", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster 16 */ {.id = "CTL0028", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster 16 */ {.id = "CTL0029", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster 16 */ {.id = "CTL002a", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster 16 */ {.id = "CTL002b", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster 16 */ {.id = "CTL002c", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster 16 */ {.id = "CTL00ed", .driver_data = 0, .devs = { {.id="CTL0041"}, } }, /* Sound Blaster 16 */ {.id = "CTL0086", .driver_data = 0, .devs = { {.id="CTL0041"}, } }, /* Sound Blaster Vibra16S */ {.id = "CTL0051", .driver_data = 0, .devs = { {.id="CTL0001"}, } }, /* Sound Blaster Vibra16C */ {.id = "CTL0070", .driver_data = 0, .devs = { {.id="CTL0001"}, } }, /* Sound Blaster Vibra16CL */ {.id = "CTL0080", .driver_data = 0, .devs = { {.id="CTL0041"}, } }, /* Sound Blaster Vibra16CL */ {.id = "CTL00F0", .driver_data = 0, .devs = { {.id="CTL0043"}, } }, /* Sound Blaster AWE 32 */ {.id = "CTL0039", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster AWE 32 */ {.id = "CTL0042", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster AWE 32 */ {.id = "CTL0043", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster AWE 32 */ {.id = "CTL0044", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster AWE 32 */ {.id = "CTL0045", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster AWE 32 */ {.id = "CTL0046", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster AWE 32 */ {.id = "CTL0047", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster AWE 32 */ {.id = "CTL0048", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster AWE 32 */ {.id = "CTL0054", .driver_data = 0, .devs = { {.id="CTL0031"}, } }, /* Sound Blaster AWE 32 */ {.id = "CTL009C", .driver_data = 0, .devs = { {.id="CTL0041"}, } }, /* Createive SB32 PnP */ {.id = "CTL009F", .driver_data = 0, .devs = { {.id="CTL0041"}, } }, /* Sound Blaster AWE 64 */ {.id = "CTL009D", .driver_data = 0, .devs = { {.id="CTL0042"}, } }, /* Sound Blaster AWE 64 Gold */ {.id = "CTL009E", .driver_data = 0, .devs = { {.id="CTL0044"}, } }, /* Sound Blaster AWE 64 Gold */ {.id = "CTL00B2", .driver_data = 0, .devs = { {.id="CTL0044"}, } }, /* Sound Blaster AWE 64 */ {.id = "CTL00C1", .driver_data = 0, .devs = { {.id="CTL0042"}, } }, /* Sound Blaster AWE 64 */ {.id = "CTL00C3", .driver_data = 0, .devs = { {.id="CTL0045"}, } }, /* Sound Blaster AWE 64 */ {.id = "CTL00C5", .driver_data = 0, .devs = { {.id="CTL0045"}, } }, /* Sound Blaster AWE 64 */ {.id = "CTL00C7", .driver_data = 0, .devs = { {.id="CTL0045"}, } }, /* Sound Blaster AWE 64 */ {.id = "CTL00E4", .driver_data = 0, .devs = { {.id="CTL0045"}, } }, /* Sound Blaster AWE 64 */ {.id = "CTL00E9", .driver_data = 0, .devs = { {.id="CTL0045"}, } }, /* ESS 1868 */ {.id = "ESS0968", .driver_data = 0, .devs = { {.id="ESS0968"}, } }, /* ESS 1868 */ {.id = "ESS1868", .driver_data = 0, .devs = { {.id="ESS1868"}, } }, /* ESS 1868 */ {.id = "ESS1868", .driver_data = 0, .devs = { {.id="ESS8611"}, } }, /* ESS 1869 PnP AudioDrive */ {.id = "ESS0003", .driver_data = 0, .devs = { {.id="ESS1869"}, } }, /* ESS 1869 */ {.id = "ESS1869", .driver_data = 0, .devs = { {.id="ESS1869"}, } }, /* ESS 1878 */ {.id = "ESS1878", .driver_data = 0, .devs = { {.id="ESS1878"}, } }, /* ESS 1879 */ {.id = "ESS1879", .driver_data = 0, .devs = { {.id="ESS1879"}, } }, /* CMI 8330 SoundPRO */ {.id = "CMI0001", .driver_data = 0, .devs = { {.id="@X@0001"}, {.id="@H@0001"}, {.id="@@@0001"}, } }, /* Diamond DT0197H */ {.id = "RWR1688", .driver_data = 0, .devs = { {.id="@@@0001"}, {.id="@X@0001"}, {.id="@H@0001"}, } }, /* ALS007 */ {.id = "ALS0007", .driver_data = 0, .devs = { {.id="@@@0001"}, {.id="@X@0001"}, {.id="@H@0001"}, } }, /* ALS100 */ {.id = "ALS0001", .driver_data = 0, .devs = { {.id="@@@0001"}, {.id="@X@0001"}, {.id="@H@0001"}, } }, /* ALS110 */ {.id = "ALS0110", .driver_data = 0, .devs = { {.id="@@@1001"}, {.id="@X@1001"}, {.id="@H@0001"}, } }, /* ALS120 */ {.id = "ALS0120", .driver_data = 0, .devs = { {.id="@@@2001"}, {.id="@X@2001"}, {.id="@H@0001"}, } }, /* ALS200 */ {.id = "ALS0200", .driver_data = 0, .devs = { {.id="@@@0020"}, {.id="@X@0030"}, {.id="@H@0001"}, } }, /* ALS200 */ {.id = "RTL3000", .driver_data = 0, .devs = { {.id="@@@2001"}, {.id="@X@2001"}, {.id="@H@0001"}, } }, /* Sound Blaster 16 (Virtual PC 2004) */ {.id = "tBA03b0", .driver_data = 0, .devs = { {.id="PNPb003"}, } }, /* -end- */ {.id = "", } }; #endif
/* * mul_events.h: MUL event handling * Copyright (C) 2012, Dipjyoti Saikia <dipjyoti.saikia@gmail.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __MUL_EVENTS_H__ #define __MUL_EVENTS_H__ #define C_MUL_TX_BUF_SZ (20480) /* Cast to struct event */ #define C_EVENT(x) ((struct event *)(x)) typedef enum { C_EVENT_NEW_SW_CONN, C_EVENT_NEW_APP_CONN, C_EVENT_NEW_HA_CONN, }c_event_conn_t; int c_ssl_accept(c_conn_t *conn); void c_write_event_sched(void *conn_arg); int c_worker_event_new_conn(void *ctx_arg, void *msg_arg); void c_switch_thread_read(evutil_socket_t fd, short events, void *arg); void c_accept(evutil_socket_t listener, short event, void *arg); void c_ha_accept(evutil_socket_t listener, short event, void *arg); void c_app_wq_accept(evutil_socket_t listener, short event, void *arg); void c_app_accept(evutil_socket_t listener, short event, void *arg); void c_aux_app_accept(evutil_socket_t listener, short event, void *arg); void c_worker_ipc_read(evutil_socket_t listener, short event, void *arg); void c_per_worker_timer_event(evutil_socket_t fd, short event, void *arg); void c_per_app_worker_timer_event(evutil_socket_t fd, short event, void *arg); void c_switch_thread_write_event(evutil_socket_t fd, short events, void *arg); void c_thread_write_event(evutil_socket_t fd, short events, void *arg); static inline void c_conn_events_del(c_conn_t *conn) { if (conn->rd_event) { event_del(C_EVENT(conn->rd_event)); event_free(C_EVENT(conn->rd_event)); conn->rd_event = NULL; } if (conn->wr_event) { event_del(C_EVENT(conn->wr_event)); event_free(C_EVENT(conn->wr_event)); conn->wr_event = NULL; } } static inline void c_conn_destroy(c_conn_t *conn) { c_wr_lock(&conn->conn_lock); c_conn_events_del(conn); if (conn->ssl) SSL_shutdown(conn->ssl); c_conn_close(conn); __c_conn_clear_buffers(conn, true); if (conn->ssl) SSL_free(conn->ssl); conn->ssl = NULL; c_wr_unlock(&conn->conn_lock); } static inline void c_conn_assign_fd(c_conn_t *conn, int fd) { struct sockaddr_in peer_addr; socklen_t peer_sz = sizeof(peer_addr); if (fd <= 0) return; conn->fd = fd; c_conn_prep(conn); memset(conn->conn_str, 0, sizeof(conn->conn_str)); if (getpeername(fd, (void *)&peer_addr, &peer_sz) < 0) { c_log_err("get peer failed |%d|", fd); return; } snprintf(conn->conn_str, C_CONN_DESC_SZ -1, "%s:%d", inet_ntoa(peer_addr.sin_addr), ntohs(peer_addr.sin_port)); } #ifdef HAVE_SG_TX static inline void c_thread_sg_tx_sync(void *conn_arg) { c_conn_t *conn = conn_arg; c_wr_lock(&conn->conn_lock); c_socket_write_nonblock_sg_loop(conn, c_write_event_sched); c_wr_unlock(&conn->conn_lock); } static inline void c_thread_tx(void *conn_arg, struct cbuf *b, bool only_q) { c_conn_t *conn = conn_arg; c_wr_lock(&conn->conn_lock); if (cbuf_list_queue_len(&conn->tx_q) > C_MUL_TX_BUF_SZ) { c_wr_unlock(&conn->conn_lock); free_cbuf(b); return; } cbuf_list_queue_tail(&conn->tx_q, b); if (!only_q) { c_socket_write_nonblock_loop(conn, c_write_event_sched); } c_wr_unlock(&conn->conn_lock); } #else static inline void c_thread_sg_tx_sync(void *conn_arg UNUSED) { return; } static inline void c_thread_tx(void *conn_arg, struct cbuf *b, bool only_q UNUSED) { c_conn_t *conn = conn_arg; c_wr_lock(&conn->conn_lock); if (cbuf_list_queue_len(&conn->tx_q) > C_MUL_TX_BUF_SZ) { c_wr_unlock(&conn->conn_lock); free_cbuf(b); return; } cbuf_list_queue_tail(&conn->tx_q, b); c_socket_write_nonblock_loop(conn, c_write_event_sched); c_wr_unlock(&conn->conn_lock); } #endif static inline void c_thread_chain_tx(void *conn_arg, struct cbuf **b, size_t nbufs) { c_conn_t *conn = conn_arg; int n; c_wr_lock(&conn->conn_lock); if (cbuf_list_queue_len(&conn->tx_q) + nbufs > C_MUL_TX_BUF_SZ) { c_wr_unlock(&conn->conn_lock); goto free_all; } for (n = 0; n < nbufs; n++) { cbuf_list_queue_tail(&conn->tx_q, b[n]); } c_socket_write_nonblock_sg_loop(conn, c_write_event_sched); c_wr_unlock(&conn->conn_lock); return; free_all: for (n = 0; n < nbufs; n++) { free_cbuf(b[n]); } } #endif
/* * File : startup.c * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://openlab.rt-thread.com/license/LICENSE * * Change Logs: * Date Author Notes * 2006-08-31 Bernard first implementation */ #include <rthw.h> #include <rtthread.h> #include "stdlib.h" #include "stdio.h" #include <string.h> #include "stm32f10x.h" #include "board.h" /** * @addtogroup STM32 */ /*@{*/ extern int rt_application_init(void); #ifdef RT_USING_FINSH extern void finsh_system_init(void); extern void finsh_set_device(const char* device); #endif #ifdef __CC_ARM extern int Image$$RW_IRAM1$$ZI$$Limit; #elif __ICCARM__ #pragma section="HEAP" #else extern int __bss_end; #endif #ifdef DEBUG /******************************************************************************* * Function Name : assert_failed * Description : Reports the name of the source file and the source line number * where the assert error has occurred. * Input : - file: pointer to the source file name * - line: assert error line source number * Output : None * Return : None *******************************************************************************/ void assert_failed(u8* file, u32 line) { rt_kprintf("\n\r Wrong parameter value detected on\r\n"); rt_kprintf(" file %s\r\n", file); rt_kprintf(" line %d\r\n", line); while (1) ; } #endif /** * This function will startup RT-Thread RTOS. */ void rtthread_startup(void) { /* init board */ rt_hw_board_init(); /* show version */ rt_show_version(); /* init tick */ rt_system_tick_init(); /* init application */ //////////////////////////////// /* init kernel object */ rt_system_object_init(); /* init timer system */ rt_system_timer_init(); #ifdef RT_USING_HEAP #if STM32_EXT_SRAM rt_system_heap_init((void*)STM32_EXT_SRAM_BEGIN, (void*)STM32_EXT_SRAM_END); #else #ifdef __CC_ARM rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)STM32_SRAM_END); #elif __ICCARM__ rt_system_heap_init(__segment_end("HEAP"), (void*)STM32_SRAM_END); #else /* init memory system */ rt_system_heap_init((void*)&__bss_end, (void*)STM32_SRAM_END); #endif #endif #endif /* init scheduler system */ rt_system_scheduler_init(); #ifdef RT_USING_DFS //sst25vfxx_init(); #endif /* init all device */ rt_device_init_all(); /* init application */ rt_application_init(); #ifdef RT_USING_FINSH /* init finsh */ finsh_system_init(); finsh_set_device("uart1"); #endif /* init timer thread */ rt_system_timer_thread_init(); /* init idle thread */ rt_thread_idle_init(); /* start scheduler */ rt_system_scheduler_start(); /* never reach here */ return ; } int main(void) { rt_uint32_t UNUSED level; /* disable interrupt first */ level = rt_hw_interrupt_disable(); /* init system setting */ SystemInit(); /* startup RT-Thread RTOS */ rtthread_startup(); return 0; } /*@}*/
/* * Copyright (c) 2003, Intel Corporation. All rights reserved. * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. */ /* * Test that mq_open() fails with ENOENT if the named message queue does * not yet exist, but O_CREAT is not set. */ #include <stdio.h> #include <mqueue.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include <string.h> #include <errno.h> #include "posixtest.h" #define NAMESIZE 50 int main() { char qname[NAMESIZE]; mqd_t queue; sprintf(qname, "/mq_open_29-1_%d", getpid()); queue = mq_open(qname, O_RDWR, S_IRUSR | S_IWUSR, NULL); if (queue != (mqd_t) -1) { printf("mq_open() did not return mqd_t - on error\n"); printf("Test FAILED\n"); mq_close(queue); mq_unlink(qname); return PTS_FAIL; } if (errno != ENOENT) { printf("errno != ENOENT\n"); printf("Test FAILED\n"); mq_close(queue); mq_unlink(qname); return PTS_FAIL; } printf("Test PASSED\n"); return PTS_PASS; }
/* * Copyright © 2003 USC, Information Sciences Institute * * Permission to use, copy, modify, distribute, and sell this software * and its documentation for any purpose is hereby granted without * fee, provided that the above copyright notice appear in all copies * and that both that copyright notice and this permission notice * appear in supporting documentation, and that the name of the * University of Southern California not be used in advertising or * publicity pertaining to distribution of the software without * specific, written prior permission. The University of Southern * California makes no representations about the suitability of this * software for any purpose. It is provided "as is" without express * or implied warranty. * * THE UNIVERSITY OF SOUTHERN CALIFORNIA DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF * SOUTHERN CALIFORNIA BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Carl D. Worth <cworth@isi.edu> */ #include <stdio.h> #include <stdlib.h> #include <png.h> #include "read-png.h" #include "util.h" static void premultiply_data (png_structp png, png_row_infop row_info, png_bytep data) { int i; for (i = 0; i < row_info->rowbytes; i += 4) { unsigned char *base = &data[i]; unsigned char blue = base[0]; unsigned char green = base[1]; unsigned char red = base[2]; unsigned char alpha = base[3]; unsigned long p; red = ((unsigned) red * (unsigned) alpha + 127) / 255; green = ((unsigned) green * (unsigned) alpha + 127) / 255; blue = ((unsigned) blue * (unsigned) alpha + 127) / 255; p = (alpha << 24) | (red << 16) | (green << 8) | (blue << 0); memcpy (base, &p, sizeof (unsigned long)); } } read_png_status_t read_png_argb32 (const char *filename, unsigned char **data, unsigned int *width, unsigned int *height, unsigned int *stride) { int i; FILE *file; static const int PNG_SIG_SIZE = 8; unsigned char png_sig[PNG_SIG_SIZE]; int sig_bytes; png_struct *png; png_info *info; png_uint_32 png_width, png_height; int depth, color_type, interlace; unsigned int pixel_size; png_byte **row_pointers; file = fopen (filename, "rb"); if (file == NULL) { fprintf (stderr, "Error: File not found: %s\n", filename); return READ_PNG_FILE_NOT_FOUND; } sig_bytes = fread (png_sig, 1, PNG_SIG_SIZE, file); if (png_check_sig (png_sig, sig_bytes) == 0) { fclose (file); fprintf (stderr, "Error: File is not a PNG image: %s\n", filename); return READ_PNG_FILE_NOT_PNG; } /* XXX: Perhaps we'll want some other error handlers? */ png = png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (png == NULL) { fclose (file); fprintf (stderr, "Error: Out of memory while reading %s\n", filename); return READ_PNG_NO_MEMORY; } info = png_create_info_struct (png); if (info == NULL) { fclose (file); png_destroy_read_struct (&png, NULL, NULL); fprintf (stderr, "Error: Out of memory while reading %s\n", filename); return READ_PNG_NO_MEMORY; } png_init_io (png, file); png_set_sig_bytes (png, sig_bytes); png_read_info (png, info); png_get_IHDR (png, info, &png_width, &png_height, &depth, &color_type, &interlace, NULL, NULL); *width = png_width; *height = png_height; *stride = 4 * png_width; /* convert palette/gray image to rgb */ if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb (png); /* expand gray bit depth if needed */ if (color_type == PNG_COLOR_TYPE_GRAY && depth < 8) png_set_gray_1_2_4_to_8 (png); /* transform transparency to alpha */ if (png_get_valid(png, info, PNG_INFO_tRNS)) png_set_tRNS_to_alpha (png); if (depth == 16) png_set_strip_16 (png); if (depth < 8) png_set_packing (png); /* convert grayscale to RGB */ if (color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) png_set_gray_to_rgb (png); if (interlace != PNG_INTERLACE_NONE) png_set_interlace_handling (png); png_set_bgr (png); png_set_filler (png, 0xff, PNG_FILLER_AFTER); if (color_type == PNG_COLOR_TYPE_RGB_ALPHA || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) png_set_read_user_transform_fn (png, premultiply_data); png_read_update_info (png, info); pixel_size = 4; *data = xmalloc (png_width * png_height * pixel_size); row_pointers = malloc (png_height * sizeof(char *)); for (i=0; i < png_height; i++) row_pointers[i] = (png_byte *) (*data + i * png_width * pixel_size); png_read_image (png, row_pointers); png_read_end (png, info); free (row_pointers); fclose (file); png_destroy_read_struct (&png, &info, NULL); return READ_PNG_SUCCESS; }
/****************************************************************************** * xmit_linux.c * * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved. * Linux device driver for RTL8192SU * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * Modifications for inclusion into the Linux staging tree are * Copyright(c) 2010 Larry Finger. All rights reserved. * * Contact information: * WLAN FAE <wlanfae@realtek.com> * Larry Finger <Larry.Finger@lwfinger.net> * ******************************************************************************/ #define _XMIT_OSDEP_C_ #include "osdep_service.h" #include "drv_types.h" #include "if_ether.h" #include "ip.h" #include "rtl871x_byteorder.h" #include "wifi.h" #include "mlme_osdep.h" #include "xmit_osdep.h" #include "osdep_intf.h" static uint remainder_len(struct pkt_file *pfile) { /* Kovich: Need to extend the buf_len to 64 bit ?(unsigned long long) */ return (uint)(pfile->buf_len - ((addr_t)(pfile->cur_addr) - (addr_t)(pfile->buf_start))); } void _r8712_open_pktfile(_pkt *pktptr, struct pkt_file *pfile) { pfile->pkt = pktptr; pfile->cur_addr = pfile->buf_start = pktptr->data; pfile->pkt_len = pfile->buf_len = pktptr->len; pfile->cur_buffer = pfile->buf_start ; } uint _r8712_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen) { uint len; len = remainder_len(pfile); len = (rlen > len) ? len : rlen; if (rmem) skb_copy_bits(pfile->pkt, pfile->buf_len - pfile->pkt_len, rmem, len); pfile->cur_addr += len; pfile->pkt_len -= len; return len; } sint r8712_endofpktfile(struct pkt_file *pfile) { if (pfile->pkt_len == 0) return true; else return false; } void r8712_set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib) { int i; struct ethhdr etherhdr; struct iphdr ip_hdr; u16 UserPriority = 0; _r8712_open_pktfile(ppktfile->pkt, ppktfile); _r8712_pktfile_read(ppktfile, (unsigned char *)&etherhdr, ETH_HLEN); /* get UserPriority from IP hdr*/ if (pattrib->ether_type == 0x0800) { i = _r8712_pktfile_read(ppktfile, (u8 *)&ip_hdr, sizeof(ip_hdr)); /*UserPriority = (ntohs(ip_hdr.tos) >> 5) & 0x3 ;*/ UserPriority = ip_hdr.tos >> 5; } else { /* "When priority processing of data frames is supported, * a STA's SME should send EAPOL-Key frames at the highest * priority." */ if (pattrib->ether_type == 0x888e) UserPriority = 7; } pattrib->priority = UserPriority; pattrib->hdrlen = WLAN_HDR_A3_QOS_LEN; pattrib->subtype = WIFI_QOS_DATA_TYPE; } int r8712_xmit_resource_alloc(struct _adapter *padapter, struct xmit_buf *pxmitbuf) { int i; for (i = 0; i < 8; i++) { pxmitbuf->pxmit_urb[i] = _usb_alloc_urb(0, GFP_KERNEL); if (pxmitbuf->pxmit_urb[i] == NULL) { printk(KERN_ERR "r8712u: pxmitbuf->pxmit_urb[i]" " == NULL"); return _FAIL; } } return _SUCCESS; } void r8712_xmit_resource_free(struct _adapter *padapter, struct xmit_buf *pxmitbuf) { int i; for (i = 0; i < 8; i++) { if (pxmitbuf->pxmit_urb[i]) { usb_kill_urb(pxmitbuf->pxmit_urb[i]); usb_free_urb(pxmitbuf->pxmit_urb[i]); } } } void r8712_xmit_complete(struct _adapter *padapter, struct xmit_frame *pxframe) { if (pxframe->pkt) dev_kfree_skb_any(pxframe->pkt); pxframe->pkt = NULL; } int r8712_xmit_entry(_pkt *pkt, struct net_device *pnetdev) { struct xmit_frame *pxmitframe = NULL; struct _adapter *padapter = (struct _adapter *)_netdev_priv(pnetdev); struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); int ret = 0; if (r8712_if_up(padapter) == false) { ret = 0; goto _xmit_entry_drop; } pxmitframe = r8712_alloc_xmitframe(pxmitpriv); if (pxmitframe == NULL) { ret = 0; goto _xmit_entry_drop; } if ((!r8712_update_attrib(padapter, pkt, &pxmitframe->attrib))) { ret = 0; goto _xmit_entry_drop; } padapter->ledpriv.LedControlHandler(padapter, LED_CTL_TX); pxmitframe->pkt = pkt; if (r8712_pre_xmit(padapter, pxmitframe) == true) { /*dump xmitframe directly or drop xframe*/ dev_kfree_skb_any(pkt); pxmitframe->pkt = NULL; } pxmitpriv->tx_pkts++; pxmitpriv->tx_bytes += pxmitframe->attrib.last_txcmdsz; return ret; _xmit_entry_drop: if (pxmitframe) r8712_free_xmitframe(pxmitpriv, pxmitframe); pxmitpriv->tx_drop++; dev_kfree_skb_any(pkt); return ret; }
// This file is part of Chaotic Rage (c) 2010 Josh Heidenreich // // kate: tab-width 4; indent-width 4; space-indent off; word-wrap off; #pragma once #include "types.h" #include <vector> #include <list> #include <string> using namespace std; /* The maximum number of local players */ #define MAX_LOCAL 2 /* The "slot" for representing all players. */ #define ALL_SLOTS 0 class AmmoRound; class AnimPlay; class AssimpModel; class Audio; class Entity; class GameLogic; class GameSettings; class GameState; class GameType; class HUD; class HUDLabel; class Light; class Map; class NetClient; class Object; class PhysicsBullet; class Pickup; class Player; class Render; class Unit; class UnitType; class Vehicle; class Wall; class WeaponType; class Weather; class btVector3; class EffectsManager; class CmdManager; class PlayerState; namespace gcn { class Gui; class SDLInput; class Container; } /** * Information about a unit. Exposed to lua as Unitinfo * This class must remain a POD or you will break the lua binding **/ class UnitQueryResult { public: Unit * u; float dist; }; enum GameStatus { STARTUP, RUNNING, END_SCREEN, FINISHED, }; /** * Contains all of the state variables for the game * * How to decide if it belongs here or in the GameEngine class: * - If it should be network-replicated, it belongs here * - If it is local to this instance, it belongs over there **/ class GameState { friend class RenderOpenGL; friend class RenderNull; friend class RenderDebug; friend class RenderAscii; friend class AudioSDLMixer; friend class NetServer; friend class PhysicsBullet; friend void gameLoop(GameState *st, Render *render, Audio* audio, NetClient* client); private: unsigned int last_tick; protected: list<Entity*> entities; list<Entity*> entities_add; vector<Unit*> units; // leaks: items are not removed vector<Wall*> walls; // leaks: items are not removed GameStatus status; EID eid_next; CmdManager* extcmd; public: Map* map; GameType* gt; GameSettings* gs; PlayerState * local_players[MAX_LOCAL]; unsigned int num_local; int last_game_result; unsigned int game_time; GameLogic* logic; PhysicsBullet* physics; SPK::System* particle_system; Weather* weather; EffectsManager* effects; float time_of_day; // 0.0 = midnight, 1.0 = midday float time_cycle; float tod_target_val; float tod_target_psec; public: GameState(); ~GameState(); public: // Adding void addUnit(Unit* unit); void addWall(Wall* wall); void addVehicle(Vehicle* vehicle); void addObject(Object* object); void addPickup(Pickup* pickup); void addAmmoRound(AmmoRound* e); void addParticleGroup(SPK::Group* group); void removeParticleGroup(SPK::Group* group); // Add and remove animations from the renderer // This just wraps the render code void addAnimPlay(AnimPlay* play, Entity* e); void remAnimPlay(AnimPlay* play); // Add and remove lights from the renderer // This just wraps the render code void addLight(Light* light); void remLight(Light* light); void setTorch(bool on); // Debris Entity* deadButNotBuried(Entity* e, AnimPlay* play); void scatterDebris(Entity* e, unsigned int num, float force, const vector<AssimpModel*>& debris_models); // Network bits (EID = entity-id; slots are for players) EID getNextEID(); Entity * getEntity(EID eid); // Data queries list<UnitQueryResult> * findVisibleUnits(Unit* origin); Unit * findUnitSlot(unsigned int slot); list<AmmoRound*>* findAmmoRoundsUnit(Unit* u); // Get the PlayerState or NULL PlayerState* getLocalPlayer(const Player* p); PlayerState* getLocalPlayer(unsigned int slot); // Start and run void preGame(); void update(float delta); void postGame(); /** * The main game loop **/ void gameLoop(Render* render, Audio* audio, NetClient* client); void gameLoopIter(); void endScreenLoopIter(); // Called by Lua, etc void terminate(); void gameOver(int result); int getLastGameResult(); // Weapon fun vector<WeaponType*>* getSpawnWeapons(UnitType* ut, Faction fac); // HUD void addHUDMessage(unsigned int slot, string text, string text2 = ""); HUDLabel* addHUDLabel(unsigned int slot, int x, int y, string data, HUDLabel* l = NULL); bool mousePick(unsigned int x, unsigned int y, btVector3& hitLocation, Entity** hitEntity); private: void animateTimeOfDay(float delta); void doTimeOfDay(float delta); void doTorch(); }; GameState * getGameState();
// // OOSMOS TimeoutInSeconds Example // // Copyright (C) 2014-2020 OOSMOS, LLC // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, version 2 of the License ("GPLv2"). // // This software may be used without the GPLv2 restrictions by entering // into a commercial license agreement with OOSMOS, LLC. // See <https://www.oosmos.com/licensing/>. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // #include "oosmos.h" #include <stdint.h> #include <stdio.h> static const uint32_t WaitTimeSeconds = 2; extern int main(void) { // // Allocate a Timeout object. // oosmos_sTimeout Timeout; // // Set timeout. // oosmos_TimeoutInSeconds(&Timeout, WaitTimeSeconds); printf("Waiting for %lu seconds...\n", (unsigned long) WaitTimeSeconds); for (;;) { // // Check if the time has expired. // if (oosmos_TimeoutHasExpired(&Timeout)) { break; } // // Be polite. Prevent 100% CPU usage on multi-tasked // machines (e.g. Windows or Linux). // oosmos_DelayMS(1); } printf("SUCCESS\n"); return 0; }
/* * This file is part of the coreboot project. * * Copyright (C) 2015 - 2016 Intel Corp. * (Written by Alexandru Gagniuc <alexandrux.gagniuc@intel.com> for Intel Corp.) * * 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. */ #include <cbfs.h> #include <console/console.h> #include <fsp/util.h> enum pixel_format { pixel_rgbx_8bpc = 0, pixel_bgrx_8bpc = 1, pixel_bitmask = 2, /* defined by <rgb>_mask values */ }; static const uint8_t uuid_graphics_info[16] = { 0xce, 0x2c, 0xf6, 0x39, 0x25, 0x68, 0x69, 0x46, 0xbb, 0x56, 0x54, 0x1a, 0xba, 0x75, 0x3a, 0x07 }; struct hob_graphics_info { uint64_t framebuffer_base; uint32_t framebuffer_size; uint32_t version; uint32_t horizontal_resolution; uint32_t vertical_resolution; uint32_t pixel_format; /* See enum pixel_format */ uint32_t red_mask; uint32_t green_mask; uint32_t blue_mask; uint32_t reserved_mask; uint32_t pixels_per_scanline; } __attribute__((packed)); struct pixel { uint8_t pos; uint8_t size; }; static const struct fsp_framebuffer { struct pixel red; struct pixel green; struct pixel blue; struct pixel rsvd; } fsp_framebuffer_format_map[] = { [pixel_rgbx_8bpc] = { {0, 8}, {8, 8}, {16, 8}, {24, 8} }, [pixel_bgrx_8bpc] = { {16, 8}, {8, 8}, {0, 8}, {24, 8} }, }; enum cb_err fsp_fill_lb_framebuffer(struct lb_framebuffer *framebuffer) { size_t size; const struct hob_graphics_info *ginfo; const struct fsp_framebuffer *fbinfo; ginfo = fsp_find_extension_hob_by_uuid(uuid_graphics_info, &size); if (!ginfo) { printk(BIOS_ALERT, "Graphics hand-off block not found\n"); return CB_ERR; } if (ginfo->pixel_format >= ARRAY_SIZE(fsp_framebuffer_format_map)) { printk(BIOS_ALERT, "FSP set unknown framebuffer format: %d\n", ginfo->pixel_format); return CB_ERR; } fbinfo = fsp_framebuffer_format_map + ginfo->pixel_format; framebuffer->physical_address = ginfo->framebuffer_base; framebuffer->x_resolution = ginfo->horizontal_resolution; framebuffer->y_resolution = ginfo->vertical_resolution; framebuffer->bytes_per_line = ginfo->pixels_per_scanline * 4; framebuffer->bits_per_pixel = 32; framebuffer->red_mask_pos = fbinfo->red.pos; framebuffer->red_mask_size = fbinfo->red.size; framebuffer->green_mask_pos = fbinfo->green.pos; framebuffer->green_mask_size = fbinfo->green.size; framebuffer->blue_mask_pos = fbinfo->blue.pos; framebuffer->blue_mask_size = fbinfo->blue.size; framebuffer->reserved_mask_pos = fbinfo->rsvd.pos; framebuffer->reserved_mask_size = fbinfo->rsvd.pos; framebuffer->tag = LB_TAG_FRAMEBUFFER; framebuffer->size = sizeof(*framebuffer); return CB_SUCCESS; } uintptr_t fsp_load_vbt(void) { void *vbt; vbt = cbfs_boot_map_with_leak("vbt.bin", CBFS_TYPE_RAW, NULL); if (!vbt) printk(BIOS_NOTICE, "Could not locate a VBT file in CBFS\n"); return (uintptr_t)vbt; }
#ifndef __MFD_WM831X_WATCHDOG_H__ #define __MFD_WM831X_WATCHDOG_H__ #define WM831X_WDOG_ENA 0x8000 #define WM831X_WDOG_ENA_MASK 0x8000 #define WM831X_WDOG_ENA_SHIFT 15 #define WM831X_WDOG_ENA_WIDTH 1 #define WM831X_WDOG_DEBUG 0x4000 #define WM831X_WDOG_DEBUG_MASK 0x4000 #define WM831X_WDOG_DEBUG_SHIFT 14 #define WM831X_WDOG_DEBUG_WIDTH 1 #define WM831X_WDOG_RST_SRC 0x2000 #define WM831X_WDOG_RST_SRC_MASK 0x2000 #define WM831X_WDOG_RST_SRC_SHIFT 13 #define WM831X_WDOG_RST_SRC_WIDTH 1 #define WM831X_WDOG_SLPENA 0x1000 #define WM831X_WDOG_SLPENA_MASK 0x1000 #define WM831X_WDOG_SLPENA_SHIFT 12 #define WM831X_WDOG_SLPENA_WIDTH 1 #define WM831X_WDOG_RESET 0x0800 #define WM831X_WDOG_RESET_MASK 0x0800 #define WM831X_WDOG_RESET_SHIFT 11 #define WM831X_WDOG_RESET_WIDTH 1 #define WM831X_WDOG_SECACT_MASK 0x0300 #define WM831X_WDOG_SECACT_SHIFT 8 #define WM831X_WDOG_SECACT_WIDTH 2 #define WM831X_WDOG_PRIMACT_MASK 0x0030 #define WM831X_WDOG_PRIMACT_SHIFT 4 #define WM831X_WDOG_PRIMACT_WIDTH 2 #define WM831X_WDOG_TO_MASK 0x0007 #define WM831X_WDOG_TO_SHIFT 0 #define WM831X_WDOG_TO_WIDTH 3 #endif
/* Copyright (C) 2000-2003 Peter Selinger. This file is part of ccrypt. It is free software and it is covered by the GNU general public license. See the file COPYING for details. */ /* readkey.h */ /* $Id: readkey.h,v 1.3 2003/03/30 00:38:29 selinger Exp $ */ #ifndef __READKEY_H #define __READKEY_H char *readkey(); #endif /* __READKEY_H */
/* ** Zabbix ** Copyright (C) 2001-2015 Zabbix SIA ** ** 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. **/ #include "common.h" #include "sysinfo.h" #include "log.h" #ifdef _WINDOWS # include "perfmon.h" # pragma comment(lib, "user32.lib") #endif int SYSTEM_LOCALTIME(AGENT_REQUEST *request, AGENT_RESULT *result) { char *type, buf[32]; struct tm *tm; size_t offset; int gmtoff, ms; unsigned short h, m; #ifdef _WINDOWS struct _timeb tv; #else struct timeval tv; struct timezone tz; #endif if (1 < request->nparam) return SYSINFO_RET_FAIL; type = get_rparam(request, 0); if (NULL == type || '\0' == *type || 0 == strcmp(type, "utc")) { SET_UI64_RESULT(result, time(NULL)); } else if (0 == strcmp(type, "local")) { #ifdef _WINDOWS _ftime(&tv); tm = localtime(&tv.time); ms = tv.millitm; #else gettimeofday(&tv, &tz); tm = localtime(&tv.tv_sec); ms = (int)(tv.tv_usec / 1000); #endif offset = zbx_snprintf(buf, sizeof(buf), "%04d-%02d-%02d,%02d:%02d:%02d.%03d,", 1900 + tm->tm_year, 1 + tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, ms); /* timezone offset */ #if defined(HAVE_TM_TM_GMTOFF) gmtoff = tm->tm_gmtoff; #else gmtoff = -timezone; #endif #ifdef _WINDOWS if (0 < tm->tm_isdst) /* daylight saving time */ gmtoff += SEC_PER_HOUR; /* assume DST is one hour */ #endif h = (unsigned short)(abs(gmtoff) / SEC_PER_HOUR); m = (unsigned short)((abs(gmtoff) - h * SEC_PER_HOUR) / SEC_PER_MIN); if (0 <= gmtoff) offset += zbx_snprintf(buf + offset, sizeof(buf) - offset, "+"); else offset += zbx_snprintf(buf + offset, sizeof(buf) - offset, "-"); offset += zbx_snprintf(buf + offset, sizeof(buf) - offset, "%02d:%02d", (int)h, (int)m); SET_STR_RESULT(result, strdup(buf)); } else return SYSINFO_RET_FAIL; return SYSINFO_RET_OK; } int SYSTEM_USERS_NUM(AGENT_REQUEST *request, AGENT_RESULT *result) { #ifdef _WINDOWS char counter_path[64]; AGENT_REQUEST request_tmp; int ret; zbx_snprintf(counter_path, sizeof(counter_path), "\\%d\\%d", PCI_TERMINAL_SERVICES, PCI_TOTAL_SESSIONS); request_tmp.nparam = 1; request_tmp.params = zbx_malloc(NULL, request_tmp.nparam * sizeof(char *)); request_tmp.params[0] = counter_path; ret = PERF_COUNTER(&request_tmp, result); zbx_free(request_tmp.params); return ret; #else return EXECUTE_INT("who | wc -l", result); #endif }
// Aseprite // Copyright (C) 2001-2015 David Capello // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. #pragma once #include "base/mutex.h" #include <memory> #include <vector> namespace base { class thread; } namespace app { class IFileItem; class ThumbnailGenerator { public: enum WorkerStatus { WithoutWorker, WorkingOnThumbnail, ThumbnailIsDone }; static ThumbnailGenerator* instance(); // Generate a thumbnail for the given file-item. It must be called // from the GUI thread. void addWorkerToGenerateThumbnail(IFileItem* fileitem); // Returns the status of the worker that is generating the thumbnail // for the given file. WorkerStatus getWorkerStatus(IFileItem* fileitem, double& progress); // Checks the status of workers. If there are workers that already // done its job, we've to destroy them. This function must be called // from the GUI thread (because a thread is joint to it). // Returns true if there are workers generating thumbnails. bool checkWorkers(); // Stops all workers generating thumbnails. This is an non-blocking // operation. The cancelation of all workers is done in a background // thread. void stopAllWorkers(); private: void stopAllWorkersBackground(); class Worker; typedef std::vector<Worker*> WorkerList; WorkerList m_workers; base::mutex m_workersAccess; std::unique_ptr<base::thread> m_stopThread; }; } // namespace app
/* This file is part of MADNESS. Copyright (C) 2007,2010 Oak Ridge National Laboratory 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 For more information please contact: Robert J. Harrison Oak Ridge National Laboratory One Bethel Valley Road P.O. Box 2008, MS-6367 email: harrisonrj@ornl.gov tel: 865-241-3937 fax: 865-572-0680 $Id$ */ #ifndef MADNESS_LINALG_TENSOR_LAPACK_H__INCLUDED #define MADNESS_LINALG_TENSOR_LAPACK_H__INCLUDED #include <madness/tensor/tensor.h> #include <madness/fortran_ctypes.h> /*! \file tensor_lapack.h \brief Prototypes for a partial interface from Tensor to LAPACK \ingroup linalg @{ */ namespace madness { /// Computes singular value decomposition of matrix /// \ingroup linalg template <typename T> void svd(const Tensor<T>& a, Tensor<T>& U, Tensor< typename Tensor<T>::scalar_type >& s, Tensor<T>& VT); /// \ingroup linalg template <typename T> void svd_result(Tensor<T>& a, Tensor<T>& U, Tensor< typename Tensor<T>::scalar_type >& s, Tensor<T>& VT, Tensor<T>& work); /// Solves linear equations /// \ingroup linalg template <typename T> void gesv(const Tensor<T>& a, const Tensor<T>& b, Tensor<T>& x); /// Solves linear equations using least squares /// \ingroup linalg template <typename T> void gelss(const Tensor<T>& a, const Tensor<T>& b, double rcond, Tensor<T>& x, Tensor< typename Tensor<T>::scalar_type >& s, long &rank, Tensor<typename Tensor<T>::scalar_type>& sumsq); /// Solves symmetric or Hermitian eigenvalue problem /// \ingroup linalg template <typename T> void syev(const Tensor<T>& A, Tensor<T>& V, Tensor< typename Tensor<T>::scalar_type >& e); /// Solves linear equations /// \ingroup linalg template <typename T> void gesv(const Tensor<T>& a, const Tensor<T>& b, Tensor<T>& x); /// Solves symmetric or Hermitian generalized eigenvalue problem /// \ingroup linalg template <typename T> void sygv(const Tensor<T>& A, const Tensor<T>& B, int itype, Tensor<T>& V, Tensor< typename Tensor<T>::scalar_type >& e); class World; // UGH! /// Solves symmetric or Hermitian generalized eigenvalue problem // !!!!!!!!!! sygvp and gesvp are now in the ELEMENTAL inteface // /// \ingroup linalg // template <typename T> // void sygvp(World& world, const Tensor<T>& A, const Tensor<T>& B, int itype, // Tensor<T>& V, Tensor< typename Tensor<T>::scalar_type >& e); // /// Solves linear equations // /// \ingroup linalg // template <typename T> // void gesvp(World& world, const Tensor<T>& a, const Tensor<T>& b, Tensor<T>& x); /// Cholesky factorization /// \ingroup linalg template <typename T> void cholesky(Tensor<T>& A); /// \ingroup linalg template <typename T> Tensor<T> inverse(const Tensor<T>& A); /// QR decomposition template<typename T> void qr(Tensor<T>& A, Tensor<T>& R); /// LQ decomposition template<typename T> void lq(Tensor<T>& A, Tensor<T>& L); /// LQ decomposition template<typename T> void lq_result(Tensor<T>& A, Tensor<T>& R, Tensor<T>& tau, Tensor<T>& work,bool do_qr); template <typename T> void geqp3(Tensor<T>& A, Tensor<T>& tau, Tensor<integer>& jpvt); /// orgqr generates an M-by-N complex matrix Q with orthonormal columns /// which is defined as the first N columns of a product of K elementary /// reflectors of order M /// Q = H(1) H(2) . . . H(k) /// as returned by ZGEQRF. template <typename T> void orgqr(Tensor<T>& A, const Tensor<T>& tau); /// Dunno // /// \ingroup linalg // template <typename T> // void triangular_solve(const Tensor<T>& L, Tensor<T>& B, // const char* side, const char* transa); /// Runs the tensor test code, returns true on success /// \ingroup linalg bool test_tensor_lapack(); /// World/MRA initialization calls this before going multithreaded due to static data in \c dlamch /// \ingroup linalg void init_tensor_lapack(); } #include <madness/tensor/elem.h> #endif // MADNESS_LINALG_TENSOR_LAPACK_H__INCLUDED
uint8_t font_6x9[654] PROGMEM = { // IMAGE DATA: /* height, pixels: */ 9, /* width in bytes: */ 72, /*0*/ 0,0,0,132,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,128,0,0, /*1*/ 0,161,40,78,101,16,8,1,0,0,0,64,12,193,120,136,199,120,12,3,0,0,0,72,14, 241,48,142,231,49,146,195,73,66,36,57,14,227,48,159,36,69,81,228,57,130,67,0,4, 32,0,16,128,0,2,129,8,6,0,0,0,0,0,4,0,0,0,0,16,4,1,0, /*2*/ 0,161,40,149,148,16,4,18,17,0,0,64,146,33,33,140,32,64,146,196,48,24,48, 64,137,18,73,146,32,72,18,129,40,194,102,69,146,36,73,132,36,69,74,4,9,2,162,0, 8,32,0,16,64,1,2,0,8,4,0,0,0,0,0,4,0,0,0,0,16,4,65,1, /*3*/ 0,161,124,5,146,16,4,162,16,0,0,32,18,1,49,138,227,64,140,196,48,198,199, 48,85,244,8,146,227,8,30,129,24,66,165,69,146,36,17,132,36,85,132,130,8,4,18,1, 0,231,112,28,67,48,142,193,40,196,226,48,14,167,112,142,36,69,146,228,9,4,162, 0, /*4*/ 0,1,40,14,97,0,4,242,125,192,7,16,18,129,64,9,36,33,18,7,0,1,0,17,205,23, 9,146,32,104,18,129,40,66,37,69,142,229,32,132,228,85,4,65,8,8,2,0,128,36,9, 146,230,72,18,129,24,68,37,73,146,100,25,132,36,85,140,132,16,4,1,0, /*5*/ 0,0,124,148,148,1,4,162,16,12,192,8,18,65,64,31,36,17,18,196,48,198,199,0, 65,20,73,146,32,72,18,145,72,66,36,69,130,38,73,132,196,108,10,33,8,16,2,0,128, 36,9,146,65,72,18,129,40,68,37,73,146,36,96,148,196,84,140,68,16,4,1,0, /*6*/ 0,1,40,149,154,0,4,18,17,8,192,8,140,227,57,136,195,16,12,195,32,24,48,16, 78,244,48,142,39,48,146,99,72,94,36,57,2,35,49,4,195,68,17,225,57,144,3,0,0, 231,112,28,71,112,146,131,72,78,36,49,14,39,56,8,199,40,18,231,33,132,0,0, /*7*/ 0,0,40,14,100,1,8,1,0,8,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,160,0,0,0,0,2,4,0,0,0,0,128,4,0,4,0, 0, /*8*/ 0,0,0,4,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,124,0,0,0,0,0,48,0,64,0,0,0,0,2,4,0,0,0,0,0,3,0,0,0,0, // CHARACTER WIDTHS: /* first char: */ 32, /* char count: */ 95, 6, 4+(4<<4), // MONOSPACED FONT! };
// ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // // File: CharIndex.h // Author: mgrosso Matthew Grosso // Created: Wed Feb 25 10:11:10 EST 2004 on localhost.localdomain // Project: // Purpose: // // $Id: CharIndex.h,v 1.1 2004/03/03 17:21:25 mgrosso Exp $ // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- #ifndef CHARINDEX_H #define CHARINDEX_H 1 #include "limits.h" #define CHARINDEX_NOTFOUND -1 class CharIndexPriv ; class CharIndex { public: typedef unsigned char key_t; typedef int index_t; CharIndex(); ~CharIndex(); index_t getIndex( key_t k ) const; index_t makeIndex( key_t k ); index_t operator[]( key_t k ); private: index_t arr_[ UCHAR_MAX ]; index_t next_; //not implemented CharIndex( const CharIndex &rhs ); CharIndex &operator=( const CharIndex &rhs ); }; #endif /* CHARINDEX_H */
/* db.h - Database Interface functions header file * Copyright (C) 2001-2004 CryptNET, V. Alex Brennen (VAB) * * This file is part of the CryptNET OpenPGP Public Key Server (cks). * * cks 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. * * cks is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef DB #define DB #include <stdlib.h> /* Postgres is the default until we support more types. */ #define POSTGRES 1 /* Postgres */ #ifdef POSTGRES #include "libpq-fe.h" #include "libpq/libpq-fs.h" #endif /* CKS */ #include "common.h" #include "datastructures.h" /* * These functions are the main interfaces to the database for the * keyserver application. These functions should be called by the * cks code throughout the scripts. */ PGconn * db_connect(struct cks_config *); int db_query(PGconn *, PGresult *,char *,struct cks_config *); int db_stmt(PGconn *, char *,struct cks_config *); int db_begin_transaction(PGconn *); int db_commit_transaction(PGconn *); int db_disconnect(PGconn *); /* * Catastrophic Database Failure, Panic out of the Keyserver. * Hopefully, this should never be used. It will likely be * removed before first release. */ void db_exit_nicely(PGconn *); /* * Functions Specific to Postgres */ int postgres_db_connect(PGconn *,struct cks_config *config); int postgres_db_query(PGconn *, PGresult *result, char *query, struct cks_config *config); int postgres_db_stmt(PGconn *, char *stmt, struct cks_config *config); int postgres_db_begin_transaction(PGconn *conn); int postgres_db_commit_transaction(PGconn *conn); int postgres_db_disconnect(PGconn *conn); /* * Misc Utility Functions */ #endif
#pragma once //см. NativeWrapper.java namespace JavaCall { int ReadHighScore(); void SubmitHighScore(int score); void Vibrate(); };
#ifndef _IP6_PMTUCFG_H #define _IP6_PMTUCFG_H #ifdef __cplusplus extern "C"{ #endif ULONG IP6_PMTU_ModifyGlobalAgeTime (USHORT usAgetime); ULONG IP6_PMTU_SetResSpecs (SPECS_RES_VALUE_S *pstResSpecs); ULONG IP6_PMTU_SetDefAgetime (USHORT usAgetime); ULONG IP6_PMTU_SetPmtu (IN6ADDR_S *pstDA, ULONG ulZoneid, ULONG ulPmtu); ULONG IP6_PMTU_DeleteMatchingEntry (IN6ADDR_S stDA, ULONG ulZoneid, ULONG ulFlag); ULONG IP6_PMTU_DeleteAllEntries (VOID); ULONG IP6_PMTU_GetFirst (UINTPTR ulHandle, PMTU_CLI_DISPLAY_S *pstCLIDisplay, ULONG *pulMultiIndex); ULONG IP6_PMTU_GetNext (ULONG *pulMultiIndex, PMTU_CLI_DISPLAY_S *pstCLIDisplay, UINTPTR ulWaitListHandle); ULONG IP6_PMTU_SearchObj (IN6ADDR_S *pstDA, ULONG ulZoneid, PMTU_CLI_DISPLAY_S *pstCLIDisplay); ULONG IP6_PMTU_DefaultMTU (IN6ADDR_S *pstDA, ULONG ulZoneid); VOID IP6_PMTU_Mindex_GetNext (ULONG *pulMiltiIndex, ULONG **ppulMindex); ULONG IP6_PMTU_OpenTable (UINTPTR *pulUserHandle); ULONG IP6_PMTU_CloseTable (UINTPTR *pulUserHandle); ULONG IP6_PMTU_ClearPMTUEntries (ULONG ulType); ULONG IP6_PMTU_GetPathMTU (IN6ADDR_S *pstDA, ULONG ulZoneid, ULONG *pulPmtu); /* Begin :Defect ID: D01006, Reason :Initial, Max Mtu change for Pos, GE interfaces*/ ULONG IP6_PMTU_SetMaxMtu (ULONG ulMaxMtu); ULONG IP6_PMTU_GetResSpecs (SPECS_RES_VALUE_S *pstResSpecs); ULONG IP6_PMTU_GetTotalEntries (ULONG ulFlag, ULONG *pulTotalEntries); ULONG IP6_PMTU_GetDefAgetime (USHORT *pusAge); #ifdef __cplusplus } #endif #endif
/* * Copyright (C) 2012 Texas Instruments * Author: Rob Clark <robdclark@gmail.com> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __TILCDC_DRV_H__ #define __TILCDC_DRV_H__ #include <linux/clk.h> #include <linux/cpufreq.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/pm.h> #include <linux/pm_runtime.h> #include <linux/slab.h> #include <linux/of.h> #include <linux/of_device.h> #include <linux/list.h> #include <drm/drmP.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_fb_cma_helper.h> struct tilcdc_drm_private { void __iomem *mmio; struct clk *disp_clk; /* display dpll */ struct clk *clk; /* functional clock */ int rev; /* IP revision */ /* don't attempt resolutions w/ higher W * H * Hz: */ uint32_t max_bandwidth; /* register contents saved across suspend/resume: */ u32 saved_register[12]; #ifdef CONFIG_CPU_FREQ struct notifier_block freq_transition; unsigned int lcd_fck_rate; #endif struct workqueue_struct *wq; struct drm_fbdev_cma *fbdev; struct drm_crtc *crtc; unsigned int num_encoders; struct drm_encoder *encoders[8]; unsigned int num_connectors; struct drm_connector *connectors[8]; }; /* Sub-module for display. Since we don't know at compile time what panels * or display adapter(s) might be present (for ex, off chip dvi/tfp410, * hdmi encoder, various lcd panels), the connector/encoder(s) are split into * separate drivers. If they are probed and found to be present, they * register themselves with tilcdc_register_module(). */ struct tilcdc_module; struct tilcdc_module_ops { /* create appropriate encoders/connectors: */ int (*modeset_init)(struct tilcdc_module *mod, struct drm_device *dev); void (*destroy)(struct tilcdc_module *mod); #ifdef CONFIG_DEBUG_FS /* create debugfs nodes (can be NULL): */ int (*debugfs_init)(struct tilcdc_module *mod, struct drm_minor *minor); /* cleanup debugfs nodes (can be NULL): */ void (*debugfs_cleanup)(struct tilcdc_module *mod, struct drm_minor *minor); #endif }; struct tilcdc_module { const char *name; struct list_head list; const struct tilcdc_module_ops *funcs; }; void tilcdc_module_init(struct tilcdc_module *mod, const char *name, const struct tilcdc_module_ops *funcs); void tilcdc_module_cleanup(struct tilcdc_module *mod); /* Panel config that needs to be set in the crtc, but is not coming from * the mode timings. The display module is expected to call * tilcdc_crtc_set_panel_info() to set this during modeset. */ struct tilcdc_panel_info { /* AC Bias Pin Frequency */ uint32_t ac_bias; /* AC Bias Pin Transitions per Interrupt */ uint32_t ac_bias_intrpt; /* DMA burst size */ uint32_t dma_burst_sz; /* Bits per pixel */ uint32_t bpp; /* FIFO DMA Request Delay */ uint32_t fdd; /* TFT Alternative Signal Mapping (Only for active) */ bool tft_alt_mode; /* Invert pixel clock */ bool invert_pxl_clk; /* Horizontal and Vertical Sync Edge: 0=rising 1=falling */ uint32_t sync_edge; /* Horizontal and Vertical Sync: Control: 0=ignore */ uint32_t sync_ctrl; /* Raster Data Order Select: 1=Most-to-least 0=Least-to-most */ uint32_t raster_order; /* DMA FIFO threshold */ uint32_t fifo_th; }; #define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__) struct drm_crtc *tilcdc_crtc_create(struct drm_device *dev); void tilcdc_crtc_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file); irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc); void tilcdc_crtc_update_clk(struct drm_crtc *crtc); void tilcdc_crtc_set_panel_info(struct drm_crtc *crtc, const struct tilcdc_panel_info *info); int tilcdc_crtc_mode_valid(struct drm_crtc *crtc, struct drm_display_mode *mode); int tilcdc_crtc_max_width(struct drm_crtc *crtc); #endif /* __TILCDC_DRV_H__ */
/* * IPv6 packet mangling table, a port of the IPv4 mangle table to IPv6 * * Copyright (C) 2000-2001 by Harald Welte <laforge@gnumonks.org> * Copyright (C) 2000-2004 Netfilter Core Team <coreteam@netfilter.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/module.h> #include <linux/netfilter_ipv6/ip6_tables.h> MODULE_LICENSE("GPL"); MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>"); MODULE_DESCRIPTION("ip6tables mangle table"); #define MANGLE_VALID_HOOKS ((1 << NF_INET_PRE_ROUTING) | \ (1 << NF_INET_LOCAL_IN) | \ (1 << NF_INET_FORWARD) | \ (1 << NF_INET_LOCAL_OUT) | \ (1 << NF_INET_POST_ROUTING)) static const struct { struct ip6t_replace repl; struct ip6t_standard entries[5]; struct ip6t_error term; } initial_table __net_initdata = { .repl = { .name = "mangle", .valid_hooks = MANGLE_VALID_HOOKS, .num_entries = 6, .size = sizeof(struct ip6t_standard) * 5 + sizeof(struct ip6t_error), .hook_entry = { [NF_INET_PRE_ROUTING] = 0, [NF_INET_LOCAL_IN] = sizeof(struct ip6t_standard), [NF_INET_FORWARD] = sizeof(struct ip6t_standard) * 2, [NF_INET_LOCAL_OUT] = sizeof(struct ip6t_standard) * 3, [NF_INET_POST_ROUTING] = sizeof(struct ip6t_standard) * 4, }, .underflow = { [NF_INET_PRE_ROUTING] = 0, [NF_INET_LOCAL_IN] = sizeof(struct ip6t_standard), [NF_INET_FORWARD] = sizeof(struct ip6t_standard) * 2, [NF_INET_LOCAL_OUT] = sizeof(struct ip6t_standard) * 3, [NF_INET_POST_ROUTING] = sizeof(struct ip6t_standard) * 4, }, }, .entries = { IP6T_STANDARD_INIT(NF_ACCEPT), /* PRE_ROUTING */ IP6T_STANDARD_INIT(NF_ACCEPT), /* LOCAL_IN */ IP6T_STANDARD_INIT(NF_ACCEPT), /* FORWARD */ IP6T_STANDARD_INIT(NF_ACCEPT), /* LOCAL_OUT */ IP6T_STANDARD_INIT(NF_ACCEPT), /* POST_ROUTING */ }, .term = IP6T_ERROR_INIT, /* ERROR */ }; static const struct xt_table packet_mangler = { .name = "mangle", .valid_hooks = MANGLE_VALID_HOOKS, .me = THIS_MODULE, .af = NFPROTO_IPV6, }; /* The work comes in here from netfilter.c. */ static unsigned int ip6t_in_hook(unsigned int hook, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { return ip6t_do_table(skb, hook, in, out, dev_net(in)->ipv6.ip6table_mangle); } static unsigned int ip6t_post_routing_hook(unsigned int hook, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { return ip6t_do_table(skb, hook, in, out, dev_net(out)->ipv6.ip6table_mangle); } static unsigned int ip6t_local_out_hook(unsigned int hook, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { unsigned int ret; struct in6_addr saddr, daddr; u_int8_t hop_limit; u_int32_t flowlabel, mark; #if 0 /* root is playing with raw sockets. */ if (skb->len < sizeof(struct iphdr) || ip_hdrlen(skb) < sizeof(struct iphdr)) { if (net_ratelimit()) printk("ip6t_hook: happy cracking.\n"); return NF_ACCEPT; } #endif /* save source/dest address, mark, hoplimit, flowlabel, priority, */ memcpy(&saddr, &ipv6_hdr(skb)->saddr, sizeof(saddr)); memcpy(&daddr, &ipv6_hdr(skb)->daddr, sizeof(daddr)); mark = skb->mark; hop_limit = ipv6_hdr(skb)->hop_limit; /* flowlabel and prio (includes version, which shouldn't change either */ flowlabel = *((u_int32_t *)ipv6_hdr(skb)); ret = ip6t_do_table(skb, hook, in, out, dev_net(out)->ipv6.ip6table_mangle); if (ret != NF_DROP && ret != NF_STOLEN && (memcmp(&ipv6_hdr(skb)->saddr, &saddr, sizeof(saddr)) || memcmp(&ipv6_hdr(skb)->daddr, &daddr, sizeof(daddr)) || skb->mark != mark || ipv6_hdr(skb)->hop_limit != hop_limit)) return ip6_route_me_harder(skb) == 0 ? ret : NF_DROP; return ret; } static struct nf_hook_ops ip6t_ops[] __read_mostly = { { .hook = ip6t_in_hook, .owner = THIS_MODULE, .pf = NFPROTO_IPV6, .hooknum = NF_INET_PRE_ROUTING, .priority = NF_IP6_PRI_MANGLE, }, { .hook = ip6t_in_hook, .owner = THIS_MODULE, .pf = NFPROTO_IPV6, .hooknum = NF_INET_LOCAL_IN, .priority = NF_IP6_PRI_MANGLE, }, { .hook = ip6t_in_hook, .owner = THIS_MODULE, .pf = NFPROTO_IPV6, .hooknum = NF_INET_FORWARD, .priority = NF_IP6_PRI_MANGLE, }, { .hook = ip6t_local_out_hook, .owner = THIS_MODULE, .pf = NFPROTO_IPV6, .hooknum = NF_INET_LOCAL_OUT, .priority = NF_IP6_PRI_MANGLE, }, { .hook = ip6t_post_routing_hook, .owner = THIS_MODULE, .pf = NFPROTO_IPV6, .hooknum = NF_INET_POST_ROUTING, .priority = NF_IP6_PRI_MANGLE, }, }; static int __net_init ip6table_mangle_net_init(struct net *net) { if (!net_ipt_permitted(net, VE_IP_MANGLE6)) return 0; /* Register table */ net->ipv6.ip6table_mangle = ip6t_register_table(net, &packet_mangler, &initial_table.repl); if (IS_ERR(net->ipv6.ip6table_mangle)) return PTR_ERR(net->ipv6.ip6table_mangle); net_ipt_module_set(net, VE_IP_MANGLE6); return 0; } static void __net_exit ip6table_mangle_net_exit(struct net *net) { if (!net_is_ipt_module_set(net, VE_IP_MANGLE6)) return; ip6t_unregister_table(net->ipv6.ip6table_mangle); } static struct pernet_operations ip6table_mangle_net_ops = { .init = ip6table_mangle_net_init, .exit = ip6table_mangle_net_exit, }; static int __init ip6table_mangle_init(void) { int ret; ret = register_pernet_subsys(&ip6table_mangle_net_ops); if (ret < 0) return ret; /* Register hooks */ ret = nf_register_hooks(ip6t_ops, ARRAY_SIZE(ip6t_ops)); if (ret < 0) goto cleanup_table; return ret; cleanup_table: unregister_pernet_subsys(&ip6table_mangle_net_ops); return ret; } static void __exit ip6table_mangle_fini(void) { nf_unregister_hooks(ip6t_ops, ARRAY_SIZE(ip6t_ops)); unregister_pernet_subsys(&ip6table_mangle_net_ops); } module_init(ip6table_mangle_init); module_exit(ip6table_mangle_fini);
/* * This file is part of PRO CFW. * PRO CFW 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. * PRO CFW 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 PRO CFW. If not, see <http://www.gnu.org/licenses/ . */ /* * This file is part of stargate. * * Copyright (C) 2008 hrimfaxi (outmatch@gmail.com) */ #include <pspsdk.h> #include <pspkernel.h> #include <pspsysmem_kernel.h> #include <pspthreadman_kernel.h> #include <pspdebug.h> #include <pspinit.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include <stdarg.h> #include "systemctrl.h" #include "systemctrl_se.h" #include "utils.h" #include "printk.h" #include "strsafe.h" #include "libs.h" #include "stargate.h" typedef struct _UtilityHookEntry { char *libname; u32 nid; void *hook_addr; } UtilityHookEntry; static int (*_sceUtilityLoadModule)(int id); static int (*_sceUtilityUnloadModule)(int id); #ifdef CONFIG_620 static int g_mp3_loaded = 0; #endif int myUtilityLoadModule(int id) { int ret; #ifdef CONFIG_620 // In FW 6.20, libmp3.prx load/unload code is buggy // It cannot load/unload again once got loaded // Doing so will result in user memory corrupted (in DBTVS) if(psp_fw_version == FW_620 && id == 0x304 && g_mp3_loaded) { ret = 0; printk("%s: [FAKE] 0x%04X -> %d\n", __func__, id, ret); return ret; } #endif ret = (*_sceUtilityLoadModule)(id); #ifdef CONFIG_620 if(psp_fw_version == FW_620 && id == 0x304 && ret == 0) { g_mp3_loaded = 1; } #endif printk("%s: 0x%04X -> 0x%08X\n", __func__, id, ret); // fake NPDRM load in np9660 if (ret == 0x80020139 && id == 0x500) { ret = 0; printk("%s: [FAKE] -> %d\n", __func__, ret); } return ret; } int myUtilityUnloadModule(int id) { int ret; #ifdef CONFIG_620 if(psp_fw_version == FW_620 && id == 0x304 && g_mp3_loaded) { ret = 0; printk("%s: [FAKE] 0x%04X -> %d\n", __func__, id, ret); return ret; } #endif ret = (*_sceUtilityUnloadModule)(id); printk("%s: 0x%04X -> 0x%08X\n", __func__, id, ret); // fake NPDRM unload in np9660 if (ret == 0x80111103 && id == 0x500) { ret = 0; printk("%s: [FAKE] -> %d\n", __func__, ret); } return ret; } static UtilityHookEntry g_utility_hook_map[] = { { "sceUtility", 0x2A2B3DE0, &myUtilityLoadModule }, { "sceUtility", 0xE49BFE92, &myUtilityUnloadModule }, }; void patch_utility(SceModule *mod) { int i; _sceUtilityLoadModule = (void*)sctrlHENFindFunction("sceUtility_Driver", "sceUtility", 0x2A2B3DE0); _sceUtilityUnloadModule = (void*)sctrlHENFindFunction("sceUtility_Driver", "sceUtility", 0xE49BFE92); if(_sceUtilityLoadModule == NULL || _sceUtilityUnloadModule == NULL) { printk("%s: utility functions not found\n", __func__); return; } for(i=0; i<NELEMS(g_utility_hook_map); ++i) { hook_import_bynid(mod, g_utility_hook_map[i].libname, g_utility_hook_map[i].nid, g_utility_hook_map[i].hook_addr, 1); } }
#include "xd60.h" #include "action_layer.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // 0: Base Layer KEYMAP( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DEL, \ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, F(0), KC_LEFT, KC_DOWN, KC_RIGHT), // 1: Function Layer KEYMAP( RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_F14, \ KC_NO, KC_WH_U, KC_UP, KC_WH_D, KC_BSPC,KC_HOME,KC_CALC,KC_NO, KC_INS, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL, \ KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT,KC_DEL, KC_END, KC_PGDN,KC_NO, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_NO, KC_APP, BL_STEP,KC_NO, KC_NO, KC_VOLD,KC_VOLU,KC_MUTE, KC_END, KC_PGDN, KC_RSFT, KC_PGUP, KC_INS, \ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, F(0), KC_HOME, KC_PGDOWN,KC_END), }; // Custom Actions const uint16_t PROGMEM fn_actions[] = { [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay }; // Macros const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function switch(id) { case 0: if (record->event.pressed) { register_code(KC_RSFT); } else { unregister_code(KC_RSFT); } break; } return MACRO_NONE; }; // Loop void matrix_scan_user(void) { // Empty };
/* horst - Highly Optimized Radio Scanning Tool * * Copyright (C) 2005-2016 Bruno Randolf (br1@einfach.org) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <stdio.h> #include <string.h> #include <unistd.h> #include <stdlib.h> #include <sys/ioctl.h> #include <sys/socket.h> #include <netpacket/packet.h> #include <net/ethernet.h> #include <net/if.h> #include <arpa/inet.h> #include <err.h> #include "capture.h" #include "util.h" #include "main.h" /* * Get the hardware type of the given interface as ARPHRD_xxx constant. */ int device_get_hwinfo(int fd, char* ifname, unsigned char* mac) { struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1); ifr.ifr_name[IFNAMSIZ - 1] = '\0'; if (ioctl(fd, SIOCGIFHWADDR, &ifr) < 0) err(1, "Could not get arptype"); DEBUG("ARPTYPE %d\n", ifr.ifr_hwaddr.sa_family); memcpy(mac, ifr.ifr_hwaddr.sa_data, 6); DEBUG("MY MAC %s\n", ether_sprintf(mac)); return ifr.ifr_hwaddr.sa_family; } static void set_receive_buffer(int fd, int sockbufsize) { int ret; /* the maximum allowed value is set by the rmem_max sysctl */ FILE* PF = fopen("/proc/sys/net/core/rmem_max", "w"); fprintf(PF, "%d", sockbufsize); fclose(PF); ret = setsockopt (fd, SOL_SOCKET, SO_RCVBUF, &sockbufsize, sizeof(sockbufsize)); if (ret != 0) err(1, "setsockopt failed"); #if DO_DEBUG socklen_t size = sizeof(sockbufsize); sockbufsize = 0; ret = getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &sockbufsize, &size); if (ret != 0) err(1, "getsockopt failed"); DEBUG("socket receive buffer size %d\n", sockbufsize); #endif } int open_packet_socket(char* devname, int recv_buffer_size) { int ret; int mon_fd; int ifindex; struct sockaddr_ll sall; mon_fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); if (mon_fd < 0) { printlog("Could not create packet socket! Please run horst as root!"); exit(1); } /* bind only to one interface */ ifindex = if_nametoindex(devname); memset(&sall, 0, sizeof(struct sockaddr_ll)); sall.sll_ifindex = ifindex; sall.sll_family = AF_PACKET; sall.sll_protocol = htons(ETH_P_ALL); ret = bind(mon_fd, (struct sockaddr*)&sall, sizeof(sall)); if (ret != 0) err(1, "bind failed"); if (recv_buffer_size) set_receive_buffer(mon_fd, recv_buffer_size); return mon_fd; } inline int recv_packet(int fd, unsigned char* buffer, size_t bufsize) { return recv(fd, buffer, bufsize, MSG_DONTWAIT); } void close_packet_socket(int fd) { if (fd > 0) close(fd); }
/* * Copyright (C) 2007-2009 Patrick Ohly <patrick.ohly@gmx.de> * * 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) version 3. * * 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 INCL_KCALEXTENDEDSYNCSOURCE #define INCL_KCALEXTENDEDSYNCSOURCE #include <syncevo/SyncSource.h> #ifdef ENABLE_KCALEXTENDED #include <boost/noncopyable.hpp> #include <syncevo/declarations.h> SE_BEGIN_CXX class KCalExtendedData; /** * Access contacts stored in KCalExtended. * * Change tracking is based on time stamps instead of id/revision * pairs as in other sources. Items are imported/export as iCalendar 2.0 * strings. This allows us to implement TestingSyncSource (and thus * use client-test). We have to override the begin/end methods * to get time stamps recorded as anchors. * * This class is designed so that no KCalExtended header files are required * to include this header file. */ class KCalExtendedSource : public TestingSyncSource, private SyncSourceAdmin, private SyncSourceBlob, private SyncSourceRevisions, public SyncSourceLogging, private boost::noncopyable { public: KCalExtendedSource(const SyncSourceParams &params); ~KCalExtendedSource(); protected: /* implementation of SyncSource interface */ virtual void open(); virtual bool isEmpty(); virtual void close(); virtual Databases getDatabases(); virtual void enableServerMode(); virtual bool serverModeEnabled() const; virtual std::string getPeerMimeType() const { return "text/calendar"; } /* implementation of SyncSourceSession interface */ virtual void beginSync(const std::string &lastToken, const std::string &resumeToken); virtual std::string endSync(bool success); /* implementation of SyncSourceDelete interface */ virtual void deleteItem(const string &luid); /* implementation of SyncSourceSerialize interface */ virtual std::string getMimeType() const { return "text/calendar"; } virtual std::string getMimeVersion() const { return "2.0"; } virtual InsertItemResult insertItem(const std::string &luid, const std::string &item); virtual void readItem(const std::string &luid, std::string &item); /* * implementation of SyncSourceRevisions * * Used for backup/restore (with dummy revision string). */ virtual void listAllItems(RevisionMap_t &revisions); /* implementation of SyncSourceLogging */ virtual std::string getDescription(const string &luid); private: KCalExtendedData *m_data; }; SE_END_CXX #endif // ENABLE_KCALEXTENDED #endif // INCL_KCALEXTENDEDSYNCSOURCE
#ifndef __RAUAP_H__ #define __RAUAP_H__ #include <rtconfig.h> #ifdef __cplusplus extern "C" { #endif #define RT_THREAD_RAUAPP_PRIORITY 0X1c #define RT_RAU_APP_DEBUG 1 #define CLIENT_NAME_LEN 16 #define CLIENT_PASSWORD_LEN 16 #define PROTOCOL_HEAD_LEN 13 /*ЭÒéÃüÁî×Ö*/ #define CMD_LOGIN 0x0001 #define CMD_LOGOUT 0x0002 #define CMD_GET_MEMBER_LIST 0x0003 #define CMD_SEND_MESSAGE 0x0004 #define CMD_FORWARD_MESSAGE 0x0005 #define CMD_UPDATE_MEMBER_STATUS 0x0006 #define CMD_RESPONSE 0x0100 #define PROTOCOL_VER_NUB 0x0001 #define HEAD_ERROR -0x0001 #define SEND_BUF_LEN 100 #define RECV_BUG_LEN 100 #define MAX_MEMBER_NUM 10 #define CLIENT_NAME "cusaproj10002" #define CLIENT_PASSWORD "111111" #define SOCKET_ERROR -1 #define SOCKET int struct member_list_t { char client_name[CLIENT_NAME_LEN]; int client_state; }; int rt_rau_application_init(void) ; void rt_rau_app_receive_msg_entry(void *parameter); void rt_rau_app_send_msg_entry(void *parameter); int rau_app_analysis_data(int client,char *pbuf,int len); void rau_app_tcp_connect_server(void); void rau_app_send_data_to_uart( char * ctrol_data); void rau_app_send_data_to_eth(void); short make_int16(char* ptr); short make_int32(char* ptr); void make_net16(char* p, short d); void make_net32(char* p, int d); void printf_buf(char *pbuf,int len); void client_save_member_list(char *pbuf,int data_len); void client_recvice_message(char *pbuf,int data_len); int client_get_member_list(SOCKET client); void rau_app_client_login(SOCKET client); int client_send_message(SOCKET client,char *p_name,char *p_sting); int client_send_receive_success(SOCKET client,char *pdata,int cmd_index); void hdp_client_log(const char *fmt, ...); int rcu_uart_init(); void rcu_uart_shutdown(); static rt_err_t rcu_rx_ind(rt_device_t dev, rt_size_t size); void rcu_uart_set_device(char* uartStr); int rcu_uart_read(char* buf, int bufLen); int rcu_uart_write(char* buf, int bufLen); #ifdef __cplusplus } #endif #endif
/* * * Header file for disk format of new quotafile format * */ #ifndef GUARD_DQBLK_V2_H #define GUARD_DQBLK_V2_H #include <sys/types.h> #include "quota_tree.h" #define Q_V2_GETQUOTA 0x0D00 /* Get limits and usage */ #define Q_V2_SETQUOTA 0x0E00 /* Set limits and usage */ #define Q_V2_SETUSE 0x0F00 /* Set only usage */ #define Q_V2_SETQLIM 0x0700 /* Set only limits */ #define Q_V2_GETINFO 0x0900 /* Get information about quota */ #define Q_V2_SETINFO 0x0A00 /* Set information about quota */ #define Q_V2_SETGRACE 0x0B00 /* Set just grace times in quotafile information */ #define Q_V2_SETFLAGS 0x0C00 /* Set just flags in quotafile information */ #define Q_V2_GETSTATS 0x1100 /* get collected stats (before proc was used) */ /* Structure for format specific information */ struct v2_mem_dqinfo { struct qtree_mem_dqinfo dqi_qtree; uint dqi_flags; /* Flags set in quotafile */ uint dqi_used_entries; /* Number of entries in file - updated by scan_dquots */ uint dqi_data_blocks; /* Number of data blocks in file - updated by scan_dquots */ }; struct v2_mem_dqblk { loff_t dqb_off; /* Offset of dquot in file */ }; struct quotafile_ops; /* Will be defined later in quotaio.h */ /* Operations above this format */ extern struct quotafile_ops quotafile_ops_2; #endif
#ifndef TEST_UTILS_MATRIX_UTILS_TEST_H_ #define TEST_UTILS_MATRIX_UTILS_TEST_H_ #include <iostream> #include "test.h" #include "utils/matrix_utils.h" void matrix_utils_test(); #endif
// Dancing bits data for encoding diskboot.bin file // Used by dancingbits.c and finsig_dryos.c #define VITALY 11 unsigned char _chr_[VITALY][8] = { { 4,6,1,0,7,2,5,3 }, // original flavor { 5,3,6,1,2,7,0,4 }, // nacho cheese sx200is, ixus100_sd780, ixu95_sd1200, a1100, d10 { 2,5,0,4,6,1,3,7 }, // mesquite bbq ixus200_sd980, sx20 (dryos r39) { 4,7,3,2,6,5,0,1 }, // cool ranch a3100 (dryos r43) { 3,2,7,5,1,4,6,0 }, // cajun chicken s95, g12, sx30 (dryos r45) { 0,4,2,7,3,6,5,1 }, // spicy wasabi sx220, sx230, ixus310 (dryos r47) { 7,1,5,3,0,6,4,2 }, // sea salt & vinegar sx40hs, sx150is (dryos r49) { 6,3,1,0,5,7,2,4 }, // spicy habenaro sx260hs (dryos r50) { 1,0,4,6,2,3,7,5 }, // tapatio hot sauce sx160is (dryos r51) { 3,6,7,2,4,5,1,0 }, // blazin' jalapeno a1400 (dryos r52) { 0,2,6,3,1,4,7,5 }, // guacamole sx510hs (dryos r52) };
C C $Id: cscomn.h,v 1.5 2008-07-27 04:02:36 haley Exp $ C C Copyright (C) 2000 C University Corporation for Atmospheric Research C All Rights Reserved C C The use of this Software is governed by a License Agreement. C DOUBLE PRECISION USSIG, TOLIC, TOLSG, RMVAL INTEGER NUMLS, NUMIT, ICSIG, IGFLG COMMON /CSCOMI/ NUMLS, NUMIT, ICSIG, IGFLG COMMON /CSCOMD/ USSIG, TOLIC, TOLSG, RMVAL
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <pthread.h> #include <unistd.h> #include <litmus.h> #define PERIOD 100000 #define RELATIVE_DEADLINE 100000 #define EXEC_COST 50000 struct thread_context { int id; }; void* rt_thread(void *tcontext); #define CALL( exp ) do { \ int ret; \ ret = exp; \ if (ret != 0) \ fprintf(stderr, "%s failed: %m\n", #exp); \ else \ fprintf(stderr, "%s ok.\n", #exp); \ } while (0) void busy_waiting(long wake_up){ long i; i=0; while(i<wake_up){ i++; } }; int main(int argc, char** argv) { int i; int thread_count = 5; struct thread_context ctx[thread_count]; pthread_t task[thread_count]; CALL(init_litmus()); for (i = 0; i < thread_count; i++) { ctx[i].id = i+1; pthread_create(task + i, NULL, rt_thread, (void *) (ctx + i)); } for (i = 0; i < thread_count; i++) pthread_join(task[i], NULL); printf("%s\n", "fifo_test finished."); return 0; } void* rt_thread(void *tcontext) { struct thread_context *ctx = (struct thread_context *) tcontext; struct rt_task param; int lock_1 =-1; CALL(be_migrate_to_domain(ctx->id)); //printf("id: %d\n", ctx->id); /* Set up task parameters */ init_rt_task_param(&param); param.exec_cost = ms2ns(2000); param.period = ms2ns(2000); param.relative_deadline = ms2ns(2000); param.budget_policy = NO_ENFORCEMENT; param.cls = RT_CLASS_HARD; param.cpu = ctx->id; param.priority = 500; CALL( init_rt_thread() ); CALL( set_rt_task_param(gettid(), &param) ); CALL( task_mode(LITMUS_RT_TASK) ); CALL(lock_1 = litmus_open_lock(7, 1, "b", init_prio_per_cpu(6, 500, 400, 300, 200, 100, 10))); //printf("lock generated: %d\n", lock_1); CALL(litmus_lock(lock_1)); printf("in lock: %d\n", ctx->id); if(ctx->id == 1) sleep_next_period(); //busy_waiting(ctx->id); CALL(litmus_unlock(lock_1)); printf("after unlock: %d\n", ctx->id); CALL( task_mode(BACKGROUND_TASK) ); printf("task finished: %d\n", ctx->id); return NULL; }
#include <newNTL/pair_GF2X_long.h> #include <newNTL/new.h> newNTL_START_IMPL newNTL_pair_impl(GF2X,long,pair_GF2X_long) newNTL_pair_io_impl(GF2X,long,pair_GF2X_long) newNTL_pair_eq_impl(GF2X,long,pair_GF2X_long) newNTL_vector_impl(pair_GF2X_long,vec_pair_GF2X_long) newNTL_io_vector_impl(pair_GF2X_long,vec_pair_GF2X_long) newNTL_eq_vector_impl(pair_GF2X_long,vec_pair_GF2X_long) newNTL_END_IMPL
/* Copyright Statement: * * This software/firmware and related documentation ("MediaTek Software") are * protected under relevant copyright laws. The information contained herein * is confidential and proprietary to MediaTek Inc. and/or its licensors. * Without the prior written permission of MediaTek inc. and/or its licensors, * any reproduction, modification, use or disclosure of MediaTek Software, * and information contained herein, in whole or in part, shall be strictly prohibited. * * MediaTek Inc. (C) 2010. All rights reserved. * * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. * * The following software/firmware and/or related documentation ("MediaTek Software") * have been modified by MediaTek Inc. All revisions are subject to any receiver's * applicable license agreements with MediaTek Inc. */ /* * (C) Copyright 2009 * Marvell Semiconductor <www.marvell.com> * Written-by: Prafulla Wadaskar <prafulla@marvell.com> * * Header file for Feroceon CPU core 88FR131 Based KW88F6281 SOC. * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef _ASM_ARCH_KW88F6281_H #define _ASM_ARCH_KW88F6281_H /* SOC specific definations */ #define KW88F6281_REGS_PHYS_BASE 0xf1000000 #define KW_REGS_PHY_BASE KW88F6281_REGS_PHYS_BASE /* TCLK Core Clock defination*/ #define CONFIG_SYS_TCLK 200000000 /* 200MHz */ #endif /* _ASM_ARCH_KW88F6281_H */
// // SDSyncEngine.h // immortalsantee@me.com // // Created by Santosh Maharjan on 7/16/15. // Copyright (c) 2015 Santosh Maharjan. All rights reserved. // https://github.com/immortalsantee/SyncEngine #import <Foundation/Foundation.h> @interface SDSyncEngine : NSObject @property (atomic, readonly) BOOL syncInProgress; @property (atomic, assign) BOOL debugMode; @property (nonatomic, retain) NSString *syncCompleteMessage; @property (nonatomic, retain) NSString *baseURL; typedef enum { SDObjectSynced = 0, SDObjectCreated, SDObjectDeleted, SDObjectUpdated, } SDObjectSyncStatus; + (SDSyncEngine *)sharedEngine; - (void)setURLForRequest:(NSString *)url; - (void)registerNSManagedObjectClassToSync:(Class)aClass; - (void)unRegisterAllNSManagedObjectClass; - (void)startSync; - (NSString *)dateStringForAPIUsingDate:(NSDate *)date; - (NSDate *)dateUsingStringFromAPI:(NSString *)dateString; @end
#ifndef VEHICLE_H #define VEHICLE_H #include <stdint.h> #include <stddef.h> #include "config.h" #include "frame.h" class Device; class Receiver; class Exception; class UAVNav; /* * Abstract class: * Basic functions for all copter-frame types and * some pure virtual functions which are specific for certain frames */ class AbsAttitude { private: uint_fast32_t m_iAttHTimer; // Read from receiver and copy into floats above void read_receiver(); protected: // Current roll, pitch, throttle and yaw readouts from the receiver module float m_fRCRol; float m_fRCPit; float m_fRCYaw; float m_fRCThr; // Device module pointers for high level hardware access Device* m_pHalBoard; Receiver* m_pReceiver; Exception* m_pExeption; UAVNav* m_pNavigation; // Function must be overloaded for basic (and frame dependent) flight control virtual void attitude_hold() = 0; // Calculate here, how the copter can hold attitude automatically virtual void altitude_hold() = 0; // Calculate here, how the copter can hold altitude automatically virtual void auto_navigate() = 0; // Here the basic Auto-GPS navigation should be implemented virtual void accel_xy_stab() = 0; // Correct small deviation along the z axis using the accelerometer virtual void accel_z_stab() = 0; // Correct small deviations along the x or y axis using the accelerometer public: AbsAttitude(Device *, Receiver *, Exception *, UAVNav *); /* * Updates all the necessary sensors, reads from receiver * and handles exceptions. * Function calls: * - read_receiver() * - calc_attitude_hold() * - calc_altitude_hold() * - accel_xy_stab() * - accel_z_stab() * - auto_navigate() */ virtual void run(); }; /* * Implementation of an quad-copter with X-configuration */ class MultiCopter : public AbsAttitude, Frame4X { private: uint_fast32_t m_iAltHTimer; // Altitude hold timer using barometer/sonar for GPS navigation and altitude hold mode (50 Hz) uint_fast32_t m_iAccZTimer; // Altitude hold timer using the accelerometer for every flight mode (if necessary). Aim: Compensation of fast g-changes along the z-axis. private: // Motor compensation terms (if model is tilted or battery voltage drops) float m_fBattComp; float m_fTiltComp; // Calculate and apply the motor compensation terms void apply_motor_compens(); // This functions applies motor compensation terms (e.g. battery and tilt) to the output of the servos protected: void attitude_hold(); void altitude_hold(); void accel_xy_stab(); void accel_z_stab(); void auto_navigate(); public: MultiCopter(Device *, Receiver *, Exception *, UAVNav *); void calc_batt_comp(); // battery voltage drop compensation void calc_tilt_comp(); // motor compensation if model is tilted /* * Updates all the necessary sensors, reads from receiver * and handles exceptions. * Function calls: * - AbsAttitude::run() * - servo_out() */ void run(); }; #endif
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_TEST_CHROMEDRIVER_NET_ADB_CLIENT_SOCKET_H_ #define CHROME_TEST_CHROMEDRIVER_NET_ADB_CLIENT_SOCKET_H_ #include "base/callback.h" #include "net/base/io_buffer.h" #include "net/socket/stream_socket.h" class AdbClientSocket { public: typedef base::Callback<void(int, const std::string&)> CommandCallback; typedef base::Callback<void(int result, net::StreamSocket*)> SocketCallback; static void AdbQuery(int port, const std::string& query, const CommandCallback& callback); static void TransportQuery(int port, const std::string& serial, const std::string& socket_name, const SocketCallback& callback); static void HttpQuery(int port, const std::string& serial, const std::string& socket_name, const std::string& request, const CommandCallback& callback); static void HttpQuery(int port, const std::string& serial, const std::string& socket_name, const std::string& request, const SocketCallback& callback); explicit AdbClientSocket(int port); ~AdbClientSocket(); protected: void Connect(const net::CompletionCallback& callback); void SendCommand(const std::string& command, bool is_void, const CommandCallback& callback); scoped_ptr<net::StreamSocket> socket_; private: void ReadResponse(const CommandCallback& callback, bool is_void, int result); void OnResponseHeader(const CommandCallback& callback, bool is_void, scoped_refptr<net::IOBuffer> response_buffer, int result); void OnResponseData(const CommandCallback& callback, const std::string& response, scoped_refptr<net::IOBuffer> response_buffer, int bytes_left, int result); std::string host_; int port_; DISALLOW_COPY_AND_ASSIGN(AdbClientSocket); }; #endif
#ifndef PowerTop_REPORT_DATA_HTML_H_C58C116411234A34AC2EFB8D23A69713 #define PowerTop_REPORT_DATA_HTML_H_C58C116411234A34AC2EFB8D23A69713 #include <string> #include <sstream> using namespace std; struct tag_attr { const char *css_class; const char *css_id; }; /* T:Top, L:Left, TL:Top-Left, TLC: Top-Left-Center */ enum position { T, L, TL, TC, TLC }; struct table_attributes { const char *table_class; const char *td_class; const char *tr_class; const char *th_class; position pos_table_title; int title_mod; int rows; int cols; }; struct table_size { int rows; int cols; }; /* Definition of css attributes for the cases that apply to powertop * html report * */ void init_div(struct tag_attr *div_attr, const char *css_class, const char *css_id); void init_top_table_attr(struct table_attributes *table_css, int rows, int cols); void init_title_attr(struct tag_attr *title_attr); void init_std_table_attr(struct table_attributes *table_css, int rows, int cols); void init_std_side_table_attr(struct table_attributes *table_css, int rows, int cols); void init_pkg_table_attr(struct table_attributes *table_css, int rows, int cols); void init_core_table_attr(struct table_attributes *table_css, int title_mod, int rows, int cols); void init_cpu_table_attr(struct table_attributes *table_css, int title_mod, int rows, int cols); void init_nowarp_table_attr(struct table_attributes *table_css, int rows, int cols); void init_tune_table_attr(struct table_attributes *table_css, int rows, int cols); void init_wakeup_table_attr(struct table_attributes *table_css, int rows, int cols); /* Other helper functions */ string double_to_string(double dval); #endif
#include "dm.h" #include <linux/module.h> #include <linux/init.h> #include <linux/kmod.h> #include <linux/bio.h> #define DM_MSG_PREFIX "target" static LIST_HEAD(_targets); static DECLARE_RWSEM(_lock); #define DM_MOD_NAME_SIZE 32 static inline struct target_type *__find_target_type(const char *name) { struct target_type *tt; list_for_each_entry(tt, &_targets, list) if (!strcmp(name, tt->name)) return tt; return NULL; } static struct target_type *get_target_type(const char *name) { struct target_type *tt; down_read(&_lock); tt = __find_target_type(name); if (tt && !try_module_get(tt->module)) tt = NULL; up_read(&_lock); return tt; } static void load_module(const char *name) { request_module("dm-%s", name); } struct target_type *dm_get_target_type(const char *name) { struct target_type *tt = get_target_type(name); if (!tt) { load_module(name); tt = get_target_type(name); } return tt; } void dm_put_target_type(struct target_type *tt) { down_read(&_lock); module_put(tt->module); up_read(&_lock); } int dm_target_iterate(void (*iter_func)(struct target_type *tt, void *param), void *param) { struct target_type *tt; down_read(&_lock); list_for_each_entry(tt, &_targets, list) iter_func(tt, param); up_read(&_lock); return 0; } int dm_register_target(struct target_type *tt) { int rv = 0; down_write(&_lock); if (__find_target_type(tt->name)) rv = -EEXIST; else list_add(&tt->list, &_targets); up_write(&_lock); return rv; } void dm_unregister_target(struct target_type *tt) { down_write(&_lock); if (!__find_target_type(tt->name)) { DMCRIT("Unregistering unrecognised target: %s", tt->name); BUG(); } list_del(&tt->list); up_write(&_lock); } static int io_err_ctr(struct dm_target *tt, unsigned int argc, char **args) { return 0; } static void io_err_dtr(struct dm_target *tt) { /* empty */ } static int io_err_map(struct dm_target *tt, struct bio *bio, union map_info *map_context) { return -EIO; } static struct target_type error_target = { .name = "error", .version = {1, 0, 1}, .ctr = io_err_ctr, .dtr = io_err_dtr, .map = io_err_map, }; int __init dm_target_init(void) { return dm_register_target(&error_target); } void dm_target_exit(void) { dm_unregister_target(&error_target); } EXPORT_SYMBOL(dm_register_target); EXPORT_SYMBOL(dm_unregister_target);
/* * General purpose random utilities * * Based on libuuid code. * * This file may be redistributed under the terms of the * GNU Lesser General Public License. */ #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <stdlib.h> #include <string.h> #include <sys/time.h> #include <sys/syscall.h> #include "c.h" #include "randutils.h" #include "nls.h" #ifdef HAVE_TLS #define THREAD_LOCAL static __thread #else #define THREAD_LOCAL static #endif #ifdef HAVE_GETRANDOM # include <sys/random.h> #elif defined (__linux__) # if !defined(SYS_getrandom) && defined(__NR_getrandom) /* usable kernel-headers, but old glibc-headers */ # define SYS_getrandom __NR_getrandom # endif #endif #if !defined(HAVE_GETRANDOM) && defined(SYS_getrandom) /* libc without function, but we have syscal */ static int getrandom(void *buf, size_t buflen, unsigned int flags) { return (syscall(SYS_getrandom, buf, buflen, flags)); } # define HAVE_GETRANDOM #endif #if defined(__linux__) && defined(__NR_gettid) && defined(HAVE_JRAND48) #define DO_JRAND_MIX THREAD_LOCAL unsigned short ul_jrand_seed[3]; #endif int rand_get_number(int low_n, int high_n) { return rand() % (high_n - low_n + 1) + low_n; } static void crank_random(void) { int i; struct timeval tv; gettimeofday(&tv, NULL); srand((getpid() << 16) ^ getuid() ^ tv.tv_sec ^ tv.tv_usec); #ifdef DO_JRAND_MIX ul_jrand_seed[0] = getpid() ^ (tv.tv_sec & 0xFFFF); ul_jrand_seed[1] = getppid() ^ (tv.tv_usec & 0xFFFF); ul_jrand_seed[2] = (tv.tv_sec ^ tv.tv_usec) >> 16; #endif /* Crank the random number generator a few times */ gettimeofday(&tv, NULL); for (i = (tv.tv_sec ^ tv.tv_usec) & 0x1F; i > 0; i--) rand(); } int random_get_fd(void) { int i, fd; fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC); if (fd == -1) fd = open("/dev/random", O_RDONLY | O_NONBLOCK | O_CLOEXEC); if (fd >= 0) { i = fcntl(fd, F_GETFD); if (i >= 0) fcntl(fd, F_SETFD, i | FD_CLOEXEC); } crank_random(); return fd; } /* * Generate a stream of random nbytes into buf. * Use /dev/urandom if possible, and if not, * use glibc pseudo-random functions. */ void random_get_bytes(void *buf, size_t nbytes) { unsigned char *cp = (unsigned char *)buf; size_t i, n = nbytes; int lose_counter = 0; #ifdef HAVE_GETRANDOM while (n > 0) { int x; errno = 0; x = getrandom(cp, n, 0); if (x > 0) { /* success */ n -= x; cp += x; lose_counter = 0; } else if (errno == ENOSYS) /* kernel without getrandom() */ break; else if (lose_counter++ > 16) /* entropy problem? */ break; } if (errno == ENOSYS) #endif /* * We've been built against headers that support getrandom, but the * running kernel does not. Fallback to reading from /dev/{u,}random * as before */ { int fd = random_get_fd(); lose_counter = 0; if (fd >= 0) { while (n > 0) { ssize_t x = read(fd, cp, n); if (x <= 0) { if (lose_counter++ > 16) break; continue; } n -= x; cp += x; lose_counter = 0; } close(fd); } } /* * We do this all the time, but this is the only source of * randomness if /dev/random/urandom is out to lunch. */ crank_random(); for (cp = buf, i = 0; i < nbytes; i++) *cp++ ^= (rand() >> 7) & 0xFF; #ifdef DO_JRAND_MIX { unsigned short tmp_seed[3]; memcpy(tmp_seed, ul_jrand_seed, sizeof(tmp_seed)); ul_jrand_seed[2] = ul_jrand_seed[2] ^ syscall(__NR_gettid); for (cp = buf, i = 0; i < nbytes; i++) *cp++ ^= (jrand48(tmp_seed) >> 7) & 0xFF; memcpy(ul_jrand_seed, tmp_seed, sizeof(ul_jrand_seed)-sizeof(unsigned short)); } #endif return; } /* * Tell source of randomness. */ const char *random_tell_source(void) { #ifdef HAVE_GETRANDOM return _("getrandom() function"); #else size_t i; static const char *random_sources[] = { "/dev/urandom", "/dev/random" }; for (i = 0; i < ARRAY_SIZE(random_sources); i++) { if (!access(random_sources[i], R_OK)) return random_sources[i]; } #endif return _("libc pseudo-random functions"); } #ifdef TEST_PROGRAM_RANDUTILS #include <inttypes.h> int main(int argc, char *argv[]) { size_t i, n; int64_t *vp, v; char *buf; size_t bufsz; n = argc == 1 ? 16 : atoi(argv[1]); printf("Multiple random calls:\n"); for (i = 0; i < n; i++) { random_get_bytes(&v, sizeof(v)); printf("#%02zu: %25"PRIu64"\n", i, v); } printf("One random call:\n"); bufsz = n * sizeof(*vp); buf = malloc(bufsz); if (!buf) err(EXIT_FAILURE, "failed to allocate buffer"); random_get_bytes(buf, bufsz); for (i = 0; i < n; i++) { vp = (int64_t *) (buf + (i * sizeof(*vp))); printf("#%02zu: %25"PRIu64"\n", i, *vp); } return EXIT_SUCCESS; } #endif /* TEST_PROGRAM_RANDUTILS */
/* Definitions relating to the special __do_global_init function used for getting g++ file-scope static objects constructed. This file will get included either by libgcc2.c (for systems that don't support a .init section) or by crtstuff.c (for those that do). Copyright (C) 1991, 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc. Contributed by Ron Guilmette (rfg@segfault.us.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This file contains definitions and declarations of things relating to the normal start-up-time invocation of C++ file-scope static object constructors. These declarations and definitions are used by *both* libgcc2.c and by crtstuff.c. Note that this file should only be compiled with GCC. */ #ifdef NEED_ATEXIT extern int atexit (void (*) (void)); #endif /* Declare a pointer to void function type. */ typedef void (*func_ptr) (void); /* Declare the set of symbols use as begin and end markers for the lists of global object constructors and global object destructors. */ extern func_ptr __CTOR_LIST__[]; extern func_ptr __DTOR_LIST__[]; #ifdef __pdp10__ /* Ugly hack: The PDP-10 has only 6 significant characters in symbols. */ #define __do_global_ctors _ctors #define __do_global_dtors _dtors #endif /* Declare the routine which needs to get invoked at program start time. */ extern void __do_global_ctors (void); /* Declare the routine which needs to get invoked at program exit time. */ extern void __do_global_dtors (void); /* Define a macro with the code which needs to be executed at program start-up time. This macro is used in two places in crtstuff.c (for systems which support a .init section) and in one place in libgcc2.c (for those system which do *not* support a .init section). For all three places where this code might appear, it must be identical, so we define it once here as a macro to avoid various instances getting out-of-sync with one another. */ /* Some systems place the number of pointers in the first word of the table. On other systems, that word is -1. In all cases, the table is null-terminated. If the length is not recorded, count up to the null. */ /* Some systems use a different strategy for finding the ctors. For example, svr3. */ #ifndef DO_GLOBAL_CTORS_BODY #define DO_GLOBAL_CTORS_BODY \ do { \ unsigned long nptrs = (unsigned long) __CTOR_LIST__[0]; \ unsigned i; \ if (nptrs == (unsigned long)-1) \ for (nptrs = 0; __CTOR_LIST__[nptrs + 1] != 0; nptrs++); \ for (i = nptrs; i >= 1; i--) \ __CTOR_LIST__[i] (); \ } while (0) #endif
/* * * Copyright (C) 2013 HUAWEI, Inc. *File Name: kernel/drivers/misc/hw_sensor_info.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <linux/module.h> #include <linux/init.h> #include <linux/slab.h> #include <linux/delay.h> #include <linux/device.h> #include <linux/sysfs.h> #include <linux/fs.h> #include <linux/of_device.h> #include <linux/wait.h> #include <linux/platform_device.h> #include <linux/kernel.h> #include <linux/types.h> #include <huawei_platform/sensor/hw_sensor_info.h> struct sensor_info{ struct platform_driver sensor_info_drv; struct platform_device *sensor_info_dev; }; static struct device_node *this_node = NULL; static const char *product_name = NULL; const char * get_sensor_info_of_product_name(void) { if(NULL != product_name) return product_name ; else return "error"; } int sensor_info_probe(struct platform_device *pdev) { int ret = 0; struct sensor_info *info = NULL ; info = kzalloc(sizeof(*info), GFP_KERNEL); if (info == NULL) { ret = -ENOMEM; goto error1; } info->sensor_info_dev = pdev; this_node = info->sensor_info_dev->dev.of_node; ret = of_property_read_string(this_node, "product_name", &product_name); if(ret) { pr_err("%s ,sensor info get failed,ret = %d\n",__func__,ret); goto error2; } pr_info("%s ,huawei product name is %s\n",__func__,product_name); return 0; error2: pr_info("%s ,error2,huawei product name is %s\n",__func__,product_name); kfree(info); error1: pr_info("%s ,error1,huawei product name is %s\n",__func__,product_name); return ret; } static struct of_device_id sensor_info_match_table[] = { { .compatible = "huawei,hw_sensor_info", }, }; static struct sensor_info sensor_info_instance = { .sensor_info_drv = { .probe = sensor_info_probe, .remove = NULL, .driver = { .name = "huawei_sensor_info", .owner = THIS_MODULE, .of_match_table = sensor_info_match_table, }, }, .sensor_info_dev = NULL, }; static int __init hw_sensor_info_init(void) { int err = 0; err = platform_driver_register(&sensor_info_instance.sensor_info_drv); if (err){ printk("sensor_info_drv regiset error %d\n", err); } return err; } static void __exit hw_sensor_info_exit(void) { platform_driver_unregister(&sensor_info_instance.sensor_info_drv); } MODULE_AUTHOR("huawei"); MODULE_DESCRIPTION("name infomation for sensor"); MODULE_LICENSE("GPL"); module_init(hw_sensor_info_init); module_exit(hw_sensor_info_exit);
/* * SATAN, Signal Applications To Any Network * Copyright (C) 2003 by Anton Persson & Johan Thim * Copyright (C) 2005 by Anton Persson * Copyright (C) 2006 by Anton Persson & Ted Björling * * About SATAN: * Originally developed as a small subproject in * a course about applied signal processing. * Original Developers: * Anton Persson * Johan Thim * * http://www.733kru.org/ * * This program is free software; you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with this program; * if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "../satan_debug.hh" #include "dynlib.h" #include <stdlib.h> #include <string.h> #ifdef HAVE_CONFIG_H #include "config.h" #else #error "CAN'T FIND config.h" #endif typedef struct _XEchoData { int echo_len; int offset; int bsize; float delay; float amplitude; float amp_left; float amp_right; FTYPE *buffer; } XEchoData; void *init(MachineTable *mt, const char *name) { /* Allocate and initiate instance data here */ XEchoData *d = (XEchoData *)malloc(sizeof(XEchoData)); memset(d, 0, sizeof(XEchoData)); d->delay = 0.25; d->amplitude = 0.5; d->echo_len = 3; d->amp_left = 0.75; d->amp_right = 0.25; /* return pointer to instance data */ return (void *)d; } void delete(void *data) { XEchoData *d = (XEchoData *)data; /* free instance data here */ free(d->buffer); free(d); } void *get_controller_ptr(MachineTable *mt, void *void_info, const char *name, const char *group) { XEchoData *d = (XEchoData *)void_info; if(strcmp(name, "delay") == 0) { return &(d->delay); } if(strcmp(name, "amplitude") == 0) { return &(d->amplitude); } if(strcmp(name, "amp_left") == 0) { return &(d->amp_left); } if(strcmp(name, "amp_right") == 0) { return &(d->amp_right); } return NULL; } void reset(MachineTable *mt, void *data) { return; /* nothing to do... */ } void execute(MachineTable *mt, void *data) { XEchoData *d = (XEchoData *)data; SignalPointer *s = mt->get_input_signal(mt, "Mono"); SignalPointer *s_stereo = mt->get_input_signal(mt, "Stereo"); SignalPointer *os = mt->get_output_signal(mt, "Stereo"); if(os == NULL) return; FTYPE *ou = mt->get_signal_buffer(os); int ol = mt->get_signal_samples(os); int oc = mt->get_signal_channels(os); if(s == NULL && s_stereo == NULL) { // just clear output, then return int t; for(t = 0; t < ol; t++) { ou[t * 2 + 0] = itoFTYPE(0); ou[t * 2 + 1] = itoFTYPE(0); } return; } FTYPE *in = NULL; int il = 0; int ic = 0; int Fs = 0; FTYPE *in_s = NULL; int il_s = 0; int ic_s = 0; if(s != NULL) { in = mt->get_signal_buffer(s); il = mt->get_signal_samples(s); ic = mt->get_signal_channels(s); Fs = mt->get_signal_frequency(s); } if(s_stereo != NULL) { in_s = mt->get_signal_buffer(s_stereo); il_s = mt->get_signal_samples(s_stereo); ic_s = mt->get_signal_channels(s_stereo); Fs = mt->get_signal_frequency(s_stereo); } int c; int i; int p1, p2; int bsize = sizeof(FTYPE) * 500000; // "enough bytes".. (>44100*5 ..) if(d->buffer == NULL) { d->bsize = bsize; d->buffer = (FTYPE *)malloc(bsize); memset(d->buffer, 0, bsize); } else if(d->bsize != bsize) { d->bsize = bsize; d->buffer = (FTYPE *)realloc(d->buffer, bsize); memset(d->buffer, 0, bsize); } FTYPE stereo_amp_left = ftoFTYPE(d->amp_left); FTYPE stereo_amp_right = ftoFTYPE(d->amp_right); FTYPE *bf = d->buffer; float delay_f = d->delay * (float)Fs; int delay = (int)delay_f; FTYPE delay_amplitude = ftoFTYPE(d->amplitude); // mix "now" if(il == 0 && il_s > 0) il = il_s; // this happens if the mono input is not connected. for(i = 0; i < il; i++) { c = 0; // mix "left" p1 = ((i + d->offset) % (delay * 5)) * oc + c; if(in != NULL) bf[p1] += in[i * ic]; if(in_s != NULL) bf[p1] += mulFTYPE(in_s[i * ic_s], stereo_amp_left); p2 = ((i + 3 * delay + d->offset) % (delay * 5)) * oc + (1 - c); bf[p2] = mulFTYPE(bf[p1], delay_amplitude); c = 1; // mix "right" p1 = ((i + d->offset) % (delay * 5)) * oc + c; if(in_s != NULL) bf[p1] += mulFTYPE(in_s[i * ic_s + 1], stereo_amp_right); p2 = ((i + 3 * delay + d->offset) % (delay * 5)) * oc + (1 - c); bf[p2] = mulFTYPE(bf[p1], delay_amplitude); } // mix "delayed" // echo-through int p; for(i = 0; i < ol; i++) { for(c = 0; c < oc; c++) { p = ((i + d->offset) % (delay * 5)) * oc + c; ou[i * oc + c] = bf[p]; bf[p] = 0; } } d->offset = (d->offset + il) % (delay * 5); }
/* * ProFTPD - FTP server daemon * Copyright (c) 2008 The ProFTPD Project team * * 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, Suite 500, Boston, MA 02110-1335, USA. * * As a special exemption, The ProFTPD Project team and other respective * copyright holders give permission to link this program with OpenSSL, and * distribute the resulting executable, without including the source code for * OpenSSL in the source distribution. */ /* Versioning * $Id: version.c,v 1.2 2011-05-23 21:22:24 castaglia Exp $ */ #include "conf.h" unsigned long pr_version_get_module_api_number(void) { return PR_MODULE_API_VERSION; } unsigned long pr_version_get_number(void) { return PROFTPD_VERSION_NUMBER; } const char *pr_version_get_str(void) { return PROFTPD_VERSION_TEXT; }
#ifndef TEAMCALCULATION_H #define TEAMCALCULATION_H void GetTeamCode(TCHAR *code, double bearing, double range); void CalcTeammateBearingRange(double ownDist, double ownBear, TCHAR *TeamMateCode, double *distToMate, double *bearToMate); double GetTeammateBearingFromRef(TCHAR *code ); double GetTeammateRangeFromRef(TCHAR *code ); #endif
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ /* Rosegarden A MIDI and audio sequencer and musical notation editor. Copyright 2000-2018 the Rosegarden development team. Other copyrights also apply to some parts of this work. Please see the AUTHORS file and individual file headers for details. 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. See the file COPYING included with this distribution for more information. */ #ifndef RG_RG21LOADER_H #define RG_RG21LOADER_H #include "base/Instrument.h" #include "base/MidiProgram.h" #include "base/NotationTypes.h" #include <map> #include <string> #include <QString> #include <QStringList> #include <vector> #include "base/Event.h" class QTextStream; class QObject; class Iterator; namespace Rosegarden { class Studio; class Segment; class Event; class Composition; /** * Rosegarden 2.1 file import */ class RG21Loader { public: RG21Loader(Studio *); ~RG21Loader(); /** * Load and parse the RG2.1 file \a fileName, and write it into the * given Composition (clearing the existing segment data first). * Return true for success. */ bool load(const QString& fileName, Composition &); protected: // RG21 note mods enum { ModSharp = (1<<0), ModFlat = (1<<1), ModNatural = (1<<2) }; // RG21 chord mods enum { ModDot = (1<<0), ModLegato = (1<<1), ModAccent = (1<<2), ModSfz = (1<<3), ModRfz = (1<<4), ModTrill = (1<<5), ModTurn = (1<<6), ModPause = (1<<7) }; // RG21 text positions enum { TextAboveStave = 0, TextAboveStaveLarge, TextAboveBarLine, TextBelowStave, TextBelowStaveItalic, TextChordName, TextDynamic }; bool parseClef(); bool parseKey(); bool parseMetronome(); bool parseChordItem(); bool parseRest(); bool parseText(); bool parseGroupStart(); bool parseIndicationStart(); bool parseBarType(); bool parseStaveType(); void closeGroup(); void closeIndication(); void closeSegment(); void setGroupProperties(Event *); long convertRG21Pitch(long rg21pitch, int noteModifier); timeT convertRG21Duration(QStringList::Iterator&); std::vector<std::string> convertRG21ChordMods(int chordMod); bool readNextLine(); //--------------- Data members --------------------------------- QTextStream *m_stream; Studio *m_studio; Composition* m_composition; Segment* m_currentSegment; unsigned int m_currentSegmentTime; unsigned int m_currentSegmentNb; Clef m_currentClef; Rosegarden::Key m_currentKey; InstrumentId m_currentInstrumentId; typedef std::map<int, Event *> EventIdMap; EventIdMap m_indicationsExtant; bool m_inGroup; long m_groupId; std::string m_groupType; timeT m_groupStartTime; int m_groupTupledLength; int m_groupTupledCount; int m_groupUntupledLength; int m_groupUntupledCount; int m_tieStatus; // 0 -> none, 1 -> tie started, 2 -> seen one note QString m_currentLine; QString m_currentStaffName; QStringList m_tokens; unsigned int m_nbStaves; }; } #endif
/** * @file lxData.h * Loch model data. */ /* Copyright (C) 2004 Stacho Mudrak * * $Date: $ * $RCSfile: $ * $Revision: $ * * -------------------------------------------------------------------- * 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 * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * -------------------------------------------------------------------- */ #ifndef lxData_h #define lxData_h // Standard libraries #ifndef LXDEPCHECK #include <limits> // required to compile with vtk 9.0.1 and gcc 11 #include <vtkPolyData.h> #include <vtkLookupTable.h> #include <vtkAppendPolyData.h> #include <vtkPolyDataNormals.h> #include <vtkDepthSortPolyData.h> #include <vtkTriangleFilter.h> #include <vtkStripper.h> #include <wx/string.h> #include <vector> #include <set> #endif //LXDEPCHECK - standard libraries #include "lxMath.h" #include "lxImgIO.h" #include "lxImgIO.h" #include "lxFile.h" struct lxDataSurvey { size_t m_id, m_parent, m_level; const char * m_name, * m_title; std::string m_full_name; bool m_selected; }; struct lxDataStation { lxVec pos; size_t m_survey_idx = 0; const char * m_name, * m_comment = nullptr; bool m_temporary, m_entrance, m_fix, m_selected; double m_screen_x = 0.0, m_screen_y = 0.0, m_screen_z = 0.0, m_surface; lxDataStation() : m_name(NULL), m_temporary(false), m_entrance(false), m_fix(false), m_selected(true), m_surface(false) {} }; struct lxDataTexture { double dx, dy, xx, xy, yx, yy, iw, ih; unsigned texSizeS = 0, texSizeO = 0; lxImageRGB image; unsigned char * texS, * texSbw, * texO, * texObw; lxDataTexture() : dx(0.0), dy(0.0), xx(1.0), xy(0.0), yx(0.0), yy(1.0), iw(1.0), ih(1.0), image(), texS(NULL), texSbw(NULL), texO(NULL), texObw(NULL) {} ~lxDataTexture(); bool SetImage(lxImageRGB img); void Clear(); void ClearTexImages(); void CreateTexImages(int sizeS, int sizeO); bool InitCalibInverse(double idx, double idy, double ixx, double ixy, double iyx, double iyy); bool InitCalibNormal(double idx, double idy, double ixx, double ixy, double iyx, double iyy); }; struct lxDataShot { unsigned long from, to; size_t m_survey_idx; bool surface, invisible, splay, duplicate, m_selected; }; typedef std::vector<lxDataStation> lxDataStationVec; typedef std::vector<lxDataShot> lxDataShotVec; typedef std::vector<lxDataSurvey> lxDataSurveyVec; struct lxData { lxFile m_input; lxDataStationVec stations; lxDataShotVec shots; lxDataSurveyVec surveys; std::set<size_t> m_selected_surveys; wxString title; vtkPolyData * scrapWalls, * lrudWalls, * surface, * m_centerline; vtkTriangleFilter * allWallsTriangle, * surfaceTriangle; vtkDepthSortPolyData * allWallsSorted, * surfaceSorted; vtkAppendPolyData * allWalls; vtkStripper * allWallsStripped; vtkPolyDataNormals * scrapWallsNormals, * surfaceNormals; vtkLookupTable * luTable; lxDataTexture m_textureSurface; lxData(); ~lxData(); void Clear(); void Rebuild(); void InitTextures(); void ExportVTK(wxString fileName); void ExportPLY(wxString fileName); void ClearSurveySelection(); void AddSelectedSurvey(size_t id); }; #endif
#ifndef __PERF_EVLIST_H #define __PERF_EVLIST_H 1 #include <linux/list.h> #include <stdio.h> #include "../perf.h" #include "event.h" #include "util.h" #include <unistd.h> struct pollfd; struct thread_map; struct cpu_map; struct perf_record_opts; #define PERF_EVLIST__HLIST_BITS 8 #define PERF_EVLIST__HLIST_SIZE (1 << PERF_EVLIST__HLIST_BITS) struct perf_evlist { struct list_head entries; struct hlist_head heads[PERF_EVLIST__HLIST_SIZE]; int nr_entries; int nr_fds; int nr_mmaps; int mmap_len; struct { int cork_fd; pid_t pid; } workload; bool overwrite; union perf_event event_copy; struct perf_mmap *mmap; struct pollfd *pollfd; struct thread_map *threads; struct cpu_map *cpus; struct perf_evsel *selected; }; struct perf_evsel_str_handler { const char *name; void *handler; }; struct perf_evsel; struct perf_evlist *perf_evlist__new(struct cpu_map *cpus, struct thread_map *threads); void perf_evlist__init(struct perf_evlist *evlist, struct cpu_map *cpus, struct thread_map *threads); void perf_evlist__exit(struct perf_evlist *evlist); void perf_evlist__delete(struct perf_evlist *evlist); void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry); int perf_evlist__add_default(struct perf_evlist *evlist); int perf_evlist__add_attrs(struct perf_evlist *evlist, struct perf_event_attr *attrs, size_t nr_attrs); int perf_evlist__add_tracepoints(struct perf_evlist *evlist, const char *tracepoints[], size_t nr_tracepoints); int perf_evlist__set_tracepoints_handlers(struct perf_evlist *evlist, const struct perf_evsel_str_handler *assocs, size_t nr_assocs); #define perf_evlist__add_attrs_array(evlist, array) \ perf_evlist__add_attrs(evlist, array, ARRAY_SIZE(array)) #define perf_evlist__add_tracepoints_array(evlist, array) \ perf_evlist__add_tracepoints(evlist, array, ARRAY_SIZE(array)) #define perf_evlist__set_tracepoints_handlers_array(evlist, array) \ perf_evlist__set_tracepoints_handlers(evlist, array, ARRAY_SIZE(array)) void perf_evlist__id_add(struct perf_evlist *evlist, struct perf_evsel *evsel, int cpu, int thread, u64 id); void perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd); struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id); union perf_event *perf_evlist__mmap_read(struct perf_evlist *self, int idx); int perf_evlist__open(struct perf_evlist *evlist, bool group); void perf_evlist__config_attrs(struct perf_evlist *evlist, struct perf_record_opts *opts); int perf_evlist__prepare_workload(struct perf_evlist *evlist, struct perf_record_opts *opts, const char *argv[]); int perf_evlist__start_workload(struct perf_evlist *evlist); int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages, bool overwrite); void perf_evlist__munmap(struct perf_evlist *evlist); void perf_evlist__disable(struct perf_evlist *evlist); void perf_evlist__enable(struct perf_evlist *evlist); void perf_evlist__set_selected(struct perf_evlist *evlist, struct perf_evsel *evsel); static inline void perf_evlist__set_maps(struct perf_evlist *evlist, struct cpu_map *cpus, struct thread_map *threads) { evlist->cpus = cpus; evlist->threads = threads; } int perf_evlist__create_maps(struct perf_evlist *evlist, const char *target_pid, const char *tid, uid_t uid, const char *cpu_list); void perf_evlist__delete_maps(struct perf_evlist *evlist); int perf_evlist__set_filters(struct perf_evlist *evlist); u64 perf_evlist__sample_type(const struct perf_evlist *evlist); bool perf_evlist__sample_id_all(const const struct perf_evlist *evlist); u16 perf_evlist__id_hdr_size(const struct perf_evlist *evlist); bool perf_evlist__valid_sample_type(const struct perf_evlist *evlist); bool perf_evlist__valid_sample_id_all(const struct perf_evlist *evlist); void perf_evlist__splice_list_tail(struct perf_evlist *evlist, struct list_head *list, int nr_entries); #endif /* __PERF_EVLIST_H */