text
stringlengths
4
6.14k
/*************************************************************************/ /* node_dock.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #ifndef NODE_DOCK_H #define NODE_DOCK_H #include "connections_dialog.h" #include "groups_editor.h" class NodeDock : public VBoxContainer { GDCLASS(NodeDock, VBoxContainer); Button *connections_button; Button *groups_button; ConnectionsDock *connections; GroupsEditor *groups; HBoxContainer *mode_hb; Label *select_a_node; protected: static void _bind_methods(); void _notification(int p_what); public: static NodeDock *singleton; void set_node(Node *p_node); void show_groups(); void show_connections(); void update_lists(); NodeDock(); }; #endif // NODE_DOCK_H
/* Copyright Statement: * * This software/firmware and related documentation ("MediaTek Software") are * protected under relevant copyright laws. The information contained herein is * confidential and proprietary to MediaTek Inc. and/or its licensors. Without * the prior written permission of MediaTek inc. and/or its licensors, any * reproduction, modification, use or disclosure of MediaTek Software, and * information contained herein, in whole or in part, shall be strictly * prohibited. * * MediaTek Inc. (C) 2010. All rights reserved. * * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. * * The following software/firmware and/or related documentation ("MediaTek * Software") have been modified by MediaTek Inc. All revisions are subject to * any receiver's applicable license agreements with MediaTek Inc. */ #ifndef _MTK_HAL_CLIENT_CAMCLIENT_INC_CAMUTILS_H_ #define _MTK_HAL_CLIENT_CAMCLIENT_INC_CAMUTILS_H_ /****************************************************************************** * *******************************************************************************/ // #include <stdlib.h> // #include <hardware/camera.h> #include <system/camera.h> // #include <mtkcam/Log.h> #include <mtkcam/common.h> #include <mtkcam/utils/common.h> // #include <mtkcam/v1/camutils/CamFormatTransform.h> // #include <mtkcam/hwutils/CameraProfile.h> using namespace CPTool; // #include <mtkcam/v1/camutils/CamInfo.h> // #include <mtkcam/v1/camutils/IBuffer.h> #include <mtkcam/v1/camutils/ICameraBuffer.h> // #include <mtkcam/v1/camutils/IImgBufQueue.h> #include <mtkcam/v1/camutils/ImgBufQueue.h> // #include <mtkcam/v1/camutils/CamFormat.h> #endif //_MTK_HAL_CLIENT_CAMCLIENT_INC_CAMUTILS_H_
/* * Shell-like utility functions * * Copyright 2004, Broadcom Corporation * All Rights Reserved. * * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE. * * $Id: shutils.h 1517 2005-07-21 11:45:36Z nbd $ */ #ifndef _shutils_h_ #define _shutils_h_ #include <string.h> /* * Reads file and returns contents * @param fd file descriptor * @return contents of file or NULL if an error occurred */ extern char * fd2str(int fd); /* * Reads file and returns contents * @param path path to file * @return contents of file or NULL if an error occurred */ extern char * file2str(const char *path); /* * Waits for a file descriptor to become available for reading or unblocked signal * @param fd file descriptor * @param timeout seconds to wait before timing out or 0 for no timeout * @return 1 if descriptor changed status or 0 if timed out or -1 on error */ extern int waitfor(int fd, int timeout); /* * Concatenates NULL-terminated list of arguments into a single * commmand and executes it * @param argv argument list * @param path NULL, ">output", or ">>output" * @param timeout seconds to wait before timing out or 0 for no timeout * @param ppid NULL to wait for child termination or pointer to pid * @return return value of executed command or errno */ extern int _eval(char *const argv[], char *path, int timeout, pid_t *ppid); /* * Concatenates NULL-terminated list of arguments into a single * commmand and executes it * @param argv argument list * @return stdout of executed command or NULL if an error occurred */ extern char * _backtick(char *const argv[]); /* * Kills process whose PID is stored in plaintext in pidfile * @param pidfile PID file * @return 0 on success and errno on failure */ extern int kill_pidfile(char *pidfile); /* * fread() with automatic retry on syscall interrupt * @param ptr location to store to * @param size size of each element of data * @param nmemb number of elements * @param stream file stream * @return number of items successfully read */ extern int safe_fread(void *ptr, size_t size, size_t nmemb, FILE *stream); /* * fwrite() with automatic retry on syscall interrupt * @param ptr location to read from * @param size size of each element of data * @param nmemb number of elements * @param stream file stream * @return number of items successfully written */ extern int safe_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream); /* * Convert Ethernet address string representation to binary data * @param a string in xx:xx:xx:xx:xx:xx notation * @param e binary data * @return TRUE if conversion was successful and FALSE otherwise */ extern int ether_atoe(const char *a, unsigned char *e); /* * Convert Ethernet address binary data to string representation * @param e binary data * @param a string in xx:xx:xx:xx:xx:xx notation * @return a */ extern char * ether_etoa(const unsigned char *e, char *a); /* * Concatenate two strings together into a caller supplied buffer * @param s1 first string * @param s2 second string * @param buf buffer large enough to hold both strings * @return buf */ static inline char * strcat_r(const char *s1, const char *s2, char *buf) { strcpy(buf, s1); strcat(buf, s2); return buf; } /* Check for a blank character; that is, a space or a tab */ #define isblank(c) ((c) == ' ' || (c) == '\t') /* Strip trailing CR/NL from string <s> */ #define chomp(s) ({ \ char *c = (s) + strlen((s)) - 1; \ while ((c > (s)) && (*c == '\n' || *c == '\r' || *c == ' ')) \ *c-- = '\0'; \ s; \ }) /* Simple version of _backtick() */ #define backtick(cmd, args...) ({ \ char *argv[] = { cmd, ## args, NULL }; \ _backtick(argv); \ }) /* Simple version of _eval() (no timeout and wait for child termination) */ #define eval(cmd, args...) ({ \ char *argv[] = { cmd, ## args, NULL }; \ _eval(argv, ">/dev/console", 0, NULL); \ }) /* Copy each token in wordlist delimited by space into word */ #define foreach(word, wordlist, next) \ for (next = &wordlist[strspn(wordlist, " ")], \ strncpy(word, next, sizeof(word)), \ word[strcspn(word, " ")] = '\0', \ word[sizeof(word) - 1] = '\0', \ next = strchr(next, ' '); \ strlen(word); \ next = next ? &next[strspn(next, " ")] : "", \ strncpy(word, next, sizeof(word)), \ word[strcspn(word, " ")] = '\0', \ word[sizeof(word) - 1] = '\0', \ next = strchr(next, ' ')) /* Return NUL instead of NULL if undefined */ #define safe_getenv(s) (getenv(s) ? : "") /* Print directly to the console */ #define cprintf(fmt, args...) do { \ FILE *fp = fopen("/dev/console", "w"); \ if (fp) { \ fprintf(fp, fmt, ## args); \ fclose(fp); \ } \ } while (0) /* Debug print */ #ifdef DEBUG #define dprintf(fmt, args...) cprintf("%s: " fmt, __FUNCTION__, ## args) #else #define dprintf(fmt, args...) #endif #ifdef vxworks #include <inetLib.h> #define inet_aton(a, n) ((inet_aton((a), (n)) == ERROR) ? 0 : 1) #define inet_ntoa(n) ({ char a[INET_ADDR_LEN]; inet_ntoa_b ((n), a); a; }) #include <typedefs.h> #include <bcmutils.h> #define ether_atoe(a, e) bcm_ether_atoe((a), (e)) #define ether_etoa(e, a) bcm_ether_ntoa((e), (a)) /* These declarations are not available where you would expect them */ extern int vsnprintf (char *, size_t, const char *, va_list); extern int snprintf(char *str, size_t count, const char *fmt, ...); extern char *strdup(const char *); extern char *strsep(char **stringp, char *delim); extern int strcasecmp(const char *s1, const char *s2); extern int strncasecmp(const char *s1, const char *s2, size_t n); /* Neither are socket() and connect() */ #include <sockLib.h> #ifdef DEBUG #undef dprintf #define dprintf printf #endif #endif #endif /* _shutils_h_ */
#ifndef R819XUSB_CMDPKT_H #define R819XUSB_CMDPKT_H /* */ #define CMPK_RX_TX_FB_SIZE sizeof(cmpk_txfb_t) // #define CMPK_TX_SET_CONFIG_SIZE sizeof(cmpk_set_cfg_t) // #define CMPK_BOTH_QUERY_CONFIG_SIZE sizeof(cmpk_set_cfg_t) // #define CMPK_RX_TX_STS_SIZE sizeof(cmpk_tx_status_t)// #define CMPK_RX_DBG_MSG_SIZE sizeof(cmpk_rx_dbginfo_t)// #define CMPK_TX_RAHIS_SIZE sizeof(cmpk_tx_rahis_t) /* */ #define ISR_TxBcnOk BIT27 // #define ISR_TxBcnErr BIT26 // #define ISR_BcnTimerIntr BIT13 // /* */ /* */ /* */ /* */ typedef struct tag_cmd_pkt_tx_feedback { // u8 element_id; /* */ u8 length; /* */ /* */ /* */ u8 TID:4; /* */ u8 fail_reason:3; /* */ u8 tok:1; /* */ u8 reserve1:4; /* */ u8 pkt_type:2; /* */ u8 bandwidth:1; /* */ u8 qos_pkt:1; /* */ // u8 reserve2; /* */ /* */ u8 retry_cnt; /* */ u16 pkt_id; /* */ // u16 seq_num; /* */ u8 s_rate; /* */ u8 f_rate; /* */ // u8 s_rts_rate; /* */ u8 f_rts_rate; /* */ u16 pkt_length; /* */ // u16 reserve3; /* */ u16 duration; /* */ }cmpk_txfb_t; /* */ typedef struct tag_cmd_pkt_interrupt_status { u8 element_id; /* */ u8 length; /* */ u16 reserve; u32 interrupt_status; /* */ }cmpk_intr_sta_t; /* */ typedef struct tag_cmd_pkt_set_configuration { u8 element_id; /* */ u8 length; /* */ u16 reserve1; /* */ u8 cfg_reserve1:3; u8 cfg_size:2; /* */ u8 cfg_type:2; /* */ u8 cfg_action:1; /* */ u8 cfg_reserve2; /* */ u8 cfg_page:4; /* */ u8 cfg_reserve3:4; /* */ u8 cfg_offset; /* */ u32 value; /* */ u32 mask; /* */ }cmpk_set_cfg_t; /* */ #define cmpk_query_cfg_t cmpk_set_cfg_t /* */ typedef struct tag_tx_stats_feedback // { // // u16 reserve1; u8 length; // u8 element_id; // // u16 txfail; // u16 txok; // // u16 txmcok; // u16 txretry; // // u16 txucok; // u16 txbcok; // // u16 txbcfail; // u16 txmcfail; // // u16 reserve2; // u16 txucfail; // // u32 txmclength; u32 txbclength; u32 txuclength; // u16 reserve3_23; u8 reserve3_1; u8 rate; }__attribute__((packed)) cmpk_tx_status_t; /* */ /* */ typedef struct tag_rx_debug_message_feedback { // // u16 reserve1; u8 length; // u8 element_id; // // // }cmpk_rx_dbginfo_t; /* */ typedef struct tag_tx_rate_history { // // u8 element_id; // u8 length; // u16 reserved1; // u16 cck[4]; // u16 ofdm[8]; // // // // // // // // // // // // u16 ht_mcs[4][16]; }__attribute__((packed)) cmpk_tx_rahis_t; typedef enum tag_command_packet_directories { RX_TX_FEEDBACK = 0, RX_INTERRUPT_STATUS = 1, TX_SET_CONFIG = 2, BOTH_QUERY_CONFIG = 3, RX_TX_STATUS = 4, RX_DBGINFO_FEEDBACK = 5, RX_TX_PER_PKT_FEEDBACK = 6, RX_TX_RATE_HISTORY = 7, RX_CMD_ELE_MAX }cmpk_element_e; typedef enum _rt_status{ RT_STATUS_SUCCESS, RT_STATUS_FAILURE, RT_STATUS_PENDING, RT_STATUS_RESOURCE }rt_status,*prt_status; extern rt_status cmpk_message_handle_tx(struct net_device *dev, u8* codevirtualaddress, u32 packettype, u32 buffer_len); extern u32 cmpk_message_handle_rx(struct net_device *dev, struct ieee80211_rx_stats * pstats); extern rt_status SendTxCommandPacket( struct net_device *dev, void* pData, u32 DataLen); #endif
/* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once #include <inttypes.h> #include "unit.h" enum { BPF_FIREWALL_UNSUPPORTED = 0, BPF_FIREWALL_SUPPORTED = 1, BPF_FIREWALL_SUPPORTED_WITH_MULTI = 2, }; int bpf_firewall_supported(void); int bpf_firewall_compile(Unit *u); int bpf_firewall_install(Unit *u); int bpf_firewall_read_accounting(int map_fd, uint64_t *ret_bytes, uint64_t *ret_packets); int bpf_firewall_reset_accounting(int map_fd);
/* * Copyright (C) 2002 Manuel Novoa III * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #include "_string.h" #ifdef WANT_WIDE # define Wstrstr wcsstr #else libc_hidden_proto(strstr) # define Wstrstr strstr #endif /* NOTE: This is the simple-minded O(len(s1) * len(s2)) worst-case approach. */ Wchar *Wstrstr(const Wchar *s1, const Wchar *s2) { register const Wchar *s = s1; register const Wchar *p = s2; do { if (!*p) { return (Wchar *) s1;; } if (*p == *s) { ++p; ++s; } else { p = s2; if (!*s) { return NULL; } s = ++s1; } } while (1); } #ifndef WANT_WIDE libc_hidden_def(strstr) #else strong_alias(wcsstr,wcswcs) #endif
/* * Disk Array driver for Compaq SMART2 Controllers * Copyright 1998 Compaq Computer 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, GOOD TITLE or * NON INFRINGEMENT. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Questions/Comments/Bugfixes to arrays@compaq.com * * If you want to make changes, improve or add functionality to this * driver, you'll probably need the Compaq Array Controller Interface * Specificiation (Document number ECG086/1198) */ #ifndef CPQARRAY_H #define CPQARRAY_H #ifdef __KERNEL__ #include <linux/blkdev.h> #include <linux/slab.h> #include <linux/proc_fs.h> #include <linux/timer.h> #endif #include "ida_cmd.h" #define IO_OK 0 #define IO_ERROR 1 #define NWD 16 #define NWD_SHIFT 4 #define IDA_TIMER (5*HZ) #define IDA_TIMEOUT (10*HZ) #define MISC_NONFATAL_WARN 0x01 typedef struct { unsigned blk_size; unsigned nr_blks; unsigned cylinders; unsigned heads; unsigned sectors; int usage_count; } drv_info_t; #ifdef __KERNEL__ struct ctlr_info; typedef struct ctlr_info ctlr_info_t; struct access_method { void (*submit_command)(ctlr_info_t *h, cmdlist_t *c); void (*set_intr_mask)(ctlr_info_t *h, unsigned long val); unsigned long (*fifo_full)(ctlr_info_t *h); unsigned long (*intr_pending)(ctlr_info_t *h); unsigned long (*command_completed)(ctlr_info_t *h); }; struct board_type { __u32 board_id; char *product_name; struct access_method *access; }; struct ctlr_info { int ctlr; char devname[8]; __u32 log_drv_map; __u32 drv_assign_map; __u32 drv_spare_map; __u32 mp_failed_drv_map; char firm_rev[4]; int ctlr_sig; int log_drives; int phys_drives; struct pci_dev *pci_dev; /* NULL if EISA */ __u32 board_id; char *product_name; void __iomem *vaddr; unsigned long paddr; unsigned long io_mem_addr; unsigned long io_mem_length; int intr; int usage_count; drv_info_t drv[NWD]; struct proc_dir_entry *proc; struct access_method access; cmdlist_t *reqQ; cmdlist_t *cmpQ; cmdlist_t *cmd_pool; dma_addr_t cmd_pool_dhandle; unsigned long *cmd_pool_bits; struct request_queue *queue; spinlock_t lock; unsigned int Qdepth; unsigned int maxQsinceinit; unsigned int nr_requests; unsigned int nr_allocs; unsigned int nr_frees; struct timer_list timer; unsigned int misc_tflags; }; #define IDA_LOCK(i) (&hba[i]->lock) #endif #endif /* CPQARRAY_H */
// // RootViewController.h // NavApp3 // // Created by David Cole on 6/23/11. // Copyright 2011 Kitware, Inc. All rights reserved. // #import <UIKit/UIKit.h> @interface RootViewController : UITableViewController { } @end
/**************************************************************************** ** ** This file is part of the Qt Extended Opensource Package. ** ** Copyright (C) 2009 Trolltech ASA. ** ** Contact: Qt Extended Information (info@qtextended.org) ** ** This file may be used under the terms of the GNU General Public License ** version 2.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 GNU General Public ** Licensing requirements will be met: ** http://www.fsf.org/licensing/licenses/info/GPLv2.html. ** ** ****************************************************************************/ #ifndef NOTESDEMO_H #define NOTESDEMO_H #include <QDialog> #include <QContent> class QDocumentSelector; class QTextEdit; class QStackedLayout; class QTextDocument; class NotesDemo : public QDialog { Q_OBJECT public: NotesDemo( QWidget *parent = 0, Qt::WindowFlags flags = 0 ); public slots: virtual void done( int result ); private slots: void newDocument(); void openDocument( const QContent &document ); private: bool readContent( QTextDocument *document, QContent *content ); bool writeContent( QTextDocument *document, QContent *content ); QStackedLayout *layout; QDocumentSelector *documentSelector; QTextEdit *editor; QContent currentDocument; }; #endif
/* Test re_search with multi-byte characters in EUC-JP. Copyright (C) 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Stanislav Brabec <sbrabec@suse.cz>, 2012. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #define _GNU_SOURCE 1 #include <locale.h> #include <regex.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "regex_internal.h" static int do_test (void) { struct re_pattern_buffer r; struct re_registers s; int e, rc = 0; if (setlocale (LC_CTYPE, "ja_JP.EUC-JP") == NULL) { puts ("setlocale failed"); return 1; } memset (&r, 0, sizeof (r)); memset (&s, 0, sizeof (s)); /* The bug cannot be reproduced without initialized fastmap. */ r.fastmap = malloc (SBC_MAX); /* 圭 */ re_compile_pattern ("\xb7\xbd", 2, &r); /* aaaaa件a新処, \xb7\xbd constitutes a false match */ e = re_search (&r, "\x61\x61\x61\x61\x61\xb7\xef\x61\xbf\xb7\xbd\xe8", 12, 0, 12, &s); if (e != -1) { printf ("bug-regex33.1: false match or error: re_search() returned %d, should return -1\n", e); rc = 1; } /* aaaa件a新処, \xb7\xbd constitutes a false match, * this is a reproducer of BZ #13637 */ e = re_search (&r, "\x61\x61\x61\x61\xb7\xef\x61\xbf\xb7\xbd\xe8", 11, 0, 11, &s); if (e != -1) { printf ("bug-regex33.2: false match or error: re_search() returned %d, should return -1\n", e); rc = 1; } /* aaa件a新処, \xb7\xbd constitutes a false match, * this is a reproducer of BZ #13637 */ e = re_search (&r, "\x61\x61\x61\xb7\xef\x61\xbf\xb7\xbd\xe8", 10, 0, 10, &s); if (e != -1) { printf ("bug-regex33.3: false match or error: re_search() returned %d, should return -1\n", e); rc = 1; } /* aa件a新処, \xb7\xbd constitutes a false match */ e = re_search (&r, "\x61\x61\xb7\xef\x61\xbf\xb7\xbd\xe8", 9, 0, 9, &s); if (e != -1) { printf ("bug-regex33.4: false match or error: re_search() returned %d, should return -1\n", e); rc = 1; } /* a件a新処, \xb7\xbd constitutes a false match */ e = re_search (&r, "\x61\xb7\xef\x61\xbf\xb7\xbd\xe8", 8, 0, 8, &s); if (e != -1) { printf ("bug-regex33.5: false match or error: re_search() returned %d, should return -1\n", e); rc = 1; } /* 新処圭新処, \xb7\xbd here really matches 圭, but second occurrence is a false match, * this is a reproducer of bug-regex25 and BZ #13637 */ e = re_search (&r, "\xbf\xb7\xbd\xe8\xb7\xbd\xbf\xb7\xbd\xe8", 10, 0, 10, &s); if (e != 4) { printf ("bug-regex33.6: no match or false match: re_search() returned %d, should return 4\n", e); rc = 1; } /* 新処圭新, \xb7\xbd here really matches 圭, * this is a reproducer of bug-regex25 */ e = re_search (&r, "\xbf\xb7\xbd\xe8\xb7\xbd\xbf\xb7", 10, 0, 10, &s); if (e != 4) { printf ("bug-regex33.7: no match or false match: re_search() returned %d, should return 4\n", e); rc = 1; } return rc; } #define TEST_FUNCTION do_test () #include "../test-skeleton.c"
/* A depends on B, C and D. B depends on E. C depends on B and E. D depends on B. */ #include "module.h" int b; extern int e; static void foo(void) { b = e = 0; } EXPORT_SYMBOL(b);
/******************************************************************************* * Agere Systems Inc. * Wireless device driver for Linux (wlags49). * * Copyright (c) 1998-2003 Agere Systems Inc. * All rights reserved. * http://www.agere.com * * Initially developed by TriplePoint, Inc. * http://www.triplepoint.com * *------------------------------------------------------------------------------ * * Header describing information required for the driver to support PCI. * *------------------------------------------------------------------------------ * * SOFTWARE LICENSE * * This software is provided subject to the following terms and conditions, * which you should read carefully before using the software. Using this * software indicates your acceptance of these terms and conditions. If you do * not agree with these terms and conditions, do not use the software. * * Copyright © 2003 Agere Systems Inc. * All rights reserved. * * Redistribution and use in source or binary forms, with or without * modifications, 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 as comments in the code as * well as in the documentation and/or other materials provided with the * distribution. * * . 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 Agere Systems Inc. nor the names of the contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * Disclaimer * * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, 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 __WL_PCI_H__ #define __WL_PCI_H__ /* */ #define PCI_VENDOR_IDWL_LKM 0x11C1 /* */ #define PCI_DEVICE_ID_WL_LKM_0 0xAB30 /* */ #define PCI_DEVICE_ID_WL_LKM_1 0xAB34 /* */ #define PCI_DEVICE_ID_WL_LKM_2 0xAB11 /* */ /* */ int wl_adapter_init_module( void ); void wl_adapter_cleanup_module( void ); int wl_adapter_insert( struct net_device *dev ); int wl_adapter_open( struct net_device *dev ); int wl_adapter_close( struct net_device *dev ); int wl_adapter_is_open( struct net_device *dev ); #ifdef ENABLE_DMA void wl_pci_dma_hcf_supply( struct wl_private *lp ); void wl_pci_dma_hcf_reclaim( struct wl_private *lp ); DESC_STRCT * wl_pci_dma_get_tx_packet( struct wl_private *lp ); void wl_pci_dma_put_tx_packet( struct wl_private *lp, DESC_STRCT *desc ); void wl_pci_dma_hcf_reclaim_tx( struct wl_private *lp ); #endif // #endif //
/* * $Id: Array.h,v 1.6 2001/10/08 16:18:31 hno Exp $ * * AUTHOR: Alex Rousskov * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- * * Squid is the result of efforts by numerous individuals from * the Internet community; see the CONTRIBUTORS file for full * details. Many organizations have provided support for Squid's * development; see the SPONSORS file for full details. Squid is * Copyrighted (C) 2001 by the Regents of the University of * California; see the COPYRIGHT file for full details. Squid * incorporates software developed and/or copyrighted by other * sources; see the CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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, USA. * */ #ifndef SQUID_ARRAY_H #define SQUID_ARRAY_H /* see Array.c for more documentation */ typedef struct { int capacity; int count; void **items; } Array; extern Array *arrayCreate(void); extern void arrayInit(Array * s); extern void arrayClean(Array * s); extern void arrayDestroy(Array * s); extern void arrayAppend(Array * s, void *obj); extern void arrayPreAppend(Array * s, int app_count); #endif /* SQUID_ARRAY_H */
/* * This file is part of the libopencm3 project. * * Copyright (C) 2015 Kuldeep Singh Dhaka <kuldeepdhaka9@gmail.com> * * This library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see <http://www.gnu.org/licenses/>. */ #if defined(EFM32LG) # include <libopencm3/efm32/lg/adc.h> #else # error "efm32 family not defined." #endif
// Copyright (C) 2002-2014 Nikolaus Gebhardt // This file is part of the "irrKlang" library. // For conditions of distribution and use, see copyright notice in irrKlang.h #ifndef __I_IRRKLANG_SOUND_STOP_EVENT_RECEIVER_H_INCLUDED__ #define __I_IRRKLANG_SOUND_STOP_EVENT_RECEIVER_H_INCLUDED__ #include "ik_IRefCounted.h" #include "ik_SAudioStreamFormat.h" namespace irrklang { //! An enumeration listing all reasons for a fired sound stop event enum E_STOP_EVENT_CAUSE { //! The sound stop event was fired because the sound finished playing ESEC_SOUND_FINISHED_PLAYING = 0, //! The sound stop event was fired because the sound was stopped by the user, calling ISound::stop(). ESEC_SOUND_STOPPED_BY_USER, //! The sound stop event was fired because the source of the sound was removed, for example //! because irrKlang was shut down or the user called ISoundEngine::removeSoundSource(). ESEC_SOUND_STOPPED_BY_SOURCE_REMOVAL, //! This enumeration literal is never used, it only forces the compiler to //! compile these enumeration values to 32 bit. ESEC_FORCE_32_BIT = 0x7fffffff }; //! Interface to be implemented by the user, which recieves sound stop events. /** The interface has only one method to be implemented by the user: OnSoundStopped(). Implement this interface and set it via ISound::setSoundStopEventReceiver(). The sound stop event is guaranteed to be called when a sound or sound stream is finished, either because the sound reached its playback end, its sound source was removed, ISoundEngine::stopAllSounds() has been called or the whole engine was deleted. */ class ISoundStopEventReceiver { public: //! destructor virtual ~ISoundStopEventReceiver() {}; //! Called when a sound has stopped playing. /** This is the only method to be implemented by the user. The sound stop event is guaranteed to be called when a sound or sound stream is finished, either because the sound reached its playback end, its sound source was removed, ISoundEngine::stopAllSounds() has been called or the whole engine was deleted. Please note: Sound events will occur in a different thread when the engine runs in multi threaded mode (default). In single threaded mode, the event will happen while the user thread is calling ISoundEngine::update(). \param sound: Sound which has been stopped. \param reason: The reason why the sound stop event was fired. Usually, this will be ESEC_SOUND_FINISHED_PLAYING. When the sound was aborded by calling ISound::stop() or ISoundEngine::stopAllSounds();, this would be ESEC_SOUND_STOPPED_BY_USER. If irrKlang was deleted or the sound source was removed, the value is ESEC_SOUND_STOPPED_BY_SOURCE_REMOVAL. \param userData: userData pointer set by the user when registering the interface via ISound::setSoundStopEventReceiver(). */ virtual void OnSoundStopped(ISound* sound, E_STOP_EVENT_CAUSE reason, void* userData) = 0; }; } // end namespace irrklang #endif
/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 4 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once #pragma comment(linker, "/nodefaultlib:libc.lib") #pragma comment(linker, "/nodefaultlib:libcd.lib") // NOTE - this value is not strongly correlated to the Windows CE OS version being targeted #define WINVER _WIN32_WCE #include <ceconfig.h> #if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) #define SHELL_AYGSHELL #endif #ifdef _CE_DCOM #define _ATL_APARTMENT_THREADED #endif #ifdef SHELL_AYGSHELL #include <aygshell.h> #pragma comment(lib, "aygshell.lib") #endif // SHELL_AYGSHELL // Windows Header Files: #include <windows.h> #if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) #ifndef _DEVICE_RESOLUTION_AWARE #define _DEVICE_RESOLUTION_AWARE #endif #endif #ifdef _DEVICE_RESOLUTION_AWARE #include "DeviceResolutionAware.h" #endif #if _WIN32_WCE < 0x500 && ( defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) ) #pragma comment(lib, "ccrtrtti.lib") #ifdef _X86_ #if defined(_DEBUG) #pragma comment(lib, "libcmtx86d.lib") #else #pragma comment(lib, "libcmtx86.lib") #endif #endif #endif #include <altcecrt.h> // TODO: reference additional headers your program requires here
/** ****************************************************************************** * @file stm32f7xx_hal_pcd_ex.h * @author MCD Application Team * @version V1.1.2 * @date 23-September-2016 * @brief Header file of PCD HAL module. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F7xx_HAL_PCD_EX_H #define __STM32F7xx_HAL_PCD_EX_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32f7xx_hal_def.h" /** @addtogroup STM32F7xx_HAL_Driver * @{ */ /** @addtogroup PCDEx * @{ */ /* Exported types ------------------------------------------------------------*/ typedef enum { PCD_LPM_L0_ACTIVE = 0x00U, /* on */ PCD_LPM_L1_ACTIVE = 0x01U, /* LPM L1 sleep */ }PCD_LPM_MsgTypeDef; /* Exported constants --------------------------------------------------------*/ /* Exported macros -----------------------------------------------------------*/ /* Exported functions --------------------------------------------------------*/ /** @addtogroup PCDEx_Exported_Functions PCDEx Exported Functions * @{ */ /** @addtogroup PCDEx_Exported_Functions_Group1 Peripheral Control functions * @{ */ HAL_StatusTypeDef HAL_PCDEx_SetTxFiFo(PCD_HandleTypeDef *hpcd, uint8_t fifo, uint16_t size); HAL_StatusTypeDef HAL_PCDEx_SetRxFiFo(PCD_HandleTypeDef *hpcd, uint16_t size); HAL_StatusTypeDef HAL_PCDEx_ActivateLPM(PCD_HandleTypeDef *hpcd); HAL_StatusTypeDef HAL_PCDEx_DeActivateLPM(PCD_HandleTypeDef *hpcd); void HAL_PCDEx_LPM_Callback(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg); /** * @} */ /** * @} */ /** * @} */ /** * @} */ #ifdef __cplusplus } #endif #endif /* __STM32F7xx_HAL_PCD_EX_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
// TabeButtonPressedDelegate.h // bither-ios // // Copyright 2014 http://Bither.net // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #import <Foundation/Foundation.h> @protocol TabButtonPressedDelegate <NSObject> - (void)tabButtonPressed:(int)index; @end
/** * WinPR: Windows Portable Runtime * Synchronization Functions * * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef WINPR_SYNCH_PRIVATE_H #define WINPR_SYNCH_PRIVATE_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <winpr/platform.h> #include <winpr/synch.h> #ifdef __linux__ #define WITH_POSIX_TIMER 1 #endif #include "../handle/handle.h" #ifndef _WIN32 #define WINPR_PIPE_SEMAPHORE 1 #if defined __APPLE__ #include <pthread.h> #include <sys/time.h> #include <semaphore.h> #include <mach/mach.h> #include <mach/semaphore.h> #include <mach/task.h> #define winpr_sem_t semaphore_t #else #include <pthread.h> #include <semaphore.h> #define winpr_sem_t sem_t #endif struct winpr_mutex { WINPR_HANDLE_DEF(); pthread_mutex_t mutex; }; typedef struct winpr_mutex WINPR_MUTEX; struct winpr_semaphore { WINPR_HANDLE_DEF(); int pipe_fd[2]; winpr_sem_t* sem; }; typedef struct winpr_semaphore WINPR_SEMAPHORE; struct winpr_event { WINPR_HANDLE_DEF(); int pipe_fd[2]; BOOL bAttached; BOOL bManualReset; }; typedef struct winpr_event WINPR_EVENT; #ifdef HAVE_TIMERFD_H #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <sys/timerfd.h> #endif struct winpr_timer { WINPR_HANDLE_DEF(); int fd; BOOL bInit; LONG lPeriod; BOOL bManualReset; PTIMERAPCROUTINE pfnCompletionRoutine; LPVOID lpArgToCompletionRoutine; #ifdef WITH_POSIX_TIMER timer_t tid; struct itimerspec timeout; #endif }; typedef struct winpr_timer WINPR_TIMER; typedef struct winpr_timer_queue_timer WINPR_TIMER_QUEUE_TIMER; struct winpr_timer_queue { WINPR_HANDLE_DEF(); pthread_t thread; pthread_attr_t attr; pthread_mutex_t mutex; pthread_cond_t cond; pthread_mutex_t cond_mutex; struct sched_param param; BOOL bCancelled; WINPR_TIMER_QUEUE_TIMER* activeHead; WINPR_TIMER_QUEUE_TIMER* inactiveHead; }; typedef struct winpr_timer_queue WINPR_TIMER_QUEUE; struct winpr_timer_queue_timer { WINPR_HANDLE_DEF(); ULONG Flags; DWORD DueTime; DWORD Period; PVOID Parameter; WAITORTIMERCALLBACK Callback; int FireCount; struct timespec StartTime; struct timespec ExpirationTime; WINPR_TIMER_QUEUE* timerQueue; WINPR_TIMER_QUEUE_TIMER* next; }; #endif #endif /* WINPR_SYNCH_PRIVATE_H */
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_WEBUI_SHARED_RESOURCES_DATA_SOURCE_H_ #define CHROME_BROWSER_UI_WEBUI_SHARED_RESOURCES_DATA_SOURCE_H_ #include <string> #include "base/compiler_specific.h" #include "chrome/browser/ui/webui/chrome_url_data_manager.h" // A DataSource for chrome://resources/ URLs. class SharedResourcesDataSource : public ChromeURLDataManager::DataSource { public: SharedResourcesDataSource(); // Overridden from ChromeURLDataManager::DataSource: virtual void StartDataRequest(const std::string& path, bool is_incognito, int request_id) OVERRIDE; virtual std::string GetMimeType(const std::string&) const OVERRIDE; private: virtual ~SharedResourcesDataSource(); DISALLOW_COPY_AND_ASSIGN(SharedResourcesDataSource); }; #endif // CHROME_BROWSER_UI_WEBUI_SHARED_RESOURCES_DATA_SOURCE_H_
#ifdef __CINT__ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class AliAnalysisTaskTree_MCut+; #endif
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef STORAGE_BROWSER_BLOB_BLOB_URL_UTILS_H_ #define STORAGE_BROWSER_BLOB_BLOB_URL_UTILS_H_ #include "url/gurl.h" namespace storage { namespace BlobUrlUtils { // We can't use GURL directly for these hash fragment manipulations // since it doesn't have specific knowlege of the BlobURL format. GURL // treats BlobURLs as if they were PathURLs which don't support hash // fragments. // Returns true iff |url| contains a hash fragment. bool UrlHasFragment(const GURL& url); // Returns |url| with any potential hash fragment stripped. If |url| didn't // contain such a fragment this returns |url| unchanged. GURL ClearUrlFragment(const GURL& url); } // namespace BlobUrlUtils } // namespace storage #endif // STORAGE_BROWSER_BLOB_BLOB_URL_UTILS_H_
/* * * Copyright 2015, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. 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 GRPC_CORE_LIB_IOMGR_ENDPOINT_H #define GRPC_CORE_LIB_IOMGR_ENDPOINT_H #include <grpc/slice.h> #include <grpc/slice_buffer.h> #include <grpc/support/time.h> #include "src/core/lib/iomgr/pollset.h" #include "src/core/lib/iomgr/pollset_set.h" #include "src/core/lib/iomgr/resource_quota.h" /* An endpoint caps a streaming channel between two communicating processes. Examples may be: a tcp socket, <stdin+stdout>, or some shared memory. */ typedef struct grpc_endpoint grpc_endpoint; typedef struct grpc_endpoint_vtable grpc_endpoint_vtable; struct grpc_endpoint_vtable { void (*read)(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, grpc_slice_buffer *slices, grpc_closure *cb); void (*write)(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, grpc_slice_buffer *slices, grpc_closure *cb); grpc_workqueue *(*get_workqueue)(grpc_endpoint *ep); void (*add_to_pollset)(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, grpc_pollset *pollset); void (*add_to_pollset_set)(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, grpc_pollset_set *pollset); void (*shutdown)(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep); void (*destroy)(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep); grpc_resource_user *(*get_resource_user)(grpc_endpoint *ep); char *(*get_peer)(grpc_endpoint *ep); int (*get_fd)(grpc_endpoint *ep); }; /* When data is available on the connection, calls the callback with slices. Callback success indicates that the endpoint can accept more reads, failure indicates the endpoint is closed. Valid slices may be placed into \a slices even when the callback is invoked with error != GRPC_ERROR_NONE. */ void grpc_endpoint_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, grpc_slice_buffer *slices, grpc_closure *cb); char *grpc_endpoint_get_peer(grpc_endpoint *ep); /* Get the file descriptor used by \a ep. Return -1 if \a ep is not using an fd. */ int grpc_endpoint_get_fd(grpc_endpoint *ep); /* Retrieve a reference to the workqueue associated with this endpoint */ grpc_workqueue *grpc_endpoint_get_workqueue(grpc_endpoint *ep); /* Write slices out to the socket. If the connection is ready for more data after the end of the call, it returns GRPC_ENDPOINT_DONE. Otherwise it returns GRPC_ENDPOINT_PENDING and calls cb when the connection is ready for more data. \a slices may be mutated at will by the endpoint until cb is called. No guarantee is made to the content of slices after a write EXCEPT that it is a valid slice buffer. */ void grpc_endpoint_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, grpc_slice_buffer *slices, grpc_closure *cb); /* Causes any pending and future read/write callbacks to run immediately with success==0 */ void grpc_endpoint_shutdown(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep); void grpc_endpoint_destroy(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep); /* Add an endpoint to a pollset, so that when the pollset is polled, events from this endpoint are considered */ void grpc_endpoint_add_to_pollset(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, grpc_pollset *pollset); void grpc_endpoint_add_to_pollset_set(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, grpc_pollset_set *pollset_set); grpc_resource_user *grpc_endpoint_get_resource_user(grpc_endpoint *endpoint); struct grpc_endpoint { const grpc_endpoint_vtable *vtable; }; #endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_H */
/* * Copyright (c) 2013, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following * disclaimer in the documentation and/or other materials provided with the * distribution. * * Neither the name of the Ford Motor Company nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_ #include "application_manager/commands/hmi/request_to_hmi.h" namespace application_manager { namespace commands { /** * @brief UIGetSupportedLanguagesRequest command class **/ class UIGetSupportedLanguagesRequest : public RequestToHMI { public: /** * @brief UIGetSupportedLanguagesRequest class constructor * * @param message Incoming SmartObject message **/ UIGetSupportedLanguagesRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); /** * @brief UIGetSupportedLanguagesRequest class destructor **/ virtual ~UIGetSupportedLanguagesRequest(); /** * @brief Execute command **/ virtual void Run(); private: DISALLOW_COPY_AND_ASSIGN(UIGetSupportedLanguagesRequest); }; } // namespace commands } // namespace application_manager #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
/* Copyright (C) 1994, 1995 Aladdin Enterprises. All rights reserved. This file is part of Aladdin Ghostscript. Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author or distributor accepts any responsibility for the consequences of using it, or for whether it serves any particular purpose or works at all, unless he or she says so in writing. Refer to the Aladdin Ghostscript Free Public License (the "License") for full details. Every copy of Aladdin Ghostscript must include a copy of the License, normally in a plain ASCII text file named PUBLIC. The License grants you the right to copy, modify and redistribute Aladdin Ghostscript, but only under certain conditions described in the License. Among other things, the License requires that the copyright notice and this notice be preserved on all copies. */ /* gdevdfax.c */ /* DigiBoard fax device. */ /*** *** Note: this driver is maintained by a user: please contact *** Rick Richardson (rick@digibd.com) if you have questions. ***/ #include "gdevprn.h" #include "strimpl.h" #include "scfx.h" /* Import the key routines from gdevtfax.c. */ int gdev_fax_open(P1(gx_device *)); void gdev_fax_init_state(P2(stream_CFE_state *, const gx_device_printer *)); int gdev_fax_print_page(P3(gx_device_printer *, FILE *, stream_CFE_state *)); /* Define the device parameters. */ #define X_DPI 204 #define Y_DPI 196 /* The device descriptors */ private dev_proc_open_device(dfax_prn_open); private dev_proc_print_page(dfax_print_page); struct gx_device_dfax_s { gx_device_common; gx_prn_device_common; long pageno; uint iwidth; /* width of image data in pixels */ }; typedef struct gx_device_dfax_s gx_device_dfax; private gx_device_procs dfax_procs = prn_procs(dfax_prn_open, gdev_prn_output_page, gdev_prn_close); gx_device_dfax far_data gs_dfaxlow_device = { prn_device_std_body(gx_device_dfax, dfax_procs, "dfaxlow", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI/2, 0,0,0,0, /* margins */ 1, dfax_print_page) }; gx_device_dfax far_data gs_dfaxhigh_device = { prn_device_std_body(gx_device_dfax, dfax_procs, "dfaxhigh", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI, 0,0,0,0, /* margins */ 1, dfax_print_page) }; #define dfdev ((gx_device_dfax *)dev) /* Open the device, adjusting the paper size. */ private int dfax_prn_open(gx_device *dev) { dfdev->pageno = 0; return gdev_fax_open(dev); } /* Print a DigiFAX page. */ private int dfax_print_page(gx_device_printer *dev, FILE *prn_stream) { stream_CFE_state state; static char hdr[64] = "\000PC Research, Inc\000\000\000\000\000\000"; int code; gdev_fax_init_state(&state, dev); state.EndOfLine = true; state.EncodedByteAlign = true; /* Start a page: write the header */ hdr[24] = 0; hdr[28] = 1; hdr[26] = ++dfdev->pageno; hdr[27] = dfdev->pageno >> 8; if (dev->y_pixels_per_inch == Y_DPI) { hdr[45] = 0x40; hdr[29] = 1; } /* high res */ else { hdr[45] = hdr[29] = 0; } /* low res */ fseek(prn_stream, 0, SEEK_END); fwrite(hdr, sizeof(hdr), 1, prn_stream); /* Write the page */ code = gdev_fax_print_page(dev, prn_stream, &state); /* Fixup page count */ fseek(prn_stream, 24L, SEEK_SET); hdr[24] = dfdev->pageno; hdr[25] = dfdev->pageno >> 8; fwrite(hdr+24, 2, 1, prn_stream); return code; } #undef dfdev
//////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2013, Jasper Blues & Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// #import <Foundation/Foundation.h> @class TyphoonDefinition; @class TyphoonRuntimeArguments; typedef void(^TyphoonInstanceCompleteBlock)(id instance); @interface TyphoonStackElement : NSObject @property(nonatomic, strong, readonly) NSString *key; @property(nonatomic, strong, readonly) TyphoonRuntimeArguments *args; @property(nonatomic, strong, readonly) id instance; /* Raises a circular init exception if instance in initializing state. */ + (instancetype)elementWithKey:(NSString *)key args:(TyphoonRuntimeArguments *)args; - (NSString *)description; - (BOOL)isInitializingInstance; - (void)addInstanceCompleteBlock:(TyphoonInstanceCompleteBlock)completeBlock; - (void)takeInstance:(id)instance; @end
// // OCHamcrest - HCSubstringMatcher.h // Copyright 2014 hamcrest.org. See LICENSE.txt // // Created by: Jon Reid, http://qualitycoding.org/ // Docs: http://hamcrest.github.com/OCHamcrest/ // Source: https://github.com/hamcrest/OCHamcrest // #import <OCHamcrest/HCBaseMatcher.h> @interface HCSubstringMatcher : HCBaseMatcher @property (nonatomic, readonly) NSString *substring; - (instancetype)initWithSubstring:(NSString *)aString; @end
#include <threads.h> #include <pthread.h> int cnd_signal(cnd_t *c) { /* This internal function never fails, and always returns zero, * which matches the value thrd_success is defined with. */ return __private_cond_signal((pthread_cond_t *)c, 1); }
/* Copyright (C) 1991-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <sys/time.h> /* Set the current time of day and timezone information. This call is restricted to the super-user. */ int __settimeofday (tv, tz) const struct timeval *tv; const struct timezone *tz; { __set_errno (ENOSYS); return -1; } stub_warning (settimeofday) weak_alias (__settimeofday, settimeofday)
/* inc-gdbserv-log.c Copyright 2001, 2002 Red Hat, Inc. This file is part of RDA, the Red Hat Debug Agent (and library). 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. Alternative licenses for RDA may be arranged by contacting Red Hat, Inc. */ #include "gdbserv-log.h"
/* * drivers/video/tegra/host/debug.h * * Tegra Graphics Host Debug * * Copyright (C) 2011-2015, NVIDIA Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __NVHOST_DEBUG_H #define __NVHOST_DEBUG_H #include <linux/debugfs.h> #include <linux/seq_file.h> #include "nvhost_syncpt.h" struct output { void (*fn)(void *ctx, const char* str, size_t len); void *ctx; char buf[256]; }; static inline void write_to_seqfile(void *ctx, const char* str, size_t len) { seq_write((struct seq_file *)ctx, str, len); } static inline void write_to_printk(void *ctx, const char* str, size_t len) { printk("%s", str); } void nvhost_debug_output(struct output *o, const char* fmt, ...); void nvhost_debug_dump_locked(struct nvhost_master *master, int locked_id); void nvhost_syncpt_debug(struct nvhost_syncpt *sp); extern pid_t nvhost_debug_force_timeout_pid; extern u32 nvhost_debug_force_timeout_val; extern u32 nvhost_debug_force_timeout_channel; extern u32 nvhost_debug_force_timeout_dump; extern unsigned int nvhost_debug_trace_cmdbuf; extern unsigned int nvhost_debug_trace_actmon; #endif /*__NVHOST_DEBUG_H */
/* * Copyright (C) 2005 Junio C Hamano */ #ifndef DIFFCORE_H #define DIFFCORE_H /* This header file is internal between diff.c and its diff transformers * (e.g. diffcore-rename, diffcore-pickaxe). Never include this header * in anything else. */ /* We internally use unsigned short as the score value, * and rely on an int capable to hold 32-bits. -B can take * -Bmerge_score/break_score format and the two scores are * passed around in one int (high 16-bit for merge and low 16-bit * for break). */ #define MAX_SCORE 60000.0 #define DEFAULT_RENAME_SCORE 30000 /* rename/copy similarity minimum (50%) */ #define DEFAULT_BREAK_SCORE 30000 /* minimum for break to happen (50%) */ #define DEFAULT_MERGE_SCORE 36000 /* maximum for break-merge to happen (60%) */ #define MINIMUM_BREAK_SIZE 400 /* do not break a file smaller than this */ struct userdiff_driver; struct diff_filespec { struct object_id oid; char *path; void *data; void *cnt_data; unsigned long size; int count; /* Reference count */ int rename_used; /* Count of rename users */ unsigned short mode; /* file mode */ unsigned oid_valid : 1; /* if true, use oid and trust mode; * if false, use the name and read from * the filesystem. */ #define DIFF_FILE_VALID(spec) (((spec)->mode) != 0) unsigned should_free : 1; /* data should be free()'ed */ unsigned should_munmap : 1; /* data should be munmap()'ed */ unsigned dirty_submodule : 2; /* For submodules: its work tree is dirty */ #define DIRTY_SUBMODULE_UNTRACKED 1 #define DIRTY_SUBMODULE_MODIFIED 2 unsigned is_stdin : 1; unsigned has_more_entries : 1; /* only appear in combined diff */ /* data should be considered "binary"; -1 means "don't know yet" */ signed int is_binary : 2; struct userdiff_driver *driver; }; extern struct diff_filespec *alloc_filespec(const char *); extern void free_filespec(struct diff_filespec *); extern void fill_filespec(struct diff_filespec *, const unsigned char *, int, unsigned short); #define CHECK_SIZE_ONLY 1 #define CHECK_BINARY 2 extern int diff_populate_filespec(struct diff_filespec *, unsigned int); extern void diff_free_filespec_data(struct diff_filespec *); extern void diff_free_filespec_blob(struct diff_filespec *); extern int diff_filespec_is_binary(struct diff_filespec *); struct diff_filepair { struct diff_filespec *one; struct diff_filespec *two; unsigned short int score; char status; /* M C R A D U etc. (see Documentation/diff-format.txt or DIFF_STATUS_* in diff.h) */ unsigned broken_pair : 1; unsigned renamed_pair : 1; unsigned is_unmerged : 1; unsigned done_skip_stat_unmatch : 1; unsigned skip_stat_unmatch_result : 1; }; #define DIFF_PAIR_UNMERGED(p) ((p)->is_unmerged) #define DIFF_PAIR_RENAME(p) ((p)->renamed_pair) #define DIFF_PAIR_BROKEN(p) \ ( (!DIFF_FILE_VALID((p)->one) != !DIFF_FILE_VALID((p)->two)) && \ ((p)->broken_pair != 0) ) #define DIFF_PAIR_TYPE_CHANGED(p) \ ((S_IFMT & (p)->one->mode) != (S_IFMT & (p)->two->mode)) #define DIFF_PAIR_MODE_CHANGED(p) ((p)->one->mode != (p)->two->mode) extern void diff_free_filepair(struct diff_filepair *); extern int diff_unmodified_pair(struct diff_filepair *); struct diff_queue_struct { struct diff_filepair **queue; int alloc; int nr; }; #define DIFF_QUEUE_CLEAR(q) \ do { \ (q)->queue = NULL; \ (q)->nr = (q)->alloc = 0; \ } while (0) extern struct diff_queue_struct diff_queued_diff; extern struct diff_filepair *diff_queue(struct diff_queue_struct *, struct diff_filespec *, struct diff_filespec *); extern void diff_q(struct diff_queue_struct *, struct diff_filepair *); extern void diffcore_break(int); extern void diffcore_rename(struct diff_options *); extern void diffcore_merge_broken(void); extern void diffcore_pickaxe(struct diff_options *); extern void diffcore_order(const char *orderfile); /* low-level interface to diffcore_order */ struct obj_order { void *obj; /* setup by caller */ /* setup/used by order_objects() */ int orig_order; int order; }; typedef const char *(*obj_path_fn_t)(void *obj); void order_objects(const char *orderfile, obj_path_fn_t obj_path, struct obj_order *objs, int nr); #define DIFF_DEBUG 0 #if DIFF_DEBUG void diff_debug_filespec(struct diff_filespec *, int, const char *); void diff_debug_filepair(const struct diff_filepair *, int); void diff_debug_queue(const char *, struct diff_queue_struct *); #else #define diff_debug_filespec(a,b,c) do { /* nothing */ } while (0) #define diff_debug_filepair(a,b) do { /* nothing */ } while (0) #define diff_debug_queue(a,b) do { /* nothing */ } while (0) #endif extern int diffcore_count_changes(struct diff_filespec *src, struct diff_filespec *dst, void **src_count_p, void **dst_count_p, unsigned long *src_copied, unsigned long *literal_added); #endif
#ifndef COMPAT_BSWAP_H #define COMPAT_BSWAP_H /* * Let's make sure we always have a sane definition for ntohl()/htonl(). * Some libraries define those as a function call, just to perform byte * shifting, bringing significant overhead to what should be a simple * operation. */ /* * Default version that the compiler ought to optimize properly with * constant values. */ static inline uint32_t default_swab32(uint32_t val) { return (((val & 0xff000000) >> 24) | ((val & 0x00ff0000) >> 8) | ((val & 0x0000ff00) << 8) | ((val & 0x000000ff) << 24)); } static inline uint64_t default_bswap64(uint64_t val) { return (((val & (uint64_t)0x00000000000000ffULL) << 56) | ((val & (uint64_t)0x000000000000ff00ULL) << 40) | ((val & (uint64_t)0x0000000000ff0000ULL) << 24) | ((val & (uint64_t)0x00000000ff000000ULL) << 8) | ((val & (uint64_t)0x000000ff00000000ULL) >> 8) | ((val & (uint64_t)0x0000ff0000000000ULL) >> 24) | ((val & (uint64_t)0x00ff000000000000ULL) >> 40) | ((val & (uint64_t)0xff00000000000000ULL) >> 56)); } #undef bswap32 #undef bswap64 #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) #define bswap32 git_bswap32 static inline uint32_t git_bswap32(uint32_t x) { uint32_t result; if (__builtin_constant_p(x)) result = default_swab32(x); else __asm__("bswap %0" : "=r" (result) : "0" (x)); return result; } #define bswap64 git_bswap64 #if defined(__x86_64__) static inline uint64_t git_bswap64(uint64_t x) { uint64_t result; if (__builtin_constant_p(x)) result = default_bswap64(x); else __asm__("bswap %q0" : "=r" (result) : "0" (x)); return result; } #else static inline uint64_t git_bswap64(uint64_t x) { union { uint64_t i64; uint32_t i32[2]; } tmp, result; if (__builtin_constant_p(x)) result.i64 = default_bswap64(x); else { tmp.i64 = x; result.i32[0] = git_bswap32(tmp.i32[1]); result.i32[1] = git_bswap32(tmp.i32[0]); } return result.i64; } #endif #elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) #include <stdlib.h> #define bswap32(x) _byteswap_ulong(x) #define bswap64(x) _byteswap_uint64(x) #endif #if defined(bswap32) #undef ntohl #undef htonl #define ntohl(x) bswap32(x) #define htonl(x) bswap32(x) #endif #if defined(bswap64) #undef ntohll #undef htonll #define ntohll(x) bswap64(x) #define htonll(x) bswap64(x) #else #undef ntohll #undef htonll #if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN) # define GIT_BYTE_ORDER __BYTE_ORDER # define GIT_LITTLE_ENDIAN __LITTLE_ENDIAN # define GIT_BIG_ENDIAN __BIG_ENDIAN #elif defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN) # define GIT_BYTE_ORDER BYTE_ORDER # define GIT_LITTLE_ENDIAN LITTLE_ENDIAN # define GIT_BIG_ENDIAN BIG_ENDIAN #else # define GIT_BIG_ENDIAN 4321 # define GIT_LITTLE_ENDIAN 1234 # if defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) # define GIT_BYTE_ORDER GIT_BIG_ENDIAN # elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) # define GIT_BYTE_ORDER GIT_LITTLE_ENDIAN # elif defined(__THW_BIG_ENDIAN__) && !defined(__THW_LITTLE_ENDIAN__) # define GIT_BYTE_ORDER GIT_BIG_ENDIAN # elif defined(__THW_LITTLE_ENDIAN__) && !defined(__THW_BIG_ENDIAN__) # define GIT_BYTE_ORDER GIT_LITTLE_ENDIAN # else # error "Cannot determine endianness" # endif #endif #if GIT_BYTE_ORDER == GIT_BIG_ENDIAN # define ntohll(n) (n) # define htonll(n) (n) #else # define ntohll(n) default_bswap64(n) # define htonll(n) default_bswap64(n) #endif #endif /* * Performance might be improved if the CPU architecture is OK with * unaligned 32-bit loads and a fast ntohl() is available. * Otherwise fall back to byte loads and shifts which is portable, * and is faster on architectures with memory alignment issues. */ #if !defined(NO_UNALIGNED_LOADS) && ( \ defined(__i386__) || defined(__x86_64__) || \ defined(_M_IX86) || defined(_M_X64) || \ defined(__ppc__) || defined(__ppc64__) || \ defined(__powerpc__) || defined(__powerpc64__) || \ defined(__s390__) || defined(__s390x__)) #define get_be16(p) ntohs(*(unsigned short *)(p)) #define get_be32(p) ntohl(*(unsigned int *)(p)) #define get_be64(p) ntohll(*(uint64_t *)(p)) #define put_be32(p, v) do { *(unsigned int *)(p) = htonl(v); } while (0) #define put_be64(p, v) do { *(uint64_t *)(p) = htonll(v); } while (0) #else static inline uint16_t get_be16(const void *ptr) { const unsigned char *p = ptr; return (uint16_t)p[0] << 8 | (uint16_t)p[1] << 0; } static inline uint32_t get_be32(const void *ptr) { const unsigned char *p = ptr; return (uint32_t)p[0] << 24 | (uint32_t)p[1] << 16 | (uint32_t)p[2] << 8 | (uint32_t)p[3] << 0; } static inline uint64_t get_be64(const void *ptr) { const unsigned char *p = ptr; return (uint64_t)get_be32(&p[0]) << 32 | (uint64_t)get_be32(&p[4]) << 0; } static inline void put_be32(void *ptr, uint32_t value) { unsigned char *p = ptr; p[0] = value >> 24; p[1] = value >> 16; p[2] = value >> 8; p[3] = value >> 0; } static inline void put_be64(void *ptr, uint64_t value) { unsigned char *p = ptr; p[0] = value >> 56; p[1] = value >> 48; p[2] = value >> 40; p[3] = value >> 32; p[4] = value >> 24; p[5] = value >> 16; p[6] = value >> 8; p[7] = value >> 0; } #endif #endif /* COMPAT_BSWAP_H */
/* vim: set expandtab ts=4 sw=4: */ /* * You may redistribute this program 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 Security_H #define Security_H #include "benc/Dict.h" #include "memory/Allocator.h" #include "exception/Except.h" #include "util/log/Log.h" #include "util/events/EventBase.h" #include "util/Linker.h" #ifdef win32 Linker_require("util/Security_win32.c") #else Linker_require("util/Security.c") #endif #include <stdint.h> #include <stdbool.h> struct Security_Permissions { int noOpenFiles; int seccompExists; int seccompEnforcing; int uid; }; struct Security { bool setupComplete; }; void Security_setUser(int uid, bool keepNetAdmin, struct Log* logger, struct Except* eh, struct Allocator* alloc); void Security_nofiles(struct Except* eh); void Security_noforks(struct Except* eh); void Security_chroot(char* root, struct Except* eh); void Security_seccomp(struct Allocator* tempAlloc, struct Log* logger, struct Except* eh); void Security_setupComplete(struct Security* security); struct Security* Security_new(struct Allocator* alloc, struct Log* log, struct EventBase* base); Dict* Security_getUser(char* userName, struct Allocator* retAlloc); struct Security_Permissions* Security_checkPermissions(struct Allocator* alloc, struct Except* eh); #endif
/* * Copyright (C) 2011-2012 Project SkyFire <http://www.projectskyfire.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 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 DEF_BARADIN_HOLD_H_ #define DEF_BARADIN_HOLD_H_ enum Creatures { CREATURE_ARGALOTH = 47120, CREATURE_OCCUTHAR = 52363, // will be in 4.2 }; enum Data { DATA_ARGALOTH, DATA_OCCUTHAR, MAX_ENCOUNTER }; #endif
/* * compression/DecompressorLZX.h * * Copyright 2009 Peter Barth * * This file is part of Milkytracker. * * Milkytracker 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. * * Milkytracker 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 Milkytracker. If not, see <http://www.gnu.org/licenses/>. * */ /* * DecompressorLZX.h * milkytracker_universal * * Created by Peter Barth on 17.04.09. * */ #ifndef __DECOMPRESSOR_LZX_H__ #define __DECOMPRESSOR_LZX_H__ #include "Decompressor.h" /***************************************************************************** * LZX decompressor *****************************************************************************/ class DecompressorLZX : public DecompressorBase { public: DecompressorLZX(const PPSystemString& filename); virtual bool identify(XMFile& f); // this type of archive only contain modules virtual bool doesServeHint(Hints hint) { return (hint == HintAll || hint == HintModules); } virtual const PPSimpleVector<Descriptor>& getDescriptors(Hints hint) const; virtual bool decompress(const PPSystemString& outFilename, Hints hint); virtual DecompressorBase* clone(); }; #endif
// ---------------------------------------------------------------------------- // outputencoder.h -- output charset conversion // // Copyright (C) 2012 // Andrej Lajovic, S57LN // // This file is part of fldigi. // // Fldigi 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. // // Fldigi 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 fldigi. If not, see <http://www.gnu.org/licenses/>. // ---------------------------------------------------------------------------- #ifndef OUTPUTENCODER_H #define OUTPUTENCODER_H #include <string> #include <tiniconv.h> class OutputEncoder { public: OutputEncoder(const int charset_out, unsigned int buffer_size = 32); ~OutputEncoder(void); void set_output_encoding(const int charset_out); void push(std::string s); const unsigned int pop(void); private: unsigned int buffer_size; unsigned char *buffer; unsigned char *encoding_ptr; unsigned char *pop_ptr; unsigned int data_length; tiniconv_ctx_s ctx; }; #endif
/** ****************************************************************************** * @file usbd_cdc_vcp.h * @author MCD Application Team * @version V1.0.0 * @date 22-July-2011 * @brief Header for usbd_cdc_vcp.c 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 __USBD_CDC_VCP_H #define __USBD_CDC_VCP_H /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_conf.h" #include "usbd_cdc_core.h" #include "usbd_conf.h" #include <stdint.h> #include "usbd_core.h" #include "usbd_usr.h" #include "usbd_desc.h" __ALIGN_BEGIN USB_OTG_CORE_HANDLE USB_OTG_dev __ALIGN_END; uint32_t CDC_Send_DATA(const uint8_t *ptrBuffer, uint32_t sendLength); uint32_t CDC_Send_FreeBytes(void); uint32_t CDC_Receive_DATA(uint8_t* recvBuf, uint32_t len); // HJI uint32_t CDC_Receive_BytesAvailable(void); uint8_t usbIsConfigured(void); // HJI uint8_t usbIsConnected(void); // HJI uint32_t CDC_BaudRate(void); /* External variables --------------------------------------------------------*/ extern __IO uint32_t bDeviceState; /* USB device status */ typedef enum _DEVICE_STATE { UNCONNECTED, ATTACHED, POWERED, SUSPENDED, ADDRESSED, CONFIGURED } DEVICE_STATE; /* Exported typef ------------------------------------------------------------*/ /* The following structures groups all needed parameters to be configured for the ComPort. These parameters can modified on the fly by the host through CDC class command class requests. */ typedef struct { uint32_t bitrate; uint8_t format; uint8_t paritytype; uint8_t datatype; } LINE_CODING; #endif /* __USBD_CDC_VCP_H */
/* MusicXML Library Copyright (C) Grame 2006-2013 This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. Grame Research Laboratory, 11, cours de Verdun Gensoul 69002 Lyon - France research@grame.fr */ #ifndef __cloneVisitor__ #define __cloneVisitor__ #include <stack> #include "visitor.h" #include "xml.h" namespace MusicXML2 { /*! \addtogroup visitors @{ */ /*! \brief A visitor that clones a musicxml tree */ class EXP clonevisitor : public visitor<Sxmlelement> { public: clonevisitor() : fClone(true) {} virtual ~clonevisitor() {} virtual void visitStart( Sxmlelement& elt ); virtual void visitEnd ( Sxmlelement& elt ); virtual Sxmlelement clone() { return fStack.top(); } protected: virtual void clone(bool state) { fClone = state; } virtual void copyAttributes (const Sxmlelement& src, Sxmlelement& dst); virtual Sxmlelement copy (const Sxmlelement& elt); virtual Sxmlelement& lastCopy () { return fLastCopy; } bool fClone; Sxmlelement fLastCopy; std::stack<Sxmlelement> fStack; }; /*! @} */ } #endif
/* * This file is designed to support Analog functions in Espruino for ESP32, * a JavaScript interpreter for Microcontrollers designed by Gordon Williams * * Copyright (C) 2016 by Juergen Marsch * * This Source Code Form is subject to the terms of the Mozilla Publici * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * ---------------------------------------------------------------------------- * This file is designed to be parsed during the build process * * Contains ESP32 board specific functions. * ---------------------------------------------------------------------------- */ #include "jspininfo.h" void ADCReset(); void initADC(int ADCgroup); int readADC(Pin pin); void rangeADC(Pin pin,int range); void writeDAC(Pin pin,uint8_t value);
/* Free ISQL - An isql for DB-Library (C) 2007 Nicholas S. Castellano * * 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 library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include <stdio.h> #include <string.h> #include <sybfront.h> #include <sybdb.h> #include "handlers.h" int global_errorlevel = -1; int err_handler(DBPROCESS * dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr) { if ((dbproc == NULL) || (DBDEAD(dbproc))) { return (INT_EXIT); } if (dberr != SYBESMSG) { fprintf(stdout, "DB-LIBRARY error:\n\t%s\n", dberrstr); } if (oserr != DBNOERR) { fprintf(stdout, "Operating-system error:\n\t%s\n", oserrstr); } return (INT_CANCEL); } int msg_handler(DBPROCESS * dbproc, DBINT msgno, int msgstate, int severity, char *msgtext, char *srvname, char *procname, int line) { if (severity > 10) { if ((global_errorlevel == -1) || (severity >= global_errorlevel)) { fprintf(stdout, "Msg %ld, Level %d, State %d:\n", (long) msgno, severity, msgstate); } if (global_errorlevel == -1) { if (strlen(srvname) > 0) { fprintf(stdout, "Server '%s', ", srvname); } if (strlen(procname) > 0) { fprintf(stdout, "Procedure '%s', ", procname); } if (line > 0) { fprintf(stdout, "Line %d:\n", line); } } } if (global_errorlevel == -1) { fprintf(stdout, "%s\n", msgtext); } return (0); }
// RUN: %clang_cc1 %s -fsyntax-only -verify // RUN: %clang_cc1 %s -fsyntax-only -fshort-wchar -verify -DSHORT_WCHAR typedef __WCHAR_TYPE__ wchar_t; #if defined(_WIN32) || defined(_M_IX86) || defined(__CYGWIN__) \ || defined(_M_X64) || defined(__ORBIS__) || defined(SHORT_WCHAR) #define WCHAR_T_TYPE unsigned short #elif defined(__arm) || defined(__aarch64__) #define WCHAR_T_TYPE unsigned int #elif defined(__sun) #define WCHAR_T_TYPE long #else /* Solaris. */ #define WCHAR_T_TYPE int #endif int check_wchar_size[sizeof(*L"") == sizeof(wchar_t) ? 1 : -1]; void foo() { WCHAR_T_TYPE t1[] = L"x"; wchar_t tab[] = L"x"; WCHAR_T_TYPE t2[] = "x"; // expected-error {{initializing wide char array with non-wide string literal}} char t3[] = L"x"; // expected-error {{initializing char array with wide string literal}} }
/* * Copyright (c) 2016 RnDity Sp. z o.o. * * SPDX-License-Identifier: Apache-2.0 */ #include "soc.h" #include <errno.h> #include <device.h> #include <pinmux/stm32/pinmux_stm32.h> #include <drivers/clock_control/stm32_clock_control.h> int stm32_get_pin_config(int pin, int func) { /* GPIO function is a known setting */ if (func == STM32_PINMUX_FUNC_GPIO) { return STM32F3X_PIN_CONFIG_BIAS_HIGH_IMPEDANCE; } /* analog function is another 'known' setting */ if (func == STM32_PINMUX_FUNC_ANALOG) { return STM32F3X_PIN_CONFIG_ANALOG; } if (func > STM32_PINMUX_FUNC_ALT_MAX) { return -EINVAL; } /* encode and return the 'real' alternate function number */ return STM32_PINFUNC(func, STM32F3X_PIN_CONFIG_AF); }
/*========================================================================= * * Copyright NumFOCUS * * 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.txt * * 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 itkImageContainerInterface_h #define itkImageContainerInterface_h #include "itkObject.h" namespace itk { /** \class ImageContainerInterface * \brief Used for reference when writing containers conforming to * this interface. * * This should only be used for reference when writing containers * conforming to this interface. ITK uses generic programming to * allow container type substitution, so polymorphism is not needed to * use containers through this interface. This means that a container * conforming to this interface need not be derived from it, and that * their methods should not be virtual. However, the container must * derive from Object in order to support the reference counting, * modification time, and debug information required by this * interface. * * Note that many comments refer to a "default element" or "default element * value". This value is equal to the default constructor of the * Element type. Also note that all non-const methods assume that the * container was modified, and update the modification time. * * \tparam TElementIdentifier A type that shall be used to index the * container. It must have a < operator defined for ordering. * * \tparam TElement The element type stored in the container. * * \ingroup ImageObjects * \ingroup ITKCommon */ template <typename TElementIdentifier, typename TElement> class ImageContainerInterface : public Object { public: /** Standard class type aliases. */ using Self = ImageContainerInterface; using Superclass = Object; using Pointer = SmartPointer<Self>; using ConstPointer = SmartPointer<const Self>; /** Standard part of every itk Object. */ itkTypeMacro(ImageContainerInterface, Object); /** Save the template parameters. */ using ElementIdentifier = TElementIdentifier; using Element = TElement; /** Index operator. This version can be an lvalue. */ virtual TElement & operator[](const ElementIdentifier) = 0; /** Index operator. This version can only be an rvalue */ virtual const TElement & operator[](const ElementIdentifier) const = 0; /** Return a pointer to the beginning of the buffer. This is used by * the image iterator class. */ virtual TElement * GetBufferPointer() = 0; /** Get the number of elements currently stored in the container. */ virtual ElementIdentifier Size() const = 0; /** Tell the container to allocate enough memory to allow at least * as many elements as the size given to be stored. This is NOT * guaranteed to actually allocate any memory, but is useful if the * implementation of the container allocates contiguous storage. */ virtual void Reserve(ElementIdentifier) = 0; /** Tell the container to try to minimize its memory usage for storage of * the current number of elements. This is NOT guaranteed to decrease * memory usage. */ virtual void Squeeze() = 0; }; } // end namespace itk #endif
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_RENDERER_PEPPER_PPB_AUDIO_IMPL_H_ #define CONTENT_RENDERER_PEPPER_PPB_AUDIO_IMPL_H_ #include <stddef.h> #include <stdint.h> #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/shared_memory.h" #include "base/sync_socket.h" #include "content/public/renderer/plugin_instance_throttler.h" #include "content/renderer/pepper/audio_helper.h" #include "ppapi/c/pp_completion_callback.h" #include "ppapi/c/ppb_audio.h" #include "ppapi/c/ppb_audio_config.h" #include "ppapi/shared_impl/ppb_audio_config_shared.h" #include "ppapi/shared_impl/ppb_audio_shared.h" #include "ppapi/shared_impl/resource.h" #include "ppapi/shared_impl/scoped_pp_resource.h" namespace content { class PepperPlatformAudioOutput; // Some of the backend functionality of this class is implemented by the // PPB_Audio_Shared so it can be shared with the proxy. // // TODO(teravest): PPB_Audio is no longer supported in-process. Clean this up // to look more like typical HostResource implementations. class PPB_Audio_Impl : public ppapi::Resource, public ppapi::PPB_Audio_Shared, public AudioHelper, public PluginInstanceThrottler::Observer { public: explicit PPB_Audio_Impl(PP_Instance instance); // Resource overrides. ppapi::thunk::PPB_Audio_API* AsPPB_Audio_API() override; // PPB_Audio_API implementation. PP_Resource GetCurrentConfig() override; PP_Bool StartPlayback() override; PP_Bool StopPlayback() override; int32_t Open(PP_Resource config_id, scoped_refptr<ppapi::TrackedCallback> create_callback) override; int32_t GetSyncSocket(int* sync_socket) override; int32_t GetSharedMemory(base::SharedMemory** shm, uint32_t* shm_size) override; void SetVolume(double volume); private: ~PPB_Audio_Impl() override; // AudioHelper implementation. void OnSetStreamInfo(base::SharedMemoryHandle shared_memory_handle, size_t shared_memory_size_, base::SyncSocket::Handle socket) override; // PluginInstanceThrottler::Observer implementation. void OnThrottleStateChange() override; // Starts the deferred playback and unsubscribes from the throttler. void StartDeferredPlayback(); // AudioConfig used for creating this Audio object. We own a ref. ppapi::ScopedPPResource config_; // PluginDelegate audio object that we delegate audio IPC through. We don't // own this pointer but are responsible for calling Shutdown on it. PepperPlatformAudioOutput* audio_; // Stream is playing, but throttled due to Plugin Power Saver. bool playback_throttled_; DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Impl); }; } // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_AUDIO_IMPL_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_SYNC_GLUE_FRONTEND_DATA_TYPE_CONTROLLER_H__ #define CHROME_BROWSER_SYNC_GLUE_FRONTEND_DATA_TYPE_CONTROLLER_H__ #include <string> #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "components/sync_driver/data_type_controller.h" #include "components/sync_driver/data_type_error_handler.h" class Profile; class ProfileSyncService; class ProfileSyncComponentsFactory; namespace base { class TimeDelta; } namespace syncer { class SyncError; } namespace browser_sync { class AssociatorInterface; class ChangeProcessor; // Implementation for datatypes that reside on the frontend thread // (UI thread). This is the same thread we perform initialization on, so we // don't have to worry about thread safety. The main start/stop funtionality is // implemented by default. // Derived classes must implement (at least): // syncer::ModelType type() const // void CreateSyncComponents(); // NOTE: This class is deprecated! New sync datatypes should be using the // syncer::SyncableService API and the UIDataTypeController instead. // TODO(zea): Delete this once all types are on the new API. class FrontendDataTypeController : public DataTypeController { public: FrontendDataTypeController( scoped_refptr<base::MessageLoopProxy> ui_thread, const base::Closure& error_callback, ProfileSyncComponentsFactory* profile_sync_factory, Profile* profile, ProfileSyncService* sync_service); // DataTypeController interface. virtual void LoadModels( const ModelLoadCallback& model_load_callback) OVERRIDE; virtual void StartAssociating(const StartCallback& start_callback) OVERRIDE; virtual void Stop() OVERRIDE; virtual syncer::ModelType type() const = 0; virtual syncer::ModelSafeGroup model_safe_group() const OVERRIDE; virtual std::string name() const OVERRIDE; virtual State state() const OVERRIDE; // DataTypeErrorHandler interface. virtual void OnSingleDatatypeUnrecoverableError( const tracked_objects::Location& from_here, const std::string& message) OVERRIDE; protected: friend class FrontendDataTypeControllerMock; // For testing only. FrontendDataTypeController(); virtual ~FrontendDataTypeController(); // Kick off any dependent services that need to be running before we can // associate models. The default implementation is a no-op. // Return value: // True - if models are ready and association can proceed. // False - if models are not ready. Associate() should be called when the // models are ready. Refer to Start(_) implementation. virtual bool StartModels(); // Datatype specific creation of sync components. virtual void CreateSyncComponents() = 0; // DataTypeController interface. virtual void OnModelLoaded() OVERRIDE; // Perform any DataType controller specific state cleanup before stopping // the datatype controller. The default implementation is a no-op. virtual void CleanUpState(); // Helper method for cleaning up state and running the start callback. virtual void StartDone( StartResult start_result, const syncer::SyncMergeResult& local_merge_result, const syncer::SyncMergeResult& syncer_merge_result); // Record association time. virtual void RecordAssociationTime(base::TimeDelta time); // Record causes of start failure. virtual void RecordStartFailure(StartResult result); virtual AssociatorInterface* model_associator() const; virtual void set_model_associator(AssociatorInterface* associator); virtual ChangeProcessor* GetChangeProcessor() const OVERRIDE; virtual void set_change_processor(ChangeProcessor* processor); // Handles the reporting of unrecoverable error. It records stuff in // UMA and reports to breakpad. // Virtual for testing purpose. virtual void RecordUnrecoverableError( const tracked_objects::Location& from_here, const std::string& message); ProfileSyncComponentsFactory* const profile_sync_factory_; Profile* const profile_; ProfileSyncService* const sync_service_; State state_; StartCallback start_callback_; ModelLoadCallback model_load_callback_; // TODO(sync): transition all datatypes to SyncableService and deprecate // AssociatorInterface. scoped_ptr<AssociatorInterface> model_associator_; scoped_ptr<ChangeProcessor> change_processor_; private: // Build sync components and associate models. // Return value: // True - if association was successful. FinishStart should have been // invoked. // False - if association failed. StartFailed should have been invoked. virtual bool Associate(); void AbortModelLoad(); // Clean up our state and state variables. Called in response // to a failure or abort or stop. void CleanUp(); DISALLOW_COPY_AND_ASSIGN(FrontendDataTypeController); }; } // namespace browser_sync #endif // CHROME_BROWSER_SYNC_GLUE_FRONTEND_DATA_TYPE_CONTROLLER_H__
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_ITEM_UTILS_H_ #define COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_ITEM_UTILS_H_ class GURL; namespace offline_pages { // Returns true if two URLs are equal, ignoring the fragment. // Because offline page items are stored without fragment, this is appropriate // for checking if an offline item's URL matches another URL. bool EqualsIgnoringFragment(const GURL& lhs, const GURL& rhs); // Strips any fragment from |url| and returns the result. GURL UrlWithoutFragment(const GURL& url); } // namespace offline_pages #endif // COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_ITEM_UTILS_H_
// Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef IOS_CHROME_BROWSER_UI_THUMB_STRIP_THUMB_STRIP_SUPPORTING_H_ #define IOS_CHROME_BROWSER_UI_THUMB_STRIP_THUMB_STRIP_SUPPORTING_H_ #import <Foundation/Foundation.h> @class ViewRevealingVerticalPanHandler; // Protocol defining an interface that enables and disables the thumb strip // on demand. @protocol ThumbStripSupporting <NSObject> // YES if the thumb strip is currently enabled. @property(nonatomic, readonly, getter=isThumbStripEnabled) BOOL thumbStripEnabled; // Informs that the thumb strip has been enabled, and classes that adopt this // protocol need to do any changes necessary to support it. - (void)thumbStripEnabledWithPanHandler: (ViewRevealingVerticalPanHandler*)panHandler; // Informs that the thumb strip has been disabled, and classes that adopt this // protocol need to do any changes necessary. - (void)thumbStripDisabled; @end #endif // IOS_CHROME_BROWSER_UI_THUMB_STRIP_THUMB_STRIP_SUPPORTING_H_
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ASH_PUBLIC_CPP_NOTIFIER_SETTINGS_OBSERVER_H_ #define ASH_PUBLIC_CPP_NOTIFIER_SETTINGS_OBSERVER_H_ #include <vector> #include "ash/public/cpp/ash_public_export.h" #include "base/observer_list_types.h" namespace message_center { struct NotifierId; } namespace gfx { class ImageSkia; } namespace ash { struct NotifierMetadata; // An interface used to listen for changes to notifier settings information, // implemented by any view that displays info about notifiers. class ASH_PUBLIC_EXPORT NotifierSettingsObserver : public base::CheckedObserver { public: // Sets the user-visible and toggle-able list of notifiers. virtual void OnNotifiersUpdated( const std::vector<NotifierMetadata>& notifiers) {} // Updates an icon for a notifier previously sent via OnNotifierListUpdated. virtual void OnNotifierIconUpdated( const message_center::NotifierId& notifier_id, const gfx::ImageSkia& icon) {} }; } // namespace ash #endif // ASH_PUBLIC_CPP_NOTIFIER_SETTINGS_OBSERVER_H_
/* SQCIF */ { {0, 0, {0x04, 0x01, 0x03}}, {8, 0, {0x05, 0x01, 0x03}}, {7, 0, {0x08, 0x01, 0x03}}, {7, 0, {0x0A, 0x01, 0x03}}, {6, 0, {0x0C, 0x01, 0x03}}, {5, 0, {0x0F, 0x01, 0x03}}, {4, 0, {0x14, 0x01, 0x03}}, {3, 0, {0x18, 0x01, 0x03}}, }, /* QSIF */ { {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, }, /* QCIF */ { {0, 0, {0x04, 0x01, 0x02}}, {8, 0, {0x05, 0x01, 0x02}}, {7, 0, {0x08, 0x01, 0x02}}, {6, 0, {0x0A, 0x01, 0x02}}, {5, 0, {0x0C, 0x01, 0x02}}, {4, 0, {0x0F, 0x01, 0x02}}, {1, 0, {0x14, 0x01, 0x02}}, {1, 0, {0x18, 0x01, 0x02}}, }, /* SIF */ { {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, }, /* CIF */ { {4, 0, {0x04, 0x01, 0x01}}, {7, 1, {0x05, 0x03, 0x01}}, {6, 1, {0x08, 0x03, 0x01}}, {4, 1, {0x0A, 0x03, 0x01}}, {3, 1, {0x0C, 0x03, 0x01}}, {2, 1, {0x0F, 0x03, 0x01}}, {0}, {0}, }, /* VGA */ { {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, },
#include<stdio.h> int main() { int a[1000]; int i=0,j,p,n,m; do{ printf("\n Insert Number: "); scanf("%d", &a[i]); if(a[i]==42) break; i++; }while(i<=1000); for(j=0; j<i; j++){ for(p=0; p<i; p++){ if(a[j]<a[p]){ n=a[j]; a[j]=a[p]; a[p]=n; } } } for(m=0; m<i; m++){ printf("\n %d \n",a[m]); } return 0; }
/* * This file is part of the coreboot project. * * Copyright (C) 2014 Imagination Technologies * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc. */ #ifndef __MIPS_ARCH_CPU_H #define __MIPS_ARCH_CPU_H #define asmlinkage #ifndef __PRE_RAM__ #include <device/device.h> struct cpu_driver { struct device_operations *ops; struct cpu_device_id *id_table; }; struct thread; struct cpu_info { device_t cpu; unsigned long index; }; #endif /* !__PRE_RAM__ */ /*************************************************************************** * The following section was copied from arch/mips/include/asm/mipsregs.h in * the 3.14 kernel tree. */ /* * Macros to access the system control coprocessor */ #define __read_32bit_c0_register(source, sel) \ ({ int __res; \ if (sel == 0) \ __asm__ __volatile__( \ "mfc0\t%0, " #source "\n\t" \ : "=r" (__res)); \ else \ __asm__ __volatile__( \ ".set\tmips32\n\t" \ "mfc0\t%0, " #source ", " #sel "\n\t" \ ".set\tmips0\n\t" \ : "=r" (__res)); \ __res; \ }) #define __write_32bit_c0_register(register, sel, value) \ do { \ if (sel == 0) \ __asm__ __volatile__( \ "mtc0\t%z0, " #register "\n\t" \ : : "Jr" ((unsigned int)(value))); \ else \ __asm__ __volatile__( \ ".set\tmips32\n\t" \ "mtc0\t%z0, " #register ", " #sel "\n\t" \ ".set\tmips0" \ : : "Jr" ((unsigned int)(value))); \ } while (0) /* Shortcuts to access various internal registers, keep adding as needed. */ #define read_c0_index() __read_32bit_c0_register($0, 0) #define write_c0_index(val) __write_32bit_c0_register($0, 0, (val)) #define read_c0_entrylo0() __read_32bit_c0_register($2, 0) #define write_c0_entrylo0(val) __write_32bit_c0_register($2, 0, (val)) #define read_c0_entrylo1() __read_32bit_c0_register($3, 0) #define write_c0_entrylo1(val) __write_32bit_c0_register($3, 0, (val)) #define read_c0_pagemask() __read_32bit_c0_register($5, 0) #define write_c0_pagemask(val) __write_32bit_c0_register($5, 0, (val)) #define read_c0_wired() __read_32bit_c0_register($6, 0) #define write_c0_wired(val) __write_32bit_c0_register($6, 0, (val)) #define read_c0_count() __read_32bit_c0_register($9, 0) #define write_c0_count(val) __write_32bit_c0_register($9, 0, (val)) #define read_c0_entryhi() __read_32bit_c0_register($10, 0) #define write_c0_entryhi(val) __write_32bit_c0_register($10, 0, (val)) #define read_c0_cause() __read_32bit_c0_register($13, 0) #define write_c0_cause(val) __write_32bit_c0_register($13, 0, (val)) #define read_c0_config1() __read_32bit_c0_register($16, 1) #define write_c0_config1(val) __write_32bit_c0_register($16, 1, (val)) #define read_c0_config2() __read_32bit_c0_register($16, 2) #define write_c0_config2(val) __write_32bit_c0_register($16, 2, (val)) #define read_c0_l23taglo() __read_32bit_c0_register($28, 4) #define write_c0_l23taglo(val) __write_32bit_c0_register($28, 4, (val)) #define C0_ENTRYLO_PFN_SHIFT 6 #define C0_ENTRYLO_WB (0x3 << 3) /* Cacheable, write-back, non-coherent */ #define C0_ENTRYLO_D (0x1 << 2) /* Writeable */ #define C0_ENTRYLO_V (0x1 << 1) /* Valid */ #define C0_ENTRYLO_G (0x1 << 0) /* Global */ #define C0_PAGEMASK_SHIFT 13 #define C0_PAGEMASK_MASK 0xffff #define C0_WIRED_MASK 0x3f #define C0_CAUSE_DC (1 << 27) #define C0_CONFIG1_MMUSIZE_SHIFT 25 #define C0_CONFIG1_MMUSIZE_MASK 0x3f /* Hazard handling */ static inline void __nop(void) { __asm__ __volatile__("nop"); } static inline void __ssnop(void) { __asm__ __volatile__("sll\t$0, $0, 1"); } #define mtc0_tlbw_hazard() \ do { \ __nop(); \ __nop(); \ } while (0) #define tlbw_use_hazard() \ do { \ __nop(); \ __nop(); \ __nop(); \ } while (0) #define tlb_probe_hazard() \ do { \ __nop(); \ __nop(); \ __nop(); \ } while (0) #define back_to_back_c0_hazard() \ do { \ __ssnop(); \ __ssnop(); \ __ssnop(); \ } while (0) /**************************************************************************/ #endif /* __MIPS_ARCH_CPU_H */
/* * ALSA driver for Echoaudio soundcards. * Copyright (C) 2003-2004 Giuliano Pochini <pochini@shiny.it> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define ECHO3G_FAMILY #define ECHOCARD_ECHO3G #define ECHOCARD_NAME "Echo3G" #define ECHOCARD_HAS_MONITOR #define ECHOCARD_HAS_ASIC #define ECHOCARD_HAS_INPUT_NOMINAL_LEVEL #define ECHOCARD_HAS_OUTPUT_NOMINAL_LEVEL #define ECHOCARD_HAS_SUPER_INTERLEAVE #define ECHOCARD_HAS_DIGITAL_IO #define ECHOCARD_HAS_DIGITAL_MODE_SWITCH #define ECHOCARD_HAS_ADAT 6 #define ECHOCARD_HAS_EXTERNAL_CLOCK #define ECHOCARD_HAS_STEREO_BIG_ENDIAN32 #define ECHOCARD_HAS_MIDI #define ECHOCARD_HAS_PHANTOM_POWER /* Pipe indexes */ #define PX_ANALOG_OUT 0 #define PX_DIGITAL_OUT chip->px_digital_out #define PX_ANALOG_IN chip->px_analog_in #define PX_DIGITAL_IN chip->px_digital_in #define PX_NUM chip->px_num /* Bus indexes */ #define BX_ANALOG_OUT 0 #define BX_DIGITAL_OUT chip->bx_digital_out #define BX_ANALOG_IN chip->bx_analog_in #define BX_DIGITAL_IN chip->bx_digital_in #define BX_NUM chip->bx_num #include <sound/driver.h> #include <linux/delay.h> #include <linux/init.h> #include <linux/interrupt.h> #include <linux/pci.h> #include <linux/slab.h> #include <linux/moduleparam.h> #include <linux/firmware.h> #include <sound/core.h> #include <sound/info.h> #include <sound/control.h> #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/asoundef.h> #include <sound/initval.h> #include <sound/rawmidi.h> #include <asm/io.h> #include <asm/atomic.h> #include "echoaudio.h" #define FW_361_LOADER 0 #define FW_ECHO3G_DSP 1 #define FW_3G_ASIC 2 static const struct firmware card_fw[] = { {0, "loader_dsp.fw"}, {0, "echo3g_dsp.fw"}, {0, "3g_asic.fw"} }; static struct pci_device_id snd_echo_ids[] = { {0x1057, 0x3410, 0xECC0, 0x0100, 0, 0, 0}, /* Echo 3G */ {0,} }; static struct snd_pcm_hardware pcm_hardware_skel = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_SYNC_START, .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE, .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_CONTINUOUS, .rate_min = 32000, .rate_max = 100000, .channels_min = 1, .channels_max = 8, .buffer_bytes_max = 262144, .period_bytes_min = 32, .period_bytes_max = 131072, .periods_min = 2, .periods_max = 220, }; #include "echo3g_dsp.c" #include "echoaudio_dsp.c" #include "echoaudio_3g.c" #include "echoaudio.c" #include "midi.c"
/* ################################################################################ # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # # Read the zproject/README.md for information about making permanent changes. # ################################################################################ */ #ifndef QML_ZCHUNK_H #define QML_ZCHUNK_H #include <QtQml> #include <czmq.h> #include "qml_czmq_plugin.h" class QmlZchunk : public QObject { Q_OBJECT Q_PROPERTY(bool isNULL READ isNULL) public: zchunk_t *self; QmlZchunk() { self = NULL; } bool isNULL() { return self == NULL; } static QObject* qmlAttachedProperties(QObject* object); // defined in QmlZchunk.cpp public slots: // Resizes chunk max_size as requested; chunk_cur size is set to zero void resize (size_t size); // Return chunk cur size size_t size (); // Return chunk max size size_t maxSize (); // Return chunk data byte *data (); // Set chunk data from user-supplied data; truncate if too large. Data may // be null. Returns actual size of chunk size_t set (const void *data, size_t size); // Fill chunk data from user-supplied octet size_t fill (byte filler, size_t size); // Append user-supplied data to chunk, return resulting chunk size. If the // data would exceeded the available space, it is truncated. If you want to // grow the chunk to accommodate new data, use the zchunk_extend method. size_t append (const void *data, size_t size); // Append user-supplied data to chunk, return resulting chunk size. If the // data would exceeded the available space, the chunk grows in size. size_t extend (const void *data, size_t size); // Copy as much data from 'source' into the chunk as possible; returns the // new size of chunk. If all data from 'source' is used, returns exhausted // on the source chunk. Source can be consumed as many times as needed until // it is exhausted. If source was already exhausted, does not change chunk. size_t consume (QmlZchunk *source); // Returns true if the chunk was exhausted by consume methods, or if the // chunk has a size of zero. bool exhausted (); // Write chunk to an open file descriptor int write (FILE *handle); // Create copy of chunk, as new chunk object. Returns a fresh zchunk_t // object, or null if there was not enough heap memory. If chunk is null, // returns null. QmlZchunk *dup (); // Return chunk data encoded as printable hex string. Caller must free // string when finished with it. QString strhex (); // Return chunk data copied into freshly allocated string // Caller must free string when finished with it. QString strdup (); // Return TRUE if chunk body is equal to string, excluding terminator bool streq (const QString &string); // Transform zchunk into a zframe that can be sent in a message. QmlZframe *pack (); // Calculate SHA1 digest for chunk, using zdigest class. const QString digest (); // Dump chunk to FILE stream, for debugging and tracing. void fprint (FILE *file); // Dump message to stderr, for debugging and tracing. // See zchunk_fprint for details void print (); }; class QmlZchunkAttached : public QObject { Q_OBJECT QObject* m_attached; public: QmlZchunkAttached (QObject* attached) { Q_UNUSED (attached); }; public slots: // Read chunk from an open file descriptor QmlZchunk *read (FILE *handle, size_t bytes); // Try to slurp an entire file into a chunk. Will read up to maxsize of // the file. If maxsize is 0, will attempt to read the entire file and // fail with an assertion if that cannot fit into memory. Returns a new // chunk containing the file data, or NULL if the file could not be read. QmlZchunk *slurp (const QString &filename, size_t maxsize); // Transform zchunk into a zframe that can be sent in a message. // Take ownership of the chunk. QmlZframe *packx (QmlZchunk *selfP); // Transform a zframe into a zchunk. QmlZchunk *unpack (QmlZframe *frame); // Probe the supplied object, and report if it looks like a zchunk_t. bool is (void *self); // Self test of this class. void test (bool verbose); // Create a new chunk of the specified size. If you specify the data, it // is copied into the chunk. If you do not specify the data, the chunk is // allocated and left empty, and you can then add data using zchunk_append. QmlZchunk *construct (const void *data, size_t size); // Create a new chunk from memory. Take ownership of the memory and calling the destructor // on destroy. QmlZchunk *frommem (void *data, size_t size, zchunk_destructor_fn destructor, void *hint); // Destroy a chunk void destruct (QmlZchunk *qmlSelf); }; QML_DECLARE_TYPEINFO(QmlZchunk, QML_HAS_ATTACHED_PROPERTIES) #endif /* ################################################################################ # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # # Read the zproject/README.md for information about making permanent changes. # ################################################################################ */
// Copyright 2010 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Author: sligocki@google.com (Shawn Ligocki) #ifndef PAGESPEED_APACHE_APACHE_MESSAGE_HANDLER_H_ #define PAGESPEED_APACHE_APACHE_MESSAGE_HANDLER_H_ #include "pagespeed/kernel/base/basictypes.h" #include "pagespeed/kernel/base/message_handler.h" #include "pagespeed/kernel/base/string.h" #include "pagespeed/kernel/base/string_util.h" #include "pagespeed/system/system_message_handler.h" struct server_rec; namespace net_instaweb { class AbstractMutex; class Timer; // Implementation of an HTML parser message handler that uses Apache // logging to emit messsages. class ApacheMessageHandler : public SystemMessageHandler { public: // version is a string added to each message. // Timer is used to generate timestamp for messages in shared memory. ApacheMessageHandler(const server_rec* server, const StringPiece& version, Timer* timer, AbstractMutex* mutex); // Installs a signal handler for common crash signals that tries to print // out a backtrace. static void InstallCrashHandler(server_rec* global_server); protected: virtual void MessageSImpl(MessageType type, const GoogleString& message); virtual void FileMessageSImpl(MessageType type, const char* filename, int line, const GoogleString& message); private: int GetApacheLogLevel(MessageType type); const server_rec* server_rec_; const GoogleString version_; DISALLOW_COPY_AND_ASSIGN(ApacheMessageHandler); }; } // namespace net_instaweb #endif // PAGESPEED_APACHE_APACHE_MESSAGE_HANDLER_H_
//===- GenericSpecializationMangler.h - generic specializations -*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// #ifndef SWIFT_SIL_UTILS_GENERICSPECIALIZATIONMANGLER_H #define SWIFT_SIL_UTILS_GENERICSPECIALIZATIONMANGLER_H #include "swift/AST/ASTMangler.h" #include "swift/Basic/NullablePtr.h" #include "swift/Demangling/Demangler.h" #include "swift/SIL/SILFunction.h" namespace swift { namespace Mangle { enum class SpecializationKind : uint8_t { Generic, NotReAbstractedGeneric, FunctionSignature, }; /// Inject SpecializationPass into the Mangle namespace. using SpecializationPass = Demangle::SpecializationPass; /// The base class for specialization mangles. class SpecializationMangler : public Mangle::ASTMangler { protected: /// The specialization pass. SpecializationPass Pass; IsSerialized_t Serialized; /// The original function which is specialized. SILFunction *Function; std::string FunctionName; llvm::SmallVector<char, 32> ArgOpStorage; llvm::raw_svector_ostream ArgOpBuffer; protected: SpecializationMangler(SpecializationPass P, IsSerialized_t Serialized, SILFunction *F) : Pass(P), Serialized(Serialized), Function(F), ArgOpBuffer(ArgOpStorage) {} SpecializationMangler(SpecializationPass P, IsSerialized_t Serialized, std::string functionName) : Pass(P), Serialized(Serialized), Function(nullptr), FunctionName(functionName), ArgOpBuffer(ArgOpStorage) {} void beginMangling(); /// Finish the mangling of the symbol and return the mangled name. std::string finalize(); void appendSpecializationOperator(StringRef Op) { appendOperator(Op, StringRef(ArgOpStorage.data(), ArgOpStorage.size())); } }; // The mangler for specialized generic functions. class GenericSpecializationMangler : public SpecializationMangler { GenericSpecializationMangler(std::string origFuncName) : SpecializationMangler(SpecializationPass::GenericSpecializer, IsNotSerialized, origFuncName) {} GenericSignature getGenericSignature() { assert(Function && "Need a SIL function to get a generic signature"); return Function->getLoweredFunctionType()->getInvocationGenericSignature(); } void appendSubstitutions(GenericSignature sig, SubstitutionMap subs); std::string manglePrespecialized(GenericSignature sig, SubstitutionMap subs); public: GenericSpecializationMangler(SILFunction *F, IsSerialized_t Serialized) : SpecializationMangler(SpecializationPass::GenericSpecializer, Serialized, F) {} std::string mangleNotReabstracted(SubstitutionMap subs); std::string mangleReabstracted(SubstitutionMap subs, bool alternativeMangling); std::string mangleForDebugInfo(GenericSignature sig, SubstitutionMap subs, bool forInlining); std::string manglePrespecialized(SubstitutionMap subs) { return manglePrespecialized(getGenericSignature(), subs); } static std::string manglePrespecialization(std::string unspecializedName, GenericSignature genericSig, GenericSignature specializedSig); }; } // end namespace Mangle } // end namespace swift #endif
//===-- RemarkStringTable.h - Serializing string table ----------*- C++/-*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This class is used to deduplicate and serialize a string table used for // generating remarks. // // For parsing a string table, use ParsedStringTable in RemarkParser.h // //===----------------------------------------------------------------------===// #ifndef LLVM_REMARKS_REMARK_STRING_TABLE_H #define LLVM_REMARKS_REMARK_STRING_TABLE_H #include "llvm/ADT/StringMap.h" #include "llvm/Support/Allocator.h" #include <vector> namespace llvm { class raw_ostream; class StringRef; namespace remarks { struct ParsedStringTable; struct Remark; /// The string table used for serializing remarks. /// This table can be for example serialized in a section to be consumed after /// the compilation. struct StringTable { /// The string table containing all the unique strings used in the output. /// It maps a string to an unique ID. StringMap<unsigned, BumpPtrAllocator> StrTab; /// Total size of the string table when serialized. size_t SerializedSize = 0; StringTable() = default; /// Disable copy. StringTable(const StringTable &) = delete; StringTable &operator=(const StringTable &) = delete; /// Should be movable. StringTable(StringTable &&) = default; StringTable &operator=(StringTable &&) = default; /// Construct a string table from a ParsedStringTable. StringTable(const ParsedStringTable &Other); /// Add a string to the table. It returns an unique ID of the string. std::pair<unsigned, StringRef> add(StringRef Str); /// Modify \p R to use strings from this string table. If the string table /// does not contain the strings, it adds them. void internalize(Remark &R); /// Serialize the string table to a stream. It is serialized as a little /// endian uint64 (the size of the table in bytes) followed by a sequence of /// NULL-terminated strings, where the N-th string is the string with the ID N /// in the StrTab map. void serialize(raw_ostream &OS) const; /// Serialize the string table to a vector. This allows users to do the actual /// writing to file/memory/other. /// The string with the ID == N should be the N-th element in the vector. std::vector<StringRef> serialize() const; }; } // end namespace remarks } // end namespace llvm #endif /* LLVM_REMARKS_REMARK_STRING_TABLE_H */
/* * AVID Meridien decoder * * Copyright (c) 2012 Carl Eugen Hoyos * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "avcodec.h" #include "internal.h" #include "libavutil/intreadwrite.h" static av_cold int avui_decode_init(AVCodecContext *avctx) { avctx->pix_fmt = AV_PIX_FMT_YUVA422P; return 0; } static int avui_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { int ret; AVFrame *pic = data; const uint8_t *src = avpkt->data, *extradata = avctx->extradata; const uint8_t *srca; uint8_t *y, *u, *v, *a; int transparent, interlaced = 1, skip, opaque_length, i, j, k; uint32_t extradata_size = avctx->extradata_size; while (extradata_size >= 24) { uint32_t atom_size = AV_RB32(extradata); if (!memcmp(&extradata[4], "APRGAPRG0001", 12)) { interlaced = extradata[19] != 1; break; } if (atom_size && atom_size <= extradata_size) { extradata += atom_size; extradata_size -= atom_size; } else { break; } } if (avctx->height == 486) { skip = 10; } else { skip = 16; } opaque_length = 2 * avctx->width * (avctx->height + skip) + 4 * interlaced; if (avpkt->size < opaque_length) { av_log(avctx, AV_LOG_ERROR, "Insufficient input data.\n"); return AVERROR(EINVAL); } transparent = avctx->bits_per_coded_sample == 32 && avpkt->size >= opaque_length * 2 + 4; srca = src + opaque_length + 5; if ((ret = ff_get_buffer(avctx, pic, 0)) < 0) return ret; pic->key_frame = 1; pic->pict_type = AV_PICTURE_TYPE_I; if (!interlaced) { src += avctx->width * skip; srca += avctx->width * skip; } for (i = 0; i < interlaced + 1; i++) { src += avctx->width * skip; srca += avctx->width * skip; if (interlaced && avctx->height == 486) { y = pic->data[0] + (1 - i) * pic->linesize[0]; u = pic->data[1] + (1 - i) * pic->linesize[1]; v = pic->data[2] + (1 - i) * pic->linesize[2]; a = pic->data[3] + (1 - i) * pic->linesize[3]; } else { y = pic->data[0] + i * pic->linesize[0]; u = pic->data[1] + i * pic->linesize[1]; v = pic->data[2] + i * pic->linesize[2]; a = pic->data[3] + i * pic->linesize[3]; } for (j = 0; j < avctx->height >> interlaced; j++) { for (k = 0; k < avctx->width >> 1; k++) { u[ k ] = *src++; y[2 * k ] = *src++; a[2 * k ] = 0xFF - (transparent ? *srca++ : 0); srca++; v[ k ] = *src++; y[2 * k + 1] = *src++; a[2 * k + 1] = 0xFF - (transparent ? *srca++ : 0); srca++; } y += (interlaced + 1) * pic->linesize[0]; u += (interlaced + 1) * pic->linesize[1]; v += (interlaced + 1) * pic->linesize[2]; a += (interlaced + 1) * pic->linesize[3]; } src += 4; srca += 4; } *got_frame = 1; return avpkt->size; } AVCodec ff_avui_decoder = { .name = "avui", .long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_AVUI, .init = avui_decode_init, .decode = avui_decode_frame, .capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, };
/* * The authors of this software are Rob Pike and Ken Thompson. * Copyright (c) 2002 by Lucent Technologies. * Permission to use, copy, modify, and distribute this software for any * purpose without fee is hereby granted, provided that this entire notice * is included in all copies of any software which is or includes a copy * or modification of this software and in all copies of the supporting * documentation for such software. * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. */ #include <stdarg.h> #include <string.h> #include <plan9.h> Rune* runestrcat(Rune *s1, const Rune *s2) { runestrcpy(runestrchr(s1, 0), s2); return s1; }
/* ** $Id$ ** Lua standard libraries ** See Copyright Notice in lua.h */ #ifndef lualib_h #define lualib_h #include "lua.h" /* Key to file-handle type */ #define LUA_FILEHANDLE "FILE*" #define LUA_COLIBNAME "coroutine" LUALIB_API int (luaopen_base) (lua_State *L); #define LUA_TABLIBNAME "table" LUALIB_API int (luaopen_table) (lua_State *L); #define LUA_IOLIBNAME "io" LUALIB_API int (luaopen_io) (lua_State *L); #define LUA_OSLIBNAME "os" LUALIB_API int (luaopen_os) (lua_State *L); #define LUA_STRLIBNAME "string" LUALIB_API int (luaopen_string) (lua_State *L); #define LUA_MATHLIBNAME "math" LUALIB_API int (luaopen_math) (lua_State *L); #define LUA_DBLIBNAME "debug" LUALIB_API int (luaopen_debug) (lua_State *L); #define LUA_LOADLIBNAME "package" LUALIB_API int (luaopen_package) (lua_State *L); /* open all previous libraries */ LUALIB_API void (luaL_openlibs) (lua_State *L); #ifndef lua_assert #define lua_assert(x) ((void)0) #endif #endif
/* Copyright (C) 1998-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <math.h> #include <math_private.h> #include <float.h> long double __ieee754_exp10l (long double arg) { if (isfinite (arg) && arg < LDBL_MIN_10_EXP - LDBL_DIG - 10) return LDBL_MIN * LDBL_MIN; else /* This is a very stupid and inprecise implementation. It'll get replaced sometime (soon?). */ return __ieee754_expl (M_LN10l * arg); } strong_alias (__ieee754_exp10l, __exp10l_finite)
#ifndef _ARCH_X86_REALMODE_H #define _ARCH_X86_REALMODE_H #include <linux/types.h> #include <asm/io.h> /* This must match data at realmode.S */ struct real_mode_header { u32 text_start; u32 ro_end; /* SMP trampoline */ u32 trampoline_start; u32 trampoline_status; u32 trampoline_header; #ifdef CONFIG_X86_64 u32 trampoline_pgd; #endif /* ACPI S3 wakeup */ #ifdef CONFIG_ACPI_SLEEP u32 wakeup_start; u32 wakeup_header; #endif /* APM/BIOS reboot */ u32 machine_real_restart_asm; u32 machine_real_restart_seg; }; /* This must match data at trampoline_32/64.S */ struct trampoline_header { #ifdef CONFIG_X86_32 u32 start; u16 boot_cs; u16 gdt_limit; u32 gdt_base; #else u64 start; u64 efer; u32 cr4; #endif }; extern struct real_mode_header *real_mode_header; extern unsigned char real_mode_blob_end[]; extern unsigned long init_rsp; extern unsigned long initial_code; extern unsigned long initial_gs; extern unsigned char real_mode_blob[]; extern unsigned char real_mode_relocs[]; #ifdef CONFIG_X86_32 extern unsigned char startup_32_smp[]; extern unsigned char boot_gdt[]; #else extern unsigned char secondary_startup_64[]; #endif void reserve_real_mode(void); void setup_real_mode(void); #endif /* _ARCH_X86_REALMODE_H */
/* PR debug/42728 */ /* { dg-do compile } */ /* { dg-options "-O1 -fcompare-debug" } */ /* { dg-xfail-if "" { powerpc-ibm-aix* } } */ void foo (char *a) { char *b; for (; *a; a++) a = b++; }
/* * We build for both wr-switch and wr-node (core). * * Unfortunately, our submodules include <board.h> without using * our own Kconfig defines. Thus, assume wr-node unless building * specifically for wr-switch (which doesn't refer to submodules). * Same appplies to ./tools/, where we can avoid a Makefile * patch for add "-include ../include/generated/autoconf.h" */ #if defined(CONFIG_WR_SWITCH) # include "board-wrs.h" #else # include "board-wrc.h" #endif
/* pthread_spin_init -- initialize a spin lock. Generic version. Copyright (C) 2003-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include "pthreadP.h" int pthread_spin_init (pthread_spinlock_t *lock, int pshared) { *lock = 0; return 0; }
/* Initialize pid and tid fields of struct pthread. NaCl version. Copyright (C) 2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <pthreadP.h> /* NaCl has no concept of PID or TID, nor even any notion of an identifier for a thread within the process. But various places in the NPTL implementation rely on using the 'tid' field of the TCB (struct pthread) as an identifier that is unique at least among all live threads in the process. So we must synthesize some number to use. Conveniently, the 'pthread_t' value itself is already unique in exactly this way (because it's the 'struct pthread' pointer). The only wrinkle is that 'tid' is a (32-bit) 'int' and its high (sign) bit is used for special purposes, so we must be absolutely sure that we never use a pointer value with the high bit set. (It also cannot be zero, but zero is never a valid pointer anyway.) The NaCl sandbox models for 32-bit machines limit the address space to less than 3GB (in fact, to 1GB), so it's already impossible that a valid pointer will have its high bit set. But the NaCl x86-64 sandbox model allows a full 4GB of address space, so we cannot assume that an arbitrary pointer value will not have the high bit set. Conveniently, there are always unused bits in the pointer value for a 'struct pthread', because it is always aligned to at least 32 bits and so the low bits are always zero. Hence, we can safely avoid the danger of a nonzero high bit just by shifting the pointer value right. */ static inline int __nacl_get_tid (struct pthread *pd) { uintptr_t id = (uintptr_t) pd; int tid = id >> 1; assert ((id & 1) == 0); assert (sizeof id == sizeof tid); assert (tid > 0); /* This ensures that NACL_EXITING_TID (lowlevellock.h) can never be a valid TID value. */ assert ((tid & 1) == 0); return tid; } /* Initialize PD->pid and PD->tid for the initial thread. If there is setup required to arrange that __exit_thread causes PD->tid to be cleared and futex-woken, then this function should do that as well. */ static inline void __pthread_initialize_pids (struct pthread *pd) { pd->tid = __nacl_get_tid (pd); pd->pid = -1; }
/* * SpanDSP - a series of DSP components for telephony * * biquad.h - General telephony bi-quad section routines (currently this just * handles canonic/type 2 form) * * Written by Steve Underwood <steveu@coppice.org> * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * 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 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page biquad_page Bi-quadratic filter sections \section biquad_page_sec_1 What does it do? ???. \section biquad_page_sec_2 How does it work? ???. */ #if !defined(_SPANDSP_BIQUAD_H_) #define _SPANDSP_BIQUAD_H_ typedef struct { int32_t gain; int32_t a1; int32_t a2; int32_t b1; int32_t b2; int32_t z1; int32_t z2; #if FIRST_ORDER_NOISE_SHAPING int32_t residue; #elif SECOND_ORDER_NOISE_SHAPING int32_t residue1; int32_t residue2; #endif } biquad2_state_t; #if defined(__cplusplus) extern "C" { #endif static __inline__ void biquad2_init(biquad2_state_t *bq, int32_t gain, int32_t a1, int32_t a2, int32_t b1, int32_t b2) { bq->gain = gain; bq->a1 = a1; bq->a2 = a2; bq->b1 = b1; bq->b2 = b2; bq->z1 = 0; bq->z2 = 0; #if FIRST_ORDER_NOISE_SHAPING bq->residue = 0; #elif SECOND_ORDER_NOISE_SHAPING bq->residue1 = 0; bq->residue2 = 0; #endif } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t biquad2(biquad2_state_t *bq, int16_t sample) { int32_t y; int32_t z0; z0 = sample*bq->gain + bq->z1*bq->a1 + bq->z2*bq->a2; y = z0 + bq->z1*bq->b1 + bq->z2*bq->b2; bq->z2 = bq->z1; bq->z1 = z0 >> 15; #if FIRST_ORDER_NOISE_SHAPING y += bq->residue; bq->residue = y & 0x7FFF; #elif SECOND_ORDER_NOISE_SHAPING y += (2*bq->residue1 - bq->residue2); bq->residue2 = bq->residue1; bq->residue1 = y & 0x7FFF; #endif y >>= 15; return (int16_t) y; } /*- End of function --------------------------------------------------------*/ #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef LASTEXPRESS_BACKGROUND_H #define LASTEXPRESS_BACKGROUND_H /* Background file format (.BG) header: uint32 {4} - position X on screen uint32 {4} - position Y on screen uint32 {4} - image width uint32 {4} - image height uint32 {4} - red color channel data size uint32 {4} - blue color channel data size uint32 {4} - green color channel data size data: byte {x} - red color channel data byte {x} - blue color channel data byte {x} - green color channel data */ #include "lastexpress/drawable.h" namespace Common { class SeekableReadStream; } namespace LastExpress { class Background : public Drawable { public: Background(); ~Background(); bool load(Common::SeekableReadStream *stream); Common::Rect draw(Graphics::Surface *surface); private: struct BackgroundHeader { uint32 posX; ///< position X on screen uint32 posY; ///< position Y on screen uint32 width; ///< image width uint32 height; ///< image height uint32 redSize; ///< red color channel data size uint32 blueSize; ///< blue color channel data size uint32 greenSize; ///< green color channel data size }; BackgroundHeader _header; uint16 *_data; ///< decoded background data byte *decodeComponent(Common::SeekableReadStream *in, uint32 inSize, uint32 outSize) const; }; } // End of namespace LastExpress #endif // LASTEXPRESS_BACKGROUND_H
/* Copyright 2020 Ben Roesner (keycapsss.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/>. */ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* * ,-----------------------, * | 7 | 8 | 9 | / | * |-----+-----+-----+-----| * | 4 | 5 | 6 | * | * |-----+-----+-----+-----| * | 1 | 2 | 3 | - | * |-----+-----+-----+-----| * | 0 | . | = | + | * `-----------------------' */ [0] = LAYOUT_ortho_4x4( KC_P7, KC_P8, KC_P9, KC_PSLS, KC_P4, KC_P5, KC_P6, KC_PAST, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_P0, KC_PDOT, KC_PEQL, KC_PPLS ), [1] = LAYOUT_ortho_4x4( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), [2] = LAYOUT_ortho_4x4( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), [3] = LAYOUT_ortho_4x4( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), }; // Set LED1 state during powerup void keyboard_post_init_user(void) { writePinHigh(LED_RED); } void encoder_update_user(uint8_t index, bool clockwise) { /* Rev1.1 Rev1 ,-----------------------, ,-----------------------, | E1 | E2 | E3 | E4 | | E1 | | | E2 | |-----+-----+-----+-----| |-----+-----+-----+-----| | | | | E3 | | | | | | |-----+-----+-----+-----| |-----+-----+-----+-----| | | | | E2 | | | | | | |-----+-----+-----+-----| |-----+-----+-----+-----| | | | | E1 | | | | | | `-----------------------' `-----------------------' */ // First encoder (E1) if (index == 0) { if (clockwise) { tap_code(KC_F17); } else { tap_code(KC_F18); } // Second encoder (E2) } else if (index == 1) { if (clockwise) { tap_code(KC_F19); } else { tap_code(KC_F20); } // Third encoder (E3) } else if (index == 2) { if (clockwise) { tap_code(KC_F21); } else { tap_code(KC_F22); } // Forth encoder (E4) } else if (index == 3) { if (clockwise) { tap_code(KC_F23); } else { tap_code(KC_F24); } } }
// -*- C++ -*- /** * \file LaTeXPackages.h * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * * \author Lars Gullik Bjønnes * \author Jean-Marc Lasgouttes * * Full author contact details are available in file CREDITS. */ #ifndef LATEXPACKAGES_H #define LATEXPACKAGES_H #include <string> #include <set> namespace lyx { /** The list of avilable LaTeX packages */ class LaTeXPackages { public: /// Which of the required packages are installed? static void getAvailable(); /// Is the (required) package available? static bool isAvailable(std::string const & name); private: /// The available (required) packages typedef std::set<std::string> Packages; /// static Packages packages_; }; } // namespace lyx #endif
/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */ #include "test_sve_acle.h" /* ** bic_b_z_tied1: ** bic p0\.b, p3/z, p0\.b, p1\.b ** ret */ TEST_UNIFORM_P (bic_b_z_tied1, p0 = svbic_b_z (p3, p0, p1), p0 = svbic_z (p3, p0, p1)) /* ** bic_b_z_tied2: ** bic p0\.b, p3/z, p1\.b, p0\.b ** ret */ TEST_UNIFORM_P (bic_b_z_tied2, p0 = svbic_b_z (p3, p1, p0), p0 = svbic_z (p3, p1, p0)) /* ** bic_b_z_untied: ** bic p0\.b, p3/z, p1\.b, p2\.b ** ret */ TEST_UNIFORM_P (bic_b_z_untied, p0 = svbic_b_z (p3, p1, p2), p0 = svbic_z (p3, p1, p2))
/* If-conversion header file. Copyright (C) 2014-2017 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ #ifndef GCC_IFCVT_H #define GCC_IFCVT_H /* Structure to group all of the information to process IF-THEN and IF-THEN-ELSE blocks for the conditional execution support. */ struct ce_if_block { basic_block test_bb; /* First test block. */ basic_block then_bb; /* THEN block. */ basic_block else_bb; /* ELSE block or NULL. */ basic_block join_bb; /* Join THEN/ELSE blocks. */ basic_block last_test_bb; /* Last bb to hold && or || tests. */ int num_multiple_test_blocks; /* # of && and || basic blocks. */ int num_and_and_blocks; /* # of && blocks. */ int num_or_or_blocks; /* # of || blocks. */ int num_multiple_test_insns; /* # of insns in && and || blocks. */ int and_and_p; /* Complex test is &&. */ int num_then_insns; /* # of insns in THEN block. */ int num_else_insns; /* # of insns in ELSE block. */ int pass; /* Pass number. */ }; /* Used by noce_process_if_block to communicate with its subroutines. The subroutines know that A and B may be evaluated freely. They know that X is a register. They should insert new instructions before cond_earliest. */ struct noce_if_info { /* The basic blocks that make up the IF-THEN-{ELSE-,}JOIN block. */ basic_block test_bb, then_bb, else_bb, join_bb; /* The jump that ends TEST_BB. */ rtx_insn *jump; /* The jump condition. */ rtx cond; /* Reversed jump condition. */ rtx rev_cond; /* New insns should be inserted before this one. */ rtx_insn *cond_earliest; /* Insns in the THEN and ELSE block. There is always just this one insns in those blocks. The insns are single_set insns. If there was no ELSE block, INSN_B is the last insn before COND_EARLIEST, or NULL_RTX. In the former case, the insn operands are still valid, as if INSN_B was moved down below the jump. */ rtx_insn *insn_a, *insn_b; /* The SET_SRC of INSN_A and INSN_B. */ rtx a, b; /* The SET_DEST of INSN_A. */ rtx x; /* The original set destination that the THEN and ELSE basic blocks finally write their result to. */ rtx orig_x; /* True if this if block is not canonical. In the canonical form of if blocks, the THEN_BB is the block reached via the fallthru edge from TEST_BB. For the noce transformations, we allow the symmetric form as well. */ bool then_else_reversed; /* True if the contents of then_bb and else_bb are a simple single set instruction. */ bool then_simple; bool else_simple; /* True if we're optimisizing the control block for speed, false if we're optimizing for size. */ bool speed_p; /* An estimate of the original costs. When optimizing for size, this is the combined cost of COND, JUMP and the costs for THEN_BB and ELSE_BB. When optimizing for speed, we use the costs of COND plus the minimum of the costs for THEN_BB and ELSE_BB, as computed in the next field. */ unsigned int original_cost; /* Maximum permissible cost for the unconditional sequence we should generate to replace this branch. */ unsigned int max_seq_cost; /* The name of the noce transform that succeeded in if-converting this structure. Used for debugging. */ const char *transform_name; }; #endif /* GCC_IFCVT_H */
/**************************************************************************** ** ** Copyright (C) 2012-2013 Richard J. Moore <rich@kde.org> ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef KEYBUILDER_H #define KEYBUILDER_H #include <QtNetwork/QSslKey> #include <QtNetwork/QSsl> #include "certificate_global.h" QT_BEGIN_NAMESPACE_CERTIFICATE class Q_CERTIFICATE_EXPORT KeyBuilder { public: enum KeyStrength { StrengthLow, StrengthNormal, StrengthHigh, StrengthUltra }; static QSslKey generate( QSsl::KeyAlgorithm algo, KeyStrength strength ); private: KeyBuilder() {} ~KeyBuilder() {} private: struct KeyBuilderPrivate *d; }; QT_END_NAMESPACE_CERTIFICATE #endif // KEYBUILDER_H
/* LibTomCrypt, modular cryptographic library -- Tom St Denis * * LibTomCrypt is a library that provides various cryptographic * algorithms in a highly modular and flexible manner. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" /** @file katja_import.c Import a LTC_PKCS-style Katja key, Tom St Denis */ #ifdef MKAT /** Import an KatjaPublicKey or KatjaPrivateKey [two-prime only, only support >= 1024-bit keys, defined in LTC_PKCS #1 v2.1] @param in The packet to import from @param inlen It's length (octets) @param key [out] Destination for newly imported key @return CRYPT_OK if successful, upon error allocated memory is freed */ int katja_import(const unsigned char *in, unsigned long inlen, katja_key *key) { int err; void *zero; LTC_ARGCHK(in != NULL); LTC_ARGCHK(key != NULL); LTC_ARGCHK(ltc_mp.name != NULL); /* init key */ if ((err = mp_init_multi(&zero, &key->d, &key->N, &key->dQ, &key->dP, &key->qP, &key->p, &key->q, &key->pq, NULL)) != CRYPT_OK) { return err; } if ((err = der_decode_sequence_multi(in, inlen, LTC_ASN1_INTEGER, 1UL, key->N, LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { goto LBL_ERR; } if (mp_cmp_d(key->N, 0) == LTC_MP_EQ) { /* it's a private key */ if ((err = der_decode_sequence_multi(in, inlen, LTC_ASN1_INTEGER, 1UL, zero, LTC_ASN1_INTEGER, 1UL, key->N, LTC_ASN1_INTEGER, 1UL, key->d, LTC_ASN1_INTEGER, 1UL, key->p, LTC_ASN1_INTEGER, 1UL, key->q, LTC_ASN1_INTEGER, 1UL, key->dP, LTC_ASN1_INTEGER, 1UL, key->dQ, LTC_ASN1_INTEGER, 1UL, key->qP, LTC_ASN1_INTEGER, 1UL, key->pq, LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { goto LBL_ERR; } key->type = PK_PRIVATE; } else { /* public we have N */ key->type = PK_PUBLIC; } mp_clear(zero); return CRYPT_OK; LBL_ERR: mp_clear_multi(zero, key->d, key->N, key->dQ, key->dP, key->qP, key->p, key->q, key->pq, NULL); return err; } #endif /* LTC_MRSA */ /* $Source: /cvs/libtom/libtomcrypt/src/pk/katja/katja_import.c,v $ */ /* $Revision: 1.5 $ */ /* $Date: 2007/05/12 14:32:35 $ */
// --------------------------------------------------------------------- // // Copyright (C) 2010 - 2015 by the deal.II authors // // This file is part of the deal.II library. // // The deal.II library is free software; you can use it, redistribute // it, and/or modify it under the terms of the GNU Lesser General // Public License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // The full text of the license can be found in the file LICENSE at // the top level of the deal.II distribution. // // --------------------------------------------------------------------- #ifndef dealii__newton_h #define dealii__newton_h #include <deal.II/base/smartpointer.h> #include <deal.II/lac/solver_control.h> #include <deal.II/algorithms/operator.h> #include <deal.II/algorithms/any_data.h> DEAL_II_NAMESPACE_OPEN class ParameterHandler; namespace Algorithms { /** * Operator class performing Newton's iteration with standard step size * control and adaptive matrix generation. * * This class performs a Newton iteration up to convergence determined by * #control. If after an update the norm of the residual has become larger, * then step size control is activated and the update is subsequently * divided by two until the residual actually becomes smaller (or the * minimal scaling factor determined by #n_stepsize_iterations is reached). * * Since assembling matrices, depending on the implementation, tends to be * costly, this method applies an adaptive reassembling strategy. Only if * the reduction factor for the residual is more than #threshold, the event * Algorithms::bad_derivative is submitted to #inverse_derivative. It is up * to this object to implement reassembling accordingly. * * <h3>Contents of the AnyData objects</h3> * * The only value used by the Newton method is the first vector in the * parameter <tt>out</tt> of operator()(). It serves as the start vector of * Newton's method and in the end contains the solution. All other vectors * of <tt>out</tt> are ignored by Newton's method and its inner Operator * objects. All vectors of <tt>in</tt> are forwarded to the inner Operator * objects, with additional information added as follows. * * When calling (*#residual)(), the NamedData <tt>in</tt> given to the * Newton iteration is prepended by a vector <tt>"Newton iterate"</tt>, the * current value of the Newton iterate, which can be used to evaluate the * residual at this point. * * For the call to (*#inverse_derivative), the vector <tt>"Newton * residual"</tt> is inserted before <tt>"Newton iterate"</tt>. * * @author Guido Kanschat, 2006, 2010 */ template <class VECTOR> class Newton : public Operator<VECTOR> { public: /** * Constructor, receiving the applications computing the residual and * solving the linear problem, respectively. */ Newton (Operator<VECTOR> &residual, Operator<VECTOR> &inverse_derivative); /** * Declare the parameters applicable to Newton's method. */ static void declare_parameters (ParameterHandler &param); /** * Read the parameters in the ParameterHandler. */ void parse_parameters (ParameterHandler &param); /** * Initialize the pointer data_out for debugging. */ void initialize (OutputOperator<VECTOR> &output); /** * The actual Newton iteration. The initial value is in <tt>out(0)</tt>, * which also contains the result after convergence. Values in <tt>in</tt> * are not used by Newton, but will be handed down to the objects * #residual and #inverse_derivative. */ virtual void operator() (AnyData &out, const AnyData &in); virtual void notify(const Event &); /** * Set the maximal residual reduction allowed without triggering * assembling in the next step. Return the previous value. */ double threshold(double new_value); /** * Control object for the Newton iteration. */ ReductionControl control; private: /** * The operator computing the residual. */ SmartPointer<Operator<VECTOR>, Newton<VECTOR> > residual; /** * The operator applying the inverse derivative to the residual. */ SmartPointer<Operator<VECTOR>, Newton<VECTOR> > inverse_derivative; /** * The operator handling the output in case the debug_vectors is true. * Call the initialize function first. */ SmartPointer<OutputOperator<VECTOR>, Newton<VECTOR> > data_out; /** * This flag is set by the function assemble(), indicating that the matrix * must be assembled anew upon start. */ bool assemble_now; /** * A flag used to decide how many stepsize iteration should be made. * Default is the original value of 21. * * Enter zero here to turn of stepsize control. * * @note Controlled by <tt>Stepsize iterations</tt> in parameter file */ unsigned int n_stepsize_iterations; /** * Threshold for re-assembling matrix. * * If the quotient of two consecutive residuals is smaller than this * threshold, the system matrix is not assembled in this step. * * @note This parameter should be adjusted to the residual gain of the * inner solver. * * The default values is zero, resulting in reassembling in every Newton * step. */ double assemble_threshold; public: /** * Print residual, update and updated solution after each step into file * <tt>Newton_NNN</tt>? */ bool debug_vectors; /** * Write debug output to @p deallog; the higher the number, the more * output. */ unsigned int debug; }; } DEAL_II_NAMESPACE_CLOSE #endif
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * 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 * OpenSceneGraph Public License for more details. */ #ifndef FREETYPE_FONT #define FREETYPE_FONT 1 #include <osgText/Font> #include <ft2build.h> #include FT_FREETYPE_H class FreeTypeFont : public osgText::Font::FontImplementation { // declare the interface to a font. public: FreeTypeFont(const std::string& filename, FT_Face face, unsigned int flags); FreeTypeFont(FT_Byte* buffer, FT_Face face, unsigned int flags); virtual ~FreeTypeFont(); virtual std::string getFileName() const { return _filename; } virtual bool supportsMultipleFontResolutions() const { return true; } virtual osgText::Glyph* getGlyph(const osgText::FontResolution& fontRes,unsigned int charcode); virtual osgText::Glyph3D* getGlyph3D(unsigned int charcode); virtual osg::Vec2 getKerning(unsigned int leftcharcode,unsigned int rightcharcode, osgText::KerningType _kerningType); virtual bool hasVertical() const; virtual bool getVerticalSize(float & ascender, float & descender) const; float getCoordScale() const; protected: void init(); void setFontResolution(const osgText::FontResolution& fontSize); osgText::FontResolution _currentRes; long ft_round( long x ) { return (( x + 32 ) & -64); } long ft_floor( long x ) { return (x & -64); } long ft_ceiling( long x ){ return (( x + 63 ) & -64); } std::string _filename; FT_Byte* _buffer; FT_Face _face; unsigned int _flags; }; #endif
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, // copy, modify, and distribute this software in source code or binary form for use // in connection with the web services and APIs provided by Facebook. // // As with any software that integrates with the Facebook platform, your use of // this software is subject to the Facebook Developer Principles and Policies // [http://developers.facebook.com/policy/]. This copyright notice shall be // included in all copies or substantial portions of the software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #import <Foundation/Foundation.h> // this type is not thread safe. NS_SWIFT_NAME(AppEventsState) @interface FBSDKAppEventsState : NSObject<NSCopying, NSSecureCoding> @property (nonatomic, readonly, copy) NSArray *events; @property (nonatomic, readonly, assign) NSUInteger numSkipped; @property (nonatomic, readonly, copy) NSString *tokenString; @property (nonatomic, readonly, copy) NSString *appID; @property (nonatomic, readonly, getter=areAllEventsImplicit) BOOL allEventsImplicit; - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; - (instancetype)initWithToken:(NSString *)tokenString appID:(NSString *)appID NS_DESIGNATED_INITIALIZER; - (void)addEvent:(NSDictionary *)eventDictionary isImplicit:(BOOL)isImplicit; - (void)addEventsFromAppEventState:(FBSDKAppEventsState *)appEventsState; - (BOOL)isCompatibleWithAppEventsState:(FBSDKAppEventsState *)appEventsState; - (BOOL)isCompatibleWithTokenString:(NSString *)tokenString appID:(NSString *)appID; - (NSString *)JSONStringForEvents:(BOOL)includeImplicitEvents; - (NSString *)extractReceiptData; @end
/* * The olsr.org Optimized Link-State Routing daemon(olsrd) * Copyright (c) 2004, Andreas Tonnesen(andreto@olsr.org) * 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 olsr.org, olsrd 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. * * Visit http://www.olsr.org for more information. * * If you find this software useful feel free to make a donation * to the project. For more information see the website or contact * the copyright holders. * */ #ifndef _OLSR_HYSTERESIS #define _OLSR_HYSTERESIS #include "link_set.h" #include "mantissa.h" float olsr_hyst_calc_stability(float); int olsr_process_hysteresis(struct link_entry *); float olsr_hyst_calc_instability(float); void olsr_update_hysteresis_hello(struct link_entry *, olsr_reltime); void update_hysteresis_incoming(union olsr_ip_addr *, struct interface *, uint16_t); #endif /* _OLSR_HYSTERESIS */ /* * Local Variables: * c-basic-offset: 2 * indent-tabs-mode: nil * End: */
// Copyright 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CC_RESOURCES_TILE_MANAGER_H_ #define CC_RESOURCES_TILE_MANAGER_H_ #include <queue> #include <set> #include <vector> #include "base/containers/hash_tables.h" #include "base/memory/scoped_ptr.h" #include "base/values.h" #include "cc/debug/rendering_stats_instrumentation.h" #include "cc/resources/managed_tile_state.h" #include "cc/resources/memory_history.h" #include "cc/resources/picture_pile_impl.h" #include "cc/resources/prioritized_tile_set.h" #include "cc/resources/raster_worker_pool.h" #include "cc/resources/resource_pool.h" #include "cc/resources/tile.h" namespace cc { class ResourceProvider; class CC_EXPORT TileManagerClient { public: virtual void NotifyReadyToActivate() = 0; protected: virtual ~TileManagerClient() {} }; struct RasterTaskCompletionStats { RasterTaskCompletionStats(); size_t completed_count; size_t canceled_count; }; scoped_ptr<base::Value> RasterTaskCompletionStatsAsValue( const RasterTaskCompletionStats& stats); // This class manages tiles, deciding which should get rasterized and which // should no longer have any memory assigned to them. Tile objects are "owned" // by layers; they automatically register with the manager when they are // created, and unregister from the manager when they are deleted. class CC_EXPORT TileManager : public RasterWorkerPoolClient { public: static scoped_ptr<TileManager> Create( TileManagerClient* client, ResourceProvider* resource_provider, size_t num_raster_threads, RenderingStatsInstrumentation* rendering_stats_instrumentation, bool use_map_image); virtual ~TileManager(); const GlobalStateThatImpactsTilePriority& GlobalState() const { return global_state_; } void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); void ManageTiles(); // Returns true when visible tiles have been initialized. bool UpdateVisibleTiles(); scoped_ptr<base::Value> BasicStateAsValue() const; scoped_ptr<base::Value> AllTilesAsValue() const; void GetMemoryStats(size_t* memory_required_bytes, size_t* memory_nice_to_have_bytes, size_t* memory_used_bytes) const; const MemoryHistory::Entry& memory_stats_from_last_assign() const { return memory_stats_from_last_assign_; } bool AreTilesRequiredForActivationReady() const { return all_tiles_required_for_activation_have_been_initialized_; } protected: TileManager(TileManagerClient* client, ResourceProvider* resource_provider, scoped_ptr<RasterWorkerPool> raster_worker_pool, size_t num_raster_threads, RenderingStatsInstrumentation* rendering_stats_instrumentation, GLenum texture_format); // Methods called by Tile friend class Tile; void RegisterTile(Tile* tile); void UnregisterTile(Tile* tile); // Overriden from RasterWorkerPoolClient: virtual bool ShouldForceTasksRequiredForActivationToComplete() const OVERRIDE; virtual void DidFinishRunningTasks() OVERRIDE; virtual void DidFinishRunningTasksRequiredForActivation() OVERRIDE; typedef std::vector<Tile*> TileVector; typedef std::set<Tile*> TileSet; // Virtual for test virtual void ScheduleTasks( const TileVector& tiles_that_need_to_be_rasterized); void AssignGpuMemoryToTiles( PrioritizedTileSet* tiles, TileVector* tiles_that_need_to_be_rasterized); void GetTilesWithAssignedBins(PrioritizedTileSet* tiles); void GetPrioritizedTileSet(PrioritizedTileSet* tiles); private: void OnImageDecodeTaskCompleted( int layer_id, skia::LazyPixelRef* pixel_ref, bool was_canceled); void OnRasterTaskCompleted( Tile::Id tile, scoped_ptr<ResourcePool::Resource> resource, RasterMode raster_mode, const PicturePileImpl::Analysis& analysis, bool was_canceled); RasterMode DetermineRasterMode(const Tile* tile) const; void CleanUpUnusedImageDecodeTasks(); void FreeResourceForTile(Tile* tile, RasterMode mode); void FreeResourcesForTile(Tile* tile); void FreeUnusedResourcesForTile(Tile* tile); RasterWorkerPool::Task CreateImageDecodeTask( Tile* tile, skia::LazyPixelRef* pixel_ref); RasterWorkerPool::RasterTask CreateRasterTask(Tile* tile); scoped_ptr<base::Value> GetMemoryRequirementsAsValue() const; TileManagerClient* client_; scoped_ptr<ResourcePool> resource_pool_; scoped_ptr<RasterWorkerPool> raster_worker_pool_; GlobalStateThatImpactsTilePriority global_state_; typedef base::hash_map<Tile::Id, Tile*> TileMap; TileMap tiles_; PrioritizedTileSet prioritized_tiles_; bool all_tiles_that_need_to_be_rasterized_have_memory_; bool all_tiles_required_for_activation_have_memory_; bool all_tiles_required_for_activation_have_been_initialized_; bool ever_exceeded_memory_budget_; MemoryHistory::Entry memory_stats_from_last_assign_; RenderingStatsInstrumentation* rendering_stats_instrumentation_; bool did_initialize_visible_tile_; GLenum texture_format_; typedef base::hash_map<uint32_t, RasterWorkerPool::Task> PixelRefTaskMap; typedef base::hash_map<int, PixelRefTaskMap> LayerPixelRefTaskMap; LayerPixelRefTaskMap image_decode_tasks_; RasterTaskCompletionStats update_visible_tiles_stats_; DISALLOW_COPY_AND_ASSIGN(TileManager); }; } // namespace cc #endif // CC_RESOURCES_TILE_MANAGER_H_
// // ShareFunnel.h // Wikipedia // // Created by Adam Baso on 2/3/15. // Copyright (c) 2015 Wikimedia Foundation. All rights reserved. // #import "EventLoggingFunnel.h" @interface WMFShareFunnel : EventLoggingFunnel - (id)initWithArticle:(MWKArticle*)article; - (void)logHighlight; - (void)logShareButtonTappedResultingInSelection:(NSString*)selection; - (void)logAbandonedAfterSeeingShareAFact; - (void)logShareAsImageTapped; - (void)logShareAsTextTapped; /*! Log the final outcome of the share as a failure * @param shareMethod System provided share application string if known */ - (void)logShareFailedWithShareMethod:(NSString*)shareMethod; /*! Log the final outcome of the share as a success * @param shareMethod System provided share application string if known */ - (void)logShareSucceededWithShareMethod:(NSString*)shareMethod; @end
// // GCYGroceryStoreListViewModel.h // GroceryList // // Created by Justin Spahr-Summers on 2013-12-14. // Copyright (c) 2013 Justin Spahr-Summers. All rights reserved. // #import "GCYViewModel.h" @class GCYGroceryList; @interface GCYGroceryStoreListViewModel : GCYViewModel // A list of `GCYGroceryStoreViewModel`s, in the order they should be presented // to the user. @property (nonatomic, copy, readonly) NSArray *stores; - (instancetype)initWithGroceryList:(GCYGroceryList *)list; @end
/** @file stringutils.h @maintainer Morgan McGuire, matrix@graphics3d.com @author 2000-09-09 @edited 2002-11-30 */ #ifndef G3D_STRINGUTILS_H #define G3D_STRINGUTILS_H #include "G3D/platform.h" #include "G3D/Array.h" #include <string> namespace G3D { extern const char* NEWLINE; /** Returns true if the test string begins with the pattern string. */ bool beginsWith( const std::string& test, const std::string& pattern); /** Returns true if the test string ends with the pattern string. */ bool endsWith( const std::string& test, const std::string& pattern); /** Produces a new string that is the input string wrapped at a certain number of columns (where the line is broken at the latest space before the column limit.) Platform specific NEWLINEs are inserted to wrap. */ std::string wordWrap( const std::string& input, int numCols); /** A comparison function for passing to Array::sort. */ int stringCompare( const std::string& s1, const std::string& s2); int stringPtrCompare( const std::string* s1, const std::string* s2); /** Returns a new string that is an uppercase version of x. */ std::string toUpper( const std::string& x); std::string toLower( const std::string& x); /** Splits x at each occurance of splitChar. */ G3D::Array<std::string> stringSplit( const std::string& x, char splitChar); /** joinChar is not inserted at the beginning or end, just in between elements. */ std::string stringJoin( const G3D::Array<std::string>& a, char joinChar); std::string stringJoin( const G3D::Array<std::string>& a, const std::string& joinStr); /** Strips whitespace from both ends of the string. */ std::string trimWhitespace( const std::string& s); /** These standard C functions are renamed for clarity/naming conventions and to return bool, not int. */ inline bool isWhiteSpace(const char c) { return isspace(c) != 0; } /** These standard C functions are renamed for clarity/naming conventions and to return bool, not int. */ inline bool isNewline(const char c) { return (c == '\n') || (c == '\r'); } /** These standard C functions are renamed for clarity/naming conventions and to return bool, not int. */ inline bool isDigit(const char c) { return isdigit(c) != 0; } /** These standard C functions are renamed for clarity/naming conventions and to return bool, not int. */ inline bool isLetter(const char c) { return isalpha(c) != 0; } inline bool isSlash(const char c) { return (c == '\\') || (c == '/'); } inline bool isQuote(const char c) { return (c == '\'') || (c == '\"'); } }; // namespace #endif
/* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #ifdef FIX_CLASS FixStyle(spring,FixSpring) #else #ifndef LMP_FIX_SPRING_H #define LMP_FIX_SPRING_H #include "fix.h" namespace LAMMPS_NS { class FixSpring : public Fix { public: FixSpring(class LAMMPS *, int, char **); ~FixSpring(); int setmask(); void init(); void setup(int); void min_setup(int); void post_force(int); void post_force_respa(int, int, int); void min_post_force(int); double compute_scalar(); double compute_vector(int); private: double xc,yc,zc,r0; double k_spring; int xflag,yflag,zflag; int styleflag; char *group2; int igroup2,group2bit; double masstotal,masstotal2; int nlevels_respa; double espring,ftotal[4]; void spring_tether(); void spring_couple(); }; } #endif #endif /* ERROR/WARNING messages: E: Illegal ... command Self-explanatory. Check the input script syntax and compare to the documentation for the command. You can use -echo screen as a command-line option when running LAMMPS to see the offending line. E: R0 < 0 for fix spring command Equilibrium spring length is invalid. E: Fix spring couple group ID does not exist Self-explanatory. E: Two groups cannot be the same in fix spring couple Self-explanatory. */
/* * sha and other hashing utilities * * Copyright (C) 2014 1&1 Germany * * This file is part of Kamailio, a free SIP server. * * Kamailio 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 * * Kamailio 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 */ /*! @defgroup srutils Various utilities * * Kamailio core library. */ /*! * \file * \brief srutils :: SHA and other hashing utilities * \ingroup srutils * Module: \ref srutils */ #include "../../md5.h" #include "../../ut.h" #include "shautils.h" /*! \brief Compute MD5 checksum */ void compute_md5(char *dst, char *src, int src_len) { MD5_CTX context; unsigned char digest[16]; MD5Init (&context); MD5Update (&context, src, src_len); U_MD5Final (digest, &context); string2hex(digest, 16, dst); } /*! \brief Compute SHA256 checksum */ void compute_sha256(char *dst, u_int8_t *src, int src_len) { SHA256_CTX ctx256; SHA256_Init(&ctx256); SHA256_Update(&ctx256, src, src_len); SHA256_End(&ctx256, dst); } /*! \brief Compute SHA384 checksum */ void compute_sha384(char *dst, u_int8_t *src, int src_len) { SHA384_CTX ctx384; SHA384_Init(&ctx384); SHA384_Update(&ctx384, src, src_len); SHA384_End(&ctx384, dst); } /*! \brief Compute SHA512 checksum */ void compute_sha512(char *dst, u_int8_t *src, int src_len) { SHA512_CTX ctx512; SHA512_Init(&ctx512); SHA512_Update(&ctx512, src, src_len); SHA512_End(&ctx512, dst); }
/* * Copyright (C) 2011-2014 MediaTek 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. * * 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 <generated/autoconf.h> #include <linux/bug.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/linkage.h> #include <linux/xlog.h> #include "xlog_internal.h" int __xlog_output(int level, const char *tag, const char *fmt, va_list args) { int r; const char *level_str; char printk_string[1024]; int plen; if (!tag) return -1; #ifdef CONFIG_HAVE_XLOG_FEATURE if (!xLog_isOn(tag, level)) return -1; #endif switch (level) { case ANDROID_LOG_VERBOSE: level_str = KERN_DEBUG; break; case ANDROID_LOG_DEBUG: level_str = KERN_INFO; break; case ANDROID_LOG_INFO: level_str = KERN_NOTICE; break; case ANDROID_LOG_WARN: level_str = KERN_WARNING; break; case ANDROID_LOG_ERROR: level_str = KERN_ERR; break; case ANDROID_LOG_FATAL: level_str = KERN_EMERG; break; default: level_str = KERN_INFO; break; } //printk("%s[%s] ", level_str, tag); //r = vprintk(fmt, args); plen = snprintf(printk_string, sizeof(printk_string), "%s[%s] ", level_str, tag); vsnprintf(printk_string + plen, sizeof(printk_string) - plen, fmt, args); r = printk("%s", printk_string); if (level == ANDROID_LOG_FATAL) { BUG(); } return r; } asmlinkage int __xlog_printk(const struct xlog_record *rec, ...) { va_list args; int r; va_start(args, rec); r = __xlog_output(rec->prio, rec->tag_str, rec->fmt_str, args); va_end(args); return r; } int __xlog_ale_printk(int prio, const struct ale_convert *convert, ...) { if (convert->fmt_ptr != NULL) { va_list args; int r; va_start(args, convert); r = __xlog_output(prio, convert->tag_str, convert->fmt_ptr, args); va_end(args); return r; } return 0; } EXPORT_SYMBOL(__xlog_printk); EXPORT_SYMBOL(__xlog_ale_printk);
/** ****************************************************************************** * @file USART/HyperTerminal_Interrupt/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****/
/* * Copyright (c) 2011 The Chromium OS Authors. * * (C) Copyright 2002 * Sysgo Real-Time Solutions, GmbH <www.elinos.com> * Marius Groeger <mgroeger@sysgo.de> * * (C) Copyright 2002 * Sysgo Real-Time Solutions, GmbH <www.elinos.com> * Alex Zuepke <azu@sysgo.de> * * SPDX-License-Identifier: GPL-2.0+ */ #ifndef _U_BOOT_SANDBOX_H_ #define _U_BOOT_SANDBOX_H_ /* board/.../... */ int board_init(void); int dram_init(void); /* start.c */ int sandbox_early_getopt_check(void); int sandbox_main_loop_init(void); #endif /* _U_BOOT_SANDBOX_H_ */
#include <config.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <fcntl.h> #include "internal.h" #include "testutils.h" #include "storage_conf.h" #include "testutilsqemu.h" #include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE static int testCompareXMLToXMLFiles(const char *poolxml, const char *inxml, const char *outxml) { char *poolXmlData = NULL; char *inXmlData = NULL; char *outXmlData = NULL; char *actual = NULL; int ret = -1; virStoragePoolDefPtr pool = NULL; virStorageVolDefPtr dev = NULL; if (virtTestLoadFile(poolxml, &poolXmlData) < 0) goto fail; if (virtTestLoadFile(inxml, &inXmlData) < 0) goto fail; if (virtTestLoadFile(outxml, &outXmlData) < 0) goto fail; if (!(pool = virStoragePoolDefParseString(poolXmlData))) goto fail; if (!(dev = virStorageVolDefParseString(pool, inXmlData))) goto fail; if (!(actual = virStorageVolDefFormat(pool, dev))) goto fail; if (STRNEQ(outXmlData, actual)) { virtTestDifference(stderr, outXmlData, actual); goto fail; } ret = 0; fail: VIR_FREE(poolXmlData); VIR_FREE(inXmlData); VIR_FREE(outXmlData); VIR_FREE(actual); virStoragePoolDefFree(pool); virStorageVolDefFree(dev); return ret; } struct testInfo { const char *pool; const char *name; }; static int testCompareXMLToXMLHelper(const void *data) { int result = -1; const struct testInfo *info = data; char *poolxml = NULL; char *inxml = NULL; char *outxml = NULL; if (virAsprintf(&poolxml, "%s/storagepoolxml2xmlin/%s.xml", abs_srcdir, info->pool) < 0 || virAsprintf(&inxml, "%s/storagevolxml2xmlin/%s.xml", abs_srcdir, info->name) < 0 || virAsprintf(&outxml, "%s/storagevolxml2xmlout/%s.xml", abs_srcdir, info->name) < 0) { goto cleanup; } result = testCompareXMLToXMLFiles(poolxml, inxml, outxml); cleanup: VIR_FREE(poolxml); VIR_FREE(inxml); VIR_FREE(outxml); return result; } static int mymain(void) { int ret = 0; #define DO_TEST(pool, name) \ do { \ struct testInfo info = { pool, name }; \ if (virtTestRun("Storage Vol XML-2-XML " name, \ testCompareXMLToXMLHelper, &info) < 0) \ ret = -1; \ } \ while (0); DO_TEST("pool-dir", "vol-file"); DO_TEST("pool-dir", "vol-file-naming"); DO_TEST("pool-dir", "vol-file-backing"); DO_TEST("pool-dir", "vol-qcow2"); DO_TEST("pool-dir", "vol-qcow2-1.1"); DO_TEST("pool-dir", "vol-qcow2-lazy"); DO_TEST("pool-dir", "vol-qcow2-0.10-lazy"); DO_TEST("pool-dir", "vol-qcow2-nobacking"); DO_TEST("pool-disk", "vol-partition"); DO_TEST("pool-logical", "vol-logical"); DO_TEST("pool-logical", "vol-logical-backing"); DO_TEST("pool-sheepdog", "vol-sheepdog"); DO_TEST("pool-gluster", "vol-gluster-dir"); return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } VIRT_TEST_MAIN(mymain)
/* * * libnet 1.1 * Build a IPv4 packet with what you want as payload * * Copyright (c) 2003 Frédéric Raynal <pappy@security-labs.org> * All rights reserved. * * Ex: * - send an UDP packet from port 4369 to port 8738 * ./ip -s 1.1.1.1 -d 2.2.2.2 * * - send a TCP SYN from port 4369 to port 8738 * ./ip -s 1.1.1.1 -d 2.2.2.2 -t -p `printf "\x04\x57\x08\xae\x01\x01\x01\x01\x02\x02\x02\x02\x50\x02\x7f\xff\xd5\x91\x41\x41"` * * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. * */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "./libnet_test.h" int main(int argc, char *argv[]) { int c; libnet_t *l; char *device = NULL; char *dst = "2.2.2.2", *src = "1.1.1.1"; u_long src_ip, dst_ip; char errbuf[LIBNET_ERRBUF_SIZE]; libnet_ptag_t ip_ptag = 0; u_short proto = IPPROTO_UDP; u_char payload[255] = {0x11, 0x11, 0x22, 0x22, 0x00, 0x08, 0xc6, 0xa5}; u_long payload_s = 8; printf("libnet 1.1 packet shaping: IP + payload[raw]\n"); /* * handle options */ while ((c = getopt(argc, argv, "d:s:tp:i:h")) != EOF) { switch (c) { case 'd': dst = optarg; break; case 's': src = optarg; break; case 'i': device = optarg; break; case 't': proto = IPPROTO_TCP; break; case 'p': strncpy(payload, optarg, sizeof(payload)-1); payload_s = strlen(payload); break; case 'h': usage(argv[0]); exit(EXIT_SUCCESS); default: exit(EXIT_FAILURE); } } /* * Initialize the library. Root priviledges are required. */ l = libnet_init( LIBNET_RAW4, /* injection type */ device, /* network interface */ errbuf); /* error buffer */ printf("Using device %s\n", l->device); if (l == NULL) { fprintf(stderr, "libnet_init() failed: %s", errbuf); exit(EXIT_FAILURE); } if ((dst_ip = libnet_name2addr4(l, dst, LIBNET_RESOLVE)) == -1) { fprintf(stderr, "Bad destination IP address: %s\n", dst); exit(EXIT_FAILURE); } if ((src_ip = libnet_name2addr4(l, src, LIBNET_RESOLVE)) == -1) { fprintf(stderr, "Bad source IP address: %s\n", src); exit(EXIT_FAILURE); } /* * Build the packet */ ip_ptag = libnet_build_ipv4( LIBNET_IPV4_H + payload_s, /* length */ 0, /* TOS */ 242, /* IP ID */ 0, /* IP Frag */ 64, /* TTL */ proto, /* protocol */ 0, /* checksum */ src_ip, /* source IP */ dst_ip, /* destination IP */ payload, /* payload */ payload_s, /* payload size */ l, /* libnet handle */ ip_ptag); /* libnet id */ if (ip_ptag == -1) { fprintf(stderr, "Can't build IP header: %s\n", libnet_geterror(l)); goto bad; } /* * Write it to the wire. */ c = libnet_write(l); if (c == -1) { fprintf(stderr, "Write error: %s\n", libnet_geterror(l)); goto bad; } else { fprintf(stderr, "Wrote %d byte IP packet; check the wire.\n", c); } libnet_destroy(l); return (EXIT_SUCCESS); bad: libnet_destroy(l); return (EXIT_FAILURE); } void usage(char *name) { fprintf(stderr, "usage: %s [-s source_ip] [-d destination_ip]" " [-i iface] [-p payload] [-t]\n", name); } /* EOF */
/*************************************************************************** roadgraphplugin.h -------------------------------------- Date : 2010-10-10 Copyright : (C) 2010 by Yakushev Sergey Email : YakushevS <at> list.ru **************************************************************************** * * * 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 ROADGRAPHPLUGIN #define ROADGRAPHPLUGIN //QT4 includes #include <QObject> //QGIS includes #include <qgisplugin.h> #include <qgspoint.h> //forward declarations class QAction; class QToolBar; class QPainter; class QgisInterface; class QDockWidget; //forward declarations RoadGraph plugins classes class QgsGraphDirector; class RgShortestPathWidget; class RgLineVectorLayerSettings; /** * \class RoadGraphPlugin * \brief Road graph plugin for QGIS * This plugin can solve the shotrest path problem and etc... */ class RoadGraphPlugin: public QObject, public QgisPlugin { Q_OBJECT public: /** * Constructor for a plugin. The QgisInterface pointer is passed by * QGIS when it attempts to instantiate the plugin. * @param theQgisInterface Pointer to the QgisInterface object. */ RoadGraphPlugin( QgisInterface * theQgisInterface ); //! Destructor virtual ~RoadGraphPlugin(); /** * return pointer to my Interface */ QgisInterface *iface(); /** * return pointer to graph director */ const QgsGraphDirector* director() const; /** * get time unit name */ QString timeUnitName(); /** * get distance unit name */ QString distanceUnitName(); /** * get topology tolerance factor */ double topologyToleranceFactor(); public slots: //! init the gui virtual void initGui(); //!set values onthe gui when a project is read or the gui first loaded virtual void projectRead(); //!set default values for new project void newProject(); //! Show the property dialog box void property(); //! unload the plugin void unload(); //! show the help document void help(); private slots: /** * set show roads direction */ void onShowDirection(); private: /** * set all gui elements to default status */ void setGuiElementsToDefault( ); private: //////////////////////////////////////////////////////////////////// // // MANDATORY PLUGIN PROPERTY DECLARATIONS ..... // //////////////////////////////////////////////////////////////////// int mPluginType; //! Pointer to the QGIS interface object QgisInterface *mQGisIface; //////////////////////////////////////////////////////////////////// // ADD YOUR OWN PROPERTY DECLARATIONS AFTER THIS POINT..... // //////////////////////////////////////////////////////////////////// /** * on show settings */ QAction * mQSettingsAction; /** * GUI for use shortest path finder */ RgShortestPathWidget *mQShortestPathDock; /** * My graph settings. * @note. Should be used RgSettings */ RgLineVectorLayerSettings *mSettings; /** * time unit for results presentation */ QString mTimeUnitName; /** * distance unit for results presentation */ QString mDistanceUnitName; /** * topology tolerance factor */ double mTopologyToleranceFactor; }; #endif //ROADGRAPHPLUGIN
//* This file is part of the MOOSE framework //* https://www.mooseframework.org //* //* All rights reserved, see COPYRIGHT for full restrictions //* https://github.com/idaholab/moose/blob/master/COPYRIGHT //* //* Licensed under LGPL 2.1, please see LICENSE for details //* https://www.gnu.org/licenses/lgpl-2.1.html #pragma once #include "GeneralUserObjectBasePD.h" /** * UserObject class to eliminate the existance of singular shape tensor due to bond breakage * determined by a bond failure criterion. * Singularity is checked for all bonds, and bonds with singular shape tensor are treated * as broken as if determined by a failure criterion. Due to nonlocal dependency in a shape tensor * calculation, the above procesess is repeated with updated bond_status value from previous step * untill no further shape tensor singularity is detected. Shape tensor singularity is not allowed * in MOOSE solve. */ class SingularShapeTensorEliminatorUserObjectPD : public GeneralUserObjectBasePD { public: static InputParameters validParams(); SingularShapeTensorEliminatorUserObjectPD(const InputParameters & parameters); virtual void initialize() override; virtual void execute() override; virtual void finalize() override; protected: /// function to compute and check the singularity of shape tensor of a bond bool checkShapeTensorSingularity(const Elem * elem); };
/* LUFA Library Copyright (C) Dean Camera, 2011. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the name of the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaim all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. */ /** \file * * Header file for Descriptors.c. */ #ifndef _DESCRIPTORS_H_ #define _DESCRIPTORS_H_ /* Includes: */ #include <LUFA/Drivers/USB/USB.h> #include <avr/pgmspace.h> /* Macros: */ /** Endpoint number of the CDC device-to-host notification IN endpoint. */ #define CDC_NOTIFICATION_EPNUM 3 /** Endpoint number of the CDC device-to-host data IN endpoint. */ #define CDC_TX_EPNUM 1 /** Endpoint number of the CDC host-to-device data OUT endpoint. */ #define CDC_RX_EPNUM 2 /** Size in bytes of the CDC device-to-host notification IN endpoint. */ #define CDC_NOTIFICATION_EPSIZE 8 /** Size in bytes of the CDC data IN and OUT endpoints. */ #define CDC_TXRX_EPSIZE 64 /* Type Defines: */ /** Type define for the device configuration descriptor structure. This must be defined in the * application code, as the configuration descriptor contains several sub-descriptors which * vary between devices, and which describe the device's usage to the host. */ typedef struct { USB_Descriptor_Configuration_Header_t Config; // RNDIS CDC Control Interface USB_Descriptor_Interface_t CDC_CCI_Interface; USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; // RNDIS CDC Data Interface USB_Descriptor_Interface_t CDC_DCI_Interface; USB_Descriptor_Endpoint_t RNDIS_DataOutEndpoint; USB_Descriptor_Endpoint_t RNDIS_DataInEndpoint; } USB_Descriptor_Configuration_t; /* Function Prototypes: */ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, const void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); #endif
// // Copyright 2015 Pixar // // Licensed under the Apache License, Version 2.0 (the "Apache License") // with the following modification; you may not use this file except in // compliance with the Apache License and the following modification to it: // Section 6. Trademarks. is deleted and replaced with: // // 6. Trademarks. This License does not grant permission to use the trade // names, trademarks, service marks, or product names of the Licensor // and its affiliates, except as required to comply with Section 4(c) of // the License and to reproduce the content of the NOTICE file. // // You may obtain a copy of the Apache License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the Apache License with the above modification is // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the Apache License for the specific // language governing permissions and limitations under the Apache License. // #ifndef OPENSUBDIV_EXAMPLES_SHADER_CACHE_H #define OPENSUBDIV_EXAMPLES_SHADER_CACHE_H #include <map> template <typename DESC_TYPE, typename CONFIG_TYPE> class ShaderCacheT { public: typedef DESC_TYPE DescType; typedef CONFIG_TYPE ConfigType; typedef std::map<DescType, ConfigType *> ConfigMap; virtual ~ShaderCacheT() { Reset(); } void Reset() { for (typename ConfigMap::iterator it = _configMap.begin(); it != _configMap.end(); ++it) { delete it->second; } _configMap.clear(); } // fetch shader config ConfigType * GetDrawConfig(DescType const & desc) { typename ConfigMap::iterator it = _configMap.find(desc); if (it != _configMap.end()) { return it->second; } else { ConfigType * config = CreateDrawConfig(desc); if (config) { _configMap[desc] = config; } return config; } } virtual ConfigType *CreateDrawConfig(DescType const &desc) = 0; private: ConfigMap _configMap; }; #endif // OPENSUBDIV_EXAMPLES_SHADER_CACHE_H
/* main tabbar controller Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface MainTabBarController : UITabBarController { } @end
////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2008, Image Engine Design Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // * Neither the name of Image Engine Design nor the names of any // other contributors to this software may be used to endorse or // promote products derived from this software without specific prior // written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////// #ifndef IECORERI_COLORALGO_H #define IECORERI_COLORALGO_H float ieSRGBToLin( float sRGB ) { float k0 = 0.04045; float phi = 12.92; float result; if( sRGB <= k0 ) { result = (sRGB/phi); } else { float alpha = 0.055; float exponent = 2.4; result = pow( ( sRGB + alpha ) / ( 1.0 + alpha ), exponent ); } return result; } color ieSRGBToLin( color sRGB ) { color result; float i; for( i=0; i<3; i+=1 ) { result[i] = ieSRGBToLin( sRGB[i] ); } return result; } float ieLuminance( color c; color weights ) { return vector( c ).vector( weights ); } float ieLuminance( color c ) { return ieLuminance( c, color( 0.212671, 0.715160, 0.072169 ) ); } color ieAdjustSaturation( color c; float saturation ) { float l = ieLuminance( c ); return mix( color( l ), c, saturation ); } /// Arguments of 0 leave color unchanged. color ieAdjustHSV( color c; float hue; float saturation; float value ) { color cc = ctransform( "rgb", "hsv", c ); cc[0] += hue; cc[1] *= max( 0, 1 + saturation); cc[2] *= max( 0, 1 + value); cc = ctransform( "hsv", "rgb", cc ); return clamp( cc, 0, 1 ); } #endif // IECORERI_COLORALGO_H
/* sort/gsl_sort_ushort.h * * Copyright (C) 1996, 1997, 1998, 1999, 2000 Thomas Walter, Brian Gough * * 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 __GSL_SORT_USHORT_H__ #define __GSL_SORT_USHORT_H__ #include <stdlib.h> #include <gsl/gsl_errno.h> #include <gsl/gsl_permutation.h> #undef __BEGIN_DECLS #undef __END_DECLS #ifdef __cplusplus # define __BEGIN_DECLS extern "C" { # define __END_DECLS } #else # define __BEGIN_DECLS /* empty */ # define __END_DECLS /* empty */ #endif __BEGIN_DECLS void gsl_sort_ushort (unsigned short * data, const size_t stride, const size_t n); void gsl_sort_ushort_index (size_t * p, const unsigned short * data, const size_t stride, const size_t n); int gsl_sort_ushort_smallest (unsigned short * dest, const size_t k, const unsigned short * src, const size_t stride, const size_t n); int gsl_sort_ushort_smallest_index (size_t * p, const size_t k, const unsigned short * src, const size_t stride, const size_t n); int gsl_sort_ushort_largest (unsigned short * dest, const size_t k, const unsigned short * src, const size_t stride, const size_t n); int gsl_sort_ushort_largest_index (size_t * p, const size_t k, const unsigned short * src, const size_t stride, const size_t n); __END_DECLS #endif /* __GSL_SORT_USHORT_H__ */
/**************************************************************************** * * t1cmap.h * * Type 1 character map support (specification). * * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, * modified, and distributed under the terms of the FreeType project * license, LICENSE.TXT. By continuing to use, modify, or distribute * this file you indicate that you have read the license and * understand and accept it fully. * */ #ifndef T1CMAP_H_ #define T1CMAP_H_ #include <ft2build.h> #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_TYPE1_TYPES_H FT_BEGIN_HEADER /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** TYPE1 STANDARD (AND EXPERT) ENCODING CMAPS *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ /* standard (and expert) encoding cmaps */ typedef struct T1_CMapStdRec_* T1_CMapStd; typedef struct T1_CMapStdRec_ { FT_CMapRec cmap; const FT_UShort* code_to_sid; PS_Adobe_Std_StringsFunc sid_to_string; FT_UInt num_glyphs; const char* const* glyph_names; } T1_CMapStdRec; FT_CALLBACK_TABLE const FT_CMap_ClassRec t1_cmap_standard_class_rec; FT_CALLBACK_TABLE const FT_CMap_ClassRec t1_cmap_expert_class_rec; /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** TYPE1 CUSTOM ENCODING CMAP *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ typedef struct T1_CMapCustomRec_* T1_CMapCustom; typedef struct T1_CMapCustomRec_ { FT_CMapRec cmap; FT_UInt first; FT_UInt count; FT_UShort* indices; } T1_CMapCustomRec; FT_CALLBACK_TABLE const FT_CMap_ClassRec t1_cmap_custom_class_rec; /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** TYPE1 SYNTHETIC UNICODE ENCODING CMAP *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ /* unicode (synthetic) cmaps */ FT_CALLBACK_TABLE const FT_CMap_ClassRec t1_cmap_unicode_class_rec; /* */ FT_END_HEADER #endif /* T1CMAP_H_ */ /* END */
/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2015 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Andrey Hristov <andrey@mysql.com> | | Ulf Wendel <uwendel@mysql.com> | | Georg Richter <georg@mysql.com> | +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef MYSQLND_RESULT_META_H #define MYSQLND_RESULT_META_H PHPAPI MYSQLND_RES_METADATA * mysqlnd_result_meta_init(unsigned int field_count, zend_bool persistent TSRMLS_DC); PHPAPI struct st_mysqlnd_res_meta_methods * mysqlnd_result_metadata_get_methods(); PHPAPI void ** _mysqlnd_plugin_get_plugin_result_metadata_data(const MYSQLND_RES_METADATA * meta, unsigned int plugin_id TSRMLS_DC); #endif /* MYSQLND_RESULT_META_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */
/* * Copyright (C) 2011 Collabora Ltd. * * 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 __EMPATHY_MIC_MENU_H__ #define __EMPATHY_MIC_MENU_H__ #include <glib-object.h> #include "empathy-call-window.h" G_BEGIN_DECLS #define EMPATHY_TYPE_MIC_MENU (empathy_mic_menu_get_type ()) #define EMPATHY_MIC_MENU(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_MIC_MENU, EmpathyMicMenu)) #define EMPATHY_MIC_MENU_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EMPATHY_TYPE_MIC_MENU, EmpathyMicMenuClass)) #define EMPATHY_IS_MIC_MENU(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_MIC_MENU)) #define EMPATHY_IS_MIC_MENU_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_MIC_MENU)) #define EMPATHY_MIC_MENU_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_MIC_MENU, EmpathyMicMenuClass)) typedef struct _EmpathyMicMenu EmpathyMicMenu; typedef struct _EmpathyMicMenuPrivate EmpathyMicMenuPrivate; typedef struct _EmpathyMicMenuClass EmpathyMicMenuClass; struct _EmpathyMicMenu { GObject parent; EmpathyMicMenuPrivate *priv; }; struct _EmpathyMicMenuClass { GObjectClass parent_class; }; GType empathy_mic_menu_get_type (void) G_GNUC_CONST; EmpathyMicMenu * empathy_mic_menu_new (EmpathyCallWindow *window); G_END_DECLS #endif /* __EMPATHY_MIC_MENU_H__ */
#pragma once /* * Copyright (C) 2005-2008 Team XBMC * http://www.xbmc.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, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XBMC; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * http://www.gnu.org/copyleft/gpl.html * */ #include "IDirectory.h" class CURL; class TiXmlElement; namespace XFILE { class CTuxBoxDirectory : public IDirectory { public: CTuxBoxDirectory(void); virtual ~CTuxBoxDirectory(void); virtual bool GetDirectory(const CStdString& strPath, CFileItemList &items); virtual bool IsAllowed(const CStdString &strFile) const { return true; }; virtual DIR_CACHE_TYPE GetCacheType(const CStdString& strPath) const { return DIR_CACHE_ALWAYS; }; private: bool GetRootAndChildString(const CStdString strPath, CStdString& strBQRequest, CStdString& strXMLRootString, CStdString& strXMLChildString ); void GetRootAndChildStringEnigma2(CStdString& strBQRequest, CStdString& strXMLRootString, CStdString& strXMLChildString ); }; }