text
stringlengths
4
6.14k
/***************************************************************************** * * dbdupe.c * Purpose ...............: Dupe checking. * ***************************************************************************** * Copyright (C) 1997-2005 Michiel Broek <mbse@mbse.eu> * Copyright (C) 2013 Robert James Clay <jame@rocasa.us> * * This file is part of FTNd. * * This BBS 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, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *****************************************************************************/ #include "../config.h" #include "ftndlib.h" #include "ftnd.h" #include "users.h" #include "ftnddb.h" typedef struct _dupesrec { unsigned int *crcs; int loaded; int changed; int count; int max; int peak; } dupesrec; dupesrec dupes[3]; static char *files[] = {(char *)"echomail", (char *)"fileecho", (char *)"news"}; void CloseDdb(int); void InitDupes() { int i; Syslog('n', "Init Dupes"); memset(dupes, 0, sizeof(dupes)); for (i = 0; i < 3; i++) { dupes[i].crcs= NULL; dupes[i].loaded = FALSE; dupes[i].changed = FALSE; dupes[i].count = 0; dupes[i].max = 0; } } int CheckDupe(unsigned int crc, int idx, int max) { char *dfile; FILE *fil; unsigned int test; int i, size = 0; if (!dupes[idx].loaded) { dfile = calloc(PATH_MAX, sizeof(char)); snprintf(dfile, PATH_MAX -1, "%s/etc/%s.dupe", getenv("FTND_ROOT"), files[idx]); if ((fil = fopen(dfile, "r+")) == NULL) { /* * Dupe database doesn't exist yet. */ if ((fil = fopen(dfile, "w")) == NULL) { WriteError("$PANIC: dbdupe.c, can't create %s", dfile); free(dfile); exit(FTNERR_INIT_ERROR); } fclose(fil); fil = fopen(dfile, "r+"); } else { fseek(fil, 0L, SEEK_END); size = ftell(fil) / sizeof(unsigned int); fseek(fil, 0L, SEEK_SET); } /* * Reserve some extra memory and record howmuch. */ if (size > max) dupes[idx].peak = size + 5000; else dupes[idx].peak = max + 5000; dupes[idx].crcs = (unsigned int *)malloc(dupes[idx].peak * sizeof(unsigned int)); memset(dupes[idx].crcs, 0, dupes[idx].peak * sizeof(unsigned int)); /* * Load dupe records */ while (fread(&test, sizeof(test), 1, fil) == 1) { dupes[idx].crcs[dupes[idx].count] = test; dupes[idx].count++; } fclose(fil); free(dfile); dupes[idx].loaded = TRUE; dupes[idx].max = max; } for (i = 0; i < dupes[idx].count; i++) { if (dupes[idx].crcs[i] == crc) { return TRUE; } } /* * Not a dupe, append new crc value */ dupes[idx].crcs[dupes[idx].count] = crc; dupes[idx].count++; dupes[idx].changed = TRUE; /* * If we reach the high limit, flush the current dupelist. */ if (dupes[idx].count >= dupes[idx].peak) CloseDdb(idx); return FALSE; } void CloseDdb(int idx) { int j, start; char *dfile; FILE *fil; dfile = calloc(PATH_MAX, sizeof(char)); if (dupes[idx].loaded) { if (dupes[idx].changed) { if (dupes[idx].count > dupes[idx].max) start = dupes[idx].count - dupes[idx].max; else start = 0; snprintf(dfile, PATH_MAX -1, "%s/etc/%s.dupe", getenv("FTND_ROOT"), files[idx]); if ((fil = fopen(dfile, "w"))) { for (j = start; j < dupes[idx].count; j++) fwrite(&dupes[idx].crcs[j], sizeof(unsigned int), 1, fil); fclose(fil); } else { WriteError("$Can't write %s", dfile); } } dupes[idx].changed = FALSE; dupes[idx].loaded = FALSE; dupes[idx].count = 0; dupes[idx].max = 0; dupes[idx].peak = 0; free(dupes[idx].crcs); dupes[idx].crcs = NULL; } free(dfile); } void CloseDupes() { int i; for (i = 0; i < 3; i++) CloseDdb(i); }
// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2000-2011 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. */ #include <common.h> #include <bootstage.h> #include <command.h> #include <cpu_func.h> #include <image.h> #include <log.h> #include <part.h> int common_diskboot(struct cmd_tbl *cmdtp, const char *intf, int argc, char *const argv[]) { __maybe_unused int dev; int part; ulong addr = CONFIG_SYS_LOAD_ADDR; ulong cnt; struct disk_partition info; #if defined(CONFIG_LEGACY_IMAGE_FORMAT) image_header_t *hdr; #endif struct blk_desc *dev_desc; #if CONFIG_IS_ENABLED(FIT) const void *fit_hdr = NULL; #endif bootstage_mark(BOOTSTAGE_ID_IDE_START); if (argc > 3) { bootstage_error(BOOTSTAGE_ID_IDE_ADDR); return CMD_RET_USAGE; } bootstage_mark(BOOTSTAGE_ID_IDE_ADDR); if (argc > 1) addr = simple_strtoul(argv[1], NULL, 16); bootstage_mark(BOOTSTAGE_ID_IDE_BOOT_DEVICE); part = blk_get_device_part_str(intf, (argc == 3) ? argv[2] : NULL, &dev_desc, &info, 1); if (part < 0) { bootstage_error(BOOTSTAGE_ID_IDE_TYPE); return 1; } dev = dev_desc->devnum; bootstage_mark(BOOTSTAGE_ID_IDE_TYPE); printf("\nLoading from %s device %d, partition %d: " "Name: %.32s Type: %.32s\n", intf, dev, part, info.name, info.type); debug("First Block: " LBAFU ", # of blocks: " LBAFU ", Block Size: %ld\n", info.start, info.size, info.blksz); if (blk_dread(dev_desc, info.start, 1, (ulong *)addr) != 1) { printf("** Read error on %d:%d\n", dev, part); bootstage_error(BOOTSTAGE_ID_IDE_PART_READ); return 1; } bootstage_mark(BOOTSTAGE_ID_IDE_PART_READ); switch (genimg_get_format((void *) addr)) { #if defined(CONFIG_LEGACY_IMAGE_FORMAT) case IMAGE_FORMAT_LEGACY: hdr = (image_header_t *) addr; bootstage_mark(BOOTSTAGE_ID_IDE_FORMAT); if (!image_check_hcrc(hdr)) { puts("\n** Bad Header Checksum **\n"); bootstage_error(BOOTSTAGE_ID_IDE_CHECKSUM); return 1; } bootstage_mark(BOOTSTAGE_ID_IDE_CHECKSUM); image_print_contents(hdr); cnt = image_get_image_size(hdr); break; #endif #if CONFIG_IS_ENABLED(FIT) case IMAGE_FORMAT_FIT: fit_hdr = (const void *) addr; puts("Fit image detected...\n"); cnt = fit_get_size(fit_hdr); break; #endif default: bootstage_error(BOOTSTAGE_ID_IDE_FORMAT); puts("** Unknown image type\n"); return 1; } cnt += info.blksz - 1; cnt /= info.blksz; cnt -= 1; if (blk_dread(dev_desc, info.start + 1, cnt, (ulong *)(addr + info.blksz)) != cnt) { printf("** Read error on %d:%d\n", dev, part); bootstage_error(BOOTSTAGE_ID_IDE_READ); return 1; } bootstage_mark(BOOTSTAGE_ID_IDE_READ); #if CONFIG_IS_ENABLED(FIT) /* This cannot be done earlier, * we need complete FIT image in RAM first */ if (genimg_get_format((void *) addr) == IMAGE_FORMAT_FIT) { if (fit_check_format(fit_hdr, IMAGE_SIZE_INVAL)) { bootstage_error(BOOTSTAGE_ID_IDE_FIT_READ); puts("** Bad FIT image format\n"); return 1; } bootstage_mark(BOOTSTAGE_ID_IDE_FIT_READ_OK); fit_print_contents(fit_hdr); } #endif flush_cache(addr, (cnt+1)*info.blksz); /* Loading ok, update default load address */ image_load_addr = addr; return bootm_maybe_autostart(cmdtp, argv[0]); }
/* $Id$ */ /* * This file is part of OpenTTD. * OpenTTD 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. * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>. */ /** @file crashlog.h Functions to be called to log a crash */ #ifndef CRASHLOG_H #define CRASHLOG_H /** * Helper class for creating crash logs. */ class CrashLog { private: /** Pointer to the error message. */ static const char *message; /** Temporary 'local' location of the buffer. */ static char *gamelog_buffer; /** Temporary 'local' location of the end of the buffer. */ static const char *gamelog_last; static void GamelogFillCrashLog(const char *s); protected: /** * Writes OS' version to the buffer. * @param buffer The begin where to write at. * @param last The last position in the buffer to write to. * @return the position of the \c '\0' character after the buffer. */ virtual char *LogOSVersion(char *buffer, const char *last) const = 0; /** * Writes compiler (and its version, if available) to the buffer. * @param buffer The begin where to write at. * @param last The last position in the buffer to write to. * @return the position of the \c '\0' character after the buffer. */ virtual char *LogCompiler(char *buffer, const char *last) const; /** * Writes OS' version detail to the buffer, if available. * @param buffer The begin where to write at. * @param last The last position in the buffer to write to. * @return the position of the \c '\0' character after the buffer. */ virtual char *LogOSVersionDetail(char *buffer, const char *last) const; /** * Writes actually encountered error to the buffer. * @param buffer The begin where to write at. * @param last The last position in the buffer to write to. * @param message Message passed to use for possible errors. Can be NULL. * @return the position of the \c '\0' character after the buffer. */ virtual char *LogError(char *buffer, const char *last, const char *message) const = 0; /** * Writes the stack trace to the buffer, if there is information about it * available. * @param buffer The begin where to write at. * @param last The last position in the buffer to write to. * @return the position of the \c '\0' character after the buffer. */ virtual char *LogStacktrace(char *buffer, const char *last) const = 0; /** * Writes information about the data in the registers, if there is * information about it available. * @param buffer The begin where to write at. * @param last The last position in the buffer to write to. * @return the position of the \c '\0' character after the buffer. */ virtual char *LogRegisters(char *buffer, const char *last) const; /** * Writes the dynamically linked libraries/modules to the buffer, if there * is information about it available. * @param buffer The begin where to write at. * @param last The last position in the buffer to write to. * @return the position of the \c '\0' character after the buffer. */ virtual char *LogModules(char *buffer, const char *last) const; #ifdef USE_SCOPE_INFO /** * Writes the scope info log to the buffer. * This may only be called when IsMainThread() returns true * @param buffer The begin where to write at. * @param last The last position in the buffer to write to. * @return the position of the \c '\0' character after the buffer. */ virtual char *LogScopeInfo(char *buffer, const char *last) const; #endif char *LogOpenTTDVersion(char *buffer, const char *last) const; char *LogConfiguration(char *buffer, const char *last) const; char *LogLibraries(char *buffer, const char *last) const; char *LogGamelog(char *buffer, const char *last) const; char *LogCommandLog(char *buffer, const char *last) const; public: /** Stub destructor to silence some compilers. */ virtual ~CrashLog() {} char *FillCrashLog(char *buffer, const char *last) const; bool WriteCrashLog(const char *buffer, char *filename, const char *filename_last) const; /** * Write the (crash) dump to a file. * @note On success the filename will be filled with the full path of the * crash dump file. Make sure filename is at least \c MAX_PATH big. * @param filename Output for the filename of the written file. * @param filename_last The last position in the filename buffer. * @return if less than 0, error. If 0 no dump is made, otherwise the dump * was successful (not all OSes support dumping files). */ virtual int WriteCrashDump(char *filename, const char *filename_last) const; bool WriteSavegame(char *filename, const char *filename_last) const; bool WriteScreenshot(char *filename, const char *filename_last) const; bool MakeCrashLog() const; /** * Initialiser for crash logs; do the appropriate things so crashes are * handled by our crash handler instead of returning straight to the OS. * @note must be implemented by all implementers of CrashLog. */ static void InitialiseCrashLog(); static void SetErrorMessage(const char *message); static void AfterCrashLogCleanup(); inline const char *GetMessage() const { return this->message; } static const char *GetAbortCrashlogReason(); }; #endif /* CRASHLOG_H */
#ifndef __KONST_UI_FUNC_H_ #define __KONST_UI_FUNC_H_ #include "kkstrtext.h" #include "conf.h" #include <string> #include <vector> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <signal.h> #include <sys/time.h> #include <sys/types.h> #include <sys/ioctl.h> #include <ncurses.h> #include <ctype.h> #ifdef __sun__ #include <sys/termio.h> #include <sys/filio.h> #endif #ifdef __CYGWIN__ #include <sys/termios.h> #include <sys/socket.h> #endif #undef box #undef clear #undef erase #undef move #undef refresh /* Fucking ncurses stuff */ #define boldcolor(c) COLOR_PAIR(c)|A_BOLD #define normalcolor(c) COLOR_PAIR(c) #ifdef LOCALES_HACK #define KT_DISP_FILTER(c) ( (((unsigned char) c > ' ') && (c != '\177')) ? c : ' ' ) #else #define KT_DISP_FILTER(c) (!iscntrl((unsigned char) c) ? c : ' ') #endif #define VLINE kintf_graph ? ACS_VLINE : '|' #define HLINE kintf_graph ? ACS_HLINE : '-' #define ULCORNER kintf_graph ? ACS_ULCORNER : '+' #define URCORNER kintf_graph ? ACS_URCORNER : '+' #define LLCORNER kintf_graph ? ACS_LLCORNER : '+' #define LRCORNER kintf_graph ? ACS_LRCORNER : '+' #define LTEE kintf_graph ? ACS_LTEE : '|' #define RTEE kintf_graph ? ACS_RTEE : '|' #define TTEE kintf_graph ? ACS_TTEE : '+' #define BTEE kintf_graph ? ACS_BTEE : '+' #define KEY_TAB 9 #define KEY_ESC 27 #ifndef CTRL #define CTRL(x) ((x) & 0x1F) #endif #ifndef ALT #define ALT(x) (0x200 | (unsigned int) x) #endif #define SHIFT_PRESSED 1 #define ALTR_PRESSED 2 #define ALTL_PRESSED 8 #define CONTROL_PRESSED 4 extern bool kintf_graph, kintf_refresh, use_fribidi; extern void (*kt_resize_event)(void); void printchar(char c); void printstring(const string &s); int string2key(const string &adef); string makebidi(const string &buf, int lpad = 0); int findcolor(const string &s); __KTOOL_BEGIN_C void kinterface(); void kendinterface(); int keypressed(bool wait = false); int emacsbind(int k); int getkey(); int getctrlkeys(); void kwriteatf(int x, int y, int c, const char *fmt, ...); void kwriteat(int x, int y, const char *msg, int c); void kgotoxy(int x, int y); void hidecursor(); void showcursor(); void setbeep(int freq, int duration); int kwherex(); int kwherey(); __KTOOL_END_C #endif
#include <stdlib.h> #include <stdio.h> #include "../scl.h" #include "../cfunc.h" // (+ 2 3 4) => 9 VAL *sum(ND *n) { // suming long double r = 0; for (ND *m = n; m != NULL; m = m->tail) { VAL *v = eval(m); if (v == NULL) return NULL; if (v->type != SCALAR) { fprintf(stderr, ":: sum: not all values are scalars\n"); exit(5); } r += v->val.v; } VAL *v = (VAL *) calloc(1, sizeof(VAL)); v->type = SCALAR; v->val.v = r; return v; }
/** * @file * * @ingroup ClassicChains * * @brief Chain API. */ /* * Copyright (c) 2010 embedded brains GmbH. * * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. */ #ifndef _RTEMS_CHAIN_H #define _RTEMS_CHAIN_H #include <rtems/system.h> #include <rtems/score/chain.h> #include <rtems/rtems/event.h> #ifdef __cplusplus extern "C" { #endif /** * @defgroup ClassicChains Chains * * @ingroup ClassicRTEMS * * @brief Chain API. * * @{ */ typedef Chain_Node rtems_chain_node; typedef Chain_Control rtems_chain_control; /** * @brief Chain initializer for an empty chain with designator @a name. */ #define RTEMS_CHAIN_INITIALIZER_EMPTY(name) \ CHAIN_INITIALIZER_EMPTY(name) /** * @brief Chain definition for an empty chain with designator @a name. */ #define RTEMS_CHAIN_DEFINE_EMPTY(name) \ CHAIN_DEFINE_EMPTY(name) /** @} */ #include <rtems/chain.inl> /** * @addtogroup ClassicChains * * @{ */ /** * @brief Appends the @a node to the @a chain and sends the @a events to the * @a task if the @a chain was empty before the append. * * @see rtems_chain_append_with_empty_check() and rtems_event_send(). * * @retval RTEMS_SUCCESSFUL Successful operation. * @retval RTEMS_INVALID_ID No such task. */ rtems_status_code rtems_chain_append_with_notification( rtems_chain_control *chain, rtems_chain_node *node, rtems_id task, rtems_event_set events ); /** * @brief Prepends the @a node to the @a chain and sends the @a events to the * @a task if the @a chain was empty before the prepend. * * @see rtems_chain_prepend_with_empty_check() and rtems_event_send(). * * @retval RTEMS_SUCCESSFUL Successful operation. * @retval RTEMS_INVALID_ID No such task. */ rtems_status_code rtems_chain_prepend_with_notification( rtems_chain_control *chain, rtems_chain_node *node, rtems_id task, rtems_event_set events ); /** * @brief Gets the first @a node of the @a chain and sends the @a events to the * @a task if the @a chain is empty after the get. * * @see rtems_chain_get_with_empty_check() and rtems_event_send(). * * @retval RTEMS_SUCCESSFUL Successful operation. * @retval RTEMS_INVALID_ID No such task. */ rtems_status_code rtems_chain_get_with_notification( rtems_chain_control *chain, rtems_id task, rtems_event_set events, rtems_chain_node **node ); /** * @brief Gets the first @a node of the @a chain and sends the @a events to the * @a task if the @a chain is empty afterwards. * * @see rtems_chain_get() and rtems_event_receive(). * * @retval RTEMS_SUCCESSFUL Successful operation. * @retval RTEMS_TIMEOUT Timeout. */ rtems_status_code rtems_chain_get_with_wait( rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node ); /** @} */ #ifdef __cplusplus } #endif #endif /* end of include file */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Gypsy * * A simple to use and understand GPSD replacement * that uses D-Bus, GLib and memory allocations * * Author: Iain Holmes <iain@sleepfive.com> * Copyright (C) 2011 * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __GYPSY_DISCOVERY_H__ #define __GYPSY_DISCOVERY_H__ #include <glib-object.h> G_BEGIN_DECLS #define GYPSY_DISCOVERY_DBUS_SERVICE "org.freedesktop.Gypsy" #define GYPSY_DISCOVERY_DBUS_PATH "/org/freedesktop/Gypsy/Discovery" #define GYPSY_DISCOVERY_DBUS_INTERFACE "org.freedesktop.Gypsy.Discovery" #define GYPSY_TYPE_DISCOVERY \ (gypsy_discovery_get_type()) #define GYPSY_DISCOVERY(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ GYPSY_TYPE_DISCOVERY, \ GypsyDiscovery)) #define GYPSY_DISCOVERY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), \ GYPSY_TYPE_DISCOVERY, \ GypsyDiscoveryClass)) #define GYPSY_IS_DISCOVERY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ GYPSY_TYPE_DISCOVERY)) #define GYPSY_IS_DISCOVERY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), \ GYPSY_TYPE_DISCOVERY)) #define GYPSY_DISCOVERY_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ GYPSY_TYPE_DISCOVERY, \ GypsyDiscoveryClass)) typedef struct _GypsyDiscoveryPrivate GypsyDiscoveryPrivate; typedef struct _GypsyDiscovery GypsyDiscovery; typedef struct _GypsyDiscoveryClass GypsyDiscoveryClass; typedef struct _GypsyDiscoveryDeviceInfo GypsyDiscoveryDeviceInfo; struct _GypsyDiscovery { GObject parent; GypsyDiscoveryPrivate *priv; }; struct _GypsyDiscoveryClass { GObjectClass parent_class; }; struct _GypsyDiscoveryDeviceInfo { char *device_path; char *type; }; GType gypsy_discovery_get_type (void) G_GNUC_CONST; GypsyDiscovery *gypsy_discovery_new (void); GPtrArray *gypsy_discovery_list_devices (GypsyDiscovery *discovery, GError **error); gboolean gypsy_discovery_start_scanning (GypsyDiscovery *discovery, GError **error); gboolean gypsy_discovery_stop_scanning (GypsyDiscovery *discovery, GError **error); GypsyDiscoveryDeviceInfo *gypsy_discovery_device_info_copy (GypsyDiscoveryDeviceInfo *di); void gypsy_discovery_device_info_free (GypsyDiscoveryDeviceInfo *device_info); G_END_DECLS #endif /* __GYPSY_DISCOVERY_H__ */
#include <system.h> #include <isr.h> #include <kbd.h> #include <vfs.h> uint32_t pos = 0; void kbd_wait(void) { while(inb(0x64) & 2); } uint32_t spec = 0; void kbd_handler(regs_t *r) { kbd_wait(); uint8_t scancode = inb(0x60); if(scancode == 0xE0) { spec = 1; return; } /* static inode_t *i; if(!i) i = vfs_trace_path(vfs_root, "/dev/console"); if(spec) { switch(scancode) { case 0x4D: ++pos; break; case 0x4B: --pos; break; } spec = 0; } i->fs->ioctl(i, 1, pos); */ extern void tty_kbd(uint8_t); tty_kbd(scancode); }
/* Do not modify this file. */ /* It is created automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-logotypecertextn.h */ /* ../../tools/asn2wrs.py -b -p logotypecertextn -c ./logotypecertextn.cnf -s ./packet-logotypecertextn-template -D . -O ../../epan/dissectors LogotypeCertExtn.asn */ /* Input file: packet-logotypecertextn-template.h */ #line 1 "../../asn1/logotypecertextn/packet-logotypecertextn-template.h" /* packet-logotypecertextn.h * Routines for RFC3907 Logotype Certificate Extensions packet dissection * Ronnie Sahlberg 2004 * * $Id: packet-logotypecertextn.h 39427 2011-10-15 19:27:27Z wmeier $ * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs * * 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 PACKET_LOGOTYPE_CERT_EXTN_H #define PACKET_LOGOTYPE_CERT_EXTN_H /*#include "packet-logotypecertextn-exp.h"*/ #endif /* PACKET_LOGOTYPE_CERT_EXTN_H */
// // SMITH3 - generates spin-free multireference electron correlation programs. // Filename: op.h // Copyright (C) 2012 Toru Shiozaki // // Author: Toru Shiozaki <shiozaki@northwestern.edu> // Maintainer: Shiozaki group // // This file is part of the SMITH3 package. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // #ifndef __TWOOP_H #define __TWOOP_H #include "operator.h" namespace smith { /// Derived class for spin-summed operators which produce tensors. /// for a historical reason, this is a derived class of Operator, although it does not have to be so. class Op : public Operator { protected: /// Related to tensor info. std::string label_; public: /// Create two-body tensor operator. explicit Op(const std::string lab, const std::string& ta, const std::string& tb, const std::string& tc, const std::string& td, const bool alpha1 = false, const bool alpha2 = false); /// Create one-body tensor operator. When alpha is true, the operators are alpha only. explicit Op(const std::string lab, const std::string& ta, const std::string& tb, const bool alpha = false); /// Create one-body tensor with spin information. No operator is created. explicit Op(const std::string lab, std::shared_ptr<Index> ta, std::shared_ptr<Index> tb, std::shared_ptr<Spin> ts); /// Create operator with label. explicit Op(const std::string lab = "") : label_(lab) { } /// Create operator without label. explicit Op(const std::string& ta, const std::string& tb, const std::string& tc, const std::string& td, const bool alpha1 = false, const bool alpha2 = false) : Op("", ta, tb, tc, td, alpha1, alpha2) { } /// Create operator without label. When alpha is true, the operators are alpha only. explicit Op(const std::string& ta, const std::string& tb, const bool alpha = false) : Op("", ta, tb, alpha) { } virtual ~Op() { } bool is_ex() const { return label_.empty(); } /// Returns operator name. std::string label() const override { return label_; } /// Print out operator. void print() const override; /// Makes a possible permutation of indices. Cannot permute if there are active daggered and no-daggered operators or if label is proj. std::pair<bool, double> permute(const bool proj) override; /// Checks label, and first two operator tuple fields (index and operator contraction info). **NOTE** that spin info (third op field) is not checked. bool identical(std::shared_ptr<Operator> o) const override; /// Creates a new Operator pointer. std::shared_ptr<Operator> copy() const override; }; } #endif
// // ODBCException.h // // $Id: //poco/Main/Data/ODBC/include/Poco/Data/ODBC/ODBCException.h#4 $ // // Library: ODBC // Package: ODBC // Module: ODBCException // // Definition of ODBCException. // // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization // obtaining a copy of the software and accompanying documentation covered by // this license (the "Software") to use, reproduce, display, distribute, // execute, and transmit the Software, and to prepare derivative works of the // Software, and to permit third-parties to whom the Software is furnished to // do so, all subject to the following: // // The copyright notices in the Software and this entire statement, including // the above license grant, this restriction and the following disclaimer, // must be included in all copies of the Software, in whole or in part, and // all derivative works of the Software, unless such copies or derivative // works are solely in the form of machine-executable object code generated by // a source language processor. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. // #ifndef Data_ODBC_ODBCException_INCLUDED #define Data_ODBC_ODBCException_INCLUDED #include "Poco/Data/ODBC/ODBC.h" #include "Poco/Data/ODBC/Utility.h" #include "Poco/Data/ODBC/Diagnostics.h" #include "Poco/Data/ODBC/Error.h" #include "Poco/Data/DataException.h" namespace Poco { namespace Data { namespace ODBC { POCO_DECLARE_EXCEPTION(ODBC_API, ODBCException, Poco::Data::DataException) POCO_DECLARE_EXCEPTION(ODBC_API, InsufficientStorageException, ODBCException) POCO_DECLARE_EXCEPTION(ODBC_API, UnknownDataLengthException, ODBCException) POCO_DECLARE_EXCEPTION(ODBC_API, DataTruncatedException, ODBCException) template <class H, SQLSMALLINT handleType> class HandleException: public ODBCException { public: HandleException(const H& handle): _error(handle) { } HandleException(const H& handle, const std::string& msg): ODBCException(msg), _error(handle) { } HandleException(const H& handle, const std::string& msg, const std::string& arg): ODBCException(msg, arg), _error(handle) { } HandleException(const H& handle, const std::string& msg, const Poco::Exception& exc): ODBCException(msg, exc), _error(handle) { } HandleException(const HandleException& exc): ODBCException(exc), _error(exc._error) { } ~HandleException() throw() { } HandleException& operator = (const HandleException& exc) { HandleException::operator = (exc); return *this; } const char* name() const throw() { return "ODBC handle exception"; } const char* className() const throw() { return typeid(*this).name(); } Poco::Exception* clone() const { return new HandleException(*this); } void rethrow() const { throw *this; } const Diagnostics<H, handleType>& diagnostics() { return _error.diagnostics(); } std::string toString() const { std::stringstream os; os << "ODBC Error: " << what() << std::endl << "===================" << std::endl << _error.toString() << std::endl ; return os.str(); } private: Error<H, handleType> _error; }; typedef HandleException<SQLHENV, SQL_HANDLE_ENV> EnvironmentException; typedef HandleException<SQLHDBC, SQL_HANDLE_DBC> ConnectionException; typedef HandleException<SQLHSTMT, SQL_HANDLE_STMT> StatementException; typedef HandleException<SQLHDESC, SQL_HANDLE_DESC> DescriptorException; } } } // namespace Poco::Data::ODBC #endif
/* * Copyright (C) 2008 Martin Willi * Copyright (C) 2009 Andreas Steffen * Hochschule fuer Technik Rapperswil * * 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 <http://www.fsf.org/copyleft/gpl.txt>. * * 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. */ /** * @defgroup serpent_p serpent * @ingroup plugins * * @defgroup serpent_plugin serpent_plugin * @{ @ingroup serpent_p */ #ifndef SERPENT_PLUGIN_H_ #define SERPENT_PLUGIN_H_ #include <plugins/plugin.h> typedef struct serpent_plugin_t serpent_plugin_t; /** * Plugin implementing Serpent based algorithms in software. */ struct serpent_plugin_t { /** * implements plugin interface */ plugin_t plugin; }; #endif /** SERPENT_PLUGIN_H_ @}*/
/************************************************* * Perl-Compatible Regular Expressions * *************************************************/ /* PCRE is a library of functions to support regular expressions whose syntax and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Copyright (c) 1997-2005 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the University of Cambridge 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. ----------------------------------------------------------------------------- */ /* This module contains some fixed tables that are used by more than one of the PCRE code modules. The tables are also #included by the pcretest program, which uses macros to change their names from _pcre_xxx to xxxx, thereby avoiding name clashes with the library. */ #include "pcre_internal.h" /* Table of sizes for the fixed-length opcodes. It's defined in a macro so that the definition is next to the definition of the opcodes in internal.h. */ const uschar _pcre_OP_lengths[] = { OP_LENGTHS }; /************************************************* * Tables for UTF-8 support * *************************************************/ /* These are the breakpoints for different numbers of bytes in a UTF-8 character. */ const int _pcre_utf8_table1[] = { 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff}; const int _pcre_utf8_table1_size = sizeof(_pcre_utf8_table1)/sizeof(int); /* These are the indicator bits and the mask for the data bits to set in the first byte of a character, indexed by the number of additional bytes. */ const int _pcre_utf8_table2[] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc}; const int _pcre_utf8_table3[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01}; /* Table of the number of extra characters, indexed by the first character masked with 0x3f. The highest number for a valid UTF-8 character is in fact 0x3d. */ const uschar _pcre_utf8_table4[] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }; /* This table translates Unicode property names into code values for the ucp_findchar() function. */ const ucp_type_table _pcre_utt[] = { { "C", 128 + ucp_C }, { "Cc", ucp_Cc }, { "Cf", ucp_Cf }, { "Cn", ucp_Cn }, { "Co", ucp_Co }, { "Cs", ucp_Cs }, { "L", 128 + ucp_L }, { "Ll", ucp_Ll }, { "Lm", ucp_Lm }, { "Lo", ucp_Lo }, { "Lt", ucp_Lt }, { "Lu", ucp_Lu }, { "M", 128 + ucp_M }, { "Mc", ucp_Mc }, { "Me", ucp_Me }, { "Mn", ucp_Mn }, { "N", 128 + ucp_N }, { "Nd", ucp_Nd }, { "Nl", ucp_Nl }, { "No", ucp_No }, { "P", 128 + ucp_P }, { "Pc", ucp_Pc }, { "Pd", ucp_Pd }, { "Pe", ucp_Pe }, { "Pf", ucp_Pf }, { "Pi", ucp_Pi }, { "Po", ucp_Po }, { "Ps", ucp_Ps }, { "S", 128 + ucp_S }, { "Sc", ucp_Sc }, { "Sk", ucp_Sk }, { "Sm", ucp_Sm }, { "So", ucp_So }, { "Z", 128 + ucp_Z }, { "Zl", ucp_Zl }, { "Zp", ucp_Zp }, { "Zs", ucp_Zs } }; const int _pcre_utt_size = sizeof(_pcre_utt)/sizeof(ucp_type_table); /* End of pcre_tables.c */
/* * Minion http://minion.sourceforge.net * Copyright (C) 2006-09 * * 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 CONSTRAINT_CONSTANT_H #define CONSTRAINT_CONSTANT_H template<bool truth> struct ConstantConstraint : public AbstractConstraint { virtual string constraint_name() { if(truth) return "true"; else return "false"; } CONSTRAINT_ARG_LIST0(); ConstantConstraint(StateObj* _stateObj) : AbstractConstraint(_stateObj) { } virtual triggerCollection setup_internal() { triggerCollection t; return t; } virtual void propagate(DomainInt i, DomainDelta) { } virtual void full_propagate() { if(!truth) getState(stateObj).setFailed(true); } virtual BOOL check_assignment(DomainInt* v, SysInt v_size) { D_ASSERT(v_size == 0); return truth; } virtual bool get_satisfying_assignment(box<pair<SysInt,DomainInt> >& assignment) { return truth; } AbstractConstraint* reverse_constraint() { return new ConstantConstraint<!truth>(stateObj); } virtual vector<AnyVarRef> get_vars() { vector<AnyVarRef> v; return v; } }; #endif
/* * This file is part of the coreboot project. * * Copyright (C) 2013 Google Inc. * Copyright (C) 2013 Sage Electronic Engineering, 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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <stddef.h> #include <arch/cpu.h> #include <lib.h> #include <arch/io.h> #include <arch/cbfs.h> #include <arch/stages.h> #include <console/console.h> #include <cbmem.h> #include <cpu/x86/mtrr.h> #include <romstage_handoff.h> #include <timestamp.h> #include <soc/gpio.h> #include <soc/iomap.h> #include <soc/lpc.h> #include <soc/pci_devs.h> #include <soc/romstage.h> #include <soc/acpi.h> #include <soc/baytrail.h> #include <drivers/intel/fsp1_0/fsp_util.h> #include "modhwinfo.h" /** * /brief mainboard call for setup that needs to be done before fsp init * */ void early_mainboard_romstage_entry() { } /** * Get function disables - most of these will be done automatically * @param fd_mask * @param fd2_mask */ void get_func_disables(uint32_t *fd_mask, uint32_t *fd2_mask) { } /** * /brief mainboard call for setup that needs to be done after fsp init * */ void late_mainboard_romstage_entry() { } const uint32_t mAzaliaVerbTableData13[] = { /* *ALC262 Verb Table - 10EC0262 */ /* Pin Complex (NID 0x11 ) */ 0x01171CF0, 0x01171D11, 0x01171E11, 0x01171F41, /* Pin Complex (NID 0x12 ) */ 0x01271CF0, 0x01271D11, 0x01271E11, 0x01271F41, /* Pin Complex (NID 0x14 ) */ 0x01471C10, 0x01471D40, 0x01471E01, 0x01471F01, /* Pin Complex (NID 0x15 ) */ 0x01571CF0, 0x01571D11, 0x01571E11, 0x01571F41, /* Pin Complex (NID 0x16 ) */ 0x01671CF0, 0x01671D11, 0x01671E11, 0x01671F41, /* Pin Complex (NID 0x18 ) */ 0x01871C20, 0x01871D98, 0x01871EA1, 0x01871F01, /* Pin Complex (NID 0x19 ) */ 0x01971C21, 0x01971D98, 0x01971EA1, 0x01971F02, /* Pin Complex (NID 0x1A ) */ 0x01A71C2F, 0x01A71D30, 0x01A71E81, 0x01A71F01, /* Pin Complex (NID 0x1B ) */ 0x01B71C1F, 0x01B71D40, 0x01B71E21, 0x01B71F02, /* Pin Complex (NID 0x1C ) */ 0x01C71CF0, 0x01C71D11, 0x01C71E11, 0x01C71F41, /* Pin Complex (NID 0x1D ) */ 0x01D71C01, 0x01D71DC6, 0x01D71E14, 0x01D71F40, /* Pin Complex (NID 0x1E ) */ 0x01E71CF0, 0x01E71D11, 0x01E71E11, 0x01E71F41, /* Pin Complex (NID 0x1F ) */ 0x01F71CF0, 0x01F71D11, 0x01F71E11, 0x01F71F41 }; const PCH_AZALIA_VERB_TABLE mAzaliaVerbTable[] = { { /* * VerbTable: (RealTek ALC262) * Revision ID = 0xFF, support all steps * Codec Verb Table For AZALIA * Codec Address: CAd value (0/1/2) * Codec Vendor: 0x10EC0262 */ { 0x10EC0262, /* Vendor ID/Device IDA */ 0x0000, /* SubSystem ID */ 0xFF, /* Revision IDA */ 0x01, /* Front panel support (1=yes, 2=no) */ 0x000B, /* Number of Rear Jacks = 11 */ 0x0002 /* Number of Front Jacks = 2 */ }, (uint32_t *)mAzaliaVerbTableData13 } }; const PCH_AZALIA_CONFIG mainboard_AzaliaConfig = { .Pme = 1, .DS = 1, .DA = 0, .HdmiCodec = 1, .AzaliaVCi = 1, .Rsvdbits = 0, .AzaliaVerbTableNum = 1, .AzaliaVerbTable = (PCH_AZALIA_VERB_TABLE *)mAzaliaVerbTable, .ResetWaitTimer = 300 }; /** /brief customize fsp parameters here if needed */ void romstage_fsp_rt_buffer_callback(FSP_INIT_RT_BUFFER *FspRtBuffer) { struct hwinfo *hwi_main; UPD_DATA_REGION *UpdData = FspRtBuffer->Common.UpdDataRgnPtr; /* Initialize the Azalia Verb Tables to mainboard specific version */ UpdData->AzaliaConfigPtr = (UINT32)&mainboard_AzaliaConfig; /* Disable 2nd DIMM on Bakersport*/ #if IS_ENABLED(BOARD_INTEL_BAKERSPORT_FSP) UpdData->PcdMrcInitSPDAddr2 = 0x00; /* cannot use SPD_ADDR_DISABLED at this point */ #endif /* Get SPD data from hardware information block and setup memory down */ /* parameters for FSP accordingly */ hwi_main = get_hwinfo((char*)"hwinfo.hex"); if (hwi_main) { UpdData->PcdMemoryParameters.EnableMemoryDown = 1; UpdData->PcdMemoryParameters.DRAMType = hwi_main->SPD[2]; UpdData->PcdMemoryParameters.DIMM0Enable = hwi_main->SPD[3] & 0x01; UpdData->PcdMemoryParameters.DIMM1Enable = (hwi_main->SPD[3] >> 1) & 0x01; UpdData->PcdMemoryParameters.DIMMDensity = hwi_main->SPD[4]; UpdData->PcdMemoryParameters.DIMMDWidth = hwi_main->SPD[5]; UpdData->PcdMemoryParameters.DIMMSides = hwi_main->SPD[7]; UpdData->PcdMemoryParameters.DIMMBusWidth = hwi_main->SPD[8]; UpdData->PcdMemoryParameters.DRAMSpeed = hwi_main->SPD[12]; UpdData->PcdMemoryParameters.DIMMtCL = hwi_main->SPD[14]; UpdData->PcdMemoryParameters.DIMMtWR = hwi_main->SPD[17]; UpdData->PcdMemoryParameters.DIMMtRPtRCD = hwi_main->SPD[18]; UpdData->PcdMemoryParameters.DIMMtRRD = hwi_main->SPD[19]; UpdData->PcdMemoryParameters.DIMMtWTR = hwi_main->SPD[26]; UpdData->PcdMemoryParameters.DIMMtRTP = hwi_main->SPD[27]; UpdData->PcdMemoryParameters.DIMMtFAW = hwi_main->SPD[28]; /*If one need output from MRC to be used in Intel RMT, simply */ /*enable the following line */ //UpdData->PcdMrcDebugMsg = 1; } else printk(BIOS_ERR, "HWInfo not found, leave default timings for DDR3.\n"); }
/** * (C) 2007-2010 Taobao Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Version: $Id$ * * Authors: * yuanqi <yuanqi.xhf@taobao.com> * - some work details if you want */ #ifndef __OB_UPDATESERVER_OB_REMOTE_LOG_SRC_H__ #define __OB_UPDATESERVER_OB_REMOTE_LOG_SRC_H__ #include "common/ob_log_cursor.h" #include "ob_log_src.h" #include "ob_fetched_log.h" namespace oceanbase { namespace common { class IObServerGetter; class ObServer; }; namespace updateserver { class ObUpsRpcStub; class ObRemoteLogSrc { public: ObRemoteLogSrc(); virtual ~ObRemoteLogSrc(); int init(common::IObServerGetter* server_getter, ObUpsRpcStub* rpc_stub, const int64_t fetch_timeout); // 可能返回OB_NEED_RETRY; int fill_start_cursor(common::ObLogCursor& start_cursor); int fill_start_cursor_with_lsync_server(const common::ObServer& server, common::ObLogCursor& start_cursor); int fill_start_cursor_with_fetch_server(const common::ObServer& server, common::ObLogCursor& start_cursor); // virtual int get_log(const int64_t start_id, int64_t& end_id, // char* buf, const int64_t len, int64_t& read_count); int get_log(const common::ObLogCursor& start_cursor, common::ObLogCursor& end_cursor, char* buf, const int64_t len, int64_t& read_count); int get_log_from_lsync_server(const common::ObServer& server, const common::ObLogCursor& start_cursor, common::ObLogCursor& end_cursor, char* buf, const int64_t len, int64_t& read_count); bool is_using_lsync() const; ObFetchLogReq& copy_req(ObFetchLogReq& req); ObFetchLogReq& update_req(ObFetchLogReq& req); protected: bool is_inited() const; private: bool registered_to_lsync_server_; ObFetchLogReq req_; volatile int64_t req_seq_; common::IObServerGetter* server_getter_; ObUpsRpcStub* rpc_stub_; int64_t fetch_timeout_; }; }; // end namespace updateserver }; // end namespace oceanbase #endif /* __OB_UPDATESERVER_OB_REMOTE_LOG_SRC_H__ */
// PPMDSubAlloc.h // This code is based on Dmitry Shkarin's PPMdH code #ifndef __PPMD_SUBALLOC_H #define __PPMD_SUBALLOC_H #include "PPMDType.h" extern "C" { #include "../../../Common/Alloc.h" } const UINT N1=4, N2=4, N3=4, N4=(128+3-1*N1-2*N2-3*N3)/4; const UINT UNIT_SIZE=12, N_INDEXES=N1+N2+N3+N4; #pragma pack(1) struct MEM_BLK { UInt16 Stamp, NU; MEM_BLK *Next, *Prev; void InsertAt(MEM_BLK* p) { Next = (Prev = p)->Next; p->Next = Next->Prev = this; } void Remove() { Prev->Next=Next; Next->Prev=Prev; } } _PACK_ATTR; #pragma pack() class CSubAllocator { UInt32 SubAllocatorSize; Byte Indx2Units[N_INDEXES], Units2Indx[128], GlueCount; struct NODE { NODE* Next; } FreeList[N_INDEXES]; public: Byte* HeapStart, *pText, *UnitsStart, *LoUnit, *HiUnit; CSubAllocator(): SubAllocatorSize(0), GlueCount(0), pText(0), UnitsStart(0), LoUnit(0), HiUnit(0) { memset(Indx2Units, 0, sizeof(Indx2Units)); memset(FreeList, 0, sizeof(FreeList)); } ~CSubAllocator() { StopSubAllocator(); }; void InsertNode(void* p, int indx) { ((NODE*) p)->Next = FreeList[indx].Next; FreeList[indx].Next = (NODE*)p; } void* RemoveNode(int indx) { NODE* RetVal = FreeList[indx].Next; FreeList[indx].Next = RetVal->Next; return RetVal; } UINT U2B(int NU) { return 8 * NU + 4 * NU; } void SplitBlock(void* pv, int oldIndx, int newIndx) { int i, UDiff = Indx2Units[oldIndx] - Indx2Units[newIndx]; Byte* p = ((Byte*)pv) + U2B(Indx2Units[newIndx]); if (Indx2Units[i = Units2Indx[UDiff-1]] != UDiff) { InsertNode(p, --i); p += U2B(i = Indx2Units[i]); UDiff -= i; } InsertNode(p, Units2Indx[UDiff - 1]); } UInt32 GetUsedMemory() { UInt32 i, k, RetVal = SubAllocatorSize - (HiUnit - LoUnit) - (UnitsStart-pText); for (k = i = 0; i < N_INDEXES; i++, k = 0) { for (NODE* pn = FreeList + i;(pn = pn->Next) != NULL; k++) ; RetVal -= UNIT_SIZE*Indx2Units[i] * k; } return (RetVal >> 2); } void StopSubAllocator() { if ( SubAllocatorSize ) { BigFree(HeapStart); SubAllocatorSize = 0; HeapStart = 0; } } bool StartSubAllocator(UInt32 size) { if (SubAllocatorSize == size) return true; StopSubAllocator(); if ((HeapStart = (Byte *)::BigAlloc(size)) == 0) return false; SubAllocatorSize = size; return true; } void InitSubAllocator() { int i, k; memset(FreeList, 0, sizeof(FreeList)); HiUnit = (pText = HeapStart) + SubAllocatorSize; UINT Diff = UNIT_SIZE * (SubAllocatorSize / 8 / UNIT_SIZE * 7); LoUnit = UnitsStart = HiUnit - Diff; for (i = 0, k=1; i < N1 ; i++, k += 1) Indx2Units[i]=k; for (k++; i < N1 + N2 ;i++, k += 2) Indx2Units[i]=k; for (k++; i < N1 + N2 + N3 ;i++,k += 3) Indx2Units[i]=k; for (k++; i < N1 + N2 + N3 + N4; i++, k += 4) Indx2Units[i]=k; for (GlueCount = k = i = 0; k < 128; k++) { i += (Indx2Units[i] < k+1); Units2Indx[k]=i; } } void GlueFreeBlocks() { MEM_BLK s0, *p, *p1; int i, k, sz; if (LoUnit != HiUnit) *LoUnit=0; for (i = 0, s0.Next = s0.Prev = &s0; i < N_INDEXES; i++) while ( FreeList[i].Next ) { p = (MEM_BLK*) RemoveNode(i); p->InsertAt(&s0); p->Stamp = 0xFFFF; p->NU = Indx2Units[i]; } for (p=s0.Next; p != &s0; p =p->Next) while ((p1 = p + p->NU)->Stamp == 0xFFFF && int(p->NU) + p1->NU < 0x10000) { p1->Remove(); p->NU += p1->NU; } while ((p=s0.Next) != &s0) { for (p->Remove(), sz=p->NU; sz > 128; sz -= 128, p += 128) InsertNode(p, N_INDEXES - 1); if (Indx2Units[i = Units2Indx[sz-1]] != sz) { k = sz-Indx2Units[--i]; InsertNode(p + (sz - k), k - 1); } InsertNode(p,i); } } void* AllocUnitsRare(int indx) { if ( !GlueCount ) { GlueCount = 255; GlueFreeBlocks(); if (FreeList[indx].Next) return RemoveNode(indx); } int i = indx; do { if (++i == N_INDEXES) { GlueCount--; i = U2B(Indx2Units[indx]); return (UnitsStart - pText > i) ? (UnitsStart -= i) : (NULL); } } while (!FreeList[i].Next); void* RetVal = RemoveNode(i); SplitBlock(RetVal, i, indx); return RetVal; } void* AllocUnits(int NU) { int indx = Units2Indx[NU - 1]; if (FreeList[indx].Next) return RemoveNode(indx); void* RetVal = LoUnit; LoUnit += U2B(Indx2Units[indx]); if (LoUnit <= HiUnit) return RetVal; LoUnit -= U2B(Indx2Units[indx]); return AllocUnitsRare(indx); } void* AllocContext() { if (HiUnit != LoUnit) return (HiUnit -= UNIT_SIZE); if (FreeList->Next) return RemoveNode(0); return AllocUnitsRare(0); } void* ExpandUnits(void* oldPtr, int oldNU) { int i0=Units2Indx[oldNU - 1], i1=Units2Indx[oldNU - 1 + 1]; if (i0 == i1) return oldPtr; void* ptr = AllocUnits(oldNU + 1); if (ptr) { memcpy(ptr, oldPtr, U2B(oldNU)); InsertNode(oldPtr, i0); } return ptr; } void* ShrinkUnits(void* oldPtr, int oldNU, int newNU) { int i0 = Units2Indx[oldNU - 1], i1 = Units2Indx[newNU - 1]; if (i0 == i1) return oldPtr; if ( FreeList[i1].Next ) { void* ptr = RemoveNode(i1); memcpy(ptr, oldPtr, U2B(newNU)); InsertNode(oldPtr,i0); return ptr; } else { SplitBlock(oldPtr, i0, i1); return oldPtr; } } void FreeUnits(void* ptr, int oldNU) { InsertNode(ptr, Units2Indx[oldNU - 1]); } }; #endif
/* * (C) Copyright 2004-2009 * Texas Instruments, <www.ti.com> * Richard Woodruff <r-woodruff2@ti.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 * version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <common.h> #include <io.h> #include <sizes.h> #include <mach/omap4-mux.h> #include <mach/omap4-silicon.h> #include <mach/omap4-clock.h> #include <mach/syslib.h> #include <asm/barebox-arm.h> #include <asm/barebox-arm-head.h> #define TPS62361_VSEL0_GPIO 7 void set_muxconf_regs(void); static const struct ddr_regs ddr_regs_mt42L64M64_25_400_mhz = { .tim1 = 0x0EEB0662, .tim2 = 0x20370DD2, .tim3 = 0x00BFC33F, .phy_ctrl_1 = 0x849FF408, .ref_ctrl = 0x00000618, .config_init = 0x80001AB1, .config_final = 0x80001AB1, .zq_config = 0xd0093215, .mr1 = 0x83, .mr2 = 0x4 }; static noinline void pcaaxl2_init_lowlevel(void) { struct dpll_param core = OMAP4_CORE_DPLL_PARAM_19M2_DDR400; struct dpll_param mpu44xx = OMAP4_MPU_DPLL_PARAM_19M2_MPU1000; struct dpll_param mpu4460 = OMAP4_MPU_DPLL_PARAM_19M2_MPU920; struct dpll_param iva = OMAP4_IVA_DPLL_PARAM_19M2; struct dpll_param per = OMAP4_PER_DPLL_PARAM_19M2; struct dpll_param abe = OMAP4_ABE_DPLL_PARAM_19M2; struct dpll_param usb = OMAP4_USB_DPLL_PARAM_19M2; unsigned int rev = omap4_revision(); set_muxconf_regs(); omap4_ddr_init(&ddr_regs_mt42L64M64_25_400_mhz, &core); if (rev < OMAP4460_ES1_0) omap4430_scale_vcores(); else omap4460_scale_vcores(TPS62361_VSEL0_GPIO, 1320); writel(CM_SYS_CLKSEL_19M2, CM_SYS_CLKSEL); /* Configure all DPLL's at 100% OPP */ if (rev < OMAP4460_ES1_0) omap4_configure_mpu_dpll(&mpu44xx); else omap4_configure_mpu_dpll(&mpu4460); omap4_configure_iva_dpll(&iva); omap4_configure_per_dpll(&per); omap4_configure_abe_dpll(&abe); omap4_configure_usb_dpll(&usb); /* Enable all clocks */ omap4_enable_all_clocks(); sr32(0x4A30a31C, 8, 1, 0x1); /* enable software ioreq */ sr32(0x4A30a31C, 1, 2, 0x0); /* set for sys_clk (19.2MHz) */ sr32(0x4A30a31C, 16, 4, 0x0); /* set divisor to 1 */ sr32(0x4A30a110, 0, 1, 0x1); /* set the clock source to active */ sr32(0x4A30a110, 2, 2, 0x3); /* enable clocks */ } void barebox_arm_reset_vector(void) { arm_cpu_lowlevel_init(); if (get_pc() > 0x80000000) goto out; arm_setup_stack(0x4030d000); pcaaxl2_init_lowlevel(); out: barebox_arm_entry(0x80000000, SZ_512M, 0); }
/* * linux/include/asm-arm/arch-s3c2400/mz_dubug_ll.h * * Copyright (C) 2001 MIZI Research, 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 Place, Suite 330, Boston, MA 02111-1307 USA */ /* * Author : Nandy Lyu <nandy@mizi.com> * Date : 13 December 2001 * * For Low Level Debug */ /* * The following code assumes the serial port has already been * initialized by the bootloader. We use only UART1 on S3C24xx */ #define UART_UTRSTAT (*(volatile unsigned long *)0xf0000010) #define UART_UTXH (*(volatile unsigned long *)0xf0000020) #define UTRSTAT_TX_EMPTY (1 << 2) static inline void puts(const char *s) { while (*s) { while (!(UART_UTRSTAT & UTRSTAT_TX_EMPTY)); UART_UTXH = *s; if (*s == '\n') { while (!(UART_UTRSTAT & UTRSTAT_TX_EMPTY)); UART_UTXH = '\r'; } s++; } while (!(UART_UTRSTAT & UTRSTAT_TX_EMPTY)); } #define LED1 (1 << 12) #define LED2 (1 << 13) #define LED3 (1 << 14) #define LED4 (1 << 15) static inline void s3c2400_leds(unsigned long what, unsigned long how) { unsigned long mmu; volatile unsigned long *base; __asm__("mrc p15, 0, %0, c1, c0, 0\n" : "=r" (mmu)); mmu &= 0x1; if (mmu) base = (unsigned long *)(0xf5600018); else base = (unsigned long *)(0x15600018); if (how == 1) { /* LED on */ *base &= ~(what); } else if (how == 0) { *base |= what; } else { ; /* error */ } } static void inline s3c2410_go_zero(void) { __asm__("mov r0, #0x0c000000\n add r0, r0, #0x8000\n mov pc, r0\n"); } #ifdef CONFIG_S3C2400_GAMEPARK #define PHONEBTN_LED_CON (1 << 10) #define PHONEBTN_LED_ON (1 << 5) /* delay between led on/off */ #define PHONEBTN_LED_DELAY_ONOFF 10 /* 100 ms */ #define PHONEBTN_LED_DELAY_END 30 /* 300 ms */ /* Note: the unit of parameter 'tenms' is 10 ms */ static inline void gamepark_delay(int tenms) { unsigned long j = jiffies + tenms * (HZ/100); while (jiffies < j); } /* Note: the parameter 'count' means how many times the led is on/off. */ static inline void gamepark_led(int count) { int i; PDCON |= PHONEBTN_LED_CON; for (i = 0; i < count; i++) { if (i != 0) gamepark_delay(PHONEBTN_LED_DELAY_ONOFF); PDDAT |= PHONEBTN_LED_ON; gamepark_delay(PHONEBTN_LED_DELAY_ONOFF); PDDAT &= ~(PHONEBTN_LED_ON); } gamepark_delay(PHONEBTN_LED_DELAY_END); } #endif /* CONFIG_S3C2400_GAMEPARK */
/* * Copyright (c) 1995 Danny Gasparovski. * * Please read the file COPYRIGHT for the * terms and conditions of the copyright. */ #define PRN_STDERR 1 #define PRN_SPRINTF 2 extern FILE *dfd; extern FILE *lfd; extern int dostats; extern int slirp_debug; #define DBG_CALL 0x1 #define DBG_MISC 0x2 #define DBG_ERROR 0x4 #define DEBUG_DEFAULT DBG_CALL|DBG_MISC|DBG_ERROR #ifdef SLIRP_DEBUG #define DEBUG_CALL(x) if (slirp_debug & DBG_CALL) { fprintf(dfd, "%s...\n", x); fflush(dfd); } #define DEBUG_ARG(x, y) if (slirp_debug & DBG_CALL) { fputc(' ', dfd); fprintf(dfd, x, y); fputc('\n', dfd); fflush(dfd); } #define DEBUG_ARGS(x) if (slirp_debug & DBG_CALL) { fprintf x ; fflush(dfd); } #define DEBUG_MISC(x) if (slirp_debug & DBG_MISC) { fprintf x ; fflush(dfd); } #define DEBUG_ERROR(x) if (slirp_debug & DBG_ERROR) {fprintf x ; fflush(dfd); } #else #define DEBUG_CALL(x) #define DEBUG_ARG(x, y) #define DEBUG_ARGS(x) #define DEBUG_MISC(x) #define DEBUG_ERROR(x) #endif void debug_init _P((char *, int)); //void ttystats _P((struct ttys *)); void allttystats _P((void)); void ipstats _P((void)); void vjstats _P((void)); void tcpstats _P((void)); void udpstats _P((void)); void icmpstats _P((void)); void mbufstats _P((void)); void sockstats _P((void)); void slirp_exit _P((int));
/* -*- mode: C -*- */ /* IGraph library. Copyright (C) 2006-2012 Gabor Csardi <csardi.gabor@gmail.com> 334 Harvard st, Cambridge MA, 02139 USA 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 <igraph.h> #include <stdlib.h> int print_vector(igraph_vector_t *v) { long int i, n=igraph_vector_size(v); for (i=0; i<n; i++) { printf(" %li", (long int) VECTOR(*v)[i]); } printf("\n"); } void warning_handler_ignore(const char* reason,const char* file,int line,int e) { } int main() { igraph_t g; igraph_vector_ptr_t result; long int i, j, n; igraph_integer_t alpha; const int params[] = {4, -1, 2, 2, 0, 0, -1, -1}; igraph_set_warning_handler(warning_handler_ignore); igraph_vector_ptr_init(&result, 0); igraph_tree(&g, 5, 2, IGRAPH_TREE_OUT); for (j=0; j<sizeof(params)/(2*sizeof(params[0])); j++) { if (params[2*j+1] != 0) { igraph_independent_vertex_sets(&g, &result, params[2*j], params[2*j+1]); } else { igraph_largest_independent_vertex_sets(&g, &result); } n = igraph_vector_ptr_size(&result); printf("%ld independent sets found\n", (long)n); for (i=0; i<n; i++) { igraph_vector_t* v; v=igraph_vector_ptr_e(&result,i); print_vector((igraph_vector_t*)v); igraph_vector_destroy(v); free(v); } } igraph_destroy(&g); igraph_tree(&g, 10, 2, IGRAPH_TREE_OUT); igraph_maximal_independent_vertex_sets(&g, &result); n = igraph_vector_ptr_size(&result); printf("%ld maximal independent sets found\n", (long)n); for (i=0; i<n; i++) { igraph_vector_t* v; v=igraph_vector_ptr_e(&result,i); print_vector((igraph_vector_t*)v); igraph_vector_destroy(v); free(v); } igraph_vector_ptr_destroy(&result); igraph_independence_number(&g, &alpha); printf("alpha=%ld\n", (long)alpha); igraph_destroy(&g); return 0; }
/****************************************************************************** * bwm-ng curses stuff * * * * Copyright (C) 2004 Volker Gropp (vgropp@pefra.de) * * * * for more info read README. * * * * 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 "global_vars.h" #include "curses_tools.h" #ifdef HAVE_CURSES /* handle key input by user in gui (curses) mode */ void handle_gui_input(char c) { switch (c) { /* lets check for known keys */ case '+': /* increase delay */ delay+=100; timeout(delay); break; case '-': /* decrease delay */ if (delay>100) { delay+=-100; timeout(delay); } break; case 'a': case 'A': show_all_if++; if (show_all_if>2) { show_all_if=0; clean_down_ifaces(); } if (iface_list==NULL && show_all_if==1) show_all_if=2; /* get stats so all values are uptodate */ get_iface_stats(0); break; case 's': case 'S': sumhidden=!sumhidden; /* get stats so all values are uptodate */ get_iface_stats(0); break; case 'n': case 'N': do { input_method=input_method<<1; if (input_method>INPUT_MASK) input_method=1; } while (!(input_method & INPUT_MASK)); /* switched input, reset iface stats */ free(if_stats); if_stats=NULL; if_count=0; memset(&if_stats_total,0,(size_t)sizeof(t_iface_stats)); break; case 'q': case 'Q': /* we are asked to exit */ deinit(0, NULL); break; case 'd': case 'D': case 'k': case 'K': if (output_method==CURSES2_OUT) /* cycle through interfaces */ show_only_if++; else /* switch kilobyte/autoassign */ dynamic=!dynamic; break; case 'u': case 'U': if (output_method==CURSES_OUT) { if (output_unit<(!net_input_method(input_method) ? (input_method==LIBSTATDISK_IN ? 2 : 3) : 4)) output_unit++; else output_unit=1; }; break; #if EXTENDED_STATS case 't': case 'T': if (output_type<TYPE_OUT_MAX) output_type++; else output_type=1; if (output_method==CURSES2_OUT) max_rt=32; break; #endif case 'h': print_online_help(); break; } } int init_curses(void) { struct winsize size; short fg,bg; mywin=initscr(); if (mywin!=NULL && !(output_method==CURSES2_OUT && !has_colors() && !can_change_color())) { cbreak(); noecho(); nonl(); #if HAVE_CURS_SET curs_set(0); #endif timeout(delay); /* set the timeout of getch to delay in ms) */ if (output_method==CURSES2_OUT) { start_color(); pair_content(0,&fg,&bg); init_pair(1,fg,COLOR_GREEN); init_pair(2,fg,COLOR_RED); if (ioctl(fileno(stdout), TIOCGWINSZ, &size) == 0) { cols=size.ws_col; rows=size.ws_row; } } return 1; } else { printf("curses newterm() failed: %s\n",strerror(errno)); sleep(1); output_method=PLAIN_OUT; return 0; } } void sigwinch(int sig) { struct winsize size; if (ioctl(fileno(stdout), TIOCGWINSZ, &size) == 0) { if (endwin()==ERR) deinit(1, "failed to deinit curses: %s\n",strerror(errno)); init_curses(); } } #endif
/* Broadcom B43legacy wireless driver Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>, Stefano Brivio <stefano.brivio@polimi.it> Michael Buesch <m@bues.ch> Danny van Dyk <kugelfang@gentoo.org> Andreas Jaggi <andreas.jaggi@waterwave.ch> Some parts of the code in this file are derived from the ipw2200 driver Copyright(c) 2003 - 2004 Intel Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef B43legacy_RADIO_H_ #define B43legacy_RADIO_H_ #include "b43legacy.h" #define B43legacy_RADIO_DEFAULT_CHANNEL_BG 6 /* Force antenna 0. */ #define B43legacy_RADIO_TXANTENNA_0 0 /* Force antenna 1. */ #define B43legacy_RADIO_TXANTENNA_1 1 /* Use the RX antenna, that was selected for the most recently * received good PLCP header. */ #define B43legacy_RADIO_TXANTENNA_LASTPLCP 3 #define B43legacy_RADIO_TXANTENNA_DEFAULT B43legacy_RADIO_TXANTENNA_LASTPLCP #define B43legacy_RADIO_INTERFMODE_NONE 0 #define B43legacy_RADIO_INTERFMODE_NONWLAN 1 #define B43legacy_RADIO_INTERFMODE_MANUALWLAN 2 #define B43legacy_RADIO_INTERFMODE_AUTOWLAN 3 void b43legacy_radio_lock(struct b43legacy_wldev *dev); void b43legacy_radio_unlock(struct b43legacy_wldev *dev); u16 b43legacy_radio_read16(struct b43legacy_wldev *dev, u16 offset); void b43legacy_radio_write16(struct b43legacy_wldev *dev, u16 offset, u16 val); u16 b43legacy_radio_init2050(struct b43legacy_wldev *dev); void b43legacy_radio_turn_on(struct b43legacy_wldev *dev); void b43legacy_radio_turn_off(struct b43legacy_wldev *dev, bool force); int b43legacy_radio_selectchannel(struct b43legacy_wldev *dev, u8 channel, int synthetic_pu_workaround); void b43legacy_radio_set_txpower_a(struct b43legacy_wldev *dev, u16 txpower); void b43legacy_radio_set_txpower_bg(struct b43legacy_wldev *dev, u16 baseband_attenuation, u16 attenuation, u16 txpower); u16 b43legacy_default_baseband_attenuation(struct b43legacy_wldev *dev); u16 b43legacy_default_radio_attenuation(struct b43legacy_wldev *dev); u16 b43legacy_default_txctl1(struct b43legacy_wldev *dev); void b43legacy_radio_set_txantenna(struct b43legacy_wldev *dev, u32 val); void b43legacy_radio_clear_tssi(struct b43legacy_wldev *dev); u8 b43legacy_radio_aci_detect(struct b43legacy_wldev *dev, u8 channel); u8 b43legacy_radio_aci_scan(struct b43legacy_wldev *dev); int b43legacy_radio_set_interference_mitigation(struct b43legacy_wldev *dev, int mode); void b43legacy_calc_nrssi_slope(struct b43legacy_wldev *dev); void b43legacy_calc_nrssi_threshold(struct b43legacy_wldev *dev); s16 b43legacy_nrssi_hw_read(struct b43legacy_wldev *dev, u16 offset); void b43legacy_nrssi_hw_write(struct b43legacy_wldev *dev, u16 offset, s16 val); void b43legacy_nrssi_hw_update(struct b43legacy_wldev *dev, u16 val); void b43legacy_nrssi_mem_update(struct b43legacy_wldev *dev); void b43legacy_radio_set_tx_iq(struct b43legacy_wldev *dev); u16 b43legacy_radio_calibrationvalue(struct b43legacy_wldev *dev); #endif /* B43legacy_RADIO_H_ */
/* delete.h - CKS Key Deletion Application main 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 */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "libpq-fe.h" #include "common.h" #include "cks_config.h" #include "retrieve.h" #include "keys.h" #include "cgi.h" #include "db.h"
/* * LEDs driver for Dialog Semiconductor DA9030/DA9034 * * Copyright (C) 2008 Compulab, Ltd. * Mike Rapoport <mike@compulab.co.il> * * Copyright (C) 2006-2008 Marvell International Ltd. * Eric Miao <eric.miao@marvell.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/module.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> #include <linux/leds.h> #include <linux/workqueue.h> #include <linux/mfd/da903x.h> #include <linux/slab.h> #define DA9030_LED1_CONTROL 0x20 #define DA9030_LED2_CONTROL 0x21 #define DA9030_LED3_CONTROL 0x22 #define DA9030_LED4_CONTROL 0x23 #define DA9030_LEDPC_CONTROL 0x24 #define DA9030_MISC_CONTROL_A 0x26 /* Vibrator Control */ #define DA9034_LED1_CONTROL 0x35 #define DA9034_LED2_CONTROL 0x36 #define DA9034_VIBRA 0x40 struct da903x_led { struct led_classdev cdev; struct work_struct work; struct device *master; enum led_brightness new_brightness; int id; int flags; }; #define DA9030_LED_OFFSET(id) ((id) - DA9030_ID_LED_1) #define DA9034_LED_OFFSET(id) ((id) - DA9034_ID_LED_1) static void da903x_led_work(struct work_struct *work) { struct da903x_led *led = container_of(work, struct da903x_led, work); uint8_t val; int offset; switch (led->id) { case DA9030_ID_LED_1: case DA9030_ID_LED_2: case DA9030_ID_LED_3: case DA9030_ID_LED_4: case DA9030_ID_LED_PC: offset = DA9030_LED_OFFSET(led->id); val = led->flags & ~0x87; val |= (led->new_brightness) ? 0x80 : 0; /* EN bit */ val |= (0x7 - (led->new_brightness >> 5)) & 0x7; /* PWM<2:0> */ da903x_write(led->master, DA9030_LED1_CONTROL + offset, val); break; case DA9030_ID_VIBRA: val = led->flags & ~0x80; val |= (led->new_brightness) ? 0x80 : 0; /* EN bit */ da903x_write(led->master, DA9030_MISC_CONTROL_A, val); break; case DA9034_ID_LED_1: case DA9034_ID_LED_2: offset = DA9034_LED_OFFSET(led->id); val = (led->new_brightness * 0x5f / LED_FULL) & 0x7f; val |= (led->flags & DA9034_LED_RAMP) ? 0x80 : 0; da903x_write(led->master, DA9034_LED1_CONTROL + offset, val); break; case DA9034_ID_VIBRA: val = led->new_brightness & 0xfe; da903x_write(led->master, DA9034_VIBRA, val); break; } } static void da903x_led_set(struct led_classdev *led_cdev, enum led_brightness value) { struct da903x_led *led; led = container_of(led_cdev, struct da903x_led, cdev); led->new_brightness = value; schedule_work(&led->work); } static int __devinit da903x_led_probe(struct platform_device *pdev) { struct led_info *pdata = pdev->dev.platform_data; struct da903x_led *led; int id, ret; if (pdata == NULL) return 0; id = pdev->id; if (!((id >= DA9030_ID_LED_1 && id <= DA9030_ID_VIBRA) || (id >= DA9034_ID_LED_1 && id <= DA9034_ID_VIBRA))) { dev_err(&pdev->dev, "invalid LED ID (%d) specified\n", id); return -EINVAL; } led = kzalloc(sizeof(struct da903x_led), GFP_KERNEL); if (led == NULL) { dev_err(&pdev->dev, "failed to alloc memory for LED%d\n", id); return -ENOMEM; } led->cdev.name = pdata->name; led->cdev.default_trigger = pdata->default_trigger; led->cdev.brightness_set = da903x_led_set; led->cdev.brightness = LED_OFF; led->id = id; led->flags = pdata->flags; led->master = pdev->dev.parent; led->new_brightness = LED_OFF; INIT_WORK(&led->work, da903x_led_work); ret = led_classdev_register(led->master, &led->cdev); if (ret) { dev_err(&pdev->dev, "failed to register LED %d\n", id); goto err; } platform_set_drvdata(pdev, led); return 0; err: kfree(led); return ret; } static int __devexit da903x_led_remove(struct platform_device *pdev) { struct da903x_led *led = platform_get_drvdata(pdev); led_classdev_unregister(&led->cdev); kfree(led); return 0; } static struct platform_driver da903x_led_driver = { .driver = { .name = "da903x-led", .owner = THIS_MODULE, }, .probe = da903x_led_probe, .remove = __devexit_p(da903x_led_remove), }; static int __init da903x_led_init(void) { return platform_driver_register(&da903x_led_driver); } module_init(da903x_led_init); static void __exit da903x_led_exit(void) { platform_driver_unregister(&da903x_led_driver); } module_exit(da903x_led_exit); MODULE_DESCRIPTION("LEDs driver for Dialog Semiconductor DA9030/DA9034"); MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>" "Mike Rapoport <mike@compulab.co.il>"); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:da903x-led");
#ifndef _RENDERDEFAULT_H #define _RENDERDEFAULT_H #include "renderinterface.h" class RenderDefault : public QObject, public RenderInterface { Q_OBJECT Q_INTERFACES(RenderInterface) public: void paintGL(); }; #endif
/* * Copyright (C) 2005-2009 Martin Willi * Copyright (C) 2005 Jan Hutter * Hochschule fuer Technik Rapperswil * * 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 <http://www.fsf.org/copyleft/gpl.txt>. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. */ #include "psk_authenticator.h" #include <daemon.h> #include <encoding/payloads/auth_payload.h> typedef struct private_psk_authenticator_t private_psk_authenticator_t; /** * Private data of an psk_authenticator_t object. */ struct private_psk_authenticator_t { /** * Public authenticator_t interface. */ psk_authenticator_t public; /** * Assigned IKE_SA */ ike_sa_t *ike_sa; /** * nonce to include in AUTH calculation */ chunk_t nonce; /** * IKE_SA_INIT message data to include in AUTH calculation */ chunk_t ike_sa_init; }; /* * Implementation of authenticator_t.build for builder */ static status_t build(private_psk_authenticator_t *this, message_t *message) { identification_t *my_id, *other_id; auth_payload_t *auth_payload; shared_key_t *key; chunk_t auth_data; keymat_t *keymat; keymat = this->ike_sa->get_keymat(this->ike_sa); my_id = this->ike_sa->get_my_id(this->ike_sa); other_id = this->ike_sa->get_other_id(this->ike_sa); DBG1(DBG_IKE, "authentication of '%Y' (myself) with %N", my_id, auth_method_names, AUTH_PSK); key = charon->credentials->get_shared(charon->credentials, SHARED_IKE, my_id, other_id); if (key == NULL) { DBG1(DBG_IKE, "no shared key found for '%Y' - '%Y'", my_id, other_id); return NOT_FOUND; } auth_data = keymat->get_psk_sig(keymat, FALSE, this->ike_sa_init, this->nonce, key->get_key(key), my_id); key->destroy(key); DBG2(DBG_IKE, "successfully created shared key MAC"); auth_payload = auth_payload_create(); auth_payload->set_auth_method(auth_payload, AUTH_PSK); auth_payload->set_data(auth_payload, auth_data); chunk_free(&auth_data); message->add_payload(message, (payload_t*)auth_payload); return SUCCESS; } /** * Implementation of authenticator_t.process for verifier */ static status_t process(private_psk_authenticator_t *this, message_t *message) { chunk_t auth_data, recv_auth_data; identification_t *my_id, *other_id; auth_payload_t *auth_payload; auth_cfg_t *auth; shared_key_t *key; enumerator_t *enumerator; bool authenticated = FALSE; int keys_found = 0; keymat_t *keymat; auth_payload = (auth_payload_t*)message->get_payload(message, AUTHENTICATION); if (!auth_payload) { return FAILED; } keymat = this->ike_sa->get_keymat(this->ike_sa); recv_auth_data = auth_payload->get_data(auth_payload); my_id = this->ike_sa->get_my_id(this->ike_sa); other_id = this->ike_sa->get_other_id(this->ike_sa); enumerator = charon->credentials->create_shared_enumerator( charon->credentials, SHARED_IKE, my_id, other_id); while (!authenticated && enumerator->enumerate(enumerator, &key, NULL, NULL)) { keys_found++; auth_data = keymat->get_psk_sig(keymat, TRUE, this->ike_sa_init, this->nonce, key->get_key(key), other_id); if (auth_data.len && chunk_equals(auth_data, recv_auth_data)) { DBG1(DBG_IKE, "authentication of '%Y' with %N successful", other_id, auth_method_names, AUTH_PSK); authenticated = TRUE; } chunk_free(&auth_data); } enumerator->destroy(enumerator); if (!authenticated) { if (keys_found == 0) { DBG1(DBG_IKE, "no shared key found for '%Y' - '%Y'", my_id, other_id); return NOT_FOUND; } DBG1(DBG_IKE, "tried %d shared key%s for '%Y' - '%Y', but MAC mismatched", keys_found, keys_found == 1 ? "" : "s", my_id, other_id); return FAILED; } auth = this->ike_sa->get_auth_cfg(this->ike_sa, FALSE); auth->add(auth, AUTH_RULE_AUTH_CLASS, AUTH_CLASS_PSK); return SUCCESS; } /** * Implementation of authenticator_t.process for builder * Implementation of authenticator_t.build for verifier */ static status_t return_failed() { return FAILED; } /** * Implementation of authenticator_t.destroy. */ static void destroy(private_psk_authenticator_t *this) { free(this); } /* * Described in header. */ psk_authenticator_t *psk_authenticator_create_builder(ike_sa_t *ike_sa, chunk_t received_nonce, chunk_t sent_init) { private_psk_authenticator_t *this = malloc_thing(private_psk_authenticator_t); this->public.authenticator.build = (status_t(*)(authenticator_t*, message_t *message))build; this->public.authenticator.process = (status_t(*)(authenticator_t*, message_t *message))return_failed; this->public.authenticator.is_mutual = (bool(*)(authenticator_t*))return_false; this->public.authenticator.destroy = (void(*)(authenticator_t*))destroy; this->ike_sa = ike_sa; this->ike_sa_init = sent_init; this->nonce = received_nonce; return &this->public; } /* * Described in header. */ psk_authenticator_t *psk_authenticator_create_verifier(ike_sa_t *ike_sa, chunk_t sent_nonce, chunk_t received_init) { private_psk_authenticator_t *this = malloc_thing(private_psk_authenticator_t); this->public.authenticator.build = (status_t(*)(authenticator_t*, message_t *messageh))return_failed; this->public.authenticator.process = (status_t(*)(authenticator_t*, message_t *message))process; this->public.authenticator.is_mutual = (bool(*)(authenticator_t*))return_false; this->public.authenticator.destroy = (void(*)(authenticator_t*))destroy; this->ike_sa = ike_sa; this->ike_sa_init = received_init; this->nonce = sent_nonce; return &this->public; }
#include <linux/kernel.h> #include <linux/module.h> #include <linux/delay.h> #include <linux/gpio.h> #include <linux/io.h> #include <asm/proc-fns.h> #include <mach/regs-ost.h> #include <mach/reset.h> unsigned int reset_status; EXPORT_SYMBOL(reset_status); static void do_hw_reset(void); static int reset_gpio = -1; int init_gpio_reset(int gpio, int output, int level) { int rc; rc = gpio_request(gpio, "reset generator"); if (rc) { printk(KERN_ERR "Can't request reset_gpio\n"); goto out; } if (output) rc = gpio_direction_output(gpio, level); else rc = gpio_direction_input(gpio); if (rc) { printk(KERN_ERR "Can't configure reset_gpio\n"); gpio_free(gpio); goto out; } out: if (!rc) reset_gpio = gpio; return rc; } static void do_gpio_reset(void) { BUG_ON(reset_gpio == -1); gpio_direction_output(reset_gpio, 0); mdelay(2); gpio_set_value(reset_gpio, 1); mdelay(2); gpio_set_value(reset_gpio, 0); mdelay(10); WARN_ON(1); do_hw_reset(); } static void do_hw_reset(void) { OWER = OWER_WME; OSSR = OSSR_M3; OSMR3 = OSCR + 368640; } void arch_reset(char mode, const char *cmd) { clear_reset_status(RESET_STATUS_ALL); switch (mode) { case 's': cpu_reset(0); break; case 'g': do_gpio_reset(); break; case 'h': default: do_hw_reset(); break; } }
/* * Maximus Version 3.02 * Copyright 1989, 2002 by Lanius Corporation. 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 * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* $Id: maxshow.c,v 1.2 2004/01/22 08:04:27 wmcbrine Exp $ */ #include <stdlib.h> #include <string.h> #define INCL_DOS #include "pos2.h" #include "max.h" #include "mcp.h" static char buf[512]; int main(int argc, char *argv[]) { struct _cdat *pcd; HPIPE hp; USHORT rc; if (argc < 3) { printf("usage: maxshow <pipe_name> <node_num> <.bbs_filespec>\n"); exit(1); } if ((rc=McpOpenPipe(argv[1], &hp)) != 0) { printf("SYS%04d: McpOpenPipe\n", rc); return 1; } pcd=(struct _cdat *)buf; /* Fill out the Max-to-Max messag header */ pcd->tid=0; /* as a standalone program, we have no task num */ pcd->type=CMSG_DISPLAY; pcd->len=strlen(argv[3])+1; pcd->dest_tid=atoi(argv[2]); /* Add in the message data */ strcpy((char *)(pcd+1), argv[3]); if ((rc=McpSendMsg(hp, PMSG_MAX_SEND_MSG, buf, sizeof(*pcd) + pcd->len)) != 0) { printf("SYS%04d: McpSendMsg\n", rc); return 1; } McpClosePipe(hp); printf("Told node %d to display filename '%s'.\n", pcd->dest_tid, (char *)(pcd+1)); return 0; }
#ifndef __WAL_LINUX_SCAN_H__ #define __WAL_LINUX_SCAN_H__ #ifdef __cplusplus #if __cplusplus extern "C" { #endif #endif /***************************************************************************** 1 ÆäËûÍ·Îļþ°üº¬ *****************************************************************************/ #include "oal_ext_if.h" #include "frw_ext_if.h" #include "hmac_device.h" #include "wal_linux_rx_rsp.h" #undef THIS_FILE_ID #define THIS_FILE_ID OAM_FILE_ID_WAL_LINUX_SCAN_H /***************************************************************************** 2 ºê¶¨Òå *****************************************************************************/ /***************************************************************************** 3 ö¾Ù¶¨Òå *****************************************************************************/ /***************************************************************************** 4 È«¾Ö±äÁ¿ÉùÃ÷ *****************************************************************************/ /***************************************************************************** 5 ÏûϢͷ¶¨Òå *****************************************************************************/ /***************************************************************************** 6 ÏûÏ¢¶¨Òå *****************************************************************************/ /***************************************************************************** 7 STRUCT¶¨Òå *****************************************************************************/ /***************************************************************************** 8 UNION¶¨Òå *****************************************************************************/ /***************************************************************************** 9 OTHERS¶¨Òå *****************************************************************************/ /***************************************************************************** 10 º¯ÊýÉùÃ÷ *****************************************************************************/ extern oal_void wal_inform_all_bss(oal_wiphy_stru *pst_wiphy, hmac_bss_mgmt_stru *pst_bss_mgmt, oal_uint8 uc_vap_id); extern oal_uint32 wal_scan_work_func(hmac_scan_stru *pst_scan_mgmt, oal_net_device_stru *pst_netdev, oal_cfg80211_scan_request_stru *pst_request); extern oal_int32 wal_force_scan_complete(oal_net_device_stru *pst_net_dev, oal_bool_enum en_is_aborted); #define IS_P2P_SCAN_REQ(pst_request) ((pst_request->n_ssids > 0) && (NULL != pst_request->ssids )\ && (pst_request->ssids[0].ssid_len == OAL_STRLEN("DIRECT-")) \ && (0 == oal_memcmp(pst_request->ssids[0].ssid, "DIRECT-", OAL_STRLEN("DIRECT-")))) oal_void wal_update_bss(oal_wiphy_stru *pst_wiphy, hmac_bss_mgmt_stru *pst_bss_mgmt, oal_uint8 *puc_bssid); #ifdef __cplusplus #if __cplusplus } #endif #endif #endif /* end of wal_linux_scan.h */
/* sd2snes - SD card based universal cartridge for the SNES Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net> AVR firmware portion Inspired by and based on code from sd2iec, written by Ingo Korb et al. See sdcard.c|h, config.h. FAT file system access based on code by ChaN, Jim Brain, Ingo Korb, see ff.c|h. 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 only. 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 fileops.c: simple file access functions */ #include "config.h" #include "uart.h" #include "ff.h" #include "fileops.h" #include "diskio.h" #include <string.h> int newcard; void file_init() { file_res=f_mount(&fatfs, "/", 1); newcard = 0; file_path[0] = '/'; file_path[1] = 0; } void file_open(const uint8_t* filename, BYTE flags) { file_res = f_open(&file_handle, (TCHAR*)filename, flags); file_block_off = sizeof(file_buf); file_block_max = sizeof(file_buf); file_status = file_res ? FILE_ERR : FILE_OK; printf("file_open (%s, %02x) = %d\n", filename, flags, file_res); } void file_close() { file_res = f_close(&file_handle); } void file_seek(uint32_t offset) { file_res = f_lseek(&file_handle, (DWORD)offset); } UINT file_read() { UINT bytes_read; file_res = f_read(&file_handle, file_buf, sizeof(file_buf), &bytes_read); return bytes_read; } UINT file_write(size_t len) { UINT bytes_written; file_res = f_write(&file_handle, file_buf, len, &bytes_written); if(bytes_written < len) { printf("wrote less than expected - card full?\n"); } return bytes_written; } UINT file_readblock(void* buf, uint32_t addr, uint16_t size) { UINT bytes_read; file_res = f_lseek(&file_handle, addr); if(file_handle.fptr != addr) { return 0; } file_res = f_read(&file_handle, buf, size, &bytes_read); return bytes_read; } UINT file_writeblock(void* buf, uint32_t addr, uint16_t size) { UINT bytes_written; file_res = f_lseek(&file_handle, addr); if(file_res) return 0; file_res = f_write(&file_handle, buf, size, &bytes_written); return bytes_written; } uint8_t file_getc() { if(file_block_off == file_block_max) { file_block_max = file_read(); if(file_block_max == 0) file_status = FILE_EOF; file_block_off = 0; } return file_buf[file_block_off++]; } void append_file_basename(char *dirbase, char *filename, char *extension, int num) { char *append = strrchr(filename, '/'); if(append == NULL) { append = filename; } else { append++; } strncat(dirbase, append, num-strlen(dirbase)); strcpy(strrchr(dirbase, (int)'.'), extension); } FRESULT check_or_create_folder(TCHAR *dir) { FRESULT res; FILINFO fno; /* we are not interested in the file name of the existing object so no extra LFN buffer needs to be allocated. */ fno.lfname = NULL; TCHAR buf[256]; TCHAR *ptr = buf; strncpy(buf, dir, sizeof(buf) - 1); buf[sizeof(buf) - 1] = '\0'; while(*(ptr++)) { if(*ptr == '/') { *ptr = 0; res = f_stat(buf, &fno); printf("checking folder %s... res=%d\n", buf, res); if(res != FR_OK) { res = f_mkdir(buf); printf("creating folder, res=%d\n", res); if(res != FR_OK) { printf("FATAL: could not create folder %s\n", buf); return res; } } else { if(!(fno.fattrib & AM_DIR)) { printf("FATAL: %s exists but is not a directory.\n", buf); return FR_NO_PATH; } } *ptr = '/'; } } return FR_OK; }
/* * adv7604 - Analog Devices ADV7604 video decoder driver * * Copyright 2012 Cisco Systems, Inc. and/or its affiliates. All rights reserved. * * This program is free software; you may 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. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ #ifndef _ADV7604_ #define _ADV7604_ #include <linux/types.h> /* Analog input muxing modes (AFE register 0x02, [2:0]) */ enum adv7604_ain_sel { ADV7604_AIN1_2_3_NC_SYNC_1_2 = 0, ADV7604_AIN4_5_6_NC_SYNC_2_1 = 1, ADV7604_AIN7_8_9_NC_SYNC_3_1 = 2, ADV7604_AIN10_11_12_NC_SYNC_4_1 = 3, ADV7604_AIN9_4_5_6_SYNC_2_1 = 4, }; /* Bus rotation and reordering (IO register 0x04, [7:5]) */ enum adv7604_op_ch_sel { ADV7604_OP_CH_SEL_GBR = 0, ADV7604_OP_CH_SEL_GRB = 1, ADV7604_OP_CH_SEL_BGR = 2, ADV7604_OP_CH_SEL_RGB = 3, ADV7604_OP_CH_SEL_BRG = 4, ADV7604_OP_CH_SEL_RBG = 5, }; /* Input Color Space (IO register 0x02, [7:4]) */ enum adv7604_inp_color_space { ADV7604_INP_COLOR_SPACE_LIM_RGB = 0, ADV7604_INP_COLOR_SPACE_FULL_RGB = 1, ADV7604_INP_COLOR_SPACE_LIM_YCbCr_601 = 2, ADV7604_INP_COLOR_SPACE_LIM_YCbCr_709 = 3, ADV7604_INP_COLOR_SPACE_XVYCC_601 = 4, ADV7604_INP_COLOR_SPACE_XVYCC_709 = 5, ADV7604_INP_COLOR_SPACE_FULL_YCbCr_601 = 6, ADV7604_INP_COLOR_SPACE_FULL_YCbCr_709 = 7, ADV7604_INP_COLOR_SPACE_AUTO = 0xf, }; /* Select output format (IO register 0x03, [7:0]) */ enum adv7604_op_format_sel { ADV7604_OP_FORMAT_SEL_SDR_ITU656_8 = 0x00, ADV7604_OP_FORMAT_SEL_SDR_ITU656_10 = 0x01, ADV7604_OP_FORMAT_SEL_SDR_ITU656_12_MODE0 = 0x02, ADV7604_OP_FORMAT_SEL_SDR_ITU656_12_MODE1 = 0x06, ADV7604_OP_FORMAT_SEL_SDR_ITU656_12_MODE2 = 0x0a, ADV7604_OP_FORMAT_SEL_DDR_422_8 = 0x20, ADV7604_OP_FORMAT_SEL_DDR_422_10 = 0x21, ADV7604_OP_FORMAT_SEL_DDR_422_12_MODE0 = 0x22, ADV7604_OP_FORMAT_SEL_DDR_422_12_MODE1 = 0x23, ADV7604_OP_FORMAT_SEL_DDR_422_12_MODE2 = 0x24, ADV7604_OP_FORMAT_SEL_SDR_444_24 = 0x40, ADV7604_OP_FORMAT_SEL_SDR_444_30 = 0x41, ADV7604_OP_FORMAT_SEL_SDR_444_36_MODE0 = 0x42, ADV7604_OP_FORMAT_SEL_DDR_444_24 = 0x60, ADV7604_OP_FORMAT_SEL_DDR_444_30 = 0x61, ADV7604_OP_FORMAT_SEL_DDR_444_36 = 0x62, ADV7604_OP_FORMAT_SEL_SDR_ITU656_16 = 0x80, ADV7604_OP_FORMAT_SEL_SDR_ITU656_20 = 0x81, ADV7604_OP_FORMAT_SEL_SDR_ITU656_24_MODE0 = 0x82, ADV7604_OP_FORMAT_SEL_SDR_ITU656_24_MODE1 = 0x86, ADV7604_OP_FORMAT_SEL_SDR_ITU656_24_MODE2 = 0x8a, }; enum adv7604_int1_config { ADV7604_INT1_CONFIG_OPEN_DRAIN, ADV7604_INT1_CONFIG_ACTIVE_LOW, ADV7604_INT1_CONFIG_ACTIVE_HIGH, ADV7604_INT1_CONFIG_DISABLED, }; /* Platform dependent definition */ struct adv7604_platform_data { /* connector - HDMI or DVI? */ unsigned connector_hdmi:1; /* DIS_PWRDNB: 1 if the PWRDNB pin is unused and unconnected */ unsigned disable_pwrdnb:1; /* DIS_CABLE_DET_RST: 1 if the 5V pins are unused and unconnected */ unsigned disable_cable_det_rst:1; /* Analog input muxing mode */ enum adv7604_ain_sel ain_sel; /* Bus rotation and reordering */ enum adv7604_op_ch_sel op_ch_sel; /* Select output format */ enum adv7604_op_format_sel op_format_sel; /* Configuration of the INT1 pin */ enum adv7604_int1_config int1_config; /* IO register 0x02 */ unsigned alt_gamma:1; unsigned op_656_range:1; unsigned rgb_out:1; unsigned alt_data_sat:1; /* IO register 0x05 */ unsigned blank_data:1; unsigned insert_av_codes:1; unsigned replicate_av_codes:1; unsigned invert_cbcr:1; /* IO register 0x30 */ unsigned output_bus_lsb_to_msb:1; /* Free run */ unsigned hdmi_free_run_mode; /* i2c addresses: 0 == use default */ u8 i2c_avlink; u8 i2c_cec; u8 i2c_infoframe; u8 i2c_esdp; u8 i2c_dpp; u8 i2c_afe; u8 i2c_repeater; u8 i2c_edid; u8 i2c_hdmi; u8 i2c_test; u8 i2c_cp; u8 i2c_vdp; }; /* * Mode of operation. * This is used as the input argument of the s_routing video op. */ enum adv7604_mode { ADV7604_MODE_COMP, ADV7604_MODE_GR, ADV7604_MODE_HDMI, }; #define V4L2_CID_ADV_RX_ANALOG_SAMPLING_PHASE (V4L2_CID_DV_CLASS_BASE + 0x1000) #define V4L2_CID_ADV_RX_FREE_RUN_COLOR_MANUAL (V4L2_CID_DV_CLASS_BASE + 0x1001) #define V4L2_CID_ADV_RX_FREE_RUN_COLOR (V4L2_CID_DV_CLASS_BASE + 0x1002) /* notify events */ #define ADV7604_HOTPLUG 1 #define ADV7604_FMT_CHANGE 2 #endif
/***************************************************************************** * wps service (private) * * Copyright (C) 2014, Broadcom Corporation * All Rights Reserved. * * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation; * the contents of this file may not be disclosed to third parties, copied * or duplicated in any form, in whole or in part, without the prior * written permission of Broadcom Corporation. ***************************************************************************** */ #if !defined(__wps_svcp_h__) #define __wps_svcp_h__ struct wps_svc_dat { struct bind_sk *eapol_sk, *wlss_sk; void *eapol_binding, *wlss_binding; #if defined(WPS_SVC_PRIVATE) struct wps_dat wps_dat; #endif /* defined(WPS_SVC_PRIVATE) */ }; #endif /* !defined(__wps_svcp_h__) */
#define MC_CCR00_VALUE 0x00000400 #define MC_CCR01_VALUE 0x00000000 #define MC_CCR02_VALUE 0x0200c351 #define MC_CCR03_VALUE 0x02020308 #define MC_CCR04_VALUE 0x020c0f02 #define MC_CCR05_VALUE 0x03020204 #define MC_CCR06_VALUE 0x0303445A #define MC_CCR07_VALUE 0x01010000 #define MC_CCR08_VALUE 0x00080404 #define MC_CCR09_VALUE 0x020000c8 #define MC_CCR10_VALUE 0x0500650a #define MC_CCR11_VALUE 0x01000000 #define MC_CCR12_VALUE 0x0798001b #define MC_CCR13_VALUE 0x00020000 #define MC_CCR14_VALUE 0x001d00c8 #define MC_CCR15_VALUE 0x01000000 #define MC_CCR16_VALUE 0x00000000 #define MC_CCR17_VALUE 0x00000000 #define MC_CCR18_VALUE 0x00000000 #define MC_CCR19_VALUE 0x00000202 #define MC_CCR20_VALUE 0x00000000 #define MC_CCR21_VALUE 0x00064200 #define MC_CCR22_VALUE 0x00000004 #define MC_CCR23_VALUE 0x00000000 #define MC_CCR24_VALUE 0x00040642 #define MC_CCR25_VALUE 0x00000000 #define MC_CCR26_VALUE 0x06420000 #define MC_CCR27_VALUE 0x00000004 #define MC_CCR28_VALUE 0x00000000 #define MC_CCR29_VALUE 0x00040642 #define MC_CCR30_VALUE 0x00000000 #define MC_CCR31_VALUE 0x02000000 #define MC_CCR32_VALUE 0x0f0f0a02 #define MC_CCR33_VALUE 0x01010101 #define MC_CCR34_VALUE 0x00000101 #define MC_CCR35_VALUE 0x00010001 #define MC_CCR36_VALUE 0x00010006 #define MC_CCR37_VALUE 0x00000000 #define MC_CCR38_VALUE 0x00000000 #define MC_CCR39_VALUE 0x00000000 #define MC_CCR40_VALUE 0x00000000 #define MC_CCR41_VALUE 0x02000100 #define MC_CCR42_VALUE 0x08000400 #define MC_CCR43_VALUE 0x01010000 #define MC_CCR44_VALUE 0x01020201 #define MC_CCR45_VALUE 0x00000200 #define MC_CCR46_VALUE 0x00000000 #define MC_CCR47_VALUE 0x00000000 #define MC_CCR48_VALUE 0x00000600 #define MC_CCR49_VALUE 0x00079900 #define MC_CCR50_VALUE 0x02000200 #define MC_CCR51_VALUE 0x02000200 #define MC_CCR52_VALUE 0x00000799 #define MC_CCR53_VALUE 0x000025fd #define MC_CCR54_VALUE 0x00020304 #define MC_CCR55_VALUE 0x00000101 #define MC_PHYR0_VALUE 0x000f0100 #define MC_PHYR1_VALUE 0xf4013827 #define MC_PHYR2_VALUE 0x188002c0 #define MC_PHYR3_VALUE 0xf4013827 #define MC_PHYR4_VALUE 0x188002c0 #define MC_PHYR5_VALUE 0x00000005 #define MC_PHYR6_VALUE 0xc0092405 #define MC_PHYR7_VALUE 0x00091F04 #define MC_PHYR8_VALUE 0xc0092405 #define MC_PHYR9_VALUE 0x00091F04
//! @file udp.h //! // UDP Client Server -- send/receive UDP packets // Copyright (C) 2013 Made to Order Software 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. // // 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 #ifndef SNAP_UDP_CLIENT_SERVER_H #define SNAP_UDP_CLIENT_SERVER_H #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #include <stdexcept> #include <stdio.h> #include <errno.h> namespace udp_client_server { class udp_client_server_runtime_error : public std::runtime_error { public: udp_client_server_runtime_error(const char *w) : std::runtime_error(w) {} }; class udp_client { public: udp_client(const std::string& addr, int port); ~udp_client(); int get_socket() const; int get_port() const; std::string get_addr() const; int send(const char *msg, size_t size); private: int f_socket; int f_port; std::string f_addr; struct addrinfo * f_addrinfo; }; class udp_server { public: udp_server(const std::string& addr, int port); ~udp_server(); int get_socket() const; int get_port() const; std::string get_addr() const; int recv(char *msg, size_t max_size); int timed_recv(char *msg, size_t max_size, int max_wait_ms); private: int f_socket; int f_port; std::string f_addr; struct addrinfo * f_addrinfo; }; } // namespace udp_client_server #endif // SNAP_UDP_CLIENT_SERVER_H // vim: ts=4 sw=4 et
#define UTS_RELEASE "2.6.38.8-msku-kernel-jellybean"
/*********************************************************************** Copyright (c) 2006-2011, Skype Limited. 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 Internet Society, IETF or IETF Trust, nor the names of specific 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. ***********************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "main.h" /* Unpack predictor values and indices for entropy coding tables */ void silk_NLSF_unpack( opus_int16 ec_ix[], /* O Indices to entropy tables [ LPC_ORDER ] */ opus_uint8 pred_Q8[], /* O LSF predictor [ LPC_ORDER ] */ const silk_NLSF_CB_struct *psNLSF_CB, /* I Codebook object */ const opus_int CB1_index /* I Index of vector in first LSF codebook */ ) { opus_int i; opus_uint8 entry; const opus_uint8 *ec_sel_ptr; ec_sel_ptr = &psNLSF_CB->ec_sel[ CB1_index * psNLSF_CB->order / 2 ]; for( i = 0; i < psNLSF_CB->order; i += 2 ) { entry = *ec_sel_ptr++; ec_ix [ i ] = silk_SMULBB( silk_RSHIFT( entry, 1 ) & 7, 2 * NLSF_QUANT_MAX_AMPLITUDE + 1 ); pred_Q8[ i ] = psNLSF_CB->pred_Q8[ i + ( entry & 1 ) * ( psNLSF_CB->order - 1 ) ]; ec_ix [ i + 1 ] = silk_SMULBB( silk_RSHIFT( entry, 5 ) & 7, 2 * NLSF_QUANT_MAX_AMPLITUDE + 1 ); pred_Q8[ i + 1 ] = psNLSF_CB->pred_Q8[ i + ( silk_RSHIFT( entry, 4 ) & 1 ) * ( psNLSF_CB->order - 1 ) + 1 ]; } }
#include <stdio.h> #include <string.h> #include <fcntl.h> #include <stdlib.h> #include <sys/socket.h> #include <sys/types.h> #include <unistd.h> #include <sys/ioctl.h> #include <linux/wireless.h> #include <linux/netlink.h> #define NETLINK_MDRY 23 #define NL_GROUP 1 #define MAX_PAYLOAD 1024 int main(int argc, char **argv) { int sk; struct sockaddr_nl src_addr, dest_addr; struct nlmsghdr *nlh = NULL; struct iovec iov; struct msghdr msg; sk = socket(AF_NETLINK, SOCK_RAW, NETLINK_MDRY); if (sk < 0) { perror("socket failed"); return -1; } memset(&msg, 0, sizeof(msg)); memset(&src_addr, 0, sizeof(src_addr)); memset(&dest_addr, 0, sizeof(dest_addr)); src_addr.nl_family = AF_NETLINK; src_addr.nl_pid = getpid(); src_addr.nl_groups = NL_GROUP; if (bind(sk, (struct sockaddr *)&src_addr, sizeof(src_addr)) < 0) { perror("bind failed"); close(sk); return -2; } nlh = (struct nlmsghdr *)malloc(NLMSG_SPACE(MAX_PAYLOAD)); memset(nlh, 0, NLMSG_SPACE(MAX_PAYLOAD)); iov.iov_base = (void *)nlh; iov.iov_len = NLMSG_SPACE(MAX_PAYLOAD); msg.msg_name = (void *)&dest_addr; msg.msg_namelen = sizeof(dest_addr); msg.msg_iov = &iov; msg.msg_iovlen = 1; while (1) { recvmsg(sk, &msg, 0); printf("%s\n", (char *)NLMSG_DATA(nlh)); } close(sk); return 0; }
/*************************************************************************** qgsrelationmanagerdialog.h -------------------------------------- Date : 23.2.2013 Copyright : (C) 2013 Matthias Kuhn Email : matthias at opengis dot ch *************************************************************************** * * * 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 QGSRELATIONMANAGERDIALOG_H #define QGSRELATIONMANAGERDIALOG_H #include <QWidget> #include "ui_qgsrelationmanagerdialogbase.h" class QgsRelation; class QgsRelationManager; class QgsRelationManagerTreeModel; class QgsVectorLayer; class APP_EXPORT QgsRelationManagerDialog : public QWidget, private Ui::QgsRelationManagerDialogBase { Q_OBJECT public: explicit QgsRelationManagerDialog( QgsRelationManager* relationMgr, QWidget *parent = 0 ); ~QgsRelationManagerDialog(); void setLayers( const QList<QgsVectorLayer*>& ); void addRelation( const QgsRelation& rel ); QList< QgsRelation > relations(); public slots: void on_mBtnAddRelation_clicked(); void on_mBtnRemoveRelation_clicked(); private: QgsRelationManager* mRelationManager; QList< QgsVectorLayer* > mLayers; }; #endif // QGSRELATIONMANAGERDIALOG_H
#include <linux/pm_qos.h> #ifdef CONFIG_PM_RUNTIME extern void pm_runtime_init(struct device *dev); extern void pm_runtime_remove(struct device *dev); #else /* !CONFIG_PM_RUNTIME */ static inline void pm_runtime_init(struct device *dev) {} static inline void pm_runtime_remove(struct device *dev) {} #endif /* !CONFIG_PM_RUNTIME */ #ifdef CONFIG_PM_SLEEP struct dpm_drv_wd_data { struct device *dev; struct task_struct *tsk; }; /* kernel/power/main.c */ extern int pm_async_enabled; /* drivers/base/power/main.c */ extern struct list_head dpm_list; /* The active device list */ static inline struct device *to_device(struct list_head *entry) { return container_of(entry, struct device, power.entry); } extern void device_pm_init(struct device *dev); extern void device_pm_add(struct device *); extern void device_pm_remove(struct device *); extern void device_pm_move_before(struct device *, struct device *); extern void device_pm_move_after(struct device *, struct device *); extern void device_pm_move_last(struct device *); extern void (*device_pm_set_timout_handler(void (*new_fun)(unsigned long))) (unsigned long); #else /* !CONFIG_PM_SLEEP */ static inline void device_pm_init(struct device *dev) { spin_lock_init(&dev->power.lock); dev->power.power_state = PMSG_INVALID; pm_runtime_init(dev); } static inline void device_pm_add(struct device *dev) { dev_pm_qos_constraints_init(dev); } static inline void device_pm_remove(struct device *dev) { dev_pm_qos_constraints_destroy(dev); pm_runtime_remove(dev); } static inline void device_pm_move_before(struct device *deva, struct device *devb) {} static inline void device_pm_move_after(struct device *deva, struct device *devb) {} static inline void device_pm_move_last(struct device *dev) {} static void (*device_pm_set_timout_handler(void (*new_fun)(unsigned long))) (unsigned long) {} #endif /* !CONFIG_PM_SLEEP */ #ifdef CONFIG_PM /* * sysfs.c */ extern int dpm_sysfs_add(struct device *dev); extern void dpm_sysfs_remove(struct device *dev); extern void rpm_sysfs_remove(struct device *dev); extern int wakeup_sysfs_add(struct device *dev); extern void wakeup_sysfs_remove(struct device *dev); extern int pm_qos_sysfs_add(struct device *dev); extern void pm_qos_sysfs_remove(struct device *dev); #else /* CONFIG_PM */ static inline int dpm_sysfs_add(struct device *dev) { return 0; } static inline void dpm_sysfs_remove(struct device *dev) {} static inline void rpm_sysfs_remove(struct device *dev) {} static inline int wakeup_sysfs_add(struct device *dev) { return 0; } static inline void wakeup_sysfs_remove(struct device *dev) {} static inline int pm_qos_sysfs_add(struct device *dev) { return 0; } static inline void pm_qos_sysfs_remove(struct device *dev) {} #endif
#include "../stralloc.h" #undef stralloc_diffs #include "../byte.h" #include "../str.h" extern int stralloc_diffs(const stralloc* a, const char* b) { size_t i; int j; for(i = 0;; ++i) { if(i == a->len) return !b[i] ? 0 : -1; if(!b[i]) return 1; if((j = ((unsigned char)(a->s[i]) - (unsigned char)(b[i])))) break; } return j; }
/*************************************************************************** * Copyright (C) 2005 - 2007 by * * Last.fm Ltd <client@last.fm> * * * * 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 Steet, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef MACSTYLEOVERRIDES_H #define MACSTYLEOVERRIDES_H #include <QtGlobal> #ifdef Q_WS_MAC #include <QMacStyle> class MacStyleOverrides : public QMacStyle { public: MacStyleOverrides() {} virtual void drawControl( ControlElement pe, const QStyleOption* opt, QPainter* p, const QWidget* w = 0) const; virtual void drawPrimitive( PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = 0) const; }; #endif // Q_WS_MAC #endif // MACSTYLEOVERRIDES_H
/* * Copyright (c) 2011, Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _UNSUPPORTRSVDFIELDS_r10b_H_ #define _UNSUPPORTRSVDFIELDS_r10b_H_ #include "test.h" namespace GrpAdminDeleteIOSQCmd { /** \verbatim * ----------------------------------------------------------------------------- * ----------------Mandatory rules for children to follow----------------------- * ----------------------------------------------------------------------------- * 1) See notes in the header file of the Test base class * \endverbatim */ class UnsupportRsvdFields_r10b : public Test { public: UnsupportRsvdFields_r10b(string grpName, string testName); virtual ~UnsupportRsvdFields_r10b(); /** * IMPORTANT: Read Test::Clone() header comment. */ virtual UnsupportRsvdFields_r10b *Clone() const { return new UnsupportRsvdFields_r10b(*this); } UnsupportRsvdFields_r10b &operator=(const UnsupportRsvdFields_r10b &other); UnsupportRsvdFields_r10b(const UnsupportRsvdFields_r10b &other); protected: virtual void RunCoreTest(); virtual RunType RunnableCoreTest(bool preserve); private: /////////////////////////////////////////////////////////////////////////// // Adding a member variable? Then edit the copy constructor and operator=(). /////////////////////////////////////////////////////////////////////////// }; } // namespace #endif
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* Consortium theme widget (displays themed draw operations) */ /* * Copyright (C) 2002 Havoc Pennington * * 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 "theme.h" #include <gtk/gtk.h> #ifndef META_THEME_WIDGET_H #define META_THEME_WIDGET_H #define META_TYPE_AREA (meta_area_get_type ()) #define META_AREA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_AREA, MetaArea)) #define META_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_AREA, MetaAreaClass)) #define META_IS_AREA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_AREA)) #define META_IS_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_AREA)) #define META_AREA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_AREA, MetaAreaClass)) typedef struct _MetaArea MetaArea; typedef struct _MetaAreaClass MetaAreaClass; typedef void (* MetaAreaSizeFunc) (MetaArea *area, int *width, int *height, void *user_data); typedef void (* MetaAreaExposeFunc) (MetaArea *area, GdkEventExpose *event, int x_offset, int y_offset, void *user_data); struct _MetaArea { GtkMisc misc; MetaAreaSizeFunc size_func; MetaAreaExposeFunc expose_func; void *user_data; GDestroyNotify dnotify; }; struct _MetaAreaClass { GtkMiscClass parent_class; }; GType meta_area_get_type (void) G_GNUC_CONST; GtkWidget* meta_area_new (void); void meta_area_setup (MetaArea *area, MetaAreaSizeFunc size_func, MetaAreaExposeFunc expose_func, void *user_data, GDestroyNotify dnotify); #endif
/* * tkMacOSXNotify.c -- * * This file contains the implementation of a tcl event source * for the Carbon event loop. * * Copyright (c) 1995-1997 Sun Microsystems, Inc. * Copyright 2001, Apple Computer, Inc. * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net> * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * RCS: @(#) $Id: tkMacOSXNotify.c,v 1.5.2.12 2007/06/29 03:22:02 das Exp $ */ #include "tkMacOSXPrivate.h" #include "tkMacOSXEvent.h" #include <pthread.h> /* * The following static indicates whether this module has been initialized * in the current thread. */ typedef struct ThreadSpecificData { int initialized; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; static void TkMacOSXNotifyExitHandler(ClientData clientData); static void CarbonEventsSetupProc(ClientData clientData, int flags); static void CarbonEventsCheckProc(ClientData clientData, int flags); /* *---------------------------------------------------------------------- * * Tk_MacOSXSetupTkNotifier -- * * This procedure is called during Tk initialization to create * the event source for Carbon events. * * Results: * None. * * Side effects: * A new event source is created. * *---------------------------------------------------------------------- */ void Tk_MacOSXSetupTkNotifier(void) { ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!tsdPtr->initialized) { /* HACK ALERT: There is a bug in Jaguar where when it goes to make * the event queue for the Main Event Loop, it stores the Current * event loop rather than the Main Event Loop in the Queue structure. * So we have to make sure that the Main Event Queue gets set up on * the main thread. Calling GetMainEventQueue will force this to * happen. */ GetMainEventQueue(); tsdPtr->initialized = 1; /* Install Carbon events event source in main event loop thread. */ if (GetCurrentEventLoop() == GetMainEventLoop()) { if (!pthread_main_np()) { /* * Panic if the Carbon main event loop thread (i.e. the * thread where HIToolbox was first loaded) is not the * main application thread, as Carbon does not support * this properly. */ Tcl_Panic("Tk_MacOSXSetupTkNotifier: %s", "first [load] of TkAqua has to occur in the main thread!"); } Tcl_CreateEventSource(CarbonEventsSetupProc, CarbonEventsCheckProc, GetMainEventQueue()); TkCreateExitHandler(TkMacOSXNotifyExitHandler, NULL); } } } /* *---------------------------------------------------------------------- * * TkMacOSXNotifyExitHandler -- * * This function is called during finalization to clean up the * TkMacOSXNotify module. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void TkMacOSXNotifyExitHandler(clientData) ClientData clientData; /* Not used. */ { ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_DeleteEventSource(CarbonEventsSetupProc, CarbonEventsCheckProc, GetMainEventQueue()); tsdPtr->initialized = 0; } /* *---------------------------------------------------------------------- * * CarbonEventsSetupProc -- * * This procedure implements the setup part of the Carbon Events * event source. It is invoked by Tcl_DoOneEvent before entering * the notifier to check for events. * * Results: * None. * * Side effects: * If Carbon events are queued, then the maximum block time will be * set to 0 to ensure that the notifier returns control to Tcl. * *---------------------------------------------------------------------- */ static void CarbonEventsSetupProc(clientData, flags) ClientData clientData; int flags; { static Tcl_Time blockTime = { 0, 0 }; if (!(flags & TCL_WINDOW_EVENTS)) { return; } if (GetNumEventsInQueue((EventQueueRef)clientData)) { Tcl_SetMaxBlockTime(&blockTime); } } /* *---------------------------------------------------------------------- * * CarbonEventsCheckProc -- * * This procedure processes events sitting in the Carbon event * queue. * * Results: * None. * * Side effects: * Moves applicable queued Carbon events onto the Tcl event queue. * *---------------------------------------------------------------------- */ static void CarbonEventsCheckProc(clientData, flags) ClientData clientData; int flags; { int numFound; OSStatus err = noErr; if (!(flags & TCL_WINDOW_EVENTS)) { return; } numFound = GetNumEventsInQueue((EventQueueRef)clientData); /* Avoid starving other event sources: */ if (numFound > 4) { numFound = 4; } while (numFound > 0 && err == noErr) { err = TkMacOSXReceiveAndDispatchEvent(); numFound--; } }
/* * This file is part of mpv. * * mpv 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. * * mpv 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 mpv. If not, see <http://www.gnu.org/licenses/>. */ #include <stdio.h> #include <inttypes.h> #include <windows.h> #include <errors.h> #include <audioclient.h> #include "windows_utils.h" char *mp_GUID_to_str_buf(char *buf, size_t buf_size, const GUID *guid) { snprintf(buf, buf_size, "{%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x}", (unsigned) guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]); return buf; } static char *hresult_to_str(const HRESULT hr) { #define E(x) case x : return # x ; switch (hr) { E(S_OK) E(S_FALSE) E(E_FAIL) E(E_OUTOFMEMORY) E(E_POINTER) E(E_HANDLE) E(E_NOTIMPL) E(E_INVALIDARG) E(E_PROP_ID_UNSUPPORTED) E(E_NOINTERFACE) E(REGDB_E_IIDNOTREG) E(CO_E_NOTINITIALIZED) E(AUDCLNT_E_NOT_INITIALIZED) E(AUDCLNT_E_ALREADY_INITIALIZED) E(AUDCLNT_E_WRONG_ENDPOINT_TYPE) E(AUDCLNT_E_DEVICE_INVALIDATED) E(AUDCLNT_E_NOT_STOPPED) E(AUDCLNT_E_BUFFER_TOO_LARGE) E(AUDCLNT_E_OUT_OF_ORDER) E(AUDCLNT_E_UNSUPPORTED_FORMAT) E(AUDCLNT_E_INVALID_SIZE) E(AUDCLNT_E_DEVICE_IN_USE) E(AUDCLNT_E_BUFFER_OPERATION_PENDING) E(AUDCLNT_E_THREAD_NOT_REGISTERED) E(AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED) E(AUDCLNT_E_ENDPOINT_CREATE_FAILED) E(AUDCLNT_E_SERVICE_NOT_RUNNING) E(AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED) E(AUDCLNT_E_EXCLUSIVE_MODE_ONLY) E(AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL) E(AUDCLNT_E_EVENTHANDLE_NOT_SET) E(AUDCLNT_E_INCORRECT_BUFFER_SIZE) E(AUDCLNT_E_BUFFER_SIZE_ERROR) E(AUDCLNT_E_CPUUSAGE_EXCEEDED) E(AUDCLNT_E_BUFFER_ERROR) E(AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED) E(AUDCLNT_E_INVALID_DEVICE_PERIOD) E(AUDCLNT_E_INVALID_STREAM_FLAG) E(AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE) E(AUDCLNT_E_RESOURCES_INVALIDATED) E(AUDCLNT_S_BUFFER_EMPTY) E(AUDCLNT_S_THREAD_ALREADY_REGISTERED) E(AUDCLNT_S_POSITION_STALLED) default: return "<Unknown>"; } #undef E } char *mp_HRESULT_to_str_buf(char *buf, size_t buf_size, HRESULT hr) { snprintf(buf, buf_size, "%s (0x%"PRIx32")", hresult_to_str(hr), (uint32_t) hr); return buf; }
/* * Copyright (C) Kreogist Dev 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, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KNMUSICSTOREHOMELISTVIEW_H #define KNMUSICSTOREHOMELISTVIEW_H #include "knmusicstorehomeitemview.h" /*! * \brief The KNMusicStoreHomeListView class is used for providing view widget * for the normal ranking lists. It could only be used in the music main page, * and its model must be the music store list model.\n * The size of the list view will be changed according to the model size. * However, this model DOES NOT provide the automatic height changing function. * But a tweakHeight() function instead. Which means that the view will tweak * the height according to the item count set by this function. */ class KNMusicStoreHomeListView : public KNMusicStoreHomeItemView { Q_OBJECT public: /*! * \brief Construct a KNMusicStoreHomeListView widget. * \param parent The parent widget. */ explicit KNMusicStoreHomeListView(QWidget *parent = 0); /*! * \brief Reimplemented from QAbstractItemView::indexAt(). */ QModelIndex indexAt(const QPoint &point) const Q_DECL_OVERRIDE; /*! * \brief Reimplemented from QAbstractItemView::visualRect(). */ QRect visualRect(const QModelIndex &index) const Q_DECL_OVERRIDE; /*! * \brief Tweak the view height for specific rendering counts. * \param maxRenderingCount The maximum items of the view will display. */ void tweakHeight(int maxRenderingCount); signals: public slots: protected: /*! * \brief Reimplemented from QAbstractItemView::paintEvent(). */ void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: int m_maxRenderingCount; }; #endif // KNMUSICSTOREHOMELISTVIEW_H
// Copyright (C) 2005 - 2021 Settlers Freaks (sf-team at siedler25.org) // // SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include "figures/noFigure.h" class noBuildingSite; class SerializedGameData; /// Der Planierer class nofPlaner : public noFigure { /// Arbeitsstelle des Planierers noBuildingSite* building_site; /// Was der Planierer gerade so schönes macht enum class PlanerState : uint8_t { FigureWork, Walking, /// läuft zum nächsten Punkt, um zu graben Planing /// planiert einen Punkt (Abspielen der Animation } state; friend constexpr auto maxEnumValue(PlanerState) { return PlanerState::Planing; } /// Wie rum er geht enum class PlaningDir : uint8_t { NotWorking, Clockwise, /// Uhrzeigersinn Counterclockwise /// entgegen Uhrzeigersinn } pd; friend constexpr auto maxEnumValue(PlaningDir) { return PlaningDir::Counterclockwise; } private: void GoalReached() override; void Walked() override; void AbrogateWorkplace() override; void HandleDerivedEvent(unsigned id) override; public: nofPlaner(MapPoint pos, unsigned char player, noBuildingSite* building_site); nofPlaner(SerializedGameData& sgd, unsigned obj_id); void Serialize(SerializedGameData& sgd) const override; GO_Type GetGOT() const final { return GO_Type::NofPlaner; } void Draw(DrawPoint drawPt) override; /// Wird von der Baustelle aus aufgerufen, um den Bauarbeiter zu sagen, dass er gehen kann void LostWork(); };
/* * SomePlayer - An alternate music player for Maemo 5 * Copyright (C) 2010 Nikolay (somebody) Tischenko <niktischenko@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 TAGRESOLVER_H #define TAGRESOLVER_H #include <QObject> #include "someplayer.h" #include "track.h" using SomePlayer::DataObjects::Track; namespace SomePlayer { namespace DataObjects { class TagResolver : public QObject { Q_OBJECT public: explicit TagResolver(QObject *parent = 0); public slots: void decode (QStringList files); void updateTags(Track); Track decodeOne (QString filepath); signals: void decoded(Track); void done(); void started(); }; }; }; #endif // TAGRESOLVER_H
/* * UV Navigator - Auswertungsvisualisierung fuer Universum V * Copyright (C) 2004-2006 Daniel Roethlisberger <roe@chronator.ch> * * 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/copyleft/ * * $Id$ */ #ifndef COMPOSITEWIDGET_H #define COMPOSITEWIDGET_H #include "ui/core/widget.h" #include "ui/core/orientation.h" #include "util/observer.h" #include <vector> class UVCompositeWidget : public UVWidget, public Observer { public: UVCompositeWidget(int = 1, UVOrientation = UVOHorizontal, SDL_Surface* = NULL); virtual ~UVCompositeWidget(); virtual void update(Subject*); virtual void add_widget(UVWidget*); virtual void resize(); virtual void draw(); virtual void handle_click(int, int); virtual void set_surface(SDL_Surface*); protected: std::vector<UVWidget*> widgets; bool modified; UVOrientation orientation; int weight_total; }; #endif // COMPOSITEWIDGET_H
/**************************************************************************************** * Copyright (c) 2009 Alejandro Wainzinger <aikawarazuni@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, see <http://www.gnu.org/licenses/>. * ****************************************************************************************/ #ifndef UMSWRITECAPABILITY_H #define UMSWRITECAPABILITY_H #include "WriteCapabilityBase.h" namespace Meta { class UmsHandler; } namespace Handler { class UmsWriteCapability : public WriteCapabilityBase { Q_OBJECT public: UmsWriteCapability( Meta::UmsHandler *handler ); virtual QStringList supportedFormats(); virtual void findPathToCopy( const Meta::TrackPtr &srcTrack, const Meta::MediaDeviceTrackPtr &destTrack ); virtual bool libCopyTrack( const Meta::TrackPtr &srcTrack, Meta::MediaDeviceTrackPtr &destTrack ); virtual bool libDeleteTrackFile( const Meta::MediaDeviceTrackPtr &track ); virtual void libSetPlayableUrl( Meta::MediaDeviceTrackPtr &destTrack, const Meta::TrackPtr &srcTrack ); virtual void prepareToCopy(); virtual void prepareToDelete(); virtual void updateTrack( Meta::MediaDeviceTrackPtr &track ); virtual void endTrackRemove(); private: Meta::UmsHandler *m_handler; }; } #endif
/* ettercap -- curses GUI Copyright (C) ALoR & NaGA This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. $Id: ec_curses_live.c,v 1.8 2004/10/12 14:27:28 alor Exp $ */ #include <ec.h> #include <wdg.h> #include <ec_curses.h> /* globals */ /* proto */ void curses_sniff_live(void); /*******************************************/ /* the interface */ void curses_sniff_live(void) { wdg_t *menu; DEBUG_MSG("curses_sniff_live"); wdg_create_object(&menu, WDG_MENU, WDG_OBJ_WANT_FOCUS | WDG_OBJ_ROOT_OBJECT); wdg_set_title(menu, GBL_VERSION, WDG_ALIGN_RIGHT); wdg_set_color(menu, WDG_COLOR_SCREEN, EC_COLOR); wdg_set_color(menu, WDG_COLOR_WINDOW, EC_COLOR_MENU); wdg_set_color(menu, WDG_COLOR_FOCUS, EC_COLOR_FOCUS); wdg_set_color(menu, WDG_COLOR_TITLE, EC_COLOR_TITLE); /* add the menu from external files */ wdg_menu_add(menu, menu_start); wdg_menu_add(menu, menu_targets); if (GBL_SNIFF->type != SM_BRIDGED) wdg_menu_add(menu, menu_hosts); wdg_menu_add(menu, menu_view); if (GBL_SNIFF->type != SM_BRIDGED) wdg_menu_add(menu, menu_mitm); wdg_menu_add(menu, menu_filters); wdg_menu_add(menu, menu_logging); #ifdef HAVE_PLUGINS wdg_menu_add(menu, menu_plugins); #endif wdg_menu_add(menu, menu_help); wdg_draw_object(menu); /* repaint the whole screen */ wdg_redraw_all(); wdg_set_focus(menu); /* add the message flush callback */ wdg_add_idle_callback(curses_flush_msg); /* * give the control to the event dispatcher * with the emergency exit key 'Q' */ wdg_events_handler(CTRL('X')); wdg_destroy_object(&menu); } /* EOF */ // vim:ts=3:expandtab
#ifndef VBA_PORT_H #define VBA_PORT_H #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include <ctime> #ifndef NULL #define NULL 0 #endif typedef unsigned char bool8; #ifdef HAVE_STDINT_H #include <stdint.h> typedef int8_t int8; typedef uint8_t uint8; typedef int16_t int16; typedef uint16_t uint16; typedef int32_t int32; typedef uint32_t uint32; typedef int64_t int64; typedef uint64_t uint64; typedef intptr_t pint; #else /* Don't have stdint.h */ #ifdef PTR_NOT_INT typedef long pint; #else /* pointer is int */ typedef int pint; #endif /* PTR_NOT_INT */ /* FIXME: Refactor this by moving out the BORLAND part and unifying typedefs */ #ifndef WIN32 typedef unsigned char uint8; typedef unsigned short uint16; typedef signed char int8; typedef short int16; typedef int int32; typedef unsigned int uint32; # ifdef __GNUC__ /* long long is not part of ISO C++ */ __extension__ typedef long long int64; __extension__ typedef unsigned long long uint64; # else typedef long long int64; typedef unsigned long long uint64; # endif #else /* WIN32 */ # ifdef __BORLANDC__ # include <systypes.h> # else typedef unsigned char uint8; typedef unsigned short uint16; typedef signed char int8; typedef short int16; # ifndef WSAAPI /* winsock2.h typedefs int32 as well. */ typedef long int32; # endif typedef unsigned int uint32; # endif /* __BORLANDC__ */ typedef __int64 int64; typedef unsigned __int64 uint64; #endif /* WIN32 */ #endif /* HAVE_STDINT_H */ #ifndef WIN32 #ifndef PATH_MAX #define PATH_MAX 1024 #endif #define _MAX_DIR PATH_MAX #define _MAX_DRIVE 1 #define _MAX_FNAME PATH_MAX #define _MAX_EXT PATH_MAX #define _MAX_PATH PATH_MAX #define ZeroMemory(a, b) memset((a), 0, (b)) void _makepath(char *path, const char *drive, const char *dir, const char *fname, const char *ext); void _splitpath(const char *path, char *drive, char *dir, char *fname, char *ext); #else /* WIN32 */ #ifdef _MSC_VER #define strcasecmp stricmp #define strncasecmp strnicmp #endif #endif typedef uint8 u8; typedef uint16 u16; typedef uint32 u32; typedef uint64 u64; typedef int8 s8; typedef int16 s16; typedef int32 s32; typedef int64 s64; // for consistency static inline u8 swap8(u8 v) { return v; } // swaps a 16-bit value static inline u16 swap16(u16 v) { return (v<<8)|(v>>8); } // swaps a 32-bit value static inline u32 swap32(u32 v) { return (v<<24)|((v<<8)&0xff0000)|((v>>8)&0xff00)|(v>>24); } #define READ8LE(x) \ (*((u8 *)x)) #define WRITE8LE(x, v) \ (*((u8 *)x) = (v)) #ifdef WORDS_BIGENDIAN #if defined(__GNUC__) && defined(__ppc__) #define READ16LE(base) \ ({ unsigned short lhbrxResult; \ __asm__("lhbrx %0, 0, %1" : "=r" (lhbrxResult) : "r" (base) : "memory"); \ lhbrxResult; }) #define READ32LE(base) \ ({ unsigned long lwbrxResult; \ __asm__("lwbrx %0, 0, %1" : "=r" (lwbrxResult) : "r" (base) : "memory"); \ lwbrxResult; }) #define WRITE16LE(base, value) \ __asm__("sthbrx %0, 0, %1" : : "r" (value), "r" (base) : "memory") #define WRITE32LE(base, value) \ __asm__("stwbrx %0, 0, %1" : : "r" (value), "r" (base) : "memory") #else #define READ16LE(x) \ swap16(*((u16 *)(x))) #define READ32LE(x) \ swap32(*((u32 *)(x))) #define WRITE16LE(x, v) \ *((u16 *)x) = swap16((v)) #define WRITE32LE(x, v) \ *((u32 *)x) = swap32((v)) #endif #else #define READ16LE(x) \ (*((u16 *)x)) #define READ32LE(x) \ (*((u32 *)x)) #define WRITE16LE(x, v) \ (*((u16 *)x) = (v)) #define WRITE32LE(x, v) \ (*((u32 *)x) = (v)) #endif #ifndef CTASSERT #define CTASSERT(x) typedef char __assert ## y[(x) ? 1 : -1]; #endif #endif // VBA_PORT_H
//{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by OpenVPNUINetwork.rc // #define IDS_PROJNAME 100 #define IDR_OPENVPNUINETWORK 101 #define IDR_NETWORK 102 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 201 #define _APS_NEXT_COMMAND_VALUE 32768 #define _APS_NEXT_CONTROL_VALUE 201 #define _APS_NEXT_SYMED_VALUE 103 #endif #endif
/* * capsule - the game recording and overlay toolkit * Copyright (C) 2017, Amos Wenger * * 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: * https://github.com/itchio/capsule/blob/master/LICENSE * * 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 */ #pragma once static const char* kVertexSource = R"glsl( #version 120 attribute vec2 position; attribute vec2 texcoord; varying vec2 texcoordOut; void main() { texcoordOut = texcoord; gl_Position = vec4(position, 0.0, 1.0); } )glsl"; static const char* kFragmentSource = R"glsl( #version 120 varying vec2 texcoordOut; uniform sampler2D diffuse; void main() { gl_FragColor = texture2D(diffuse, texcoordOut); gl_FragColor.a = 0.4; } )glsl";
/* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved. * * The information contained herein is property of Nordic Semiconductor ASA. * Terms and conditions of usage are described in detail in NORDIC * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. * * Licensees are granted free, non-transferable use of the information. NO * WARRANTY of ANY KIND is provided. This heading must NOT be removed from * the file. * */ /**@file * @brief ANT bicycle power minimum receiver data page definitions. * @defgroup ant_bicycle_power_minimum_receiver ANT bicycle power minimum receiver example * @{ * @ingroup nrf_ant_bicycle_power * */ #ifndef BP_PAGES_H__ #define BP_PAGES_H__ #include <stdint.h> /** @brief Bicycle Power page 16 data structure. */ typedef struct { uint32_t event_count; /**< Power event count. */ uint32_t pedal_power; /**< Pedal power. */ uint32_t instantaneous_cadence; /**< Crank cadence. */ uint32_t accumulated_power; /**< Accumulated power. */ uint32_t instantaneous_power; /**< Instantaneous power. */ } bp_page16_data_t; /** @brief Bicycle Power page 17 data structure. */ typedef struct { uint32_t update_event_counter; /**< Event counter incremented with each information update. */ uint32_t wheel_ticks; /**< Wheel tick count incremented with each wheel revolution. */ uint32_t instantaneous_cadence; /**< Crank cadence, if available. */ uint32_t wheel_period; /**< Accumulated wheel period. */ uint32_t accumulated_torgue; /**< Accumulated torque. */ } bp_page17_data_t; /** @brief Bicycle Power page 18 data structure. */ typedef struct { uint32_t update_event_counter; /**< Event counter incremented with each information update. */ uint32_t crank_ticks; /**< Crank tick count incremented with each crank revolution. */ uint32_t instantaneous_cadence; /**< Crank cadence, if available. */ uint32_t crank_period; /**< Accumulated crank period. */ uint32_t accumulated_torgue; /**< Accumulated torque. */ } bp_page18_data_t; /** @brief Bicycle Power page 32 data structure. */ typedef struct { uint32_t update_event_counter; /**< Rotation event counter increments with each completed pedal revolution. */ uint32_t slope; /**< Slope defines the variation of the output frequency. */ uint32_t time_stamp; /**< Time of most recent rotation event. */ uint32_t torque_ticks_stamp; /**< Count of most recent torque event. */ // Start of calculated values. uint32_t average_cadence; /**< Average cadence calculated from received data. */ } bp_page32_data_t; /** @brief Bicycle Power page 1 general calibration response data structure. */ typedef struct { uint32_t calibration_id; /**< Calibration ID. */ uint32_t auto_zero_status; /**< Auto zero status. */ uint32_t calibration_data; /**< Calibration data. */ } bp_page1_response_data_t; /** @brief Common page 80 data structure. */ typedef struct { uint32_t hw_revision; /**< HW revision, set by the manufacturer. */ uint32_t manufacturing_id; /**< Manufacturing ID. */ uint32_t model_number; /**< Model number, set by the manufacturer. */ } page80_data_t; /** @brief Common page 81 data structure. */ typedef struct { uint32_t sw_revision; /**< SW revision, set by the manufacturer. */ uint32_t serial_number; /**< Serial number of the device. */ } page81_data_t; #endif // BP_PAGES_H__ /** *@} **/
/* $Id: addr_resolv.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJ_ADDR_RESOLV_H__ #define __PJ_ADDR_RESOLV_H__ /** * @file addr_resolv.h * @brief IP address resolution. */ #include <pj/sock.h> PJ_BEGIN_DECL /** * @defgroup pj_addr_resolve Network Address Resolution * @ingroup PJ_IO * @{ * * This module provides function to resolve Internet address of the * specified host name. To resolve a particular host name, application * can just call #pj_gethostbyname(). * * Example: * <pre> * ... * pj_hostent he; * pj_status_t rc; * pj_str_t host = pj_str("host.example.com"); * * rc = pj_gethostbyname( &host, &he); * if (rc != PJ_SUCCESS) { * char errbuf[80]; * pj_strerror( rc, errbuf, sizeof(errbuf)); * PJ_LOG(2,("sample", "Unable to resolve host, error=%s", errbuf)); * return rc; * } * * // process address... * addr.sin_addr.s_addr = *(pj_uint32_t*)he.h_addr; * ... * </pre> * * It's pretty simple really... */ /** This structure describes an Internet host address. */ typedef struct pj_hostent { char *h_name; /**< The official name of the host. */ char **h_aliases; /**< Aliases list. */ int h_addrtype; /**< Host address type. */ int h_length; /**< Length of address. */ char **h_addr_list; /**< List of addresses. */ } pj_hostent; /** Shortcut to h_addr_list[0] */ #define h_addr h_addr_list[0] /** * This structure describes address information pj_getaddrinfo(). */ typedef struct pj_addrinfo { char ai_canonname[PJ_MAX_HOSTNAME]; /**< Canonical name for host*/ pj_sockaddr ai_addr; /**< Binary address. */ } pj_addrinfo; /** * This function fills the structure of type pj_hostent for a given host name. * For host resolution function that also works with IPv6, please see * #pj_getaddrinfo(). * * @param name Host name, or IPv4 address in standard dot notation. * @param he The pj_hostent structure to be filled. Note that * the pointers in this structure points to temporary * variables which value will be reset upon subsequent * invocation. * * @return PJ_SUCCESS, or the appropriate error codes. */ PJ_DECL(pj_status_t) pj_gethostbyname(const pj_str_t *name, pj_hostent *he); /** * Resolve the primary IP address of local host. * * @param af The desired address family to query. Valid values * are pj_AF_INET() or pj_AF_INET6(). * @param addr On successful resolution, the address family and address * part of this socket address will be filled up with the host * IP address, in network byte order. Other parts of the socket * address are untouched. * * @return PJ_SUCCESS on success, or the appropriate error code. */ PJ_DECL(pj_status_t) pj_gethostip(int af, pj_sockaddr *addr); /** * Get the IP address of the default interface. Default interface is the * interface of the default route. * * @param af The desired address family to query. Valid values * are pj_AF_INET() or pj_AF_INET6(). * @param addr On successful resolution, the address family and address * part of this socket address will be filled up with the host * IP address, in network byte order. Other parts of the socket * address are untouched. * * @return PJ_SUCCESS on success, or the appropriate error code. */ PJ_DECL(pj_status_t) pj_getdefaultipinterface(int af, pj_sockaddr *addr); /** * This function translates the name of a service location (for example, * a host name) and returns a set of addresses and associated information * to be used in creating a socket with which to address the specified * service. * * @param af The desired address family to query. Valid values * are pj_AF_INET(), pj_AF_INET6(), or pj_AF_UNSPEC(). * @param name Descriptive name or an address string, such as host * name. * @param count On input, it specifies the number of elements in * \a ai array. On output, this will be set with the * number of address informations found for the * specified name. * @param ai Array of address info to be filled with the information * about the host. * * @return PJ_SUCCESS on success, or the appropriate error code. */ PJ_DECL(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *name, unsigned *count, pj_addrinfo ai[]); /** @} */ PJ_END_DECL #endif /* __PJ_ADDR_RESOLV_H__ */
/* -*- C++ -*- * * graphics_sse2.h - graphics routines using X86 SSE2 cpu functionality * * Copyright (c) 2009 Mion. 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 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 */ #ifdef USE_X86_GFX void imageFilterMean_SSE2(unsigned char *src1, unsigned char *src2, unsigned char *dst, int length); void imageFilterAddTo_SSE2(unsigned char *dst, unsigned char *src, int length); void imageFilterSubFrom_SSE2(unsigned char *dst, unsigned char *src, int length); void imageFilterBlend_SSE2(Uint32 *dst, Uint32 *src, Uint8 *alphap, int alpha, int length); #endif
#ifndef WLBITEMMAPGETREQUEST_H #define WLBITEMMAPGETREQUEST_H #include <TaoApiCpp/TaoRequest.h> #include <TaoApiCpp/TaoParser.h> #include <TaoApiCpp/response/WlbItemMapGetResponse.h> /** * TOP API: 根据物流宝商品ID查询商品映射关系 * * @author sd44 <sd44sdd44@yeah.net> */ class WlbItemMapGetRequest : public TaoRequest { public: virtual QString getApiMethodName() const; qlonglong getItemId() const ; void setItemId (qlonglong itemId); virtual WlbItemMapGetResponse *getResponseClass(const QString &session = "", const QString &accessToken = ""); private: /** * @brief 要查询映射关系的物流宝商品id **/ qlonglong itemId; }; #endif /* WLBITEMMAPGETREQUEST_H */
/* * Copyright (C) 2001-2008 Jacek Sieka, arnetheduck on gmail point 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 DCPLUSPLUS_DCPP_CLIENT_MANAGER_LISTENER_H #define DCPLUSPLUS_DCPP_CLIENT_MANAGER_LISTENER_H #include "forward.h" namespace dcpp { class ClientManagerListener { public: virtual ~ClientManagerListener() { } template<int I> struct X { enum { TYPE = I }; }; typedef X<0> UserConnected; typedef X<1> UserUpdated; typedef X<2> UserDisconnected; typedef X<3> IncomingSearch; typedef X<4> ClientConnected; typedef X<5> ClientUpdated; typedef X<6> ClientDisconnected; /** User online in at least one hub */ virtual void on(UserConnected, const UserPtr&) throw() { } virtual void on(UserUpdated, const OnlineUser&) throw() { } /** User offline in all hubs */ virtual void on(UserDisconnected, const UserPtr&) throw() { } virtual void on(IncomingSearch, const string&) throw() { } virtual void on(ClientConnected, Client*) throw() { } virtual void on(ClientUpdated, Client*) throw() { } virtual void on(ClientDisconnected, Client*) throw() { } }; } // namespace dcpp #endif // !defined(CLIENT_MANAGER_LISTENER_H)
/* APPLE LOCAL file lno */ /* { dg-do compile } */ /* { dg-options "-O1 -floop-test -ftree-elim-checks -fdump-tree-lptest-details -fdump-tree-optimized" } */ void remove_me (void); int main(void) { int a; int b; int c; /* loop_1 runs 2 times. */ for (a = 22; a < 83; a+=1) /* a -> {22, +, 60}_1 */ { c = a; /* loop_2 runs exactly 6 times. */ for (b = 23; b < 50; b+=5) /* b -> {23, +, 5}_2 */ { ++a; } /* The following stmt exercises the value of B on the exit of the loop. In this case the value of B out of the loop is that of the evolution function of B applied to the number of iterations the inner loop_2 runs. Value (B) = {23, +, 5}_2 (6) = 53. */ /* At this point, the variable A has the evolution function: {{22, +, 6}_1, +, 1}_2. */ if (b != 53 || a != c + 6) remove_me (); a = a + b; /* At this point, the variable A has the evolution function: {{22, +, 59}_1, +, 1}_2. The evolution of the variable B in the loop_2 does not matter, and is not recorded in the evolution of A. The above statement is equivalent to: "a = a + 53", ie. the scalar value of B on exit of the loop_2. */ if (a != c + 59) remove_me (); /* And finally the a+=1 from the FOR_STMT produces the evolution function: {{22, +, 60}_1, +, 1}_2. */ } } /* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 2" 1 "lptest"} } */ /* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 6" 1 "lptest"} } */ /* { dg-final { scan-tree-dump-times "remove_me" 0 "optimized"} } */
/* kernel/power/fbearlysuspend.c * * Copyright (C) 2005-2008 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/delay.h> #include <linux/earlysuspend.h> #include <linux/module.h> #include <linux/wait.h> #include "power.h" static wait_queue_head_t fb_state_wq; static DEFINE_SPINLOCK(fb_state_lock); static enum { FB_STATE_STOPPED_DRAWING, FB_STATE_REQUEST_STOP_DRAWING, FB_STATE_DRAWING_OK, } fb_state; /* tell userspace to stop drawing, wait for it to stop */ static void stop_drawing_early_suspend(struct early_suspend *h) { int ret; unsigned long irq_flags; /* FIXME: earlysuspend breaks androids CRT-off animation * Sleep a little bit to get it played properly */ msleep(500); spin_lock_irqsave(&fb_state_lock, irq_flags); fb_state = FB_STATE_REQUEST_STOP_DRAWING; spin_unlock_irqrestore(&fb_state_lock, irq_flags); wake_up_all(&fb_state_wq); ret = wait_event_timeout(fb_state_wq, fb_state == FB_STATE_STOPPED_DRAWING, HZ); if (unlikely(fb_state != FB_STATE_STOPPED_DRAWING)) pr_warning("stop_drawing_early_suspend: timeout waiting for " "userspace to stop drawing\n"); } /* tell userspace to start drawing */ static void start_drawing_late_resume(struct early_suspend *h) { unsigned long irq_flags; spin_lock_irqsave(&fb_state_lock, irq_flags); fb_state = FB_STATE_DRAWING_OK; spin_unlock_irqrestore(&fb_state_lock, irq_flags); wake_up(&fb_state_wq); } static struct early_suspend stop_drawing_early_suspend_desc = { .level = EARLY_SUSPEND_LEVEL_STOP_DRAWING, .suspend = stop_drawing_early_suspend, .resume = start_drawing_late_resume, }; static ssize_t wait_for_fb_sleep_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { char *s = buf; int ret; ret = wait_event_interruptible(fb_state_wq, fb_state != FB_STATE_DRAWING_OK); if (ret && fb_state == FB_STATE_DRAWING_OK) return ret; else s += sprintf(buf, "sleeping"); return s - buf; } static ssize_t wait_for_fb_wake_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { char *s = buf; int ret; unsigned long irq_flags; spin_lock_irqsave(&fb_state_lock, irq_flags); if (fb_state == FB_STATE_REQUEST_STOP_DRAWING) { fb_state = FB_STATE_STOPPED_DRAWING; wake_up(&fb_state_wq); } spin_unlock_irqrestore(&fb_state_lock, irq_flags); ret = wait_event_interruptible(fb_state_wq, fb_state == FB_STATE_DRAWING_OK); if (ret && fb_state != FB_STATE_DRAWING_OK) return ret; else s += sprintf(buf, "awake"); return s - buf; } #define power_ro_attr(_name) \ static struct kobj_attribute _name##_attr = { \ .attr = { \ .name = __stringify(_name), \ .mode = 0444, \ }, \ .show = _name##_show, \ .store = NULL, \ } power_ro_attr(wait_for_fb_sleep); power_ro_attr(wait_for_fb_wake); static struct attribute *g[] = { &wait_for_fb_sleep_attr.attr, &wait_for_fb_wake_attr.attr, NULL, }; static struct attribute_group attr_group = { .attrs = g, }; static int __init android_power_init(void) { int ret; init_waitqueue_head(&fb_state_wq); fb_state = FB_STATE_DRAWING_OK; ret = sysfs_create_group(power_kobj, &attr_group); if (ret) { pr_err("android_power_init: sysfs_create_group failed\n"); return ret; } register_early_suspend(&stop_drawing_early_suspend_desc); return 0; } static void __exit android_power_exit(void) { unregister_early_suspend(&stop_drawing_early_suspend_desc); sysfs_remove_group(power_kobj, &attr_group); } module_init(android_power_init); module_exit(android_power_exit);
/** * @file ns_cC.h creativeCommon RSS namespace support * * Copyright (C) 2003-2007 Lars Windolf <lars.lindner@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 _NS_CC_H #define _NS_CC_H #include "metadata.h" NsHandler *ns_cC_get_handler(void); #endif
/******************** PhyloBayes MPI. Copyright 2010-2013 Nicolas Lartillot, Nicolas Rodrigue, Daniel Stubbs, Jacques Richer. PhyloBayes 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. PhyloBayes 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 PhyloBayes. If not, see <http://www.gnu.org/licenses/>. **********************/ #ifndef AACODONMUTSELFINITESUB_H #define AACODONMUTSELFINITESUB_H #include "AACodonMutSelFiniteProfileProcess.h" #include "UniformRateProcess.h" #include "GeneralPathSuffStatMatrixSubstitutionProcess.h" class AACodonMutSelFiniteSubstitutionProcess : public virtual AACodonMutSelFiniteProfileProcess, public virtual UniformRateProcess, public virtual GeneralPathSuffStatMatrixSubstitutionProcess { // s'inspirer de GeneralPathSuffStatGTRSubstitutionProcess // et GeneralPathSuffStatRASCATGTRSubstitutionProcess public: AACodonMutSelFiniteSubstitutionProcess() {} virtual ~AACodonMutSelFiniteSubstitutionProcess() {} protected: void Create(int insite, int indim, int sitemin, int sitemax) { cerr << "In four-argument Create of AACodonMutSelFiniteSubstitutionProcess. Should not be here.\n"; exit(1); } void Create(int innsite, int indim, int ncat, int infixncomp, int inempmix, string inmixtype, int sitemin, int sitemax, CodonStateSpace* instatespace, int infixcodonprofile, int infixomega) { if (ncat == -1) { ncat = innsite; } AACodonMutSelFiniteProfileProcess::Create(innsite,indim,ncat,infixncomp,inempmix,inmixtype,instatespace,infixcodonprofile,infixomega); UniformRateProcess::Create(innsite); GeneralPathSuffStatMatrixSubstitutionProcess::Create(innsite,indim,sitemin,sitemax); } void Delete() { GeneralPathSuffStatMatrixSubstitutionProcess::Delete(); UniformRateProcess::Delete(); AACodonMutSelFiniteProfileProcess::Delete(); } }; #endif
/* Z80Load */ /***************************************************************************) (* *) (* Professional Adventure Writing System extractor. *) (* Author: Jose Luis Cebri n Page *) (* Pascal version : Carlos Sanchez (csanchez@temple.subred.org) *) (* *) (***************************************************************************) (* *) (* Z80 files support and other minor changes added by Carlos Sanchez *) (* when translating the code from C to pascal *) (* *) (***************************************************************************/ #include <memory.h> #include <stdio.h> #include <stdlib.h> /* interface */ #include "z80load.h" /* implementation */ typedef unsigned char Byte; typedef Byte *pByte; typedef unsigned short Word; typedef Word *pWord; Word MyOffset; Byte getByte (pByte * p, pWord counter) { Byte result; result = **p; *p = *p + 1; *counter = *counter - 1; return result; } void decode (void *src, void *dst, Word offset3, Word blockLen) { pByte p0, pF; Byte a, b; p0 = src; pF = (pByte) dst + MyOffset; /*offset3; */ do { a = getByte (&p0, &blockLen); if (a != 237) { *pF = a; pF++; } else { b = getByte (&p0, &blockLen); if (b != 237) { *pF = 237; pF++; *pF = b; pF++; } else { a = getByte (&p0, &blockLen); b = getByte (&p0, &blockLen); memset (pF, b, a); pF = pF + a; } } } while (blockLen != 0); } int loadZ80 (char *fileName, void *Z80RAM) { FILE *f; void *p; Word addHeaderSize; Word blockLen; Byte page; Byte hwMode; Word offset4; int result; result = 0; f = fopen (fileName, "rb"); fseek (f, 30, 0); fread (&addHeaderSize, 1, 2, f); if ((addHeaderSize != 23) && (addHeaderSize != 54)) return 1; fseek (f, 34, 0); fread (&hwMode, 1, 1, f); if (((addHeaderSize == 23) && (hwMode > 2)) || ((addHeaderSize == 54) && (hwMode > 3))) return 2; fseek (f, 32 + addHeaderSize, 0); while (!feof (f)) { fread (&blockLen, 1, 2, f); fread (&page, 1, 1, f); p = malloc (blockLen); fread (p, blockLen, 1, f); switch (page) { case 4: offset4 = 32768; break; case 5: offset4 = 49152; break; case 6: offset4 = 0; case 7: break; case 8: offset4 = 16384; break; default: return 1; } if (offset4 != 0) { offset4 -= 16384; MyOffset = offset4; decode (p, Z80RAM, offset4, blockLen); } } fclose (f); return 0; }
/**************************************************************************** * * Name: cnxtirq.c * * Description: * * Copyright: (c) 2002 Conexant Systems 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 Place, Suite 330, Boston, MA 02111-1307 USA **************************************************************************** * $Author: Palazzjd $ * $Revision: 6 $ * $Modtime: 9/24/02 8:43a $ ****************************************************************************/ /* cnxtirq.c - CNXT interrupt stuff */ #include <asm/arch/bsptypes.h> #include <asm/arch/bspcfg.h> #include <asm/arch/cnxtbsp.h> #include <asm/arch/OsTools.h> #include <asm/system.h> #include <linux/module.h> void intUnlock( UINT32 oldlevel ) { // Enables ARM IRQ interrupt restore_flags( oldlevel ); } UINT32 intLock( void ) { // Disables ARM IRQ interrupt UINT32 irqlevel; save_flags_cli(irqlevel); return irqlevel; } BOOL intContext( void ) { return FALSE; } void PICClearIntStatus(UINT32 IntSource) { HW_REG_WRITE (PIC_TOP_ISR_IRQ, (1 <<IntSource) ); } EXPORT_SYMBOL(intLock); EXPORT_SYMBOL(intUnlock);
/** * This header is generated by class-dump-z 0.2b. * * Source: /System/Library/PrivateFrameworks/WebKit.framework/WebKit */ #import <WebKit/XXUnknownSuperclass.h> #import <WebKit/WebKit-Structs.h> @class NSMutableDictionary, NSMutableArray; __attribute__((visibility("hidden"))) @interface WebHistoryPrivate : XXUnknownSuperclass { @private NSMutableDictionary *_entriesByURL; // 4 = 0x4 HashMap<long long int,WTF::RetainPtr<NSMutableArray>,WTF::IntHash<long long unsigned int>,WTF::HashTraits<long long int>,WTF::HashTraits<WTF::RetainPtr<NSMutableArray> > > *_entriesByDate; // 8 = 0x8 NSMutableArray *_orderedLastVisitedDays; // 12 = 0xc BOOL itemLimitSet; // 16 = 0x10 int itemLimit; // 20 = 0x14 BOOL ageInDaysLimitSet; // 24 = 0x18 int ageInDaysLimit; // 28 = 0x1c } @property(assign) int historyAgeInDaysLimit; // G=0x1147d; S=0x5d625; converted property @property(assign) int historyItemLimit; // G=0x113c1; S=0x5d649; converted property @property(readonly, retain) NSMutableArray *orderedLastVisitedDays; // G=0x2c125; converted property + (void)initialize; // 0x63d1 - (id)init; // 0x645d - (void)dealloc; // 0x5dc09 - (void)finalize; // 0x5db89 - (BOOL)findKey:(long long *)key forDay:(double)day; // 0x12c69 - (void)insertItem:(id)item forDateKey:(long long)dateKey; // 0x12e2d - (BOOL)removeItemFromDateCaches:(id)dateCaches; // 0x1b435 - (BOOL)removeItemForURLString:(id)urlstring; // 0x5db11 - (void)addItemToDateCaches:(id)dateCaches; // 0x12a41 - (id)visitedURL:(id)url withTitle:(id)title increaseVisitCount:(BOOL)count; // 0x1b305 - (BOOL)addItem:(id)item discardDuplicate:(BOOL)duplicate; // 0x128f9 - (BOOL)removeItem:(id)item; // 0x5d66d - (BOOL)removeItems:(id)items; // 0x5d6c9 - (BOOL)removeAllItems; // 0x5da69 - (void)addItems:(id)items; // 0x5d731 // converted property getter: - (id)orderedLastVisitedDays; // 0x2c125 - (id)orderedItemsLastVisitedOnDay:(id)day; // 0x2c095 - (id)itemForURLString:(id)urlstring; // 0x1d6dd - (BOOL)containsURL:(id)url; // 0x5d78d - (id)itemForURL:(id)url; // 0x1d6a9 - (id)allItems; // 0x5d7c9 // converted property setter: - (void)setHistoryAgeInDaysLimit:(int)daysLimit; // 0x5d625 // converted property getter: - (int)historyAgeInDaysLimit; // 0x1147d // converted property setter: - (void)setHistoryItemLimit:(int)limit; // 0x5d649 // converted property getter: - (int)historyItemLimit; // 0x113c1 - (id)ageLimitDate; // 0x1141d - (BOOL)loadHistoryGutsFromURL:(id)url savedItemsCount:(int *)count collectDiscardedItemsInto:(id)into error:(id *)error; // 0x10ff1 - (BOOL)loadFromURL:(id)url collectDiscardedItemsInto:(id)into error:(id *)error; // 0x10fc1 - (id)data; // 0x22dcd - (BOOL)saveToURL:(id)url error:(id *)error; // 0x5d7e9 - (void)addVisitedLinksToPageGroup:(PageGroup *)pageGroup; // 0x1e629 @end
/* * Copyright (C) 2015 TinyCore <http://www.tinycore.net/> * Copyright (C) 2014 TrinityCore<http://trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef TRINITY_REACTORAI_H #define TRINITY_REACTORAI_H #include "CreatureAI.h" class Unit; class ReactorAI : public CreatureAI { public: explicit ReactorAI(Creature* c) : CreatureAI(c) { } void MoveInLineOfSight(Unit*) override { } void UpdateAI(uint32 diff) override; static int Permissible(const Creature*); }; #endif
/* * Copyright (c) 2000-2003 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 of the GNU 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 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 Pkwy, * Mountain View, CA 94043, or: * * http://www.sgi.com * * For further information regarding this notice, see: * * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ #ifndef __XFS_SUPER_H__ #define __XFS_SUPER_H__ #ifdef CONFIG_XFS_DMAPI # define vfs_insertdmapi(vfs) vfs_insertops(vfsp, &xfs_dmops) # define vfs_initdmapi() dmapi_init() # define vfs_exitdmapi() dmapi_uninit() #else # define vfs_insertdmapi(vfs) do { } while (0) # define vfs_initdmapi() do { } while (0) # define vfs_exitdmapi() do { } while (0) #endif #ifdef CONFIG_XFS_QUOTA # define vfs_insertquota(vfs) vfs_insertops(vfsp, &xfs_qmops) # define vfs_initquota() xfs_qm_init() # define vfs_exitquota() xfs_qm_exit() #else # define vfs_insertquota(vfs) do { } while (0) # define vfs_initquota() do { } while (0) # define vfs_exitquota() do { } while (0) #endif #ifdef CONFIG_XFS_POSIX_ACL # define XFS_ACL_STRING "ACLs, " # define set_posix_acl_flag(sb) ((sb)->s_flags |= MS_POSIXACL) #else # define XFS_ACL_STRING # define set_posix_acl_flag(sb) do { } while (0) #endif #ifdef CONFIG_XFS_RT # define XFS_REALTIME_STRING "realtime, " #else # define XFS_REALTIME_STRING #endif #if XFS_BIG_BLKNOS # if XFS_BIG_INUMS # define XFS_BIGFS_STRING "large block/inode numbers, " # else # define XFS_BIGFS_STRING "large block numbers, " # endif #else # define XFS_BIGFS_STRING #endif #ifdef CONFIG_XFS_TRACE # define XFS_TRACE_STRING "tracing, " #else # define XFS_TRACE_STRING #endif #ifdef XFSDEBUG # define XFS_DBG_STRING "debug" #else # define XFS_DBG_STRING "no debug" #endif #define XFS_BUILD_OPTIONS XFS_ACL_STRING \ XFS_REALTIME_STRING \ XFS_BIGFS_STRING \ XFS_TRACE_STRING \ XFS_DBG_STRING /* DBG must be last */ #define LINVFS_GET_VFS(s) \ (vfs_t *)((s)->u.generic_sbp) #define LINVFS_SET_VFS(s, vfsp) \ ((s)->u.generic_sbp = vfsp) struct xfs_mount; struct pb_target; struct block_device; extern __uint64_t xfs_max_file_offset(unsigned int); extern struct inode *xfs_get_inode(bhv_desc_t *, xfs_ino_t, int); extern void xfs_initialize_vnode(bhv_desc_t *, vnode_t *, bhv_desc_t *, int); extern int xfs_blkdev_get(struct xfs_mount *, const char *, struct block_device **); extern void xfs_blkdev_put(struct block_device *); extern struct pb_target *xfs_alloc_buftarg(struct block_device *); extern void xfs_relse_buftarg(struct pb_target *); extern void xfs_free_buftarg(struct pb_target *); extern void xfs_flush_buftarg(struct pb_target *); extern int xfs_readonly_buftarg(struct pb_target *); extern void xfs_setsize_buftarg(struct pb_target *, unsigned int, unsigned int); extern unsigned int xfs_getsize_buftarg(struct pb_target *); #endif /* __XFS_SUPER_H__ */
/* FPTOOL - a fixed-point math to VHDL generation tool Description: Reader, a class that reads a source file into memory and provides in interface to it's characters with an interface that supports roll-backs. Author: Niels A. Moseley */ #ifndef reader_h #define reader_h #include <stack> #include <vector> /** The reader object reads a source file into memory and provides an interface to the characters that supports roll-backs. */ class Reader { public: virtual ~Reader(); struct position_info { size_t offset; // offset into m_source size_t line; // the line number size_t pos; // the position within the line }; /** Create a reader object by opening a file. NULL is returned when an error occured. */ static Reader* open(const char *filename); /** Rollback the read pointer to the last marked position. When succesfull, the marked position is removed from the stack. Returns false if there are no markers left. */ bool rollback(); /** Mark the current read position so we can roll back to it later */ void mark(); /** Get the charater at the current read position. The read position is not advanced. When there are no characters to read, it returns 0. */ char peek(); /** Read the character at the current read position. The read position is advanced one character. When there are no characters to read, it returns 0. */ char accept(); /** Get the current read position */ position_info getPos() const { return m_curpos; } protected: /** Hide the constructor so the user can only get a Reader object by using 'open'. */ Reader(); std::vector<char> m_source; // the source code std::stack<position_info> m_positions; // a stack to hold roll-back positions. position_info m_curpos; // the current read position. }; #endif
#ifndef R_INCLUDECONFIG_H #define R_INCLUDECONFIG_H #define R_NO_REMAP #endif
/* Copyright (c) 2016 Joey Babcock. All right reserved. See: http://www.joeybabcock.me/blog/projects/arduino-lifx-api-control-library-for-esp8266/ ArduinoLifx API - A library to control your lifx bulbs via ESP8266 on Arduino IDE. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef LifxApi_h #define LifxApi_h #include <Arduino.h> #include <ArduinoJson.h> #include <Client.h> #define HOST "api.lifx.com" #define SSL_PORT 443 #define HANDLE_MESSAGES 1 #define MAX_BUFFER_SIZE 1250 struct Color{ float saturation; float hue; long kelvin; }; struct BulbInfo{ String id; String uuid; String label; bool connected; String power; float brightness; Color color; }; class LifxApi { public: LifxApi (String apiKey, Client &client); String sendReqToLifx(String command, String type, String content); bool getBulbInfo(String selector); bool togglePower(String selector); bool setState(String selector, String param, String value, int duration); BulbInfo bulbinfo; //const char* fingerprint = "‎9D:01:5C:8E:FD:4D:DF:71:A4:99:CE:29:93:40:3F:5F:EE:74:d0:95"; const char* fingerprint = "‎E3:69:05:13:32:74:C0:37:F8:6C:B8:A7:18:98:87:B7:CD:DD:86:F0"; //Lifx https Certificate private: //JsonObject * parseUpdates(String response); String _apiKey; Client *client; const int maxMessageLength = 1500; bool checkForOkResponse(String response); }; #endif
/* * 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 * Copyright (C) 2009 Aethyra Development Team * * 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 GUI_FONTS_FONT_H #define GUI_FONTS_FONT_H #include "gui/fonts/textchunklist.h" #include <SDL_ttf.h> #include "localconsts.h" class Graphics; const unsigned int CACHES_NUMBER = 256; /** * A wrapper around SDL_ttf for allowing the use of TrueType fonts. * * <b>NOTE:</b> This class initializes SDL_ttf as necessary. */ class Font final { public: Font(const std::string &filename, const int size, const int style = 0); A_DELETE_COPY(Font) ~Font(); void loadFont(const std::string &filename, const int size, const int style = 0); int getWidth(const std::string &text) const A_WARN_UNUSED; int getHeight() const A_WARN_UNUSED; const TextChunkList *getCache() const A_WARN_UNUSED; /** * @see Font::drawString */ void drawString(Graphics *const graphics, Color col, const Color &col2, const std::string &text, const int x, const int y) A_NONNULL(2); void clear(); void doClean(); void slowLogic(const int rnd); int getCreateCounter() const A_WARN_UNUSED { return mCreateCounter; } int getDeleteCounter() const A_WARN_UNUSED { return mDeleteCounter; } int getStringIndexAt(const std::string& text, const int x) const A_WARN_UNUSED; void generate(TextChunk &chunk); void insertChunk(TextChunk *const chunk); static bool mSoftMode; private: TTF_Font *mFont; unsigned mCreateCounter; unsigned mDeleteCounter; // Word surfaces cache int mCleanTime; mutable TextChunkList mCache[CACHES_NUMBER]; }; #ifdef UNITTESTS extern int textChunkCnt; #endif #endif // GUI_FONTS_FONT_H
/* 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 */ #pragma ident "@(#) libu/ffio/evntclose.c 92.2 10/07/99 22:15:19" #include <stdio.h> #include <errno.h> #include <unistd.h> #include <ffio.h> #include "evntio.h" /* * _evnt_close * * Time close request * * Input: * fio - ffio file descriptor * stat - pointer to status return word * * Output: * ret - return value from backrtn * */ int _evnt_close(struct fdinfo *fio, struct ffsw *stat) { struct fdinfo *llfio; struct evnt_f *evnt_info; int status; int start_rtc, finish_rtc; struct ffsw log_stat; int log_ubc = 0; int ret; evnt_info = (struct evnt_f *) fio->lyr_info; llfio = fio->fioptr; if (evnt_info->parent_name == NULL) _evnt_get_parent_child(fio, &evnt_info->parent_name, &evnt_info->child_name); start_rtc = RTC(); ret = XRCALL(llfio, closertn) llfio, stat); finish_rtc = RTC(); #if !defined(__mips) && !defined(_LITTLE_ENDIAN) if (evnt_info->optflags.trace) { int record[4]; record[0] = (_evnt_CLOSE | evnt_info->fd); record[1] = start_rtc; record[2] = finish_rtc; record[3] = ret; status = EVNT_XR_WRITE(record, sizeof(int), 4); INC_GLOBAL_LOG_COUNT(close); } if (evnt_info->file_ptr) EVNT_XR_FLUSH(); #endif evnt_info->counts.close++; evnt_info->counts.total++; evnt_info->close_time = finish_rtc - start_rtc; if (evnt_info->optflags.diag || evnt_info->optflags.trace) _evnt_close_diags(fio, evnt_info, TRUE); _evnt_clfree(fio); return (ret); } /* * _evnt_clfree * * Free the memory blocks used by the event layer and set corresponding * pointers to NULL * * Input: * fio - ffio file descriptor * * Output: * */ void _evnt_clfree(struct fdinfo *fio) { struct evnt_f *evnt_info; struct evnt_async_tracker *this_tracker; struct evnt_async_tracker *next_tracker; evnt_info = (struct evnt_f *) fio->lyr_info; if (fio->lyr_info != NULL) { this_tracker = evnt_info->async_tracker; while (this_tracker) { next_tracker = this_tracker->next_tracker; free(this_tracker); this_tracker = next_tracker; } free(fio->lyr_info); fio->lyr_info = NULL; } if (fio->fioptr != NULL) { free(fio->fioptr); fio->fioptr = NULL; } }
/* UOL Messenger * Copyright (c) 2005 Universo Online S/A * * Direitos Autorais Reservados * All rights reserved * * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo * sob os termos da Licença Pública Geral GNU conforme publicada pela Free * Software Foundation; tanto a versão 2 da Licença, como (a seu critério) * qualquer versão posterior. * Este programa é distribuído na expectativa de que seja útil, porém, * SEM NENHUMA GARANTIA; nem mesmo a garantia implícita de COMERCIABILIDADE * OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral * do GNU para mais detalhes. * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto * com este programa; se não, escreva para a Free Software Foundation, Inc., * no endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. * * 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. * * Universo Online S/A - A/C: UOL Messenger 5o. Andar * Avenida Brigadeiro Faria Lima, 1.384 - Jardim Paulistano * São Paulo SP - CEP 01452-002 - BRASIL */ #pragma once #include <interfaces/IUOLMessengerMainFrameFocusNotifier.h> #include "../ObserverRegister.h" #include "../ObserverWrapper.h" class CMainFrameFocusObserverWrapper : public CObserverWrapper<CUOLMessengerMainFrameFocusObserver> { public: CMainFrameFocusObserverWrapper(CUOLMessengerMainFrameFocusObserver* pWrapped); virtual void OnSetFocus(HWND lostFocusWnd); virtual void OnKillFocus(HWND newFocusWnd); }; MAKEAUTOPTR(CMainFrameFocusObserverWrapper); class CMainFrameFocusNotifier : public IUOLMessengerMainFrameFocusNotifier { public: // IUOLMessengerMainFrameFocusNotifier interface virtual void SetFocus(HWND lostFocusWnd); virtual void KillFocus(HWND newFocusWnd); void RegisterObserver(CUOLMessengerMainFrameFocusObserver* pObserver); void UnregisterObserver(CUOLMessengerMainFrameFocusObserver* pObserver); private: CAtlList<CMainFrameFocusObserverWrapperPtr> m_listObservers; CComAutoCriticalSection m_csObservers; }; MAKEAUTOPTR(CMainFrameFocusNotifier);
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the Qt3Support module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef Q3PTRDICT_H #define Q3PTRDICT_H #include "q3gdict.h" template<class type> class Q3PtrDict #ifdef qdoc : public Q3PtrCollection #else : public Q3GDict #endif { public: Q3PtrDict(int size=17) : Q3GDict(size,PtrKey,0,0) {} Q3PtrDict( const Q3PtrDict<type> &d ) : Q3GDict(d) {} ~Q3PtrDict() { clear(); } Q3PtrDict<type> &operator=(const Q3PtrDict<type> &d) { return (Q3PtrDict<type>&)Q3GDict::operator=(d); } uint count() const { return Q3GDict::count(); } uint size() const { return Q3GDict::size(); } bool isEmpty() const { return Q3GDict::count() == 0; } void insert( void *k, const type *d ) { Q3GDict::look_ptr(k,(Item)d,1); } void replace( void *k, const type *d ) { Q3GDict::look_ptr(k,(Item)d,2); } bool remove( void *k ) { return Q3GDict::remove_ptr(k); } type *take( void *k ) { return (type*)Q3GDict::take_ptr(k); } type *find( void *k ) const { return (type *)((Q3GDict*)this)->Q3GDict::look_ptr(k,0,0); } type *operator[]( void *k ) const { return (type *)((Q3GDict*)this)->Q3GDict::look_ptr(k,0,0); } void clear() { Q3GDict::clear(); } void resize( uint n ) { Q3GDict::resize(n); } void statistics() const { Q3GDict::statistics(); } #ifdef qdoc protected: virtual QDataStream& read( QDataStream &, Q3PtrCollection::Item & ); virtual QDataStream& write( QDataStream &, Q3PtrCollection::Item ) const; #endif private: void deleteItem( Item d ); }; #if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) template<> inline void Q3PtrDict<void>::deleteItem( Q3PtrCollection::Item ) { } #endif template<class type> inline void Q3PtrDict<type>::deleteItem( Q3PtrCollection::Item d ) { if ( del_item ) delete (type *)d; } template<class type> class Q3PtrDictIterator : public Q3GDictIterator { public: Q3PtrDictIterator(const Q3PtrDict<type> &d) :Q3GDictIterator((Q3GDict &)d) {} ~Q3PtrDictIterator() {} uint count() const { return dict->count(); } bool isEmpty() const { return dict->count() == 0; } type *toFirst() { return (type *)Q3GDictIterator::toFirst(); } operator type *() const { return (type *)Q3GDictIterator::get(); } type *current() const { return (type *)Q3GDictIterator::get(); } void *currentKey() const { return Q3GDictIterator::getKeyPtr(); } type *operator()() { return (type *)Q3GDictIterator::operator()(); } type *operator++() { return (type *)Q3GDictIterator::operator++(); } type *operator+=(uint j) { return (type *)Q3GDictIterator::operator+=(j);} }; #endif // Q3PTRDICT_H
/***************************************************************************** * dbus.h : Low level dbus stuff header ***************************************************************************** * LibMPRIS - Copyright (C) 2007 Milosz Derezynski, Mirsal Ennaime * * Authors: Milosz Derezynski * Mirsal Ennaime <mirsal dot ennaime at gmail dot com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 _MPRIS_DBUS_H_ #define _MPRIS_DBUS_H_ #include <stdlib.h> #include <stdio.h> #include <dbus/dbus.h> #include <mpris/types.h> extern DBusConnection *conn; void mpris_dbus_connection_set(DBusConnection *connection); int mpris_dbus_init (void); MPRISList* mpris_dbus_list_players (void); MPRISPlayerInfo* mpris_dbus_get_player_info (const char *player); DBusMessage* mpris_dbus_get_metadata_msg(const char *player, int track); int mpris_dbus_get_current_track(const char *player); void mpris_dbus_single_call(const char *player, const char *method); void mpris_dbus_set_loop(const char *player, int boolean); void mpris_dbus_set_random(const char *player, int boolean); void mpris_dbus_del_track(const char *player, int index); int mpris_dbus_add_track(const char *player, const char *uri, int play); int mpris_dbus_get_length(const char *player); #endif /* _MPRIS_DBUS_H_ */
#ifndef __SITEMANAGER_DIALOG_H__ #define __SITEMANAGER_DIALOG_H__ #include "dialogex.h" #include "sitemanager.h" class CInterProcessMutex; class CWindowStateManager; class CSiteManagerDropTarget; class CSiteManagerDialog final : public wxDialogEx { friend class CSiteManagerDropTarget; DECLARE_EVENT_TABLE() public: struct _connected_site { CServer server; wxString old_path; wxString new_path; }; /// Constructors CSiteManagerDialog(); virtual ~CSiteManagerDialog(); // Creation. If pServer is set, it will cause a new item to be created. bool Create(wxWindow* parent, std::vector<_connected_site> *connected_sites, const CServer* pServer = 0); bool GetServer(CSiteManagerItemData_Site& data); wxString GetSitePath(bool stripBookmark = true); protected: // Creates the controls and sizers void CreateControls(wxWindow* parent); bool Verify(); bool UpdateItem(); bool UpdateServer(CSiteManagerItemData_Site &server, const wxString& name); bool UpdateBookmark(CSiteManagerItemData &bookmark, const CServer& server); bool Load(); bool Save(TiXmlElement *pElement = 0, wxTreeItemId treeId = wxTreeItemId()); bool SaveChild(TiXmlElement *pElement, wxTreeItemId child); void SetCtrlState(); bool LoadDefaultSites(); void SetProtocol(ServerProtocol protocol); ServerProtocol GetProtocol() const; bool IsPredefinedItem(wxTreeItemId item); wxString FindFirstFreeName(const wxTreeItemId &parent, const wxString& name); void AddNewSite(wxTreeItemId parent, const CServer& server, bool connected = false); void CopyAddServer(const CServer& server); void AddNewBookmark(wxTreeItemId parent); void RememberLastSelected(); wxString GetSitePath(wxTreeItemId item, bool stripBookmark = true); void MarkConnectedSites(); void MarkConnectedSite(int connected_site); void OnOK(wxCommandEvent&); void OnCancel(wxCommandEvent&); void OnConnect(wxCommandEvent& event); void OnNewSite(wxCommandEvent& event); void OnNewFolder(wxCommandEvent& event); void OnRename(wxCommandEvent& event); void OnDelete(wxCommandEvent& event); void OnBeginLabelEdit(wxTreeEvent& event); void OnEndLabelEdit(wxTreeEvent& event); void OnSelChanging(wxTreeEvent& event); void OnSelChanged(wxTreeEvent& event); void OnLogontypeSelChanged(wxCommandEvent& event); void OnRemoteDirBrowse(wxCommandEvent& event); void OnItemActivated(wxTreeEvent& event); void OnLimitMultipleConnectionsChanged(wxCommandEvent& event); void OnCharsetChange(wxCommandEvent& event); void OnProtocolSelChanged(wxCommandEvent& event); void OnBeginDrag(wxTreeEvent& event); void OnChar(wxKeyEvent& event); void OnCopySite(wxCommandEvent& event); void OnContextMenu(wxTreeEvent& event); void OnExportSelected(wxCommandEvent&); void OnNewBookmark(wxCommandEvent&); void OnBookmarkBrowse(wxCommandEvent&); CInterProcessMutex* m_pSiteManagerMutex{}; wxTreeItemId m_predefinedSites; wxTreeItemId m_ownSites; wxTreeItemId m_dropSource; wxTreeItemId m_contextMenuItem; bool MoveItems(wxTreeItemId source, wxTreeItemId target, bool copy); protected: CWindowStateManager* m_pWindowStateManager{}; wxNotebook *m_pNotebook_Site{}; wxNotebook *m_pNotebook_Bookmark{}; std::vector<_connected_site> *m_connected_sites{}; bool m_is_deleting{}; }; #endif //__SITEMANAGER_DIALOG_H__
#include <gsl/gsl_math.h> #include <gsl/gsl_cblas.h> #include "cblas.h" void cblas_dgemm (const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const double alpha, const double *A, const int lda, const double *B, const int ldb, const double beta, double *C, const int ldc) { #define BASE double #include "source_gemm_r.h" #undef BASE }
#include <kernel.h> #include <kdata.h> #include <printf.h> #include <devfd.h> /* * TODO: Debug, low density is half the sectors/track, * what to do about 80 v 40 track ? * */ /* Two drives but minors 2,3 are single density mode */ #define MAX_FD 4 #define OPDIR_NONE 0 #define OPDIR_READ 1 #define OPDIR_WRITE 2 #define FD_READ 0x88 /* 2797 needs 0x88, 1797 needs 0x80 */ #define FD_WRITE 0xA8 /* Likewise A8 v A0 */ static uint8_t motorct; static uint8_t fd_selected = 0xFF; static uint8_t fd_tab[MAX_FD] = { 0xFF, 0xFF }; void fd_motor_timer(void) { if (motorct) { motorct--; if (motorct == 0) { fd_motor_off(); fd_selected = 0xFF; } } } /* * We only support normal block I/O not swap. */ static int fd_transfer(uint_fast8_t minor, bool is_read, uint_fast8_t rawflag) { uint16_t nb = 0; int tries; uint8_t err = 0; uint8_t *driveptr = &fd_tab[minor & 1]; irqflags_t irq; if(rawflag == 1 && d_blkoff(BLKSHIFT)) return -1; udata.u_nblock *= 2; if (rawflag == 2) goto bad2; irq = di(); if (fd_selected != minor) { uint8_t err = fd_motor_on(minor|(minor > 1 ? 0: 0x10)); if (err) goto bad; motorct = 150; /* 3 seconds */ } irqrestore(irq); // kprintf("Issue command: %c drive %d block %d for %d\n", "wr"[is_read], minor, udata.u_block, udata.u_nblock); fd_cmd[0] = rawflag; fd_cmd[1] = is_read ? FD_READ : FD_WRITE; /* There are 16 256 byte sectors for DSDD. These are organised so that we switch head then step. Sectors 0-15 (our block 0-7) Track 0, side 0 Sectors 16-31 (our block 8-15) Track 0, side 1 etc */ fd_cmd[2] = udata.u_block / 16; /* Get the track we need */ fd_cmd[3] = ((udata.u_block & 15) << 1); /* 0 - 1 base is corrected in asm */ fd_cmd[4] = is_read ? OPDIR_READ: OPDIR_WRITE; fd_data = (uint16_t)udata.u_dptr; while (udata.u_nblock--) { for (tries = 0; tries < 4 ; tries++) { // kprintf("Sector: %d Head: %d Track %d\n", (fd_cmd[3]&15)+1, fd_cmd[3]>>4, fd_cmd[2]); err = fd_operation(driveptr); if (err == 0) break; if (tries > 1) fd_reset(driveptr); } /* FIXME: should we try the other half and then bale out ? */ if (tries == 3) goto bad; fd_data += 256; fd_cmd[3]++; /* Next sector for next block */ if (fd_cmd[3] == 32) { /* Next track */ fd_cmd[3] = 0; fd_cmd[2]++; } nb++; } return nb << (BLKSHIFT - 1); bad: kprintf("fd%d: error %x\n", minor, err); bad2: udata.u_error = EIO; return -1; } int fd_open(uint_fast8_t minor, uint16_t flag) { flag; if(minor >= MAX_FD) { udata.u_error = ENODEV; return -1; } return 0; } int fd_read(uint_fast8_t minor, uint_fast8_t rawflag, uint_fast8_t flag) { flag; return fd_transfer(minor, true, rawflag); } int fd_write(uint_fast8_t minor, uint_fast8_t rawflag, uint_fast8_t flag) { flag; return fd_transfer(minor, false, rawflag); }
#ifndef _LEC_ARP_H_ #define _LEC_ARP_H_ #include <linux/atm.h> #include <linux/atmdev.h> #include <linux/if_ether.h> #include <linux/atmlec.h> struct lec_arp_table { struct hlist_node next; unsigned char atm_addr[ATM_ESA_LEN]; unsigned char mac_addr[ETH_ALEN]; int is_rdesc; struct atm_vcc *vcc; struct atm_vcc *recv_vcc; void (*old_push) (struct atm_vcc *vcc, struct sk_buff *skb); void (*old_recv_push) (struct atm_vcc *vcc, struct sk_buff *skb); unsigned long last_used; unsigned long timestamp; unsigned char no_tries; unsigned char status; unsigned short flags; unsigned short packets_flooded; unsigned long flush_tran_id; struct timer_list timer; struct lec_priv *priv; u8 *tlvs; u32 sizeoftlvs; struct sk_buff_head tx_wait; atomic_t usage; }; struct tlv { u32 type; u8 length; u8 value[255]; }; #define ESI_UNKNOWN 0 #define ESI_ARP_PENDING 1 #define ESI_VC_PENDING 2 #define ESI_FLUSH_PENDING 4 #define ESI_FORWARD_DIRECT 5 #define LEC_REMOTE_FLAG 0x0001 #define LEC_PERMANENT_FLAG 0x0002 #endif
/** ****************************************************************************** * @file TIM/OCInactive/stm32f10x_conf.h * @author MCD Application Team * @version V3.5.0 * @date 08-April-2011 * @brief Library configuration file. ****************************************************************************** * @attention * * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. * * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2> ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F10x_CONF_H #define __STM32F10x_CONF_H /* Includes ------------------------------------------------------------------*/ /* Uncomment/Comment the line below to enable/disable peripheral header file inclusion */ #include "stm32f10x_adc.h" #include "stm32f10x_bkp.h" #include "stm32f10x_can.h" #include "stm32f10x_cec.h" #include "stm32f10x_crc.h" #include "stm32f10x_dac.h" #include "stm32f10x_dbgmcu.h" #include "stm32f10x_dma.h" #include "stm32f10x_exti.h" #include "stm32f10x_flash.h" #include "stm32f10x_fsmc.h" #include "stm32f10x_gpio.h" #include "stm32f10x_i2c.h" #include "stm32f10x_iwdg.h" #include "stm32f10x_pwr.h" #include "stm32f10x_rcc.h" #include "stm32f10x_rtc.h" #include "stm32f10x_sdio.h" #include "stm32f10x_spi.h" #include "stm32f10x_tim.h" #include "stm32f10x_usart.h" #include "stm32f10x_wwdg.h" #include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Uncomment the line below to expanse the "assert_param" macro in the Standard Peripheral Library drivers code */ /* #define USE_FULL_ASSERT 1 */ /* Exported macro ------------------------------------------------------------*/ #ifdef USE_FULL_ASSERT /** * @brief The assert_param macro is used for function's parameters check. * @param expr: If expr is false, it calls assert_failed function which reports * the name of the source file and the source line number of the call * that failed. If expr is true, it returns no value. * @retval None */ #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) /* Exported functions ------------------------------------------------------- */ void assert_failed(uint8_t* file, uint32_t line); #else #define assert_param(expr) ((void)0) #endif /* USE_FULL_ASSERT */ #endif /* __STM32F10x_CONF_H */ /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/* * TI OMAP L4 interconnect emulation. * * Copyright (C) 2007-2009 Nokia Corporation * Written by Andrzej Zaborowski <andrew@openedhand.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 or * (at your option) any later version 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, see <http://www.gnu.org/licenses/>. */ #include "hw.h" #include "omap.h" struct omap_l4_s { MemoryRegion *address_space; hwaddr base; int ta_num; struct omap_target_agent_s ta[0]; }; struct omap_l4_s *omap_l4_init(MemoryRegion *address_space, hwaddr base, int ta_num, int region_count) { struct omap_l4_s *bus = g_malloc0( sizeof(*bus) + ta_num * sizeof(*bus->ta)); bus->address_space = address_space; bus->ta_num = ta_num; bus->base = base; return bus; } hwaddr omap_l4_region_base(struct omap_target_agent_s *ta, int region) { return ta->bus->base + ta->start[region].offset; } hwaddr omap_l4_region_size(struct omap_target_agent_s *ta, int region) { return ta->start[region].size; } static uint64_t omap_l4ta_read(void *opaque, hwaddr addr, unsigned size) { struct omap_target_agent_s *s = (struct omap_target_agent_s *) opaque; if (size != 2) { return omap_badwidth_read16(opaque, addr); } switch (addr) { case 0x00: /* COMPONENT */ return s->component; case 0x20: /* AGENT_CONTROL */ return s->control; case 0x28: /* AGENT_STATUS */ return s->status; } OMAP_BAD_REG(addr); return 0; } static void omap_l4ta_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { struct omap_target_agent_s *s = (struct omap_target_agent_s *) opaque; if (size != 4) { return omap_badwidth_write32(opaque, addr, value); } switch (addr) { case 0x00: /* COMPONENT */ case 0x28: /* AGENT_STATUS */ OMAP_RO_REG(addr); break; case 0x20: /* AGENT_CONTROL */ s->control = value & 0x01000700; if (value & 1) /* OCP_RESET */ s->status &= ~1; /* REQ_TIMEOUT */ break; default: OMAP_BAD_REG(addr); } } static const MemoryRegionOps omap_l4ta_ops = { .read = omap_l4ta_read, .write = omap_l4ta_write, .endianness = DEVICE_NATIVE_ENDIAN, }; struct omap_target_agent_s *omap2_l4ta_init(struct omap_l4_s *bus, const struct omap_l4_region_s *regions, const struct omap2_l4_agent_info_s *agents, int cs) { int i; struct omap_target_agent_s *ta = NULL; const struct omap2_l4_agent_info_s *info = NULL; for (i = 0; i < bus->ta_num; i ++) if (agents[i].ta == cs) { ta = &bus->ta[i]; info = &agents[i]; break; } if (!ta) { fprintf(stderr, "%s: bad target agent (%i)\n", __FUNCTION__, cs); exit(-1); } ta->bus = bus; ta->start = &regions[info->region]; ta->regions = info->regions; ta->component = ('Q' << 24) | ('E' << 16) | ('M' << 8) | ('U' << 0); ta->status = 0x00000000; ta->control = 0x00000200; /* XXX 01000200 for L4TAO */ memory_region_init_io(&ta->iomem, &omap_l4ta_ops, ta, "omap.l4ta", omap_l4_region_size(ta, info->ta_region)); omap_l4_attach(ta, info->ta_region, &ta->iomem); return ta; } hwaddr omap_l4_attach(struct omap_target_agent_s *ta, int region, MemoryRegion *mr) { hwaddr base; if (region < 0 || region >= ta->regions) { fprintf(stderr, "%s: bad io region (%i)\n", __FUNCTION__, region); exit(-1); } base = ta->bus->base + ta->start[region].offset; if (mr) { memory_region_add_subregion(ta->bus->address_space, base, mr); } return base; } struct omap_target_agent_s *omap3_l4ta_init( struct omap_l4_s *bus, const struct omap_l4_region_s *regions, const struct omap3_l4_agent_info_s *agents, int cs) { int i; struct omap_target_agent_s *ta = NULL; const struct omap3_l4_agent_info_s *info = NULL; for (i = 0; i < bus->ta_num; i++) if (agents[i].agent_id == cs) { ta = &bus->ta[i]; info = &agents[i]; break; } if (!ta) { hw_error("%s: invalid agent id (%i)", __func__, cs); } if (ta->bus) { hw_error("%s: target agent (%d) already initialized", __func__, cs); } ta->bus = bus; ta->start = &regions[info->first_region_id]; ta->regions = info->region_count; ta->component = ('Q' << 24) | ('E' << 16) | ('M' << 8) | ('U' << 0); ta->status = 0x00000000; ta->control = 0x00000200; for (i = 0; i < info->region_count; i++) { if (regions[info->first_region_id + i].access == L4TYPE_TA) { break; } } if (i >= info->region_count) { hw_error("%s: specified agent (%d) has no TA region", __func__, cs); } ta->base = ta->bus->base + ta->start[i].offset; return ta; }
/* * DO NOT EDIT THIS FILE - it is generated by Glade. */ GtkWidget* create_bfl_launcher_dialog (void); GtkWidget* create_level_select_dialog (void);
/** * @file rtems/score/threadmp.h * * This include file contains the specification for all routines * and data specific to the multiprocessing portion of the thread package. */ /* * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. */ #ifndef _RTEMS_SCORE_THREADMP_H #define _RTEMS_SCORE_THREADMP_H /** * @defgroup ScoreThreadMP Thread Handler Multiprocessing Support * * This handler encapsulates functionality which is related to managing * threads in a multiprocessor system configuration. This handler must * manage proxies which represent remote threads blocking on local * operations. */ /**@{*/ #ifdef __cplusplus extern "C" { #endif /** * @brief _Thread_MP_Handler_initialization * * This routine initializes the multiprocessing portion of the Thread Handler. */ void _Thread_MP_Handler_initialization ( uint32_t maximum_proxies ); /** * @brief _Thread_MP_Allocate_proxy * * This allocates a proxy control block from * the inactive chain of free proxy control blocks. * * @note This function returns a thread control pointer * because proxies are substitutes for remote threads. */ Thread_Control *_Thread_MP_Allocate_proxy ( States_Control the_state ); /** * @brief _Thread_MP_Find_proxy * * This function removes the proxy control block for the specified * id from the active chain of proxy control blocks. */ Thread_Control *_Thread_MP_Find_proxy ( Objects_Id the_id ); /** * @brief Active Proxy Set * * The following chain is used to manage the active set proxies. */ SCORE_EXTERN Chain_Control _Thread_MP_Active_proxies; /** * @brief Inactive Proxy Set * * The following chain is used to manage the inactive set of proxies. */ SCORE_EXTERN Chain_Control _Thread_MP_Inactive_proxies; #ifndef __RTEMS_APPLICATION__ #include <rtems/score/threadmp.inl> #endif #ifdef __cplusplus } #endif /**@}*/ #endif /* end of include file */
// boolean.c -- ʹÓÃ_BoolÀàÐ͵ıäÁ¿ variable #include <stdio.h> int main(void) { long num; long sum = 0L; _Bool input_is_good; printf("Please Enter an integer to be summed "); printf(" (q to quit): "); input_is_good = (scanf("%ld", &num) == 1) ; while (input_is_good) { sum = sum + num; printf("Please enter next integer (q to quit): "); input_is_good = (scanf("%ld", &num) == 1); } printf("Those integers sum to %ld.\n", sum); return 0; }
//============================================================================ // // SSSS tt lll lll // SS SS tt ll ll // SS tttttt eeee ll ll aaaa // SSSS tt ee ee ll ll aa // SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" // SS SS tt ee ll ll aa aa // SSSS ttt eeeee llll llll aaaaa // // Copyright (c) 1995-2015 by Bradford W. Mott, Stephen Anthony // and the Stella Team // // See the file "License.txt" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // // $Id$ //============================================================================ #import <Cocoa/Cocoa.h> /** AboutBox window class and support functions for the Macintosh OS X SDL port of Stella. @author Mark Grebe <atarimac@cox.net> */ @interface AboutBox : NSObject { IBOutlet id appNameField; IBOutlet id creditsField; IBOutlet id versionField; NSTimer *scrollTimer; float currentPosition; float maxScrollHeight; NSTimeInterval startTime; BOOL restartAtTop; } + (AboutBox *)sharedInstance; - (IBAction)showPanel:(id)sender; - (void)OK:(id)sender; @end
// -*- c-basic-offset: 8; indent-tabs-mode: t -*- // vim:ts=8:sw=8:noet:ai: /* * Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com> * * This file is part of libass. * * libass 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. * * libass 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 libass; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef LIBASS_CACHE_H #define LIBASS_CACHE_H #include "ass.h" #include "ass_font.h" #include "ass_bitmap.h" void ass_font_cache_init(void); ass_font_t* ass_font_cache_find(ass_font_desc_t* desc); void* ass_font_cache_add(ass_font_t* font); void ass_font_cache_done(void); // describes a bitmap; bitmaps with equivalents structs are considered identical typedef struct bitmap_hash_key_s { char bitmap; // bool : true = bitmap, false = outline ass_font_t* font; double size; // font size uint32_t ch; // character code unsigned outline; // border width, 16.16 fixed point value int bold, italic; char be; // blur edges double blur; // gaussian blur unsigned scale_x, scale_y; // 16.16 int frx, fry, frz; // signed 16.16 int shift_x, shift_y; // shift vector that was added to glyph before applying rotation // = 0, if frx = fry = frx = 0 // = (glyph base point) - (rotation origin), otherwise FT_Vector advance; // subpixel shift vector } bitmap_hash_key_t; typedef struct bitmap_hash_val_s { bitmap_t* bm; // the actual bitmaps bitmap_t* bm_o; bitmap_t* bm_s; } bitmap_hash_val_t; void ass_bitmap_cache_init(void); void* cache_add_bitmap(bitmap_hash_key_t* key, bitmap_hash_val_t* val); bitmap_hash_val_t* cache_find_bitmap(bitmap_hash_key_t* key); void ass_bitmap_cache_reset(void); void ass_bitmap_cache_done(void); // Cache for composited bitmaps typedef struct composite_hash_key_s { int aw, ah, bw, bh; int ax, ay, bx, by; bitmap_hash_key_t a; bitmap_hash_key_t b; } composite_hash_key_t; typedef struct composite_hash_val_s { unsigned char* a; unsigned char* b; } composite_hash_val_t; void ass_composite_cache_init(void); void* cache_add_composite(composite_hash_key_t* key, composite_hash_val_t* val); composite_hash_val_t* cache_find_composite(composite_hash_key_t* key); void ass_composite_cache_reset(void); void ass_composite_cache_done(void); // describes an outline glyph typedef struct glyph_hash_key_s { ass_font_t* font; double size; // font size uint32_t ch; // character code int bold, italic; unsigned scale_x, scale_y; // 16.16 FT_Vector advance; // subpixel shift vector unsigned outline; // border width, 16.16 } glyph_hash_key_t; typedef struct glyph_hash_val_s { FT_Glyph glyph; FT_Glyph outline_glyph; FT_BBox bbox_scaled; // bbox after scaling, but before rotation FT_Vector advance; // 26.6, advance distance to the next bitmap in line } glyph_hash_val_t; void ass_glyph_cache_init(void); void* cache_add_glyph(glyph_hash_key_t* key, glyph_hash_val_t* val); glyph_hash_val_t* cache_find_glyph(glyph_hash_key_t* key); void ass_glyph_cache_reset(void); void ass_glyph_cache_done(void); typedef struct hashmap_s hashmap_t; typedef void (*hashmap_item_dtor_t)(void* key, size_t key_size, void* value, size_t value_size); typedef int (*hashmap_key_compare_t)(void* key1, void* key2, size_t key_size); typedef unsigned (*hashmap_hash_t)(void* key, size_t key_size); hashmap_t* hashmap_init(size_t key_size, size_t value_size, int nbuckets, hashmap_item_dtor_t item_dtor, hashmap_key_compare_t key_compare, hashmap_hash_t hash); void hashmap_done(hashmap_t* map); void* hashmap_insert(hashmap_t* map, void* key, void* value); void* hashmap_find(hashmap_t* map, void* key); #endif /* LIBASS_CACHE_H */
#pragma once #include "device.h" struct System; namespace interrupt { enum IrqNumber { VBLANK = 0, GPU = 1, CDROM = 2, DMA = 3, TIMER0 = 4, TIMER1 = 5, TIMER2 = 6, CONTROLLER = 7, SIO = 8, SPU = 9, LIGHTPEN = 10 }; // Interrupt Channels union IRQ { struct { uint16_t vblank : 1; // IRQ0 uint16_t gpu : 1; // IRQ1 uint16_t cdrom : 1; // IRQ2 uint16_t dma : 1; // IRQ3 uint16_t timer0 : 1; // IRQ4 uint16_t timer1 : 1; // IRQ5 uint16_t timer2 : 1; // IRQ6 uint16_t controller : 1; // IRQ7 uint16_t sio : 1; // IRQ8 uint16_t spu : 1; // IRQ9 uint16_t lightpen : 1; // IRQ10 uint16_t : 5; }; uint16_t _reg; uint8_t _byte[2]; IRQ() : _reg(0) {} }; } // namespace interrupt class Interrupt { interrupt::IRQ status; interrupt::IRQ mask; System* sys; public: Interrupt(System* sys); void reset(); void step(); uint8_t read(uint32_t address); void write(uint32_t address, uint8_t data); void trigger(interrupt::IrqNumber irq); bool interruptPending(); template <class Archive> void serialize(Archive& ar) { ar(status._reg, mask._reg); } };
/************************************************************************ ** ** Authors: Azazello <lachupe@gmail.com>, ** Nils Schimmelmann <nschimme@gmail.com> (Jahara) ** ** This file is part of the MMapper project. ** Maintained by Nils Schimmelmann <nschimme@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 CGROUPCOMMUNICATOR_H_ #define CGROUPCOMMUNICATOR_H_ #include <QObject> #include <QDomNode> #include <QHash> class CGroup; class CGroupClient; // draft for no peer class CGroupDraftConnection : public QObject { Q_OBJECT public: CGroupDraftConnection() {} virtual ~CGroupDraftConnection() {} }; class CGroupCommunicator : public QObject { Q_OBJECT int type; enum Messages { NONE, ACK, REQ_VERSION, REQ_ACK, REQ_LOGIN, REQ_INFO, PROT_VERSION, GTELL, STATE_LOGGED, STATE_KICKED, ADD_CHAR, REMOVE_CHAR, UPDATE_CHAR, RENAME_CHAR }; QObject *peer; // server or client CGroup *getGroup() { return reinterpret_cast<CGroup*>( parent() ); } void connectionClosed(CGroupClient *connection); void connectionEstablished(CGroupClient *connection); void connecting(CGroupClient *connection); QByteArray formMessageBlock(int message, QDomNode data); void sendMessage(CGroupClient *connection, int message, QByteArray data = ""); void sendMessage(CGroupClient *connection, int message, QDomNode data); void sendLoginInformation(CGroupClient *connection); void parseLoginInformation(CGroupClient *connection, QDomNode data); void sendGroupInformation(CGroupClient *connection); void parseGroupInformation(CGroupClient *connection, QDomNode data); void userLoggedOn(CGroupClient *conn); void userLoggedOff(CGroupClient *conn); void retrieveDataClient(CGroupClient *connection, int message, QDomNode data); void retrieveDataServer(CGroupClient *connection, int message, QDomNode data); QHash<QByteArray, int> clientsList; public: const static int protocolVersion = 102; enum States { Server, Client, Off }; CGroupCommunicator(int type, QObject *parent); virtual ~CGroupCommunicator(); void changeType(int newState); int getType() {return type; } void sendCharUpdate(CGroupClient *conn, QDomNode blob); void sendCharUpdate(QDomNode blob); bool isConnected(); void reconnect(); void sendRemoveUserNotification(CGroupClient *conn, QByteArray name); void renameConnection(QByteArray oldName, QByteArray newName); void sendUpdateName(QByteArray oldName, QByteArray newName); void sendLog(const QString&); public slots: void connectionStateChanged(CGroupClient *connection); void errorInConnection(CGroupClient *connection, const QString&); void serverStartupFailed(); void incomingData(CGroupClient *connection, QByteArray data); void sendGTell(QByteArray tell); void relayMessage(CGroupClient *connection, int message, QDomNode node); signals: void typeChanged(int type); }; #endif /*CGROUPCOMMUNICATOR_H_*/
#ifndef LSSETEDITOR_H #define LSSETEDITOR_H #include <QWidget> #include <QSpinBox> #include <QComboBox> class _LSSetEntryEditorBaseBase : public QWidget { Q_OBJECT protected: explicit _LSSetEntryEditorBaseBase(QWidget *parent = 0) : QWidget(parent) { } signals: void dataEdited(); }; // class prototype template <typename TData, typename TWidget> class LSSetEditor; template <typename TData> class LSSetEntryEditorBase : public _LSSetEntryEditorBaseBase { protected: explicit LSSetEntryEditorBase(QWidget *parent = 0) : _LSSetEntryEditorBaseBase(parent) { } public: void setCurrentEntry(TData &entry) { m_currentEntry = &entry; loadEntryFrom(entry); } private: TData *m_currentEntry; protected: virtual void loadEntryFrom(const TData &entry) = 0; TData *currentEntry() const { return m_currentEntry; } }; class _LSSetEditorBase : public QWidget { Q_OBJECT public: explicit _LSSetEditorBase(int maxEntries, QWidget *parent = 0); protected: int m_maxEntries; QSpinBox *m_entryCount; QComboBox *m_chooser; QWidget *m_setEditorWidget; int m_loadingThings; void setup(QWidget *eWidget); virtual void changeEntryCountTo(int count) = 0; virtual void showEntry(int index) = 0; virtual void resizeDataListTo(int count) = 0; private slots: void handleEntryCountChanged(int count); void handleEntrySelected(int index); signals: void dataEdited(); }; template <typename TData, typename TWidget> class LSSetEditor : public _LSSetEditorBase { public: explicit LSSetEditor(int maxEntries, QWidget *parent = 0) : _LSSetEditorBase(maxEntries, parent) { TWidget *w = new TWidget(this); setup(w); m_setEditorWidget = w; m_typedSetEditorWidget = w; LSSetEntryEditorBase<TData> *checkMe = w; connect(checkMe, SIGNAL(dataEdited()), SIGNAL(dataEdited())); } void setData(QList<TData> *newData) { m_loadingThings++; m_data = newData; m_entryCount->setValue(newData->count()); changeEntryCountTo(newData->count()); m_chooser->setCurrentIndex(newData->count() ? 0 : -1); showEntry(newData->count() ? 0 : -1); m_loadingThings--; } protected: QList<TData> *m_data; TWidget *m_typedSetEditorWidget; void changeEntryCountTo(int count) { m_loadingThings++; int existingCount = m_chooser->count(); if (existingCount > count) { // remove something int nowSelected = m_chooser->currentIndex(); if (nowSelected >= count) { // oops, we'll need to select something else showEntry(count - 1); m_chooser->setCurrentIndex(count - 1); } for (int i = (existingCount - 1); i >= count; i--) m_chooser->removeItem(i); } else if (count > existingCount) { // add something for (int i = existingCount; i < count; i++) m_chooser->addItem(QString("Set %1").arg(i + 1)); } m_loadingThings--; } void resizeDataListTo(int count) { m_data->reserve(count); while (m_data->count() < count) m_data->append(TData()); while (m_data->count() > count) m_data->removeLast(); } void showEntry(int index) { m_loadingThings++; if (index == -1) { m_setEditorWidget->setEnabled(false); } else { m_setEditorWidget->setEnabled(true); TData &entry = (*m_data)[index]; m_typedSetEditorWidget->setCurrentEntry(entry); } } }; #endif // LSSETEDITOR_H
#include <linux/types.h> #include <linux/linkage.h> #include <linux/ctype.h> #include <linux/fs.h> #include <linux/sysctl.h> #include <linux/module.h> #include <asm/uaccess.h> #include <linux/sunrpc/types.h> #include <linux/sunrpc/sched.h> #include <linux/sunrpc/stats.h> #include <linux/sunrpc/svc_xprt.h> unsigned int rpc_debug; EXPORT_SYMBOL_GPL(rpc_debug); unsigned int nfs_debug; EXPORT_SYMBOL_GPL(nfs_debug); unsigned int nfsd_debug; EXPORT_SYMBOL_GPL(nfsd_debug); unsigned int nlm_debug; EXPORT_SYMBOL_GPL(nlm_debug); #ifdef RPC_DEBUG static struct ctl_table_header *sunrpc_table_header; static ctl_table sunrpc_table[]; void rpc_register_sysctl(void) { if (!sunrpc_table_header) sunrpc_table_header = register_sysctl_table(sunrpc_table); } void rpc_unregister_sysctl(void) { if (sunrpc_table_header) { unregister_sysctl_table(sunrpc_table_header); sunrpc_table_header = NULL; } } static int proc_do_xprt(ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { char tmpbuf[256]; size_t len; if ((*ppos && !write) || !*lenp) { *lenp = 0; return 0; } len = svc_print_xprts(tmpbuf, sizeof(tmpbuf)); return simple_read_from_buffer(buffer, *lenp, ppos, tmpbuf, len); } static int proc_dodebug(ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { char tmpbuf[20], c, *s; char __user *p; unsigned int value; size_t left, len; if ((*ppos && !write) || !*lenp) { *lenp = 0; return 0; } left = *lenp; if (write) { if (!access_ok(VERIFY_READ, buffer, left)) return -EFAULT; p = buffer; while (left && __get_user(c, p) >= 0 && isspace(c)) left--, p++; if (!left) goto done; if (left > sizeof(tmpbuf) - 1) return -EINVAL; if (copy_from_user(tmpbuf, p, left)) return -EFAULT; tmpbuf[left] = '\0'; for (s = tmpbuf, value = 0; '0' <= *s && *s <= '9'; s++, left--) value = 10 * value + (*s - '0'); if (*s && !isspace(*s)) return -EINVAL; while (left && isspace(*s)) left--, s++; *(unsigned int *) table->data = value; /* Display the RPC tasks on writing to rpc_debug */ if (strcmp(table->procname, "rpc_debug") == 0) rpc_show_tasks(); } else { if (!access_ok(VERIFY_WRITE, buffer, left)) return -EFAULT; len = sprintf(tmpbuf, "%d", *(unsigned int *) table->data); if (len > left) len = left; if (__copy_to_user(buffer, tmpbuf, len)) return -EFAULT; if ((left -= len) > 0) { if (put_user('\n', (char __user *)buffer + len)) return -EFAULT; left--; } } done: *lenp -= left; *ppos += *lenp; return 0; } static ctl_table debug_table[] = { { .procname = "rpc_debug", .data = &rpc_debug, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dodebug }, { .procname = "nfs_debug", .data = &nfs_debug, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dodebug }, { .procname = "nfsd_debug", .data = &nfsd_debug, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dodebug }, { .procname = "nlm_debug", .data = &nlm_debug, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dodebug }, { .procname = "transports", .maxlen = 256, .mode = 0444, .proc_handler = proc_do_xprt, }, { } }; static ctl_table sunrpc_table[] = { { .procname = "sunrpc", .mode = 0555, .child = debug_table }, { } }; #endif
/* Copyright (C) 2013- The University of Notre Dame This software is distributed under the GNU General Public License. See the file COPYING for details. */ #include "work_queue_resources.h" #include "link.h" #include "load_average.h" #include "host_disk_info.h" #include "host_memory_info.h" #include "gpu_info.h" #include "macros.h" #include "debug.h" #include "nvpair.h" #include <stdlib.h> #include <string.h> struct work_queue_resources * work_queue_resources_create() { struct work_queue_resources *r = malloc(sizeof(*r)); memset(r, 0, sizeof(struct work_queue_resources)); r->tag = -1; return r; } void work_queue_resources_delete( struct work_queue_resources *r ) { free(r); } void work_queue_resources_measure_locally( struct work_queue_resources *r, const char *disk_path ) { static int gpu_check = 0; UINT64_T avail,total; r->cores.total = load_average_get_cpus(); r->cores.largest = r->cores.smallest = r->cores.total; /* For disk and memory, we compute the total thinking that the worker is * not executing by itself, but that it has to share its resources with * other processes/workers. */ host_disk_info_get(disk_path,&avail,&total); r->disk.total = (avail / (UINT64_T) MEGA) + r->disk.inuse; // Free + whatever we are using. r->disk.largest = r->disk.smallest = r->disk.total; host_memory_info_get(&avail,&total); r->memory.total = (avail / (UINT64_T) MEGA) + r->memory.inuse; // Free + whatever we are using. r->memory.largest = r->memory.smallest = r->memory.total; if(!gpu_check) { r->gpus.total = gpu_info_get(); r->gpus.largest = r->gpus.smallest = r->gpus.total; gpu_check = 1; } r->workers.total = 1; r->workers.largest = r->workers.smallest = r->workers.total; } static void work_queue_resource_debug( struct work_queue_resource *r, const char *name ) { debug(D_WQ,"%8s %6"PRId64" inuse %6"PRId64" total %6"PRId64" smallest %6"PRId64" largest",name, r->inuse, r->total, r->smallest, r->largest); } static void work_queue_resource_send( struct link *master, struct work_queue_resource *r, const char *name, time_t stoptime ) { work_queue_resource_debug(r, name); link_putfstring(master, "resource %s %"PRId64" %"PRId64" %"PRId64"\n", stoptime, name, r->total, r->smallest, r->largest ); } void work_queue_resources_send( struct link *master, struct work_queue_resources *r, time_t stoptime ) { debug(D_WQ, "Sending resource description to master:"); work_queue_resource_send(master, &r->workers, "workers",stoptime); work_queue_resource_send(master, &r->disk, "disk", stoptime); work_queue_resource_send(master, &r->memory, "memory", stoptime); work_queue_resource_send(master, &r->gpus, "gpus", stoptime); work_queue_resource_send(master, &r->cores, "cores", stoptime); /* send the tag last, the master knows when the resource update is complete */ link_putfstring(master, "resource tag %"PRId64"\n", stoptime, r->tag); } void work_queue_resources_debug( struct work_queue_resources *r ) { work_queue_resource_debug(&r->workers, "workers"); work_queue_resource_debug(&r->disk, "disk"); work_queue_resource_debug(&r->memory, "memory"); work_queue_resource_debug(&r->gpus, "gpus"); work_queue_resource_debug(&r->cores, "cores"); } void work_queue_resources_clear( struct work_queue_resources *r ) { memset(r,0,sizeof(*r)); } static void work_queue_resource_add( struct work_queue_resource *total, struct work_queue_resource *r ) { total->inuse += r->inuse; total->total += r->total; total->smallest = MIN(total->smallest,r->smallest); total->largest = MAX(total->largest,r->largest); } void work_queue_resources_add( struct work_queue_resources *total, struct work_queue_resources *r ) { work_queue_resource_add(&total->workers, &r->workers); work_queue_resource_add(&total->memory, &r->memory); work_queue_resource_add(&total->disk, &r->disk); work_queue_resource_add(&total->gpus, &r->gpus); work_queue_resource_add(&total->cores, &r->cores); } void work_queue_resources_add_to_jx( struct work_queue_resources *r, struct jx *nv ) { jx_insert_integer(nv, "workers_inuse", r->workers.inuse); jx_insert_integer(nv, "workers_total", r->workers.total); jx_insert_integer(nv, "workers_smallest",r->workers.smallest); jx_insert_integer(nv, "workers_largest", r->workers.largest); jx_insert_integer(nv, "cores_inuse", r->cores.inuse); jx_insert_integer(nv, "cores_total", r->cores.total); jx_insert_integer(nv, "cores_smallest", r->cores.smallest); jx_insert_integer(nv, "cores_largest", r->cores.largest); jx_insert_integer(nv, "memory_inuse", r->memory.inuse); jx_insert_integer(nv, "memory_total", r->memory.total); jx_insert_integer(nv, "memory_smallest", r->memory.smallest); jx_insert_integer(nv, "memory_largest", r->memory.largest); jx_insert_integer(nv, "disk_inuse", r->disk.inuse); jx_insert_integer(nv, "disk_total", r->disk.total); jx_insert_integer(nv, "disk_smallest", r->disk.smallest); jx_insert_integer(nv, "disk_largest", r->disk.largest); jx_insert_integer(nv, "gpus_inuse", r->gpus.inuse); jx_insert_integer(nv, "gpus_total", r->gpus.total); jx_insert_integer(nv, "gpus_smallest", r->gpus.smallest); jx_insert_integer(nv, "gpus_largest", r->gpus.largest); } /* vim: set noexpandtab tabstop=4: */
/* * chardev.c: Creates a read-only char device that says how many times you've * read from the dev file. * * You can have some fun with this by removing the module_get/put calls, * allowing the module to be removed while the file is still open. * * Compile with `make`. Load with `sudo insmod chardev.ko`. Check `dmesg | tail` * output to see the assigned device number and command to create a device file. * * From TLDP.org's LKMPG book. */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/fs.h> #include <asm/uaccess.h> /* for put_user */ /* * Prototypes - this would normally go in a .h file */ int init_module(void); void cleanup_module(void); static int device_open(struct inode *, struct file *); static int device_release(struct inode *, struct file *); static ssize_t device_read(struct file *, char *, size_t, loff_t *); static ssize_t device_write(struct file *, const char *, size_t, loff_t *); #define SUCCESS 0 #define DEVICE_NAME "chardev" #define BUF_LEN 800 /* * Global variables are declared as static, so are global within the file. */ static int Major; static int Device_Open = 0; static char msg[BUF_LEN]; static char *msg_Ptr; static struct file_operations fops = { .read = device_read, .write = device_write, .open = device_open, .release = device_release }; /* * This function is called when the module is loaded */ int init_module(void) { Major = register_chrdev(0, DEVICE_NAME, &fops); if (Major < 0) { printk(KERN_ALERT "Registering char device failed with %d\n", Major); return Major; } printk(KERN_INFO "I was assigned major number %d. To talk to\n", Major); printk(KERN_INFO "the driver, create a dev file with\n"); printk(KERN_INFO "'mknod /dev/%s c %d 0'.\n", DEVICE_NAME, Major); printk(KERN_INFO "Try various minor numbers. Try to cat and echo to\n"); printk(KERN_INFO "the device file.\n"); printk(KERN_INFO "Remove the device file and module when done.\n"); return SUCCESS; } /* * This function is called when the module is unloaded */ void cleanup_module(void) { /* * Unregister the device */ unregister_chrdev(Major, DEVICE_NAME); } /* * Methods */ /* * Called when a process tries to open the device file, like * "cat /dev/mycharfile" */ static int device_open(struct inode *inode, struct file *filp) { static int counter = 0; if (Device_Open) return -EBUSY; Device_Open++; sprintf(msg, "I already told you %d times Hello world! printk: %p and frame: %p - %pF\n", counter++, printk, __builtin_return_address(0), __builtin_return_address(0)); printk(KERN_INFO "address of printk: %p and frame: %p - %pF\n", printk, __builtin_return_address(0), __builtin_return_address(0)); msg_Ptr = msg; /* * TODO: comment out the line below to have some fun! */ try_module_get(THIS_MODULE); return SUCCESS; } /* * Called when a process closes the device file. */ static int device_release(struct inode *inode, struct file *filp) { Device_Open--; /* * Decrement the usage count, or else once you opened the file, you'll never * get rid of the module. * * TODO: comment out the line below to have some fun! */ module_put(THIS_MODULE); return SUCCESS; } /* * Called when a process, which already opened the dev file, attempts to read * from it. */ static ssize_t device_read(struct file *filp, /* see include/linux/fs.h */ char *buffer, /* buffer to fill with data */ size_t length, /* length of the buffer */ loff_t *offset) { int i = 1; /* * Number of bytes actually written to the buffer */ int bytes_read = 0; printk(KERN_ALERT "sup: %s, local var at %p\n", __func__, &i); /* * If we're at the end of the message, return 0 signifying end of file. */ if (*msg_Ptr == 0) return 0; /* * Actually put the data into the buffer */ while (length && *msg_Ptr) { /* * The buffer is in the user data segment, not the kernel segment so "*" * assignment won't work. We have to use put_user which copies data from the * kernel data segment to the user data segment. */ put_user(*(msg_Ptr++), buffer++); length--; bytes_read++; } /* * Most read functions return the number of bytes put into the buffer */ return bytes_read; } /* * Called when a process writes to dev file: echo "hi" > /dev/hello */ static ssize_t device_write(struct file *filp, const char *buf, size_t len, loff_t *off) { printk(KERN_ALERT "Sorry, this operation isn't supported.\n"); return -EINVAL; }
#ifndef BASIC_H #define BASIC_H #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> struct Parameter { string source_image_name; string water_image_name; bool water_used; string mask_image_name; bool mask_used; Rect rect; string result_image_name; }; class Basic { private: Vec3b color_zero; public: Basic():color_zero(Vec3b(0,0,0)){} void Get_para(string configure_file, Parameter& para); void Get_ROI(const Mat &image, const Rect roi_rect, const int n); Mat Get_binary(const Mat &src, Mat &dst); vector<double> Get_ratio_index(Mat &src, const Mat &criterion);//²éÈ«ÂÊ,²é×¼ÂÊ,fÖ¸Êý }; void Basic::Get_para(string configure_file, Parameter& para) { FileStorage readfs(configure_file, FileStorage::READ); //¶ÁµÄÐÎʽ´ò¿ªyml¡£µ±È»Ò²¿ÉÒÔ´ò¿ªxml£¬Ö÷Òª¿´ºó׺ if(readfs.isOpened() ) { para.source_image_name = (string)readfs["source_image"]; para.water_image_name = (string)readfs["water_image"]; if (para.water_image_name.empty()) para.water_used = false; else para.water_used = true; para.mask_image_name = (string)readfs["mask_image"]; if (para.mask_image_name.empty()) para.mask_used = false; else para.mask_used = true; para.rect = Rect(Point((int)readfs["rect_xl"], (int)readfs["rect_yl"]), Point((int)readfs["rect_xr"],(int)readfs["rect_yr"])); para.result_image_name = (string)readfs["result_image"]; } readfs.release(); } void Basic::Get_ROI(const Mat &image, const Rect roi_rect, const int n) { Mat roi_image; string roit_image_name = "Roi_image.jpg"; //Rect part_rect = Rect(Point(1320,1745), Point(1594, 1936)); roi_image = Mat(image, roi_rect); imwrite(roit_image_name, roi_image); if (n > 1) { int order = 0; stringstream num; Rect part_rect = Rect(0, 0, roi_rect.width/n, roi_rect.height/n); for(int i = 0; i < n; ++i) { for(int j = 0; j < n; ++j) { part_rect = Rect(i*roi_rect.width/n, j*roi_rect.height/n, roi_rect.width/n, roi_rect.height/n);//Rect(x,y,width,height) //cout << part_rect << endl; roi_image = Mat(image, part_rect); order = i*n+j+1; num.str("");//num.clear() num << order; roit_image_name = "roi_image" + num.str() + ".jpg"; imwrite(roit_image_name, roi_image); } } } } Mat Basic::Get_binary(const Mat &src, Mat &dst) { if (src.empty()) { CV_Error( CV_StsBadArg, "src image is empty" ); } if ( !dst.empty() ) { if( dst.type() != CV_8UC1) dst.release(); } else { dst = Mat::zeros(src.size(), CV_8UC1); } //binary Vec3b color; if(src.channels() == 3) { for(int y = 0; y < src.rows; ++y) { for(int x = 0; x < src.cols; ++x) { color = src.at<Vec3b>(y,x); if (color != color_zero) { dst.at<uchar>(y,x) = (uchar)255; } } } } else { for(int y = 0; y < src.rows; ++y) { for(int x = 0; x < src.cols; ++x) { uchar gray = src.at<uchar>(y,x); if (gray != (uchar)0 ) { dst.at<uchar>(y,x) = (uchar)255; } } } } return dst; } vector<double> Basic::Get_ratio_index(Mat &src, const Mat &criterion) { if( src.empty() || criterion.empty() ) CV_Error( CV_StsBadArg, "src or criterion is empty" ); if (src.size != criterion.size) { CV_Error( CV_StsBadArg, "src and criterion mush have same size" ); } Mat src_binary = Get_binary(src, src_binary); Mat criterion_binary = Get_binary(criterion, criterion_binary); int hit_obj_num = 0, criterion_obj_num = 0, src_obj_num = 0; for(int y = 0; y < src_binary.rows; ++y) { for(int x = 0; x < src_binary.cols; ++x) { uchar src_value = src_binary.at<uchar>(y,x); uchar criterion_value = criterion_binary.at<uchar>(y,x); if(criterion_value == (uchar)255) { ++criterion_obj_num;//±ê׼ͼÖеÄÄ¿±êÏñËØÊýÄ¿ if( src_value == (uchar)255) { ++hit_obj_num;//ÃüÖÐÄ¿±êÏñËØÊýÄ¿ } } if( src_value == (uchar)255) { ++src_obj_num;//ÊäÈëͼÖÐÄ¿±êÊýÄ¿ } } } vector<double> ratio_index; double recall_ratio = (double)hit_obj_num/criterion_obj_num; ratio_index.push_back(recall_ratio); double precision_ratio = (double)hit_obj_num/src_obj_num; ratio_index.push_back(precision_ratio); double f_index = recall_ratio*precision_ratio / (precision_ratio + recall_ratio); ratio_index.push_back(f_index); return ratio_index; } #endif
/* GNUTLS --- Guile bindings for GnuTLS. Copyright (C) 2007 Free Software Foundation GNUTLS 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. GNUTLS 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 GNUTLS; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Written by Ludovic Courtès <ludo@chbouib.org>. */ #include "utils.h" #include <gnutls/gnutls.h> #include <libguile.h> #include <alloca.h> #include "enums.h" #include "errors.h" SCM scm_from_gnutls_key_usage_flags (unsigned int c_usage) { SCM usage = SCM_EOL; #define MATCH_USAGE(_value) \ if (c_usage & (_value)) \ { \ usage = scm_cons (scm_from_gnutls_key_usage (_value), \ usage); \ c_usage &= ~(_value); \ } /* when the key is to be used for signing: */ MATCH_USAGE (GNUTLS_KEY_DIGITAL_SIGNATURE); MATCH_USAGE (GNUTLS_KEY_NON_REPUDIATION); /* when the key is to be used for encryption: */ MATCH_USAGE (GNUTLS_KEY_KEY_ENCIPHERMENT); MATCH_USAGE (GNUTLS_KEY_DATA_ENCIPHERMENT); MATCH_USAGE (GNUTLS_KEY_KEY_AGREEMENT); MATCH_USAGE (GNUTLS_KEY_KEY_CERT_SIGN); MATCH_USAGE (GNUTLS_KEY_CRL_SIGN); MATCH_USAGE (GNUTLS_KEY_ENCIPHER_ONLY); MATCH_USAGE (GNUTLS_KEY_DECIPHER_ONLY); if (EXPECT_FALSE (c_usage != 0)) /* XXX: We failed to interpret one of the usage flags. */ scm_gnutls_error (GNUTLS_E_UNIMPLEMENTED_FEATURE, __FUNCTION__); #undef MATCH_USAGE return usage; } /* arch-tag: a55fe230-ead7-495d-ab11-dfe18452ca2a */
/* * $Id$ * * CentroidFold: A generalized centroid estimator for predicting RNA * secondary structures * * Copyright (C) 2008-2010 Kengo Sato * * 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 __INC_ENGINE_MIXTURE_H__ #define __INC_ENGINE_MIXTURE_H__ #include "../folding_engine.h" template < class SEQ > class MixtureModel : public FoldingEngine<SEQ> { public: MixtureModel(const std::vector<std::pair<FoldingEngine<SEQ>*,float> >& models, bool run_as_mea=false); virtual ~MixtureModel() { } // interface implementations virtual void calculate_posterior(const SEQ& seq); private: std::vector<std::pair<FoldingEngine<SEQ>*,float> > models_; using FoldingEngine<SEQ>::bp_; }; #endif // __INC_ENGINE_MIXTURE_H__ // Local Variables: // mode: C++ // End:
// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, // but are changed infrequently #pragma once #ifndef _SECURE_ATL #define _SECURE_ATL 1 #endif #ifndef VC_EXTRALEAN #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #endif // Modify the following defines if you have to target a platform prior to the ones specified below. // Refer to MSDN for the latest info on corresponding values for different platforms. #ifndef WINVER // Allow use of features specific to Windows XP or later. #define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows. #endif #ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. #endif #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. #define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. #endif #ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later. #define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE. #endif #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit // turns off MFC's hiding of some common and often safely ignored warning messages #define _AFX_ALL_WARNINGS #include <afxwin.h> // MFC core and standard components #include <afxext.h> // MFC extensions #include <afxdisp.h> // MFC Automation classes #ifndef _AFX_NO_OLE_SUPPORT #include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls #endif #ifndef _AFX_NO_AFXCMN_SUPPORT #include <afxcmn.h> // MFC support for Windows Common Controls #endif // _AFX_NO_AFXCMN_SUPPORT #ifdef _UNICODE #if defined _M_IX86 #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") #elif defined _M_IA64 #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"") #elif defined _M_X64 #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") #else #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") #endif #endif //// Ensure that GdiPlus header files work properly with MFC DEBUG_NEW and STL header files. #define iterator _iterator #ifdef _DEBUG namespace Gdiplus { namespace DllExports { #include <GdiplusMem.h> }; #ifndef _GDIPLUSBASE_H #define _GDIPLUSBASE_H class GdiplusBase { public: void (operator delete)(void* in_pVoid) { DllExports::GdipFree(in_pVoid); } void* (operator new)(size_t in_size) { return DllExports::GdipAlloc(in_size); } void (operator delete[])(void* in_pVoid) { DllExports::GdipFree(in_pVoid); } void* (operator new[])(size_t in_size) { return DllExports::GdipAlloc(in_size); } void * (operator new)(size_t nSize, LPCSTR lpszFileName, int nLine) { return DllExports::GdipAlloc(nSize); } void operator delete(void* p, LPCSTR lpszFileName, int nLine) { DllExports::GdipFree(p); } }; #endif // #ifndef _GDIPLUSBASE_H } #endif // #ifdef _DEBUG #include <gdiplus.h> #undef iterator //// Ensure that Gdiplus.lib is linked. #pragma comment(lib, "gdiplus.lib")
/* * Copyright (C) 2016-2018, Nils Asmussen <nils@os.inf.tu-dresden.de> * Economic rights: Technische Universitaet Dresden (Germany) * * This file is part of M3 (Microkernel-based SysteM for Heterogeneous Manycores). * * M3 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. * * M3 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. */ #pragma once #include <base/col/SList.h> #include <base/DTU.h> namespace m3 { class WorkLoop; class WorkItem : public SListItem { friend class WorkLoop; public: virtual ~WorkItem() { } virtual void work() = 0; }; class WorkLoop { static const size_t MAX_ITEMS = 32; public: explicit WorkLoop() : _changed(false), _permanents(0), _count(), _items() { } virtual ~WorkLoop() { } bool has_items() const { return _count > _permanents; } void add(WorkItem *item, bool permanent); void remove(WorkItem *item); virtual void multithreaded(uint count) = 0; void tick(); virtual void run(); void stop() { _permanents = _count; } protected: static void thread_startup(void *); private: bool _changed; uint _permanents; size_t _count; WorkItem *_items[MAX_ITEMS]; }; }
#ifndef MOTORS_H #define MOTORS_H #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "../commons/geometry.h" class Motor { public: double speed, rotation_speed; // vitesse moyenne du robot en m/s et rad/s long move_step, turn_step; // valeurs a passer a la carte de puissance Position old_pos, new_pos; // les ancienne et nouvelle position double rotation, translation; // valeurs du deplacement Motor(); void init(); void prepareMove(Position Old_pos, Position New_pos); double move(); double move(Position Old_pos, Position New_pos); }; #endif