text
stringlengths
4
6.14k
/* * linux/drivers/clocksource/acpi_pm.c * * This file contains the ACPI PM based clocksource. * * This code was largely moved from the i386 timer_pm.c file * which was (C) Dominik Brodowski <linux@brodo.de> 2003 * and contained the following comments: * * Driver to use the Power Management Timer (PMTMR) available in some * southbridges as primary timing source for the Linux kernel. * * Based on parts of linux/drivers/acpi/hardware/hwtimer.c, timer_pit.c, * timer_hpet.c, and on Arjan van de Ven's implementation for 2.4. * * This file is licensed under the GPL v2. */ #include <linux/acpi_pmtmr.h> #include <linux/clocksource.h> #include <linux/errno.h> #include <linux/init.h> #include <linux/pci.h> #include <asm/io.h> /* * The I/O port the PMTMR resides at. * The location is detected during setup_arch(), * in arch/i386/acpi/boot.c */ u32 pmtmr_ioport __read_mostly; static inline u32 read_pmtmr(void) { /* mask the output to 24 bits */ return inl(pmtmr_ioport) & ACPI_PM_MASK; } u32 acpi_pm_read_verified(void) { u32 v1 = 0, v2 = 0, v3 = 0; /* * It has been reported that because of various broken * chipsets (ICH4, PIIX4 and PIIX4E) where the ACPI PM clock * source is not latched, you must read it multiple * times to ensure a safe value is read: */ do { v1 = read_pmtmr(); v2 = read_pmtmr(); v3 = read_pmtmr(); } while (unlikely((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1) || (v3 > v1 && v3 < v2))); return v2; } static cycle_t acpi_pm_read_slow(void) { return (cycle_t)acpi_pm_read_verified(); } static cycle_t acpi_pm_read(void) { return (cycle_t)read_pmtmr(); } static struct clocksource clocksource_acpi_pm = { .name = "acpi_pm", .rating = 200, .read = acpi_pm_read, .mask = (cycle_t)ACPI_PM_MASK, .mult = 0, /*to be caluclated*/ .shift = 22, .flags = CLOCK_SOURCE_IS_CONTINUOUS, }; #ifdef CONFIG_PCI static int __devinitdata acpi_pm_good; static int __init acpi_pm_good_setup(char *__str) { acpi_pm_good = 1; return 1; } __setup("acpi_pm_good", acpi_pm_good_setup); static inline void acpi_pm_need_workaround(void) { clocksource_acpi_pm.read = acpi_pm_read_slow; clocksource_acpi_pm.rating = 120; } /* * PIIX4 Errata: * * The power management timer may return improper results when read. * Although the timer value settles properly after incrementing, * while incrementing there is a 3 ns window every 69.8 ns where the * timer value is indeterminate (a 4.2% chance that the data will be * incorrect when read). As a result, the ACPI free running count up * timer specification is violated due to erroneous reads. */ static void __devinit acpi_pm_check_blacklist(struct pci_dev *dev) { u8 rev; if (acpi_pm_good) return; pci_read_config_byte(dev, PCI_REVISION_ID, &rev); /* the bug has been fixed in PIIX4M */ if (rev < 3) { printk(KERN_WARNING "* Found PM-Timer Bug on the chipset." " Due to workarounds for a bug,\n" "* this clock source is slow. Consider trying" " other clock sources\n"); acpi_pm_need_workaround(); } } DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, acpi_pm_check_blacklist); static void __devinit acpi_pm_check_graylist(struct pci_dev *dev) { if (acpi_pm_good) return; printk(KERN_WARNING "* The chipset may have PM-Timer Bug. Due to" " workarounds for a bug,\n" "* this clock source is slow. If you are sure your timer" " does not have\n" "* this bug, please use \"acpi_pm_good\" to disable the" " workaround\n"); acpi_pm_need_workaround(); } DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, acpi_pm_check_graylist); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_LE, acpi_pm_check_graylist); #endif #ifndef CONFIG_X86_64 #include "mach_timer.h" #define PMTMR_EXPECTED_RATE \ ((CALIBRATE_LATCH * (PMTMR_TICKS_PER_SEC >> 10)) / (CLOCK_TICK_RATE>>10)) /* * Some boards have the PMTMR running way too fast. We check * the PMTMR rate against PIT channel 2 to catch these cases. */ static int verify_pmtmr_rate(void) { u32 value1, value2; unsigned long count, delta; mach_prepare_counter(); value1 = read_pmtmr(); mach_countup(&count); value2 = read_pmtmr(); delta = (value2 - value1) & ACPI_PM_MASK; /* Check that the PMTMR delta is within 5% of what we expect */ if (delta < (PMTMR_EXPECTED_RATE * 19) / 20 || delta > (PMTMR_EXPECTED_RATE * 21) / 20) { printk(KERN_INFO "PM-Timer running at invalid rate: %lu%% " "of normal - aborting.\n", 100UL * delta / PMTMR_EXPECTED_RATE); return -1; } return 0; } #else #define verify_pmtmr_rate() (0) #endif static int __init init_acpi_pm_clocksource(void) { u32 value1, value2; unsigned int i; if (!pmtmr_ioport) return -ENODEV; clocksource_acpi_pm.mult = clocksource_hz2mult(PMTMR_TICKS_PER_SEC, clocksource_acpi_pm.shift); /* "verify" this timing source: */ value1 = read_pmtmr(); for (i = 0; i < 10000; i++) { value2 = read_pmtmr(); if (value2 == value1) continue; if (value2 > value1) goto pm_good; if ((value2 < value1) && ((value2) < 0xFFF)) goto pm_good; printk(KERN_INFO "PM-Timer had inconsistent results:" " 0x%#x, 0x%#x - aborting.\n", value1, value2); return -EINVAL; } printk(KERN_INFO "PM-Timer had no reasonable result:" " 0x%#x - aborting.\n", value1); return -ENODEV; pm_good: if (verify_pmtmr_rate() != 0) return -ENODEV; return clocksource_register(&clocksource_acpi_pm); } /* We use fs_initcall because we want the PCI fixups to have run * but we still need to load before device_initcall */ fs_initcall(init_acpi_pm_clocksource);
// // UIImageView+Ink.h // INK Workflow Framework // // Created by Liyan David Chang on 5/17/13. // Copyright (c) 2013 Ink. All rights reserved. // #import <UIKit/UIKit.h> #import "INKBlocks.h" #import "INKBlob.h" @interface UIView (Ink) <UIGestureRecognizerDelegate> /* @property (nonatomic, retain) INKDynamicBlobBlock associatedBlobBlock; @property (nonatomic, retain) NSString* associatedUTI; @property (nonatomic, retain) INKActionCallbackBlock associatedReturnBlock; */ /** Enable a view to transmit a static INKBlob. For example: INKBlob blob; blob.data = someNSData; blob.filename = @"somefile.png"; blob.uti = @"public.png"; [view INKEnableWithBlob:blob]; @param blob The INKBlob containing the required data. */ - (void) INKEnableWithBlob:(INKBlob *)blob; /** Enable a view to transmit a dynamically loaded INKBlob. For example: [self.view INKEnableWithUTI:myFile.uti dynamicBlob:^INKBlob *{ INKBlob *blob = [INKBlob blobFromData:[myFile getData]]; blob.uti = myFile.uti; blob.filename = myFile.fileName; return blob; }]; @param UTI The NSString representation of the UTI of the INKBlob. Since the actions shown depend on the UTI, the UTI cannot be dynamically loaded. @param blobBlock The INKDynamicBlobBlock returning the INKBlob. */ - (void) INKEnableWithUTI:(NSString*)UTI dynamicBlob:(INKDynamicBlobBlock)blobBlock; /** Enable a view to transmit a static INKBlob and provide a return handler For example: INKBlob blob; blob.data = someNSData; blob.filename = @"somefile.png"; blob.uti = @"public.png"; [view INKEnableWithBlob:b returnBlock:^(INKBlob *blob, INKAction *action, NSError *error) { if ([action.type isEqualToString: INKActionType_Return]) { [self saveBlob: blob withFilename:myFile.fileName]; } else { NSLog(@"Return cancel."); } }]; @param blob The INKBlob containing the required data. @param returnBlock The INKActionCallback block to be called on a return action. This handler should examine the return action type and respond appropriately. */ - (void) INKEnableWithBlob:(INKBlob *)blob returnBlock:(INKActionCallbackBlock)returnBlock; /** Enable a view to transmit a dynamically loaded INKBlob and provide a return handler For example: [self.view INKEnableWithUTI:myFile.uti dynamicBlob:^INKBlob *{ INKBlob *blob = [INKBlob blobFromData:[myFile getData]]; blob.uti = myFile.uti; blob.filename = myFile.fileName; return blob; } returnBlock:^(INKBlob *blob, INKAction *action, NSError *error) { if ([action.type isEqualToString: INKActionType_Return]) { [self saveBlob: blob withFilename:myFile.fileName]; } else { NSLog(@"Return cancel."); } }]; @param UTI The NSString representation of the UTI of the INKBlob. Since the actions shown depend on the UTI, the UTI cannot be dynamically loaded. @param blobBlock The INKDynamicBlobBlock returning the INKBlob. @param returnBlock The INKActionCallback block to be called on a return action. This handler should determine the return action type and respond appropriately. */ - (void) INKEnableWithUTI:(NSString *)UTI dynamicBlob:(INKDynamicBlobBlock)blobBlock returnBlock:(INKActionCallbackBlock)returnBlock; /** INKAddLaunchButton will add a button to your INK enabled view, automatically positioned in the top right corner. If you wish to position it in an alternate location, the button is returned and you can place it as you like. @return (UIButton *) The placed, movable, button INK button. */ - (UIButton*) INKAddLaunchButton; @end
/* Moxie Simulator definition. Copyright (C) 2009-2016 Free Software Foundation, Inc. This file is part of GDB, the GNU debugger. 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 SIM_MAIN_H #define SIM_MAIN_H #include "sim-basics.h" #include "sim-base.h" typedef struct { int regs[20]; } regstacktype; typedef union { struct { int regs[16]; int pc; /* System registers. For sh-dsp this also includes A0 / X0 / X1 / Y0 / Y1 which are located in fregs, i.e. strictly speaking, these are out-of-bounds accesses of sregs.i . This wart of the code could be fixed by making fregs part of sregs, and including pc too - to avoid alignment repercussions - but this would cause very onerous union / structure nesting, which would only be managable with anonymous unions and structs. */ union { struct { int mach; int macl; int pr; int dummy3, dummy4; int fpul; /* A1 for sh-dsp - but only for movs etc. */ int fpscr; /* dsr for sh-dsp */ } named; int i[7]; } sregs; /* sh3e / sh-dsp */ union fregs_u { float f[16]; double d[8]; int i[16]; } fregs[2]; /* Control registers; on the SH4, ldc / stc is privileged, except when accessing gbr. */ union { struct { int sr; int gbr; int vbr; int ssr; int spc; int mod; /* sh-dsp */ int rs; int re; /* sh3 */ int bank[8]; int dbr; /* debug base register */ int sgr; /* saved gr15 */ int ldst; /* load/store flag (boolean) */ int tbr; int ibcr; /* sh2a bank control register */ int ibnr; /* sh2a bank number register */ } named; int i[16]; } cregs; unsigned char *insn_end; int ticks; int stalls; int memstalls; int cycles; int insts; int prevlock; int thislock; int exception; int end_of_registers; int msize; #define PROFILE_FREQ 1 #define PROFILE_SHIFT 2 int profile; unsigned short *profile_hist; unsigned char *memory; int xyram_select, xram_start, yram_start; unsigned char *xmem; unsigned char *ymem; unsigned char *xmem_offset; unsigned char *ymem_offset; unsigned long bfd_mach; regstacktype *regstack; } asregs; int asints[40]; } saved_state_type; /* TODO: Move into sim_cpu. */ extern saved_state_type saved_state; struct _sim_cpu { sim_cpu_base base; }; struct sim_state { sim_cpu *cpu[MAX_NR_PROCESSORS]; sim_state_base base; }; #endif
/* * Copyright (C) 2008 The Android Open Source Project * * 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. */ /* * Implementation of the user-space ashmem API for the simulator, which lacks * an ashmem-enabled kernel. See ashmem-dev.c for the real ashmem-based version. */ #include <unistd.h> #include <string.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdio.h> #include <errno.h> #include <time.h> #include <limits.h> #include <cutils/ashmem.h> int ashmem_create_region(const char *ignored, size_t size) { static const char txt[] = "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; char name[64]; unsigned int retries = 0; pid_t pid = getpid(); int fd; srand(time(NULL) + pid); retry: /* not beautiful, its just wolf-like loop unrolling */ snprintf(name, sizeof(name), "/tmp/android-ashmem-%d-%c%c%c%c%c%c%c%c", pid, txt[(int) ((sizeof(txt) - 1) * (rand() / (RAND_MAX + 1.0)))], txt[(int) ((sizeof(txt) - 1) * (rand() / (RAND_MAX + 1.0)))], txt[(int) ((sizeof(txt) - 1) * (rand() / (RAND_MAX + 1.0)))], txt[(int) ((sizeof(txt) - 1) * (rand() / (RAND_MAX + 1.0)))], txt[(int) ((sizeof(txt) - 1) * (rand() / (RAND_MAX + 1.0)))], txt[(int) ((sizeof(txt) - 1) * (rand() / (RAND_MAX + 1.0)))], txt[(int) ((sizeof(txt) - 1) * (rand() / (RAND_MAX + 1.0)))], txt[(int) ((sizeof(txt) - 1) * (rand() / (RAND_MAX + 1.0)))]); /* open O_EXCL & O_CREAT: we are either the sole owner or we fail */ fd = open(name, O_RDWR | O_CREAT | O_EXCL, 0600); if (fd == -1) { /* unlikely, but if we failed because `name' exists, retry */ if (errno == EEXIST && ++retries < 6) goto retry; return -1; } /* truncate the file to `len' bytes */ if (ftruncate(fd, size) == -1) goto error; if (unlink(name) == -1) goto error; return fd; error: close(fd); return -1; } int ashmem_set_prot_region(int fd, int prot) { return 0; } int ashmem_pin_region(int fd, size_t offset, size_t len) { return ASHMEM_NOT_PURGED; } int ashmem_unpin_region(int fd, size_t offset, size_t len) { return ASHMEM_IS_UNPINNED; } int ashmem_get_size_region(int fd) { struct stat buf; int result; result = fstat(fd, &buf); if (result == -1) { return -1; } // Check if this is an "ashmem" region. // TODO: This is very hacky, and can easily break. We need some reliable indicator. if (!(buf.st_nlink == 0 && S_ISREG(buf.st_mode))) { errno = ENOTTY; return -1; } return (int)buf.st_size; // TODO: care about overflow (> 2GB file)? }
/* * pckeymap.c * * Mappings from IBM-PC scancodes to local key codes. */ #include "input.h" int keymap[][2] = { { 1, K_ESC }, { 2, '1' }, { 3, '2' }, { 4, '3' }, { 5, '4' }, { 6, '5' }, { 7, '6' }, { 8, '7' }, { 9, '8' }, { 10, '9' }, { 11, '0' }, { 12, K_MINUS }, { 13, K_EQUALS }, { 14, K_BS }, { 15, K_TAB }, { 16, 'q' }, { 17, 'w' }, { 18, 'e' }, { 19, 'r' }, { 20, 't' }, { 21, 'y' }, { 22, 'u' }, { 23, 'i' }, { 24, 'o' }, { 25, 'p' }, { 26, '[' }, { 27, ']' }, { 28, K_ENTER }, { 29, K_CTRL }, { 30, 'a' }, { 31, 's' }, { 32, 'd' }, { 33, 'f' }, { 34, 'g' }, { 35, 'h' }, { 36, 'j' }, { 37, 'k' }, { 38, 'l' }, { 39, K_SEMI }, { 40, '\'' }, { 41, K_TILDE }, { 42, K_SHIFT }, { 43, K_BSLASH }, { 44, 'z' }, { 45, 'x' }, { 46, 'c' }, { 47, 'v' }, { 48, 'b' }, { 49, 'n' }, { 50, 'm' }, { 51, ',' }, { 52, '.' }, { 53, '/' }, { 54, K_SHIFT }, { 55, K_NUMMUL }, { 56, K_ALT }, { 57, ' ' }, { 58, K_CAPS }, { 59, K_F1 }, { 60, K_F2 }, { 61, K_F3 }, { 62, K_F4 }, { 63, K_F5 }, { 64, K_F6 }, { 65, K_F7 }, { 66, K_F8 }, { 67, K_F9 }, { 68, K_F10 }, { 69, K_NUMLOCK }, { 70, K_SCROLL }, { 71, K_NUM7 }, { 72, K_NUM8 }, { 73, K_NUM9 }, { 74, K_NUMMINUS }, { 75, K_NUM4 }, { 76, K_NUM5 }, { 77, K_NUM6 }, { 78, K_NUMPLUS }, { 79, K_NUM1 }, { 80, K_NUM2 }, { 81, K_NUM3 }, { 82, K_NUM0 }, { 83, K_NUMDOT }, { 87, K_F11 }, { 88, K_F12 }, { 96, K_NUMENTER }, { 97, K_CTRL }, { 98, K_NUMDIV }, { 99, K_SYSRQ }, { 100, K_ALT }, { 101, K_PAUSE }, { 119, K_PAUSE }, { 102, K_HOME }, { 103, K_UP }, { 104, K_PRIOR }, { 105, K_LEFT }, { 106, K_RIGHT }, { 107, K_END }, { 108, K_DOWN }, { 109, K_NEXT }, { 110, K_INS }, { 111, K_DEL }, { 0, 0 } };
/******************************************************* Copyright (C) 2013,2014 James Higley This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ********************************************************/ #ifndef MODEL_BUDGET_H #define MODEL_BUDGET_H #include "Model.h" #include "db/DB_Table_Budgettable_V1.h" class Model_Budget : public Model<DB_Table_BUDGETTABLE_V1> { public: Model_Budget(); ~Model_Budget(); public: /** Initialize the global Model_Budget table on initial call. Resets the global table on subsequent calls. * Return the static instance address for Model_Budget table * Note: Assigning the address to a local variable can destroy the instance. */ static Model_Budget& instance(wxSQLite3Database* db); /** * Return the static instance address for Model_Budget table * Note: Assigning the address to a local variable can destroy the instance. */ static Model_Budget& instance(); public: enum PERIOD_ENUM { NONE = 0, WEEKLY, BIWEEKLY, MONTHLY, BIMONTHLY, QUARTERLY, HALFYEARLY, YEARLY, DAILY }; static const std::vector<std::pair<PERIOD_ENUM, wxString> > PERIOD_ENUM_CHOICES; static wxArrayString all_period(); static PERIOD_ENUM period(const Data* r); static PERIOD_ENUM period(const Data& r); static DB_Table_BUDGETTABLE_V1::PERIOD PERIOD(PERIOD_ENUM period, OP op = EQUAL); static void getBudgetEntry(int budgetYearID, std::map<int, std::map<int, PERIOD_ENUM> > &budgetPeriod, std::map<int, std::map<int, double> > &budgetAmt); static void copyBudgetYear(int newYearID, int baseYearID); static double getMonthlyEstimate(const PERIOD_ENUM period, const double amount); static double getYearlyEstimate(const PERIOD_ENUM period, const double amount); }; #endif //
/* * Copyright (C) 2012 Andrew Mortensen * * This file is part of the sca module for Kamailio, a free SIP server. * * The sca module 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 * * The sca module is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "sca_common.h" #include "sca_db.h" #include "sca_subscribe.h" db1_con_t *sca_db_con = NULL; const str SCA_DB_SUBSCRIBER_COL_NAME = STR_STATIC_INIT( "subscriber" ); const str SCA_DB_AOR_COL_NAME = STR_STATIC_INIT( "aor" ); const str SCA_DB_EVENT_COL_NAME = STR_STATIC_INIT( "event" ); const str SCA_DB_EXPIRES_COL_NAME = STR_STATIC_INIT( "expires" ); const str SCA_DB_STATE_COL_NAME = STR_STATIC_INIT( "state" ); const str SCA_DB_APP_IDX_COL_NAME = STR_STATIC_INIT( "app_idx" ); const str SCA_DB_CALL_ID_COL_NAME = STR_STATIC_INIT( "call_id" ); const str SCA_DB_FROM_TAG_COL_NAME = STR_STATIC_INIT( "from_tag" ); const str SCA_DB_TO_TAG_COL_NAME = STR_STATIC_INIT( "to_tag" ); const str SCA_DB_RECORD_ROUTE_COL_NAME = STR_STATIC_INIT( "record_route" ); const str SCA_DB_NOTIFY_CSEQ_COL_NAME = STR_STATIC_INIT( "notify_cseq" ); const str SCA_DB_SUBSCRIBE_CSEQ_COL_NAME = STR_STATIC_INIT( "subscribe_cseq" ); void sca_db_subscriptions_get_value_for_column( int column, db_val_t *row_values, void *column_value ) { assert( column_value != NULL ); assert( row_values != NULL ); assert( column >= 0 && column < SCA_DB_SUBS_BOUNDARY ); switch ( column ) { case SCA_DB_SUBS_SUBSCRIBER_COL: case SCA_DB_SUBS_AOR_COL: case SCA_DB_SUBS_CALL_ID_COL: case SCA_DB_SUBS_FROM_TAG_COL: case SCA_DB_SUBS_TO_TAG_COL: case SCA_DB_SUBS_RECORD_ROUTE_COL: ((str *)column_value)->s = (char *)row_values[ column ].val.string_val; ((str *)column_value)->len = strlen(((str *)column_value)->s ); break; case SCA_DB_SUBS_EXPIRES_COL: *((time_t *)column_value) = row_values[ column ].val.time_val; break; case SCA_DB_SUBS_EVENT_COL: case SCA_DB_SUBS_STATE_COL: case SCA_DB_SUBS_NOTIFY_CSEQ_COL: case SCA_DB_SUBS_SUBSCRIBE_CSEQ_COL: *((int *)column_value) = row_values[ column ].val.int_val; break; default: column_value = NULL; } } void sca_db_subscriptions_set_value_for_column( int column, db_val_t *row_values, void *column_value ) { assert( column >= 0 && column < SCA_DB_SUBS_BOUNDARY ); assert( column_value != NULL ); assert( row_values != NULL ); switch ( column ) { case SCA_DB_SUBS_SUBSCRIBER_COL: case SCA_DB_SUBS_AOR_COL: case SCA_DB_SUBS_CALL_ID_COL: case SCA_DB_SUBS_FROM_TAG_COL: case SCA_DB_SUBS_TO_TAG_COL: case SCA_DB_SUBS_RECORD_ROUTE_COL: row_values[ column ].val.str_val = *((str *)column_value); row_values[ column ].type = DB1_STR; row_values[ column ].nul = 0; break; case SCA_DB_SUBS_EXPIRES_COL: row_values[ column ].val.int_val = (int)(*((time_t *)column_value)); row_values[ column ].type = DB1_INT; row_values[ column ].nul = 0; break; case SCA_DB_SUBS_APP_IDX_COL: /* for now, don't save appearance index associated with subscriber */ row_values[ column ].val.int_val = 0; row_values[ column ].type = DB1_INT; row_values[ column ].nul = 0; break; default: LM_WARN( "sca_db_subscriptions_set_value_for_column: unrecognized " "column index %d, treating as INT", column ); /* fall through */ case SCA_DB_SUBS_EVENT_COL: case SCA_DB_SUBS_STATE_COL: case SCA_DB_SUBS_NOTIFY_CSEQ_COL: case SCA_DB_SUBS_SUBSCRIBE_CSEQ_COL: row_values[ column ].val.int_val = *((int *)column_value); row_values[ column ].type = DB1_INT; row_values[ column ].nul = 0; break; } } str ** sca_db_subscriptions_columns( void ) { static str *subs_columns[] = { (str *)&SCA_DB_SUBSCRIBER_COL_NAME, (str *)&SCA_DB_AOR_COL_NAME, (str *)&SCA_DB_EVENT_COL_NAME, (str *)&SCA_DB_EXPIRES_COL_NAME, (str *)&SCA_DB_STATE_COL_NAME, (str *)&SCA_DB_APP_IDX_COL_NAME, (str *)&SCA_DB_CALL_ID_COL_NAME, (str *)&SCA_DB_FROM_TAG_COL_NAME, (str *)&SCA_DB_TO_TAG_COL_NAME, (str *)&SCA_DB_RECORD_ROUTE_COL_NAME, (str *)&SCA_DB_NOTIFY_CSEQ_COL_NAME, (str *)&SCA_DB_SUBSCRIBE_CSEQ_COL_NAME, NULL }; return( subs_columns ); } db1_con_t * sca_db_get_connection( void ) { assert( sca && sca->cfg->db_url ); assert( sca->db_api && sca->db_api->init ); if ( sca_db_con == NULL ) { sca_db_con = sca->db_api->init( sca->cfg->db_url ); /* catch connection error in caller */ } return( sca_db_con ); } void sca_db_disconnect( void ) { if ( sca_db_con != NULL ) { sca->db_api->close( sca_db_con ); sca_db_con = NULL; } }
/* * Raw VBI to sliced VBI parser. * * The slicing code was copied from libzvbi. The original copyright notice is: * * Copyright (C) 2000-2004 Michael H. Schimek * * The vbi_prepare/vbi_parse functions are: * * Copyright (C) 2012 Hans Verkuil <hans.verkuil@cisco.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library 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 Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. */ #ifndef _RAW2SLICED_H #define _RAW2SLICED_H #include <linux/videodev2.h> #define VBI_MAX_SERVICES (3) // Bit slicer internal struct struct vbi_bit_slicer { unsigned int service; unsigned int cri; unsigned int cri_mask; unsigned int thresh; unsigned int thresh_frac; unsigned int cri_samples; unsigned int cri_rate; unsigned int oversampling_rate; unsigned int phase_shift; unsigned int step; unsigned int frc; unsigned int frc_bits; unsigned int payload; unsigned int endian; }; struct vbi_handle { unsigned services; unsigned start_of_field_2; unsigned stride; bool interlaced; int start[2]; int count[2]; struct vbi_bit_slicer slicers[VBI_MAX_SERVICES]; }; // Fills in vbi_handle based on the standard and VBI format // Returns true if one or more services are valid for the fmt/std combination. bool vbi_prepare(struct vbi_handle *vh, const struct v4l2_vbi_format *fmt, v4l2_std_id std); // Parses the raw buffer and fills in sliced_vbi_format and _data. // data must be an array of count[0] + count[1] v4l2_sliced_vbi_data structs. void vbi_parse(struct vbi_handle *vh, const unsigned char *buf, struct v4l2_sliced_vbi_format *vbi, struct v4l2_sliced_vbi_data *data); #endif
/* * Copyright (c) 2015 Joern Rischmueller (joern.rm@gmail.com) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., 51 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _GC_AthleteBackup_h #define _GC_AthleteBackup_h 1 #include <QString> #include "Athlete.h" class AthleteBackup : public QObject { Q_OBJECT public: AthleteBackup(QDir athlete); ~AthleteBackup(); void backupOnClose(); void backupImmediate(); private: AthleteDirectoryStructure *athleteDirs; QString athlete; QString backupFolder; QList<QDir> sourceFolderList; bool backup(QString progressText); }; #endif
/* * Copyright (C) 2012-2014 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence. * * A copy of the licence is included with the program, and can also be obtained from Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "mali_osk.h" #include "mali_osk_list.h" #include "mali_session.h" #include "mali_ukk.h" _MALI_OSK_LIST_HEAD(mali_sessions); static u32 mali_session_count = 0; _mali_osk_spinlock_irq_t *mali_sessions_lock = NULL; _mali_osk_errcode_t mali_session_initialize(void) { _MALI_OSK_INIT_LIST_HEAD(&mali_sessions); mali_sessions_lock = _mali_osk_spinlock_irq_init( _MALI_OSK_LOCKFLAG_ORDERED, _MALI_OSK_LOCK_ORDER_SESSIONS); if (NULL == mali_sessions_lock) { return _MALI_OSK_ERR_NOMEM; } return _MALI_OSK_ERR_OK; } void mali_session_terminate(void) { if (NULL != mali_sessions_lock) { _mali_osk_spinlock_irq_term(mali_sessions_lock); mali_sessions_lock = NULL; } } void mali_session_add(struct mali_session_data *session) { mali_session_lock(); _mali_osk_list_add(&session->link, &mali_sessions); mali_session_count++; mali_session_unlock(); } void mali_session_remove(struct mali_session_data *session) { mali_session_lock(); _mali_osk_list_delinit(&session->link); mali_session_count--; mali_session_unlock(); } u32 mali_session_get_count(void) { return mali_session_count; } /* * Get the max completed window jobs from all active session, * which will be used in window render frame per sec calculate */ #if defined(CONFIG_MALI_DVFS) u32 mali_session_max_window_num(void) { struct mali_session_data *session, *tmp; u32 max_window_num = 0; u32 tmp_number = 0; mali_session_lock(); MALI_SESSION_FOREACH(session, tmp, link) { tmp_number = _mali_osk_atomic_xchg( &session->number_of_window_jobs, 0); if (max_window_num < tmp_number) { max_window_num = tmp_number; } } mali_session_unlock(); return max_window_num; } #endif void mali_session_memory_tracking(_mali_osk_print_ctx *print_ctx) { struct mali_session_data *session, *tmp; u32 mali_mem_usage; u32 total_mali_mem_size; MALI_DEBUG_ASSERT_POINTER(print_ctx); mali_session_lock(); MALI_SESSION_FOREACH(session, tmp, link) { _mali_osk_ctxprintf(print_ctx, " %-25s %-10u %-10u %-15u %-15u %-10u %-10u\n", session->comm, session->pid, session->mali_mem_array[MALI_MEM_OS] + session->mali_mem_array[MALI_MEM_BLOCK], session->max_mali_mem_allocated, session->mali_mem_array[MALI_MEM_EXTERNAL], session->mali_mem_array[MALI_MEM_UMP], session->mali_mem_array[MALI_MEM_DMA_BUF]); } mali_session_unlock(); mali_mem_usage = _mali_ukk_report_memory_usage(); total_mali_mem_size = _mali_ukk_report_total_memory_size(); _mali_osk_ctxprintf(print_ctx, "Mali mem usage: %u\nMali mem limit: %u\n", mali_mem_usage, total_mali_mem_size); }
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QFORMLAYOUT_H #define QFORMLAYOUT_H #include <QtWidgets/QLayout> QT_BEGIN_NAMESPACE class QFormLayoutPrivate; class Q_WIDGETS_EXPORT QFormLayout : public QLayout { Q_OBJECT Q_DECLARE_PRIVATE(QFormLayout) Q_PROPERTY(FieldGrowthPolicy fieldGrowthPolicy READ fieldGrowthPolicy WRITE setFieldGrowthPolicy RESET resetFieldGrowthPolicy) Q_PROPERTY(RowWrapPolicy rowWrapPolicy READ rowWrapPolicy WRITE setRowWrapPolicy RESET resetRowWrapPolicy) Q_PROPERTY(Qt::Alignment labelAlignment READ labelAlignment WRITE setLabelAlignment RESET resetLabelAlignment) Q_PROPERTY(Qt::Alignment formAlignment READ formAlignment WRITE setFormAlignment RESET resetFormAlignment) Q_PROPERTY(int horizontalSpacing READ horizontalSpacing WRITE setHorizontalSpacing) Q_PROPERTY(int verticalSpacing READ verticalSpacing WRITE setVerticalSpacing) public: enum FieldGrowthPolicy { FieldsStayAtSizeHint, ExpandingFieldsGrow, AllNonFixedFieldsGrow }; Q_ENUM(FieldGrowthPolicy) enum RowWrapPolicy { DontWrapRows, WrapLongRows, WrapAllRows }; Q_ENUM(RowWrapPolicy) enum ItemRole { LabelRole = 0, FieldRole = 1, SpanningRole = 2 }; Q_ENUM(ItemRole) explicit QFormLayout(QWidget *parent = 0); ~QFormLayout(); void setFieldGrowthPolicy(FieldGrowthPolicy policy); FieldGrowthPolicy fieldGrowthPolicy() const; void setRowWrapPolicy(RowWrapPolicy policy); RowWrapPolicy rowWrapPolicy() const; void setLabelAlignment(Qt::Alignment alignment); Qt::Alignment labelAlignment() const; void setFormAlignment(Qt::Alignment alignment); Qt::Alignment formAlignment() const; void setHorizontalSpacing(int spacing); int horizontalSpacing() const; void setVerticalSpacing(int spacing); int verticalSpacing() const; int spacing() const; void setSpacing(int); void addRow(QWidget *label, QWidget *field); void addRow(QWidget *label, QLayout *field); void addRow(const QString &labelText, QWidget *field); void addRow(const QString &labelText, QLayout *field); void addRow(QWidget *widget); void addRow(QLayout *layout); void insertRow(int row, QWidget *label, QWidget *field); void insertRow(int row, QWidget *label, QLayout *field); void insertRow(int row, const QString &labelText, QWidget *field); void insertRow(int row, const QString &labelText, QLayout *field); void insertRow(int row, QWidget *widget); void insertRow(int row, QLayout *layout); void setItem(int row, ItemRole role, QLayoutItem *item); void setWidget(int row, ItemRole role, QWidget *widget); void setLayout(int row, ItemRole role, QLayout *layout); QLayoutItem *itemAt(int row, ItemRole role) const; void getItemPosition(int index, int *rowPtr, ItemRole *rolePtr) const; void getWidgetPosition(QWidget *widget, int *rowPtr, ItemRole *rolePtr) const; void getLayoutPosition(QLayout *layout, int *rowPtr, ItemRole *rolePtr) const; QWidget *labelForField(QWidget *field) const; QWidget *labelForField(QLayout *field) const; // reimplemented from QLayout void addItem(QLayoutItem *item) Q_DECL_OVERRIDE; QLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE; QLayoutItem *takeAt(int index) Q_DECL_OVERRIDE; void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; QSize minimumSize() const Q_DECL_OVERRIDE; QSize sizeHint() const Q_DECL_OVERRIDE; void invalidate() Q_DECL_OVERRIDE; bool hasHeightForWidth() const Q_DECL_OVERRIDE; int heightForWidth(int width) const Q_DECL_OVERRIDE; Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE; int count() const Q_DECL_OVERRIDE; int rowCount() const; #if 0 void dump() const; #endif private: void resetFieldGrowthPolicy(); void resetRowWrapPolicy(); void resetLabelAlignment(); void resetFormAlignment(); }; QT_END_NAMESPACE #endif
// @(#)root/vmc:$Id$ // Author: Ivana Hrivnacova, 29/04/2014 /************************************************************************* * Copyright (C) 2014, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** #ifndef ROOT_TMCtls #define ROOT_TMCtls // Thread Local Storage typedefs // // According to Geant4 tls.hh and G4Threading.hh // Always build with thread support but keep a possibility to introduce // a build option #define VMC_MULTITHREADED 1 #if ( defined (VMC_MULTITHREADED) ) #if ( ( defined(__MACH__) && defined(__clang__) && defined(__x86_64__) ) || \ ( defined(__MACH__) && defined(__GNUC__) && __GNUC__>=4 && __GNUC_MINOR__>=7 ) || \ defined(__linux__) || defined(_AIX) ) && ( !defined(__CINT__) ) // #if ( defined(__linux__) ) && ( !defined(__CINT__) ) // Multi-threaded build: for POSIX systems #include <pthread.h> #define TMCThreadLocal __thread #else //# error "No Thread Local Storage (TLS) technology supported for this platform. Use sequential build !" #define TMCThreadLocal #endif #else #define TMCThreadLocal #endif #endif //ROOT_TMCtls
/* * Copyright (C) 2013 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 DocumentAnimations_h #define DocumentAnimations_h #include "core/CSSPropertyNames.h" namespace blink { class Document; class Node; class DocumentAnimations { public: static void updateAnimationTimingForAnimationFrame(Document&, double monotonicAnimationStartTime); static bool needsOutdatedAnimationUpdate(const Document&); static void updateAnimationTimingIfNeeded(Document&); static void updateAnimationTimingForGetComputedStyle(Node&, CSSPropertyID); static void updateCompositorAnimations(Document&); private: DocumentAnimations() { } }; } // namespace #endif
/* Allocate input grammar variables for Bison. Copyright (C) 1984, 1986, 1989, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
// -*- C++ -*- //============================================================================= /** * @file os_sysinfo.h * * @author Johnny Willemsen <jwillemsen@remedy.nl> */ //============================================================================= #ifndef ACE_OS_INCLUDE_SYS_OS_SYSINFO_H #define ACE_OS_INCLUDE_SYS_OS_SYSINFO_H #include /**/ "ace/pre.h" #include /**/ "ace/config-lite.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #if defined (ACE_HAS_SYS_SYSINFO_H) # include /**/ <sys/sysinfo.h> #endif /* ACE_HAS_SYS_SYSINFO_H */ #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_SYSINFO_H */
/* * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2013, 2014 Damien P. George * * 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 MICROPY_INCLUDED_STM32_FLASH_H #define MICROPY_INCLUDED_STM32_FLASH_H bool flash_is_valid_addr(uint32_t addr); int32_t flash_get_sector_info(uint32_t addr, uint32_t *start_addr, uint32_t *size); int flash_erase(uint32_t flash_dest, uint32_t num_word32); int flash_write(uint32_t flash_dest, const uint32_t *src, uint32_t num_word32); #endif // MICROPY_INCLUDED_STM32_FLASH_H
/*************************************************************************/ /* packet_peer_udp_winsock.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 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 PACKET_PEER_UDP_WINSOCK_H #define PACKET_PEER_UDP_WINSOCK_H #include "io/packet_peer_udp.h" #include "ring_buffer.h" class PacketPeerUDPWinsock : public PacketPeerUDP { enum { PACKET_BUFFER_SIZE = 65536 }; mutable RingBuffer<uint8_t> rb; uint8_t recv_buffer[PACKET_BUFFER_SIZE]; mutable uint8_t packet_buffer[PACKET_BUFFER_SIZE]; mutable IP_Address packet_ip; mutable int packet_port; mutable int queue_count; int sockfd; bool sock_blocking; IP::Type sock_type; IP_Address peer_addr; int peer_port; _FORCE_INLINE_ int _get_socket(); static PacketPeerUDP *_create(); void _set_sock_blocking(bool p_blocking); Error _poll(bool p_wait); public: virtual int get_available_packet_count() const; virtual Error get_packet(const uint8_t **r_buffer, int &r_buffer_size) const; virtual Error put_packet(const uint8_t *p_buffer, int p_buffer_size); virtual int get_max_packet_size() const; virtual Error listen(int p_port, IP_Address p_bind_address = IP_Address("*"), int p_recv_buffer_size = 65536); virtual void close(); virtual Error wait(); virtual bool is_listening() const; virtual IP_Address get_packet_address() const; virtual int get_packet_port() const; virtual void set_dest_address(const IP_Address &p_address, int p_port); static void make_default(); PacketPeerUDPWinsock(); ~PacketPeerUDPWinsock(); }; #endif // PACKET_PEER_UDP_WINSOCK_H
/** * @file * * @brief POSIX 1003.1b 6.4.2 - Write to a File * @ingroup libcsupport */ /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.org/license/LICENSE. */ #if HAVE_CONFIG_H #include "config.h" #endif #include <rtems/libio_.h> #include <rtems/seterr.h> /* * _write_r * * This is the Newlib dependent reentrant version of write(). */ #if defined(RTEMS_NEWLIB) #include <reent.h> _ssize_t _write_r( struct _reent *ptr __attribute__((unused)), int fd, const void *buf, size_t nbytes ) { return write( fd, buf, nbytes ); } #endif
/* * hpd_omap3630.c * * HPD library support functions for TI OMAP3 processors. * * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/ * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation. * * 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 <linux/kernel.h> #include <linux/err.h> #include <linux/io.h> #include <linux/mutex.h> #include <linux/module.h> #include <video/omapdss.h> #include <linux/switch.h> #include <linux/gpio.h> #include <linux/debugfs.h> #include <linux/delay.h> #include "dss.h" static struct { struct mutex hpd_lock; struct switch_dev hpd_switch; } hpd; enum { DISPLAY_LCD_STATE_ON, DISPLAY_HDMI_STATE_ON, DISPLAY_TV_STATE_ON, INVALID_DISPLAY_STATE, }; static struct hpd_worker_data { struct delayed_work dwork; atomic_t state; } hpd_work; static struct workqueue_struct *my_workq; static void hotplug_detect_worker(struct work_struct *work) { struct hpd_worker_data *d = container_of(work, typeof(*d), dwork.work); struct omap_dss_device *dssdev = NULL; int state = atomic_read(&d->state); int match(struct omap_dss_device *dssdev, void *arg) { return sysfs_streq(dssdev->name , "hdmi"); } dssdev = omap_dss_find_device(NULL, match); pr_err("in hpd work %d, state=%d\n", state, dssdev->state); if (dssdev == NULL) return; mutex_lock(&hpd.hpd_lock); switch_set_state(&hpd.hpd_switch, state); mutex_unlock(&hpd.hpd_lock); } int hpd_panel_handler(int hpd) { __cancel_delayed_work(&hpd_work.dwork); atomic_set(&hpd_work.state, hpd); queue_delayed_work(my_workq, &hpd_work.dwork, msecs_to_jiffies(hpd ? 30 : 40)); return 0; } static int lcd_enable(void *data, u64 val) { hpd_panel_handler(DISPLAY_LCD_STATE_ON); return 0; } static int hdmi_enable(void *data, u64 val) { hpd_panel_handler(DISPLAY_HDMI_STATE_ON); return 0; } static int tv_out_enable(void *data, u64 val) { hpd_panel_handler(DISPLAY_TV_STATE_ON); return 0; } DEFINE_SIMPLE_ATTRIBUTE(pm_lcd_fops, NULL, lcd_enable, "%llu\n"); DEFINE_SIMPLE_ATTRIBUTE(pm_hdmi_fops, NULL, hdmi_enable, "%llu\n"); DEFINE_SIMPLE_ATTRIBUTE(pm_tv_fops, NULL, tv_out_enable, "%llu\n"); int hpd_panel_init(void) { struct dentry *dbg_dir_hpd; mutex_init(&hpd.hpd_lock); hpd.hpd_switch.name = "display_support"; switch_dev_register(&hpd.hpd_switch); my_workq = create_singlethread_workqueue("display_hotplug"); INIT_DELAYED_WORK(&hpd_work.dwork, hotplug_detect_worker); dbg_dir_hpd = debugfs_create_dir("hpd_support", NULL); (void) debugfs_create_file("switch_to_hdmi", S_IRUGO | S_IWUSR, dbg_dir_hpd, NULL, &pm_hdmi_fops); (void) debugfs_create_file("switch_to_lcd", S_IRUGO | S_IWUSR, dbg_dir_hpd, NULL, &pm_lcd_fops); (void) debugfs_create_file("switch_to_tv", S_IRUGO | S_IWUSR, dbg_dir_hpd, NULL, &pm_tv_fops); return 0; } int hpd_panel_exit(void) { destroy_workqueue(my_workq); switch_dev_unregister(&hpd.hpd_switch); return 0; }
/* * Generated by class-dump 3.1.1. * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2006 by Steve Nygard. */ #import <BackRow/BRRenderer.h> @class BRRenderContext, BRRenderScene; @interface BRWindowRenderer : BRRenderer { struct CGRect _frame; unsigned int _window; unsigned int _dvdWindow; BRRenderScene *_scene; BRRenderContext *_context; BOOL _captureDisplays; BOOL _draggable; BOOL _opaque; } - (id)initCapturingDisplays:(BOOL)fp8; - (void)dealloc; - (id)scene; - (void)orderIn; - (void)orderOut; - (unsigned int)createDVDWindow; - (void)showDVDWindow:(unsigned int)fp8; - (void)hideDVDWindow:(unsigned int)fp8; - (void)destroyDVDWindow:(unsigned int)fp8; @end
// // CPJSONParser.h // CoreParse // // Created by Tom Davie on 29/03/2011. // Copyright 2011 In The Beginning... All rights reserved. // #import <Foundation/Foundation.h> /** * The CPJSONParser class is a demonstration of CoreParse. * * The parser deals with all JSON except for unicode encoded characters. The reason for not dealing with this corner case is that this parser is simply to demonstrate how to use CoreParse, and * the code needed to process unicode characters is non-trivial, and not particularly relevant to the demonstration. */ @interface CPJSONParser : NSObject /** * Parses a JSON string and returns a standard objective-c data structure reflecting it: * * JSON numbers and booleans are returned as NSNumbers; JSON strings as NSStrings; `null` as an NSNull object; JSON arrays are returned as NSArrays; finally JSON objects are returned as NSDictionarys. * * @param json The JSON string to parse. */ - (id<NSObject>)parse:(NSString *)json; @end
/*========================================================================= * * Copyright Insight Software Consortium * * 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 itkQuadEdgeMeshExtendedTraits_h #define itkQuadEdgeMeshExtendedTraits_h #include "itkCellInterface.h" #include "itkQuadEdgeCellTraitsInfo.h" #include <set> namespace itk { /** * \class QuadEdgeMeshExtendedTraits * \ingroup QEMeshObjects * * \brief Extended traits for a QuadEdgeMesh. * * QuadEdgeMeshExtendedTraits is a simple structure that holds type information * for a QuadEdgeMesh and its cells. It is used to avoid the passing * of many template parameters while still enjoying the benefits of generic * programming. * * \tparam TCoordRep * Numerical type with which to represent each coordinate value. * * \tparam VPointDimension * Geometric dimension of space. * * \tparam VMaxTopologicalDimension * Max topological dimension of a cell that can be inserted into this mesh. * * \tparam TPixelType * The type stored as data for vertices. * * \tparam TPData * The type stored as data for the primal edges. * * \tparam TDData * The type stored as data for the dual edges. * * \tparam TCellPixelType * The type associated with every cell. * * \ingroup ITKQuadEdgeMesh */ template< typename TPixelType = float, unsigned int VPointDimension = 3, unsigned int VMaxTopologicalDimension = VPointDimension, typename TCoordRep = float, typename TInterpolationWeightType = float, typename TCellPixelType = TPixelType, typename TPData = bool, typename TDData = bool > class QuadEdgeMeshExtendedTraits { public: typedef QuadEdgeMeshExtendedTraits Self; /** Save the template parameters. */ typedef TCoordRep CoordRepType; typedef TPixelType PixelType; typedef TPData PrimalDataType; typedef TDData DualDataType; typedef TCellPixelType CellPixelType; /** Save all the template parameters. */ itkStaticConstMacro(PointDimension, unsigned int, VPointDimension); itkStaticConstMacro(MaxTopologicalDimension, unsigned int, VPointDimension); typedef TInterpolationWeightType InterpolationWeightType; /** The type to be used to identify a point. This should be the index type * to the PointsContainer. */ typedef IdentifierType PointIdentifier; /** The type to be used to identify a cell. This should be the index type * to the CellsContainer. */ typedef IdentifierType CellIdentifier; /** A type that can be used to identifiy individual boundary features on * the cells. Since this will probably be an index into a static array, * this will probably never change from an integer setting. */ typedef IdentifierType CellFeatureIdentifier; /** The container type that will be used to store boundary links * back to cells. This must conform to the STL "set" interface. */ typedef std::set< CellIdentifier > UsingCellsContainer; /** The CellLinks container should be a container of PointCellLinksContainer, * which should be a container conforming to the STL "set" interface. */ typedef std::set< CellIdentifier > PointCellLinksContainer; /** Quad edge typedefs. */ typedef GeometricalQuadEdge< PointIdentifier, CellIdentifier, PrimalDataType, DualDataType > QEPrimal; typedef typename QEPrimal::DualType QEDual; typedef typename QEPrimal::OriginRefType VertexRefType; typedef typename QEPrimal::DualOriginRefType FaceRefType; /** The type of point used by the mesh. This should never change from * this setting, regardless of the mesh type. Points have an entry * in the Onext ring */ typedef QuadEdgeMeshPoint< CoordRepType, VPointDimension, QEPrimal > PointType; typedef Point< CoordRepType, VPointDimension > PointHashType; /** The container type for use in storing points. It must conform to * the IndexedContainer interface. */ typedef MapContainer< PointIdentifier, PointType > PointsContainer; /** Standard itk cell interface. */ typedef QuadEdgeMeshCellTraitsInfo< VPointDimension, CoordRepType, InterpolationWeightType, PointIdentifier, CellIdentifier, CellFeatureIdentifier, PointType, PointsContainer, UsingCellsContainer, QEPrimal > CellTraits; /** The interface to cells to be used by the mesh. */ typedef CellInterface< CellPixelType, CellTraits > CellType; typedef typename CellType::CellAutoPointer CellAutoPointer; /** Containers types. */ typedef MapContainer< PointIdentifier, PointCellLinksContainer > CellLinksContainer; typedef MapContainer< CellIdentifier, CellType * > CellsContainer; typedef MapContainer< PointIdentifier, PixelType > PointDataContainer; typedef MapContainer< CellIdentifier, CellPixelType > CellDataContainer; /** Other useful types. */ typedef typename PointType::VectorType VectorType; }; } // enamespace #endif // eof - itkQuadEdgeMeshExtendedTraits.h
/**************************************************************************** Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org 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 __COCOSGUI_H__ #define __COCOSGUI_H__ #include "ui/UIWidget.h" #include "ui/UILayout.h" #include "ui/UIButton.h" #include "ui/UICheckBox.h" #include "ui/UIRadioButton.h" #include "ui/UIImageView.h" #include "ui/UIText.h" #include "ui/UITextAtlas.h" #include "ui/UILoadingBar.h" #include "ui/UIScrollView.h" #include "ui/UIListView.h" #include "ui/UISlider.h" #include "ui/UITextField.h" #include "ui/UITextBMFont.h" #include "ui/UIPageView.h" #include "ui/UIHelper.h" #include "ui/UIRichText.h" #include "ui/UIHBox.h" #include "ui/UIVBox.h" #include "ui/UIRelativeBox.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) #include "ui/UIVideoPlayer.h" #endif #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) #include "ui/UIWebView.h" #endif #include "ui/UIDeprecated.h" #include "ui/GUIExport.h" #include "ui/UIScale9Sprite.h" #include "ui/UIEditBox/UIEditBox.h" #include "ui/UILayoutComponent.h" #include "ui/UITabControl.h" #include "editor-support/cocostudio/CocosStudioExtension.h" /** * @addtogroup ui * @{ */ NS_CC_BEGIN namespace ui { /** * Get current cocos GUI module version string. *@return A string representation of GUI module version number */ CC_GUI_DLL const char* CocosGUIVersion(); } NS_CC_END // end of ui group /// @} #endif /* defined(__CocosGUITest__Cocos__) */
#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( /* Main layer */ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,\ MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENTER, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_BSLS, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_BSPC \ ), [1] = LAYOUT( /* FN_Layer */ KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ KC_CAPS, KC_PGUP, KC_UP, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK,KC_PAUS,\ KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_HOME, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_DEL, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL \ ) };
/** * Copyright (C) ARM Limited 2013-2015. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef EVENTS_XML #define EVENTS_XML #include "mxml/mxml.h" class EventsXML { public: EventsXML() {} mxml_node_t *getTree(); char *getXML(); void write(const char* path); private: // Intentionally unimplemented EventsXML(const EventsXML &); EventsXML &operator=(const EventsXML &); }; #endif // EVENTS_XML
#include "ClkSpy.h" struct clk *clk_get(struct device *dev, const char *id){ return (struct clk*)malloc(sizeof(struct clk)); } int clk_enable(struct clk *clk){ return 0; } void clk_disable(struct clk *clk){ } void clk_put(struct clk *clk){ free((void*)clk); } int clk_prepare(struct clk *clk) { return 0; }
/* Routines for handling XML generic OS data provided by target. Copyright (C) 2008-2012 Free Software Foundation, Inc. This file is part of GDB. 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 OSDATA_H #define OSDATA_H #include "vec.h" typedef struct osdata_column { char *name; char *value; } osdata_column_s; DEF_VEC_O(osdata_column_s); typedef struct osdata_item { VEC(osdata_column_s) *columns; } osdata_item_s; DEF_VEC_O(osdata_item_s); struct osdata { char *type; VEC(osdata_item_s) *items; }; typedef struct osdata *osdata_p; DEF_VEC_P(osdata_p); struct osdata *osdata_parse (const char *xml); void osdata_free (struct osdata *); struct cleanup *make_cleanup_osdata_free (struct osdata *data); struct osdata *get_osdata (const char *type); const char *get_osdata_column (struct osdata_item *item, const char *name); void info_osdata_command (char *type, int from_tty); #endif /* OSDATA_H */
/* { dg-do compile } */ /* { dg-csky-options "-O2" } */ /* Test that the two comparisons are combined. This was formerly handled by a no-longer-present target-specific pass and is now supposed to be handled by generic CSE. */ int e1, e2; void func (int a, int b, int c, int d, int f, int g) { e1 = a > b ? f : g; e2 = a > b ? c : d; return; } /* { dg-final { scan-assembler-times "cmp" 1 } } */
/* * Copyright (c) 1988 The Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS 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. */ #include <string.h> #include <unistd.h> #include <utmp.h> #include <fcntl.h> #include <sys/stat.h> #include "logwtmp.h" void logwtmp(const char *line, const char *name, const char *host) { #ifdef WTMP struct utmp ut; struct stat buf; int fd; if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) < 0) return; if (fstat(fd, &buf) == 0) { ut.ut_pid = getpid(); ut.ut_type = (name[0] != '\0')? USER_PROCESS : DEAD_PROCESS; strncpy(ut.ut_id, "", 2); strncpy(ut.ut_line, line, sizeof(ut.ut_line)); strncpy(ut.ut_name, name, sizeof(ut.ut_name)); strncpy(ut.ut_host, host, sizeof(ut.ut_host)); time(&ut.ut_time); if (write(fd, &ut, sizeof(struct utmp)) != sizeof(struct utmp)) ftruncate(fd, buf.st_size); } close(fd); #endif }
/* Copyright (C) 2006 Openismus GmbH * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __GTK_IM_CONTEXT_MULTIPRESS_H__ #define __GTK_IM_CONTEXT_MULTIPRESS_H__ #include <gtk/gtk.h> G_BEGIN_DECLS #define GTK_TYPE_IM_CONTEXT_MULTIPRESS (gtk_im_context_multipress_get_type ()) #define GTK_IM_CONTEXT_MULTIPRESS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_IM_CONTEXT_MULTIPRESS, GtkImContextMultipress)) #define GTK_IM_CONTEXT_MULTIPRESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_IM_CONTEXT_MULTIPRESS, GtkImContextMultipressClass)) #define GTK_IS_IM_CONTEXT_MULTIPRESS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_IM_CONTEXT_MULTIPRESS)) #define GTK_IS_IM_CONTEXT_MULTIPRESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IM_CONTEXT_MULTIPRESS)) #define GTK_IM_CONTEXT_MULTIPRESS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_IM_CONTEXT_MULTIPRESS, GtkImContextMultipressClass)) typedef struct _GtkImContextMultipress GtkImContextMultipress; /* This input method allows multi-press character input, like that found on * mobile phones. * * This is based on GtkImContextSimple, which allows "compose" based on * sequences of characters. But instead the character sequences are defined * by lists of characters for a key, so that repeated pressing of the same key * can cycle through the possible output characters, with automatic choosing * of the character after a time delay. */ struct _GtkImContextMultipress { /*< private >*/ GtkIMContext parent; /* Sequence information, loaded from the configuration file: */ GHashTable* key_sequences; gsize dummy; /* ABI-preserving placeholder */ /* The last character entered so far during a compose. * If this is NULL then we are not composing yet. */ guint key_last_entered; /* The position of the compose in the possible sequence. * For instance, this is 2 if aa has been pressed to show b (from abc0). */ guint compose_count; guint timeout_id; /* The character(s) that will be used if it the current character(s) is accepted: */ const gchar *tentative_match; }; typedef struct _GtkImContextMultipressClass GtkImContextMultipressClass; struct _GtkImContextMultipressClass { GtkIMContextClass parent_class; }; void gtk_im_context_multipress_register_type (GTypeModule* type_module); GType gtk_im_context_multipress_get_type (void); GtkIMContext *gtk_im_context_multipress_new (void); G_END_DECLS #endif /* __GTK_IM_CONTEXT_MULTIPRESS_H__ */
/**************************************************************************** * * Copyright 2020 Samsung Electronics All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the License. * ****************************************************************************/ #ifndef SSS_DRIVER_RNG_H #define SSS_DRIVER_RNG_H /*************** Include Files ********************************************/ #include "sss_common.h" #include "mb_cmd_rng.h" #include "mb_cmd_system.h" /*************** Assertions ***********************************************/ /*************** Definitions / Macros *************************************/ /*************** New Data Types (Basic Data Types) ***********************/ /*************** New Data Types *******************************************/ /*************** Constants ************************************************/ /*************** Variable declarations ************************************/ /*************** Functions ***********************************************/ unsigned int sss_generate_random(stOCTET_STRING *pstRandom, unsigned int request_byte_len); unsigned int sss_generate_rawrandom(stOCTET_STRING *pstRandom, unsigned int request_byte_len); unsigned int sss_KAT_RNG(void); #endif /* SSS_DRIVER_RNG_H */
#ifndef ALIMLMODELHANDLER_H #define ALIMLMODELHANDLER_H // Copyright CERN. This software is distributed under the terms of the GNU // General Public License v3 (GPL Version 3). // // See http://www.gnu.org/licenses/ for full licensing information. // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// \file AliMLModelHandler.h /// \brief Utility class to store the compiled model and it's information /// \author pietro.fecchio@cern.ch, maximiliano.puccio@cern.ch, fabio.catalano@cern.ch #include <string> #include "TNamed.h" namespace YAML { class Node; } class AliExternalBDT; class AliMLModelHandler : public TNamed { public: enum {kXGBoost, kLightGBM, kModelLibrary}; enum {kLowerCut, kUpperCut}; AliMLModelHandler(); AliMLModelHandler(const YAML::Node &node); virtual ~AliMLModelHandler(); AliMLModelHandler(const AliMLModelHandler &source); AliMLModelHandler &operator=(const AliMLModelHandler &source); AliExternalBDT *GetModel() { return fModel; } std::string const &GetPath() const { return fPath; } std::string const &GetLibrary() const { return fLibrary; } std::vector<double> const &GetScoreCut() const { return fScoreCut; } std::vector<int> const &GetScoreCutOpt() const { return fScoreCutOpt; } bool CompileModel(); static std::string ImportFile(std::string path); private: AliExternalBDT *fModel; //!<! std::string fPath; /// std::string fLibrary; /// std::vector<double> fScoreCut; /// vector of cuts to be applied on output scores std::vector<int> fScoreCutOpt; /// vector of options on output scores ("upper" or "lower") /// \cond CLASSIMP ClassDef(AliMLModelHandler, 2); /// /// \endcond }; #endif
// RUN: %clang_cc1 -triple arm64-none-linux-gnu -emit-llvm -o - %s | FileCheck %s // The only part clang really deals with is the lvalue/rvalue // distinction on constraints. It's sufficient to emit llvm and make // sure that's sane. long var; void test_generic_constraints(int var32, long var64) { asm("add %0, %1, %1" : "=r"(var32) : "0"(var32)); // CHECK: [[R32_ARG:%[a-zA-Z0-9]+]] = load i32, i32* // CHECK: call i32 asm "add $0, $1, $1", "=r,0"(i32 [[R32_ARG]]) asm("add %0, %1, %1" : "=r"(var64) : "0"(var64)); // CHECK: [[R32_ARG:%[a-zA-Z0-9]+]] = load i64, i64* // CHECK: call i64 asm "add $0, $1, $1", "=r,0"(i64 [[R32_ARG]]) asm("ldr %0, %1" : "=r"(var32) : "m"(var)); asm("ldr %0, [%1]" : "=r"(var64) : "r"(&var)); // CHECK: call i32 asm "ldr $0, $1", "=r,*m"(i64* @var) // CHECK: call i64 asm "ldr $0, [$1]", "=r,r"(i64* @var) } float f; double d; void test_constraint_w() { asm("fadd %s0, %s1, %s1" : "=w"(f) : "w"(f)); // CHECK: [[FLT_ARG:%[a-zA-Z_0-9]+]] = load float, float* @f // CHECK: call float asm "fadd ${0:s}, ${1:s}, ${1:s}", "=w,w"(float [[FLT_ARG]]) asm("fadd %d0, %d1, %d1" : "=w"(d) : "w"(d)); // CHECK: [[DBL_ARG:%[a-zA-Z_0-9]+]] = load double, double* @d // CHECK: call double asm "fadd ${0:d}, ${1:d}, ${1:d}", "=w,w"(double [[DBL_ARG]]) } void test_constraints_immed(void) { asm("add x0, x0, %0" : : "I"(4095) : "x0"); asm("and w0, w0, %0" : : "K"(0xaaaaaaaa) : "w0"); asm("and x0, x0, %0" : : "L"(0xaaaaaaaaaaaaaaaa) : "x0"); // CHECK: call void asm sideeffect "add x0, x0, $0", "I,~{x0}"(i32 4095) // CHECK: call void asm sideeffect "and w0, w0, $0", "K,~{w0}"(i32 -1431655766) // CHECK: call void asm sideeffect "and x0, x0, $0", "L,~{x0}"(i64 -6148914691236517206) } void test_constraint_S(void) { int *addr; asm("adrp %0, %1\n\t" "add %0, %0, :lo12:%1" : "=r"(addr) : "S"(&var)); // CHECK: call i32* asm "adrp $0, $1\0A\09add $0, $0, :lo12:$1", "=r,S"(i64* @var) } void test_constraint_Q(void) { int val; asm("ldxr %0, %1" : "=r"(val) : "Q"(var)); // CHECK: call i32 asm "ldxr $0, $1", "=r,*Q"(i64* @var) } void test_gcc_registers(void) { register unsigned long reg0 asm("r0") = 0; register unsigned long reg1 asm("r1") = 1; register unsigned int reg29 asm("r29") = 2; register unsigned int reg30 asm("r30") = 3; // Test remapping register names in register ... asm("rN") statments. // rN register operands in these two inline assembly lines // should get renamed to valid AArch64 registers. asm volatile("hvc #0" : : "r" (reg0), "r" (reg1)); // CHECK: call void asm sideeffect "hvc #0", "{x0},{x1}" asm volatile("hvc #0" : : "r" (reg29), "r" (reg30)); // CHECK: call void asm sideeffect "hvc #0", "{fp},{lr}" // rN registers when used without register ... asm("rN") syntax // should not be remapped. asm volatile("mov r0, r1\n"); // CHECK: call void asm sideeffect "mov r0, r1\0A", ""() }
#include <linux/export.h> #include <linux/interrupt.h> #include <linux/mutex.h> #include <linux/kernel.h> #include <linux/spi/spi.h> #include <linux/slab.h> #include "../iio.h" #include "../ring_sw.h" #include "../trigger_consumer.h" #include "adis16240.h" /** * adis16240_read_ring_data() read data registers which will be placed into ring * @dev: device associated with child of actual device (iio_dev or iio_trig) * @rx: somewhere to pass back the value read **/ static int adis16240_read_ring_data(struct device *dev, u8 *rx) { struct spi_message msg; struct iio_dev *indio_dev = dev_get_drvdata(dev); struct adis16240_state *st = iio_priv(indio_dev); struct spi_transfer xfers[ADIS16240_OUTPUTS + 1]; int ret; int i; mutex_lock(&st->buf_lock); spi_message_init(&msg); memset(xfers, 0, sizeof(xfers)); for (i = 0; i <= ADIS16240_OUTPUTS; i++) { xfers[i].bits_per_word = 8; xfers[i].cs_change = 1; xfers[i].len = 2; xfers[i].delay_usecs = 30; xfers[i].tx_buf = st->tx + 2 * i; st->tx[2 * i] = ADIS16240_READ_REG(ADIS16240_SUPPLY_OUT + 2 * i); st->tx[2 * i + 1] = 0; if (i >= 1) xfers[i].rx_buf = rx + 2 * (i - 1); spi_message_add_tail(&xfers[i], &msg); } ret = spi_sync(st->us, &msg); if (ret) dev_err(&st->us->dev, "problem when burst reading"); mutex_unlock(&st->buf_lock); return ret; } static irqreturn_t adis16240_trigger_handler(int irq, void *p) { struct iio_poll_func *pf = p; struct iio_dev *indio_dev = pf->indio_dev; struct adis16240_state *st = iio_priv(indio_dev); struct iio_buffer *ring = indio_dev->buffer; int i = 0; s16 *data; size_t datasize = ring->access->get_bytes_per_datum(ring); data = kmalloc(datasize, GFP_KERNEL); if (data == NULL) { dev_err(&st->us->dev, "memory alloc failed in ring bh"); return -ENOMEM; } if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) && adis16240_read_ring_data(&indio_dev->dev, st->rx) >= 0) for (; i < bitmap_weight(indio_dev->active_scan_mask, indio_dev->masklength); i++) data[i] = be16_to_cpup((__be16 *)&(st->rx[i*2])); /* Guaranteed to be aligned with 8 byte boundary */ if (ring->scan_timestamp) *((s64 *)(data + ((i + 3)/4)*4)) = pf->timestamp; ring->access->store_to(ring, (u8 *)data, pf->timestamp); iio_trigger_notify_done(indio_dev->trig); kfree(data); return IRQ_HANDLED; } void adis16240_unconfigure_ring(struct iio_dev *indio_dev) { iio_dealloc_pollfunc(indio_dev->pollfunc); iio_sw_rb_free(indio_dev->buffer); } static const struct iio_buffer_setup_ops adis16240_ring_setup_ops = { .preenable = &iio_sw_buffer_preenable, .postenable = &iio_triggered_buffer_postenable, .predisable = &iio_triggered_buffer_predisable, }; int adis16240_configure_ring(struct iio_dev *indio_dev) { int ret = 0; struct iio_buffer *ring; ring = iio_sw_rb_allocate(indio_dev); if (!ring) { ret = -ENOMEM; return ret; } indio_dev->buffer = ring; ring->scan_timestamp = true; indio_dev->setup_ops = &adis16240_ring_setup_ops; indio_dev->pollfunc = iio_alloc_pollfunc(&iio_pollfunc_store_time, &adis16240_trigger_handler, IRQF_ONESHOT, indio_dev, "%s_consumer%d", indio_dev->name, indio_dev->id); if (indio_dev->pollfunc == NULL) { ret = -ENOMEM; goto error_iio_sw_rb_free; } indio_dev->modes |= INDIO_BUFFER_TRIGGERED; return 0; error_iio_sw_rb_free: iio_sw_rb_free(indio_dev->buffer); return ret; }
#import <Foundation/Foundation.h> @class NMBExpectation; @class NMBObjCBeCloseToMatcher; @class NMBObjCRaiseExceptionMatcher; @protocol NMBMatcher; #define NIMBLE_EXPORT FOUNDATION_EXPORT #ifdef NIMBLE_DISABLE_SHORT_SYNTAX #define NIMBLE_SHORT(PROTO, ORIGINAL) #else #define NIMBLE_SHORT(PROTO, ORIGINAL) FOUNDATION_STATIC_INLINE PROTO { return (ORIGINAL); } #endif NIMBLE_EXPORT NMBExpectation *NMB_expect(id(^actualBlock)(), NSString *file, NSUInteger line); NIMBLE_EXPORT NMBExpectation *NMB_expectAction(void(^actualBlock)(), NSString *file, NSUInteger line); NIMBLE_EXPORT id<NMBMatcher> NMB_equal(id expectedValue); NIMBLE_SHORT(id<NMBMatcher> equal(id expectedValue), NMB_equal(expectedValue)); NIMBLE_EXPORT id<NMBMatcher> NMB_haveCount(id expectedValue); NIMBLE_SHORT(id<NMBMatcher> haveCount(id expectedValue), NMB_haveCount(expectedValue)); NIMBLE_EXPORT NMBObjCBeCloseToMatcher *NMB_beCloseTo(NSNumber *expectedValue); NIMBLE_SHORT(NMBObjCBeCloseToMatcher *beCloseTo(id expectedValue), NMB_beCloseTo(expectedValue)); NIMBLE_EXPORT id<NMBMatcher> NMB_beAnInstanceOf(Class expectedClass); NIMBLE_SHORT(id<NMBMatcher> beAnInstanceOf(Class expectedClass), NMB_beAnInstanceOf(expectedClass)); NIMBLE_EXPORT id<NMBMatcher> NMB_beAKindOf(Class expectedClass); NIMBLE_SHORT(id<NMBMatcher> beAKindOf(Class expectedClass), NMB_beAKindOf(expectedClass)); NIMBLE_EXPORT id<NMBMatcher> NMB_beginWith(id itemElementOrSubstring); NIMBLE_SHORT(id<NMBMatcher> beginWith(id itemElementOrSubstring), NMB_beginWith(itemElementOrSubstring)); NIMBLE_EXPORT id<NMBMatcher> NMB_beGreaterThan(NSNumber *expectedValue); NIMBLE_SHORT(id<NMBMatcher> beGreaterThan(NSNumber *expectedValue), NMB_beGreaterThan(expectedValue)); NIMBLE_EXPORT id<NMBMatcher> NMB_beGreaterThanOrEqualTo(NSNumber *expectedValue); NIMBLE_SHORT(id<NMBMatcher> beGreaterThanOrEqualTo(NSNumber *expectedValue), NMB_beGreaterThanOrEqualTo(expectedValue)); NIMBLE_EXPORT id<NMBMatcher> NMB_beIdenticalTo(id expectedInstance); NIMBLE_SHORT(id<NMBMatcher> beIdenticalTo(id expectedInstance), NMB_beIdenticalTo(expectedInstance)); NIMBLE_EXPORT id<NMBMatcher> NMB_beLessThan(NSNumber *expectedValue); NIMBLE_SHORT(id<NMBMatcher> beLessThan(NSNumber *expectedValue), NMB_beLessThan(expectedValue)); NIMBLE_EXPORT id<NMBMatcher> NMB_beLessThanOrEqualTo(NSNumber *expectedValue); NIMBLE_SHORT(id<NMBMatcher> beLessThanOrEqualTo(NSNumber *expectedValue), NMB_beLessThanOrEqualTo(expectedValue)); NIMBLE_EXPORT id<NMBMatcher> NMB_beTruthy(void); NIMBLE_SHORT(id<NMBMatcher> beTruthy(void), NMB_beTruthy()); NIMBLE_EXPORT id<NMBMatcher> NMB_beFalsy(void); NIMBLE_SHORT(id<NMBMatcher> beFalsy(void), NMB_beFalsy()); NIMBLE_EXPORT id<NMBMatcher> NMB_beTrue(void); NIMBLE_SHORT(id<NMBMatcher> beTrue(void), NMB_beTrue()); NIMBLE_EXPORT id<NMBMatcher> NMB_beFalse(void); NIMBLE_SHORT(id<NMBMatcher> beFalse(void), NMB_beFalse()); NIMBLE_EXPORT id<NMBMatcher> NMB_beNil(void); NIMBLE_SHORT(id<NMBMatcher> beNil(void), NMB_beNil()); NIMBLE_EXPORT id<NMBMatcher> NMB_beEmpty(void); NIMBLE_SHORT(id<NMBMatcher> beEmpty(void), NMB_beEmpty()); NIMBLE_EXPORT id<NMBMatcher> NMB_containWithNilTermination(id itemOrSubstring, ...) NS_REQUIRES_NIL_TERMINATION; #define NMB_contain(...) NMB_containWithNilTermination(__VA_ARGS__, nil) #ifndef NIMBLE_DISABLE_SHORT_SYNTAX #define contain(...) NMB_contain(__VA_ARGS__) #endif NIMBLE_EXPORT id<NMBMatcher> NMB_endWith(id itemElementOrSubstring); NIMBLE_SHORT(id<NMBMatcher> endWith(id itemElementOrSubstring), NMB_endWith(itemElementOrSubstring)); NIMBLE_EXPORT NMBObjCRaiseExceptionMatcher *NMB_raiseException(void); NIMBLE_SHORT(NMBObjCRaiseExceptionMatcher *raiseException(void), NMB_raiseException()); NIMBLE_EXPORT id<NMBMatcher> NMB_match(id expectedValue); NIMBLE_SHORT(id<NMBMatcher> match(id expectedValue), NMB_match(expectedValue)); NIMBLE_EXPORT id<NMBMatcher> NMB_allPass(id matcher); NIMBLE_SHORT(id<NMBMatcher> allPass(id matcher), NMB_allPass(matcher)); NIMBLE_EXPORT id<NMBMatcher> NMB_satisfyAnyOfWithMatchers(id matchers); #define NMB_satisfyAnyOf(...) NMB_satisfyAnyOfWithMatchers(@[__VA_ARGS__]) #ifndef NIMBLE_DISABLE_SHORT_SYNTAX #define satisfyAnyOf(...) NMB_satisfyAnyOf(__VA_ARGS__) #endif // In order to preserve breakpoint behavior despite using macros to fill in __FILE__ and __LINE__, // define a builder that populates __FILE__ and __LINE__, and returns a block that takes timeout // and action arguments. See https://github.com/Quick/Quick/pull/185 for details. typedef void (^NMBWaitUntilTimeoutBlock)(NSTimeInterval timeout, void (^action)(void (^)(void))); typedef void (^NMBWaitUntilBlock)(void (^action)(void (^)(void))); NIMBLE_EXPORT void NMB_failWithMessage(NSString *msg, NSString *file, NSUInteger line); NIMBLE_EXPORT NMBWaitUntilTimeoutBlock NMB_waitUntilTimeoutBuilder(NSString *file, NSUInteger line); NIMBLE_EXPORT NMBWaitUntilBlock NMB_waitUntilBuilder(NSString *file, NSUInteger line); NIMBLE_EXPORT void NMB_failWithMessage(NSString *msg, NSString *file, NSUInteger line); #define NMB_waitUntilTimeout NMB_waitUntilTimeoutBuilder(@(__FILE__), __LINE__) #define NMB_waitUntil NMB_waitUntilBuilder(@(__FILE__), __LINE__) #ifndef NIMBLE_DISABLE_SHORT_SYNTAX #define expect(...) NMB_expect(^id{ return (__VA_ARGS__); }, @(__FILE__), __LINE__) #define expectAction(BLOCK) NMB_expectAction((BLOCK), @(__FILE__), __LINE__) #define failWithMessage(msg) NMB_failWithMessage(msg, @(__FILE__), __LINE__) #define fail() failWithMessage(@"fail() always fails") #define waitUntilTimeout NMB_waitUntilTimeout #define waitUntil NMB_waitUntil #endif
#ifndef AC_GEPLIN2D_H #define AC_GEPLIN2D_H // // (C) Copyright 1993-1999 by Autodesk, Inc. // // Permission to use, copy, modify, and distribute this software in // object code form for any purpose and without fee is hereby granted, // provided that the above copyright notice appears in all copies and // that both that copyright notice and the limited warranty and // restricted rights notice below appear in all supporting // documentation. // // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE // UNINTERRUPTED OR ERROR FREE. // // Use, duplication, or disclosure by the U.S. Government is subject to // restrictions set forth in FAR 52.227-19 (Commercial Computer // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) // (Rights in Technical Data and Computer Software), as applicable. // // DESCRIPTION: // // This file contains the class AcGePolyline2d - A mathematical entity // used to represent a different types of spline curves in 3-space. #include "gecurv2d.h" #include "gekvec.h" #include "gept2dar.h" #include "gevec2d.h" #include "gepnt2d.h" #include "gesent2d.h" #pragma pack (push, 8) class GE_DLLEXPIMPORT AcGePolyline2d : public AcGeSplineEnt2d { public: AcGePolyline2d(); AcGePolyline2d(const AcGePolyline2d& src); AcGePolyline2d(const AcGePoint2dArray&); AcGePolyline2d(const AcGeKnotVector& knots, const AcGePoint2dArray& points); // Approximate curve with polyline // AcGePolyline2d(const AcGeCurve2d& crv, double apprEps); // Interpolation data // int numFitPoints () const; AcGePoint2d fitPointAt (int idx) const; AcGeSplineEnt2d& setFitPointAt(int idx, const AcGePoint2d& point); // Assignment operator. // AcGePolyline2d& operator = (const AcGePolyline2d& pline); }; #pragma pack (pop) #endif
// // NativeFileChooser_WINDOWS.h -- FLTK native OS file chooser widget // // Copyright 2004 by Greg Ercolano. // API changes + filter improvements by Nathan Vander Wilt 2005 // FLTK2 port by Greg Ercolano 2007 // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library 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 Library 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. // // #define _WIN32_WINNT 0x0501 // needed for OPENFILENAME's 'FlagsEx' #include <stdio.h> #include <stdlib.h> // malloc #include <windows.h> #include <commdlg.h> // OPENFILENAME, GetOpenFileName() #include <shlobj.h> // BROWSEINFO, SHBrowseForFolder() namespace fltk { class NativeFileChooser { public: enum Type { BROWSE_FILE = 0, BROWSE_DIRECTORY, BROWSE_MULTI_FILE, BROWSE_MULTI_DIRECTORY, BROWSE_SAVE_FILE, BROWSE_SAVE_DIRECTORY }; enum Option { NO_OPTIONS = 0x0000, // no options enabled SAVEAS_CONFIRM = 0x0001, // Show native 'Save As' overwrite // confirm dialog (if supported) NEW_FOLDER = 0x0002, // Show 'New Folder' icon // (if supported) PREVIEW = 0x0004, // enable preview mode }; private: int _btype; // kind-of browser to show() int _options; // general options OPENFILENAME _ofn; // GetOpenFileName() & GetSaveFileName() struct BROWSEINFO _binf; // SHBrowseForFolder() struct char **_pathnames; // array of pathnames int _tpathnames; // total pathnames char *_directory; // default pathname to use char *_title; // title for window char *_filter; // user-side search filter char *_parsedfilt; // filter parsed for Windows dialog int _nfilters; // number of filters parse_filter counted char *_preset_file; // the file to preselect char *_errmsg; // error message // Private methods void errmsg(const char *msg); void clear_pathnames(); void set_single_pathname(const char *s); void add_pathname(const char *s); void FreePIDL(ITEMIDLIST *pidl); void ClearOFN(); void ClearBINF(); void Win2Unix(char *s); void Unix2Win(char *s); int showfile(); static int CALLBACK Dir_CB(HWND win, UINT msg, LPARAM param, LPARAM data); int showdir(); void parse_filter(const char *); void clear_filters(); void add_filter(const char *, const char *); public: NativeFileChooser(int val = BROWSE_FILE); ~NativeFileChooser(); // Public methods void type(int val); int type() const; void options(int); int options() const; int count() const; const char *filename() const; const char *filename(int i) const; void directory(const char *val); const char *directory() const; void title(const char *val); const char *title() const; const char *filter() const; void filter(const char *val); int filters() const { return _nfilters; } void filter_value(int i); int filter_value() const; void preset_file(const char *); const char *preset_file() const; const char *errmsg() const; int show(); }; } // namespace fltk
#ifndef __E_STRING__ #define __E_STRING__ const std::string convertLatin1UTF8(const std::string &string); int isUTF8(const std::string &string); std::string convertDVBUTF8(const char *data, int len, int table, int tsidonid = 0); int readEncodingFile(); inline std::string stringDVBUTF8(const std::string &string, int table=0, int tsidonid=0) { return convertDVBUTF8((const char*)string.c_str(), string.length(), table, tsidonid); } int getCountryCodeDefaultMapping( const std::string &lang ); #endif // __E_STRING__
/* Routines for dealing with '\0' separated arg vectors. Copyright (C) 1995-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader <miles@gnu.ai.mit.edu> 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 <argz.h> #include <string.h> #include <stdlib.h> /* Insert ENTRY into ARGZ & ARGZ_LEN before BEFORE, which should be an existing entry in ARGZ; if BEFORE is NULL, ENTRY is appended to the end. Since ARGZ's first entry is the same as ARGZ, argz_insert (ARGZ, ARGZ_LEN, ARGZ, ENTRY) will insert ENTRY at the beginning of ARGZ. If BEFORE is not in ARGZ, EINVAL is returned, else if memory can't be allocated for the new ARGZ, ENOMEM is returned, else 0. */ error_t __argz_insert (char **argz, size_t *argz_len, char *before, const char *entry) { if (! before) return __argz_add (argz, argz_len, entry); if (before < *argz || before >= *argz + *argz_len) return EINVAL; if (before > *argz) /* Make sure before is actually the beginning of an entry. */ while (before[-1]) before--; { size_t after_before = *argz_len - (before - *argz); size_t entry_len = strlen (entry) + 1; size_t new_argz_len = *argz_len + entry_len; char *new_argz = realloc (*argz, new_argz_len); if (new_argz) { before = new_argz + (before - *argz); memmove (before + entry_len, before, after_before); memmove (before, entry, entry_len); *argz = new_argz; *argz_len = new_argz_len; return 0; } else return ENOMEM; } } weak_alias (__argz_insert, argz_insert)
/* * arch/arm/mach-tegra/odm_kit/query/olympus/subboards/nvodm_query_discovery_e1129_addresses.h * * Specifies the peripheral connectivity database peripheral entries for the E1129 keypad module * * Copyright (c) 2009 NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "../nvodm_query_kbc_gpio_def.h" // Key Pad static const NvOdmIoAddress s_KeyPadAddresses[] = { // instance = 1 indicates Column info. // instance = 0 indicates Row info. // address holds KBC pin number used for row/column. // All Row info has to be defined contiguously from 0 to max. { NvOdmIoModule_Kbd,0x00, NvOdmKbcGpioPin_KBRow0, 0 }, // Row 0 { NvOdmIoModule_Kbd,0x00, NvOdmKbcGpioPin_KBRow1, 0 }, // Row 1 { NvOdmIoModule_Kbd,0x00 ,NvOdmKbcGpioPin_KBRow2, 0 }, // Row 2 // All Column info has to be defined contiguously from 0 to max. { NvOdmIoModule_Kbd,0x01, NvOdmKbcGpioPin_KBCol0, 0 }, // Column 0 { NvOdmIoModule_Kbd,0x01, NvOdmKbcGpioPin_KBCol1, 0 }, // Column 1 { NvOdmIoModule_Kbd,0x01, NvOdmKbcGpioPin_KBCol2, 0 }, // Column 2 }; // s_ffa ScrollWheel... only supported for personality 1 static const NvOdmIoAddress s_ffaScrollWheelAddresses[] = { { NvOdmIoModule_Gpio, 0x10, 0x3, 0 }, // GPIO Port q - Pin3 { NvOdmIoModule_Gpio, 0x11, 0x3, 0 }, // GpIO Port r - Pin 3 { NvOdmIoModule_Gpio, 0x10, 0x5, 0 }, // GPIO Port q - Pin 5 { NvOdmIoModule_Gpio, 0x10, 0x4, 0 }, // GPIO Port q - Pin 4 };
/* $Id$ * * OpenMAMA: The open middleware agnostic messaging API * Copyright (C) 2011 NYSE Technologies, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA */ /* ************************************************************** */ /* Includes. */ /* ************************************************************** */ #include "wombat/port.h" #include "destroyHandle.h" #include <stdio.h> /* ************************************************************** */ /* Private Function Prototypes. */ /* ************************************************************** */ /* ************************************************************** */ /* Private Functions. */ /* ************************************************************** */ /** * Will free memory associated with the destroy handle. * * @param[in] handle The destroy handle. */ static void destroyHandle_freeHandle(pDestroyHandle handle) { if(NULL != handle) { /* Destroy the lock. */ wlock_destroy(handle->m_lock); /* Free the structure. */ free(handle); } } /* ************************************************************** */ /* Public Functions. */ /* ************************************************************** */ pDestroyHandle destroyHandle_create(void *owner) { /* Returns. */ pDestroyHandle ret = (pDestroyHandle)calloc(1, sizeof(wDestroyHandle)); if(NULL != ret) { /* Create the lock. */ ret->m_lock = wlock_create(); /* Save the owner object. */ ret->m_owner = owner; } return ret; } void destroyHandle_destroyOwner(pDestroyHandle handle) { if(NULL != handle) { /* Acquire the lock on. */ wlock_lock(handle->m_lock); /* If there are no references held then the object can be deleted. */ if(0 == handle->m_numberReferences) { destroyHandle_freeHandle(handle); } else { /* Flag that the handle is being destroyed, the memory will then be * deleted the final time that removeReference is called. */ handle->m_destroyed = 1; /* Release the lock. */ wlock_unlock(handle->m_lock); } } } void destroyHandle_incrementRefCount(pDestroyHandle handle) { if(NULL != handle) { /* Acquire the lock on the response object. */ wlock_lock(handle->m_lock); /* Increment the number of references. */ handle->m_numberReferences ++; /* Unlock. */ wlock_unlock( handle->m_lock); } } void *destroyHandle_removeReference(pDestroyHandle handle) { /* Returns. */ void *ret = NULL; if(NULL != handle) { /* Acquire the lock. */ wlock_lock(handle->m_lock); /* Decrement the number of outstanding references. */ handle->m_numberReferences --; /* A refernce to the objcet will only be returned if it has not been destroyed. */ if(0 == handle->m_destroyed) { /* Alternatively return a reference to the object. */ ret = handle->m_owner; /* Release the lock. */ wlock_unlock(handle->m_lock); } /* If there are no references AND the owner has been destroyed then the destroy handle must be freed, else do nothing. */ else if(0 == handle->m_numberReferences) { destroyHandle_freeHandle(handle); } } return ret; }
// // ____ _ __ _ _____ // / ___\ /_\ /\/\ /\ /\ /__\ /_\ \_ \ // \ \ //_\\ / \ / / \ \ / \// //_\\ / /\/ // /\_\ \ / _ \ / /\/\ \ \ \_/ / / _ \ / _ \ /\/ /_ // \____/ \_/ \_/ \/ \/ \___/ \/ \_/ \_/ \_/ \____/ // // Copyright Samurai development team and other contributors // // http://www.samurai-framework.com // // 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. // #import "Samurai_Config.h" #import "Samurai_CoreConfig.h" #import "Samurai_Property.h" #import "Samurai_Singleton.h" #pragma mark - @interface SamuraiSandbox : NSObject @prop_strong( NSString *, appPath ); @prop_strong( NSString *, docPath ); @prop_strong( NSString *, libPrefPath ); @prop_strong( NSString *, libCachePath ); @prop_strong( NSString *, tmpPath ); @singleton( SamuraiSandbox ) - (BOOL)touch:(NSString *)path; - (BOOL)touchFile:(NSString *)file; @end
/* * usbserial.c - usb serial gadget command * * Copyright (c) 2011 Eric Bénard <eric@eukrea.com>, Eukréa Electromatique * based on dfu.c which is : * Copyright (c) 2009 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <common.h> #include <command.h> #include <errno.h> #include <malloc.h> #include <getopt.h> #include <fs.h> #include <xfuncs.h> #include <usb/usbserial.h> #include <usb/dfu.h> #include <usb/gadget-multi.h> static int do_usbgadget(int argc, char *argv[]) { int opt; int acm = 1, create_serial = 0; char *fastboot_opts = NULL, *dfu_opts = NULL; struct f_multi_opts opts = {}; while ((opt = getopt(argc, argv, "asdA:D:")) > 0) { switch (opt) { case 'a': acm = 1; create_serial = 1; break; case 's': acm = 0; create_serial = 1; break; case 'D': dfu_opts = optarg; break; case 'A': fastboot_opts = optarg; break; case 'd': usb_multi_unregister(); return 0; default: return -EINVAL; } } if (!dfu_opts && !fastboot_opts && !create_serial) return COMMAND_ERROR_USAGE; /* * Creating a gadget with both DFU and Fastboot doesn't work. * Both client tools seem to assume that the device only has * a single configuration */ if (fastboot_opts && dfu_opts) { printf("Only one of Fastboot and DFU allowed\n"); return -EINVAL; } if (fastboot_opts) { opts.fastboot_opts.files = file_list_parse(fastboot_opts); } if (dfu_opts) { opts.dfu_opts.files = file_list_parse(dfu_opts); } if (create_serial) { opts.create_acm = acm; } return usb_multi_register(&opts); } BAREBOX_CMD_HELP_START(usbgadget) BAREBOX_CMD_HELP_TEXT("Enable / disable a USB composite gadget on the USB device interface.") BAREBOX_CMD_HELP_TEXT("") BAREBOX_CMD_HELP_TEXT("Options:") BAREBOX_CMD_HELP_OPT ("-a", "Create CDC ACM function") BAREBOX_CMD_HELP_OPT ("-s", "Create Generic Serial function") BAREBOX_CMD_HELP_OPT ("-A <desc>", "Create Android Fastboot function") BAREBOX_CMD_HELP_OPT ("-D <desc>", "Create DFU function") BAREBOX_CMD_HELP_OPT ("-d", "Disable the serial gadget") BAREBOX_CMD_HELP_END BAREBOX_CMD_START(usbgadget) .cmd = do_usbgadget, BAREBOX_CMD_DESC("Create USB Gadget multifunction device") BAREBOX_CMD_OPTS("[-asdAD]") BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP) BAREBOX_CMD_HELP(cmd_usbgadget_help) BAREBOX_CMD_END
/* -*- c++ -*- */ /* * Copyright 2004,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_GR_SHORT_TO_FLOAT_H #define INCLUDED_GR_SHORT_TO_FLOAT_H #include <gr_core_api.h> #include <gr_sync_block.h> class gr_short_to_float; typedef boost::shared_ptr<gr_short_to_float> gr_short_to_float_sptr; GR_CORE_API gr_short_to_float_sptr gr_make_short_to_float (size_t vlen=1, float scale=1); /*! * \brief Convert stream of short to a stream of float * \ingroup converter_blk * * \param vlen vector length of data streams. * \param scale a scalar divider to change the output signal scale. */ class GR_CORE_API gr_short_to_float : public gr_sync_block { private: friend GR_CORE_API gr_short_to_float_sptr gr_make_short_to_float (size_t vlen, float scale); gr_short_to_float (size_t vlen, float scale); size_t d_vlen; float d_scale; public: /*! * Get the scalar divider value. */ float scale() const; /*! * Set the scalar divider value. */ void set_scale(float scale); virtual int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); }; #endif /* INCLUDED_GR_SHORT_TO_FLOAT_H */
/***************************************************************************/ /* */ /* fttrace.h */ /* */ /* Tracing handling (specification only). */ /* */ /* Copyright 2002, 2004, 2005 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. */ /* */ /***************************************************************************/ /* definitions of trace levels for FreeType 2 */ /* the first level must always be `trace_any' */ FT_TRACE_DEF( any ) /* base components */ FT_TRACE_DEF( calc ) /* calculations (ftcalc.c) */ FT_TRACE_DEF( memory ) /* memory manager (ftobjs.c) */ FT_TRACE_DEF( stream ) /* stream manager (ftstream.c) */ FT_TRACE_DEF( io ) /* i/o interface (ftsystem.c) */ FT_TRACE_DEF( list ) /* list management (ftlist.c) */ FT_TRACE_DEF( init ) /* initialization (ftinit.c) */ FT_TRACE_DEF( objs ) /* base objects (ftobjs.c) */ FT_TRACE_DEF( outline ) /* outline management (ftoutln.c) */ FT_TRACE_DEF( glyph ) /* glyph management (ftglyph.c) */ FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */ FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */ FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */ FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */ /* Cache sub-system */ FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */ /* SFNT driver components */ FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */ FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */ FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */ FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */ FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */ FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */ /* TrueType driver components */ FT_TRACE_DEF( ttdriver ) /* TT font driver (ttdriver.c) */ FT_TRACE_DEF( ttgload ) /* TT glyph loader (ttgload.c) */ FT_TRACE_DEF( ttinterp ) /* bytecode interpreter (ttinterp.c) */ FT_TRACE_DEF( ttobjs ) /* TT objects manager (ttobjs.c) */ FT_TRACE_DEF( ttpload ) /* TT data/program loader (ttpload.c) */ FT_TRACE_DEF( ttgxvar ) /* TrueType GX var handler (ttgxvar.c) */ /* Type 1 driver components */ FT_TRACE_DEF( t1driver ) FT_TRACE_DEF( t1gload ) FT_TRACE_DEF( t1hint ) FT_TRACE_DEF( t1load ) FT_TRACE_DEF( t1objs ) FT_TRACE_DEF( t1parse ) /* PostScript helper module `psaux' */ FT_TRACE_DEF( t1decode ) FT_TRACE_DEF( psobjs ) /* PostScript hinting module `pshinter' */ FT_TRACE_DEF( pshrec ) FT_TRACE_DEF( pshalgo1 ) FT_TRACE_DEF( pshalgo2 ) /* Type 2 driver components */ FT_TRACE_DEF( cffdriver ) FT_TRACE_DEF( cffgload ) FT_TRACE_DEF( cffload ) FT_TRACE_DEF( cffobjs ) FT_TRACE_DEF( cffparse ) /* Type 42 driver component */ FT_TRACE_DEF( t42 ) /* CID driver components */ FT_TRACE_DEF( cidafm ) FT_TRACE_DEF( ciddriver ) FT_TRACE_DEF( cidgload ) FT_TRACE_DEF( cidload ) FT_TRACE_DEF( cidobjs ) FT_TRACE_DEF( cidparse ) /* Windows font component */ FT_TRACE_DEF( winfnt ) /* PCF font components */ FT_TRACE_DEF( pcfdriver ) FT_TRACE_DEF( pcfread ) /* BDF font components */ FT_TRACE_DEF( bdfdriver ) FT_TRACE_DEF( bdflib ) /* PFR font component */ FT_TRACE_DEF( pfr ) /* OpenType validation components */ FT_TRACE_DEF( otvmodule ) FT_TRACE_DEF( otvcommon ) FT_TRACE_DEF( otvbase ) FT_TRACE_DEF( otvgdef ) FT_TRACE_DEF( otvgpos ) FT_TRACE_DEF( otvgsub ) FT_TRACE_DEF( otvjstf ) /* END */
/* droid VNC server - a vnc server for android Copyright (C) 2011 Jose Pereira <onaips@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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef GUI_COMM_H #define GUI_COMM_H #include "common.h" #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <pthread.h> #define DEFAULT_IPC_RECV_PORT 13131 #define DEFAULT_IPC_SEND_PORT 13132 #define SOCK_PATH "org.onaips.vnc.gui" //TODO put IPC working on unix sockets int sendMsgToGui(char *msg); int bindIPCserver(); void unbindIPCserver(); void *handle_connections(); #endif
#pragma once #include "LinkerInternals.h" #if defined(OBJFORMAT_ELF) extern const size_t stubSizeArm; bool needStubForRelArm(Elf_Rel * rel); bool needStubForRelaArm(Elf_Rela * rel); bool makeStubArm(Stub * s); #endif
/* Data definition with no type or storage class should receive a pedwarn, rather than a warning which becomes an error with -pedantic. Test with no options. */ /* Origin: Joseph Myers <jsm@polyomino.org.uk> */ /* { dg-do compile } */ /* { dg-options "" } */ foo(); /* { dg-warning "warning: data definition has no type or storage class" } */
/* * Copyright 2017 Google * * 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> #if TARGET_OS_IOS // TODO: Remove UIKit import on next breaking change release #import <UIKit/UIKit.h> #endif @class FIROptions; NS_ASSUME_NONNULL_BEGIN /** A block that takes a BOOL and has no return value. */ typedef void (^FIRAppVoidBoolCallback)(BOOL success) NS_SWIFT_NAME(FirebaseAppVoidBoolCallback); /** * The entry point of Firebase SDKs. * * Initialize and configure FIRApp using +[FIRApp configure] * or other customized ways as shown below. * * The logging system has two modes: default mode and debug mode. In default mode, only logs with * log level Notice, Warning and Error will be sent to device. In debug mode, all logs will be sent * to device. The log levels that Firebase uses are consistent with the ASL log levels. * * Enable debug mode by passing the -FIRDebugEnabled argument to the application. You can add this * argument in the application's Xcode scheme. When debug mode is enabled via -FIRDebugEnabled, * further executions of the application will also be in debug mode. In order to return to default * mode, you must explicitly disable the debug mode with the application argument -FIRDebugDisabled. * * It is also possible to change the default logging level in code by calling setLoggerLevel: on * the FIRConfiguration interface. */ NS_SWIFT_NAME(FirebaseApp) @interface FIRApp : NSObject /** * Configures a default Firebase app. Raises an exception if any configuration step fails. The * default app is named "__FIRAPP_DEFAULT". This method should be called after the app is launched * and before using Firebase services. This method is thread safe. */ + (void)configure; /** * Configures the default Firebase app with the provided options. The default app is named * "__FIRAPP_DEFAULT". Raises an exception if any configuration step fails. This method is thread * safe. * * @param options The Firebase application options used to configure the service. */ + (void)configureWithOptions:(FIROptions *)options NS_SWIFT_NAME(configure(options:)); /** * Configures a Firebase app with the given name and options. Raises an exception if any * configuration step fails. This method is thread safe. * * @param name The application's name given by the developer. The name should should only contain Letters, Numbers and Underscore. * @param options The Firebase application options used to configure the services. */ // clang-format off + (void)configureWithName:(NSString *)name options:(FIROptions *)options NS_SWIFT_NAME(configure(name:options:)); // clang-format on /** * Returns the default app, or nil if the default app does not exist. */ + (nullable FIRApp *)defaultApp NS_SWIFT_NAME(app()); /** * Returns a previously created FIRApp instance with the given name, or nil if no such app exists. * This method is thread safe. */ + (nullable FIRApp *)appNamed:(NSString *)name NS_SWIFT_NAME(app(name:)); #if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** * Returns the set of all extant FIRApp instances, or nil if there are no FIRApp instances. This * method is thread safe. */ @property(class, readonly, nullable) NSDictionary<NSString *, FIRApp *> *allApps; #else /** * Returns the set of all extant FIRApp instances, or nil if there are no FIRApp instances. This * method is thread safe. */ + (nullable NSDictionary<NSString *, FIRApp *> *)allApps NS_SWIFT_NAME(allApps()); #endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** * Cleans up the current FIRApp, freeing associated data and returning its name to the pool for * future use. This method is thread safe. */ - (void)deleteApp:(FIRAppVoidBoolCallback)completion; /** * FIRApp instances should not be initialized directly. Call +[FIRApp configure], * +[FIRApp configureWithOptions:], or +[FIRApp configureWithNames:options:] directly. */ - (instancetype)init NS_UNAVAILABLE; /** * Gets the name of this app. */ @property(nonatomic, copy, readonly) NSString *name; /** * Gets a copy of the options for this app. These are non-modifiable. */ @property(nonatomic, copy, readonly) FIROptions *options; @end NS_ASSUME_NONNULL_END
/* Copyright 2012 Jun Wako <wakojun@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef CONFIG_H #define CONFIG_H #include "config_common.h" /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x3070 #define MANUFACTURER Maple Computing #define PRODUCT Christmas Tree /* key matrix size */ #define MATRIX_ROWS 6 #define MATRIX_COLS 1 /* Planck PCB default pin-out */ #define MATRIX_ROW_PINS { D3, F4, D0, F6, F5, D4 } #define MATRIX_COL_PINS { D1 } #define UNUSED_PINS #define BACKLIGHT_PIN D2 /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST /* number of backlight levels */ #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE #endif
/* * linux/include/asm-arm/arch-rpc/uncompress.h * * Copyright (C) 1996 Russell King * * 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. */ #define VIDMEM ((char *)SCREEN_START) #include <asm/hardware.h> #include <asm/io.h> int video_num_columns, video_num_lines, video_size_row; int white, bytes_per_char_h; extern unsigned long con_charconvtable[256]; struct param_struct { unsigned long page_size; unsigned long nr_pages; unsigned long ramdisk_size; unsigned long mountrootrdonly; unsigned long rootdev; unsigned long video_num_cols; unsigned long video_num_rows; unsigned long video_x; unsigned long video_y; unsigned long memc_control_reg; unsigned char sounddefault; unsigned char adfsdrives; unsigned char bytes_per_char_h; unsigned char bytes_per_char_v; unsigned long unused[256/4-11]; }; static const unsigned long palette_4[16] = { 0x00000000, 0x000000cc, 0x0000cc00, /* Green */ 0x0000cccc, /* Yellow */ 0x00cc0000, /* Blue */ 0x00cc00cc, /* Magenta */ 0x00cccc00, /* Cyan */ 0x00cccccc, /* White */ 0x00000000, 0x000000ff, 0x0000ff00, 0x0000ffff, 0x00ff0000, 0x00ff00ff, 0x00ffff00, 0x00ffffff }; #define palette_setpixel(p) *(unsigned long *)(IO_START+0x00400000) = 0x10000000|((p) & 255) #define palette_write(v) *(unsigned long *)(IO_START+0x00400000) = 0x00000000|((v) & 0x00ffffff) extern struct param_struct params; #ifndef STANDALONE_DEBUG /* * This does not append a newline */ static void puts(const char *s) { #if 0 extern void ll_write_char(char *, unsigned long); int x,y; unsigned char c; char *ptr; x = params.video_x; y = params.video_y; while ( ( c = *(unsigned char *)s++ ) != '\0' ) { if ( c == '\n' ) { x = 0; if ( ++y >= video_num_lines ) { y--; } } else { ptr = VIDMEM + ((y*video_num_columns*params.bytes_per_char_v+x)*bytes_per_char_h); ll_write_char(ptr, c|(white<<16)); if ( ++x >= video_num_columns ) { x = 0; if ( ++y >= video_num_lines ) { y--; } } } } params.video_x = x; params.video_y = y; #else /* do nothing */ #endif } static void error(char *x); /* * Setup for decompression */ static void arch_decomp_setup(void) { int i; #if 0 video_num_lines = params.video_num_rows; video_num_columns = params.video_num_cols; bytes_per_char_h = params.bytes_per_char_h; video_size_row = video_num_columns * bytes_per_char_h; if (bytes_per_char_h == 4) for (i = 0; i < 256; i++) con_charconvtable[i] = (i & 128 ? 1 << 0 : 0) | (i & 64 ? 1 << 4 : 0) | (i & 32 ? 1 << 8 : 0) | (i & 16 ? 1 << 12 : 0) | (i & 8 ? 1 << 16 : 0) | (i & 4 ? 1 << 20 : 0) | (i & 2 ? 1 << 24 : 0) | (i & 1 ? 1 << 28 : 0); else for (i = 0; i < 16; i++) con_charconvtable[i] = (i & 8 ? 1 << 0 : 0) | (i & 4 ? 1 << 8 : 0) | (i & 2 ? 1 << 16 : 0) | (i & 1 ? 1 << 24 : 0); palette_setpixel(0); if (bytes_per_char_h == 1) { palette_write (0); palette_write (0x00ffffff); for (i = 2; i < 256; i++) palette_write (0); white = 1; } else { for (i = 0; i < 256; i++) palette_write (i < 16 ? palette_4[i] : 0); white = 7; } if (params.nr_pages * params.page_size < 4096*1024) error("<4M of mem\n"); #endif } #endif /* * nothing to do */ #define arch_decomp_wdog()
/* * Support for Intel Camera Imaging ISP subsystem. * * Copyright (c) 2010 - 2014 Intel Corporation. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version * 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. * */ #ifndef __IA_CSS_CTC_HOST_H #define __IA_CSS_CTC_HOST_H #include "sh_css_params.h" #include "ia_css_ctc_param.h" #include "ia_css_ctc_table.host.h" extern const struct ia_css_ctc_config default_ctc_config; void ia_css_ctc_vamem_encode( struct sh_css_isp_ctc_vamem_params *to, const struct ia_css_ctc_table *from); void ia_css_ctc_debug_dtrace( const struct ia_css_ctc_config *config, unsigned level) ; #endif /* __IA_CSS_CTC_HOST_H */
#ifndef _ASM_SWIOTLB_H #define _ASM_SWTIOLB_H 1 #include <asm/dma-mapping.h> /* SWIOTLB interface */ extern dma_addr_t swiotlb_map_single(struct device *hwdev, void *ptr, size_t size, int dir); extern void *swiotlb_alloc_coherent(struct device *hwdev, size_t size, dma_addr_t *dma_handle, gfp_t flags); extern void swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr, size_t size, int dir); extern void swiotlb_sync_single_for_cpu(struct device *hwdev, dma_addr_t dev_addr, size_t size, int dir); extern void swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr, size_t size, int dir); extern void swiotlb_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dev_addr, unsigned long offset, size_t size, int dir); extern void swiotlb_sync_single_range_for_device(struct device *hwdev, dma_addr_t dev_addr, unsigned long offset, size_t size, int dir); extern void swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg, int nelems, int dir); extern void swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, int nelems, int dir); extern int swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, int direction); extern void swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, int direction); extern int swiotlb_dma_mapping_error(dma_addr_t dma_addr); extern void swiotlb_free_coherent (struct device *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle); extern int swiotlb_dma_supported(struct device *hwdev, u64 mask); extern void swiotlb_init(void); extern int swiotlb_force; #ifdef CONFIG_SWIOTLB extern int swiotlb; #else #define swiotlb 0 #endif extern void pci_swiotlb_init(void); #endif /* _ASM_SWTIOLB_H */
/* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once #include "sd-bus.h" #include "sd-bus-vtable.h" #include "unit.h" extern const sd_bus_vtable bus_timer_vtable[]; int bus_timer_set_property(Unit *u, const char *name, sd_bus_message *i, UnitWriteFlags flags, sd_bus_error *error);
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #import <Foundation/Foundation.h> @class RCTBridge; typedef NS_ENUM(NSUInteger, RCTJavaScriptFunctionKind) { RCTJavaScriptFunctionKindNormal, RCTJavaScriptFunctionKindAsync, }; @interface RCTModuleMethod : NSObject @property (nonatomic, copy, readonly) NSString *moduleClassName; @property (nonatomic, copy, readonly) NSString *JSMethodName; @property (nonatomic, assign, readonly) SEL selector; @property (nonatomic, assign, readonly) RCTJavaScriptFunctionKind functionKind; - (instancetype)initWithObjCMethodName:(NSString *)objCMethodName JSMethodName:(NSString *)JSMethodName moduleClass:(Class)moduleClass NS_DESIGNATED_INITIALIZER; - (void)invokeWithBridge:(RCTBridge *)bridge module:(id)module arguments:(NSArray *)arguments context:(NSNumber *)context; @end
/* * Copyright (C) 2010 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: * 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 GOOGLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef DocumentTiming_h #define DocumentTiming_h namespace blink { struct DocumentTiming { DocumentTiming() : domLoading(0.0) , domInteractive(0.0) , domContentLoadedEventStart(0.0) , domContentLoadedEventEnd(0.0) , domComplete(0.0) { } double domLoading; double domInteractive; double domContentLoadedEventStart; double domContentLoadedEventEnd; double domComplete; }; } #endif
/////////////////////////////////////////////////////////////////////////////// // Name: wx/os2/menuitem.h // Purpose: wxMenuItem class // Author: Vadim Zeitlin // Modified by: // Created: 11.11.97 // RCS-ID: $Id$ // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _MENUITEM_H #define _MENUITEM_H // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/defs.h" #include "wx/os2/private.h" // for MENUITEM // an exception to the general rule that a normal header doesn't include other // headers - only because ownerdrw.h is not always included and I don't want // to write #ifdef's everywhere... #if wxUSE_OWNER_DRAWN #include "wx/ownerdrw.h" #include "wx/bitmap.h" #endif // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxMenuItem: public wxMenuItemBase #if wxUSE_OWNER_DRAWN , public wxOwnerDrawn #endif { public: // // ctor & dtor // wxMenuItem( wxMenu* pParentMenu = NULL ,int nId = wxID_SEPARATOR ,const wxString& rStrName = wxEmptyString ,const wxString& rWxHelp = wxEmptyString ,wxItemKind eKind = wxITEM_NORMAL ,wxMenu* pSubMenu = NULL ); // // Depricated, do not use in new code // wxMenuItem( wxMenu* pParentMenu ,int vId ,const wxString& rsText ,const wxString& rsHelp ,bool bIsCheckable ,wxMenu* pSubMenu = NULL ); virtual ~wxMenuItem(); // // Override base class virtuals // virtual void SetItemLabel(const wxString& rStrName); virtual void Enable(bool bDoEnable = true); virtual void Check(bool bDoCheck = true); virtual bool IsChecked(void) const; // // Unfortunately needed to resolve ambiguity between // wxMenuItemBase::IsCheckable() and wxOwnerDrawn::IsCheckable() // bool IsCheckable(void) const { return wxMenuItemBase::IsCheckable(); } // // The id for a popup menu is really its menu handle (as required by // ::AppendMenu() API), so this function will return either the id or the // menu handle depending on what we're // int GetRealId(void) const; // // Mark item as belonging to the given radio group // void SetAsRadioGroupStart(void); void SetRadioGroupStart(int nStart); void SetRadioGroupEnd(int nEnd); // // All OS/2PM Submenus and menus have one of these // MENUITEM m_vMenuData; #if wxUSE_OWNER_DRAWN void SetBitmaps(const wxBitmap& bmpChecked, const wxBitmap& bmpUnchecked = wxNullBitmap) { m_bmpChecked = bmpChecked; m_bmpUnchecked = bmpUnchecked; SetOwnerDrawn(true); } void SetBitmap(const wxBitmap& bmp, bool bChecked = true) { if ( bChecked ) m_bmpChecked = bmp; else m_bmpUnchecked = bmp; SetOwnerDrawn(true); } void SetDisabledBitmap(const wxBitmap& bmpDisabled) { m_bmpDisabled = bmpDisabled; SetOwnerDrawn(true); } const wxBitmap& GetBitmap(bool bChecked = true) const { return (bChecked ? m_bmpChecked : m_bmpUnchecked); } const wxBitmap& GetDisabledBitmap() const { return m_bmpDisabled; } // override wxOwnerDrawn base class virtuals virtual wxString GetName() const; virtual bool OnMeasureItem(size_t *pwidth, size_t *pheight); virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat); protected: virtual void GetFontToUse(wxFont& font) const; #endif // wxUSE_OWNER_DRAWN private: void Init(); // // The positions of the first and last items of the radio group this item // belongs to or -1: start is the radio group start and is valid for all // but first radio group items (m_isRadioGroupStart == FALSE), end is valid // only for the first one // union { int m_nStart; int m_nEnd; } m_vRadioGroup; // // Does this item start a radio group? // bool m_bIsRadioGroupStart; #if wxUSE_OWNER_DRAWN // item bitmaps wxBitmap m_bmpChecked, // bitmap to put near the item m_bmpUnchecked, // (checked is used also for 'uncheckable' items) m_bmpDisabled; #endif // wxUSE_OWNER_DRAWN DECLARE_DYNAMIC_CLASS(wxMenuItem) }; // end of CLASS wxMenuItem #endif //_MENUITEM_H
USHORT Unpack_HEAVY(UCHAR *, UCHAR *, UCHAR, USHORT); extern USHORT dms_heavy_text_loc;
/* Copyright (C) 2007-2010 Open Information Security Foundation * * You can copy, redistribute or modify this Program 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 * version 2 along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ /** * \file * * \author Anoop Saldanha <anoopsaldanha@gmail.com> */ #ifndef __UTIL_MISC_H__ #define __UTIL_MISC_H__ #include "util-error.h" /** * \brief Generic API that can be used by all to log an * invalid conf entry. * \param param_name A string specifying the param name. * \param format Format for the below value. For example "%s", "%"PRIu32, etc. * \param value Default value to be printed. */ #define WarnInvalidConfEntry(param_name, format, value) do { \ SCLogWarning(SC_ERR_INVALID_YAML_CONF_ENTRY, \ "Invalid conf entry found for " \ "\"%s\". Using default value of \"" format "\".", \ param_name, value); \ } while (0) /* size string parsing API */ int ParseSizeStringU8(const char *, uint8_t *); int ParseSizeStringU16(const char *, uint16_t *); int ParseSizeStringU32(const char *, uint32_t *); int ParseSizeStringU64(const char *, uint64_t *); void UtilMiscRegisterTests(void); void ParseSizeInit(void); void ParseSizeDeinit(void); #endif /* __UTIL_MISC_H__ */
#include "mediastreamer2/msfilter.h" extern MSFilterDesc ms_alaw_dec_desc; extern MSFilterDesc ms_alaw_enc_desc; extern MSFilterDesc ms_ulaw_dec_desc; extern MSFilterDesc ms_ulaw_enc_desc; extern MSFilterDesc ms_file_player_desc; extern MSFilterDesc ms_rtp_send_desc; extern MSFilterDesc ms_rtp_recv_desc; extern MSFilterDesc ms_dtmf_gen_desc; extern MSFilterDesc ms_file_rec_desc; extern MSFilterDesc ms_speex_dec_desc; extern MSFilterDesc ms_speex_enc_desc; extern MSFilterDesc ms_gsm_dec_desc; extern MSFilterDesc ms_gsm_enc_desc; extern MSFilterDesc ms_speex_ec_desc; extern MSFilterDesc ms_conf_desc; extern MSFilterDesc ms_v4w_desc; extern MSFilterDesc ms_video_out_desc; extern MSFilterDesc ms_h263_enc_desc; extern MSFilterDesc ms_h263_dec_desc; extern MSFilterDesc ms_h263_old_enc_desc; extern MSFilterDesc ms_h263_old_dec_desc; extern MSFilterDesc ms_mpeg4_enc_desc; extern MSFilterDesc ms_mpeg4_dec_desc; extern MSFilterDesc ms_h264_dec_desc; extern MSFilterDesc ms_snow_enc_desc; extern MSFilterDesc ms_snow_dec_desc; extern MSFilterDesc ms_theora_enc_desc; extern MSFilterDesc ms_theora_dec_desc; extern MSFilterDesc ms_mjpeg_enc_desc; extern MSFilterDesc ms_mjpeg_dec_desc; extern MSFilterDesc ms_size_conv_desc; extern MSFilterDesc ms_pix_conv_desc; extern MSFilterDesc ms_resample_desc; extern MSFilterDesc ms_volume_desc; extern MSFilterDesc ms_static_image_desc; extern MSFilterDesc ms_mire_desc; extern MSFilterDesc ms_vfw_desc; extern MSFilterDesc ms_equalizer_desc; extern MSFilterDesc ms_dd_display_desc; extern MSFilterDesc ms_audio_mixer_desc; extern MSFilterDesc ms_ext_display_desc; extern MSFilterDesc ms_jpeg_writer_desc; extern MSFilterDesc ms_tone_detector_desc; extern MSFilterDesc ms_vp8_enc_desc; extern MSFilterDesc ms_vp8_dec_desc; extern MSFilterDesc ms_l16_enc_desc; extern MSFilterDesc ms_l16_dec_desc; extern MSFilterDesc ms_g722_enc_desc; extern MSFilterDesc ms_g722_dec_desc; MSFilterDesc * ms_voip_filter_descs[]={ &ms_alaw_dec_desc, &ms_alaw_enc_desc, &ms_ulaw_dec_desc, &ms_ulaw_enc_desc, &ms_file_player_desc, &ms_rtp_send_desc, &ms_rtp_recv_desc, &ms_dtmf_gen_desc, &ms_file_rec_desc, &ms_speex_dec_desc, &ms_speex_enc_desc, &ms_gsm_dec_desc, &ms_gsm_enc_desc, &ms_speex_ec_desc, &ms_conf_desc, &ms_h263_old_enc_desc, &ms_h263_old_dec_desc, &ms_h263_enc_desc, &ms_h263_dec_desc, &ms_mpeg4_enc_desc, &ms_mpeg4_dec_desc, &ms_h264_dec_desc, &ms_snow_enc_desc, &ms_snow_dec_desc, &ms_theora_enc_desc, &ms_theora_dec_desc, &ms_mjpeg_enc_desc, &ms_mjpeg_dec_desc, &ms_size_conv_desc, &ms_pix_conv_desc, #ifndef NORESAMPLE &ms_resample_desc, #endif &ms_volume_desc, &ms_static_image_desc, &ms_mire_desc, &ms_equalizer_desc, &ms_dd_display_desc, &ms_audio_mixer_desc, &ms_ext_display_desc, &ms_tone_detector_desc, &ms_jpeg_writer_desc, &ms_vp8_enc_desc, &ms_vp8_dec_desc, &ms_l16_enc_desc, &ms_l16_dec_desc, &ms_g722_enc_desc, &ms_g722_dec_desc, NULL };
/* { dg-options "-mabicalls -mshared -mabi=n32" } */ /* { dg-final { scan-assembler "\tsd\t\\\$28," } } */ /* { dg-final { scan-assembler "\tld\t\\\$28," } } */ /* { dg-final { scan-assembler "\taddiu\t\\\$28,\\\$28,%lo\\(%neg\\(%gp_rel\\(foo\\)\\)\\)\n" } } */ /* { dg-final { scan-assembler "\tlw\t\\\$1,%got_page\\(\[^)\]*\\)\\(\\\$28\\)\n" } } */ /* { dg-final { scan-assembler "\taddiu\t\\\$1,\\\$1,%got_ofst\\(\[^)\]*\\)\n" } } */ /* { dg-final { scan-assembler "\tjr\t\\\$1\n" } } */ #include "branch-helper.h" NOMIPS16 void foo (void (*bar) (void), volatile int *x) { bar (); if (__builtin_expect (*x == 0, 1)) OCCUPY_0x1fffc; }
//////////////////////////////////////////////////////////////////////////////// // submesh.h // Author : Francesco Giordana // Sponsored by : Anygma N.V. (http://www.nazooka.com) // Start Date : January 13, 2005 // Copyright : (C) 2006 by Francesco Giordana // Email : fra.giordana@tiscali.it //////////////////////////////////////////////////////////////////////////////// /********************************************************************************* * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * **********************************************************************************/ #ifndef _SUBMESH_H #define _SUBMESH_H #include "mayaExportLayer.h" #include "paramList.h" #include "materialSet.h" #include "animation.h" #include "vertex.h" #include "blendshape.h" namespace OgreMayaExporter { /***** Class Submesh *****/ class Submesh { public: //constructor Submesh(const MString& name = ""); //destructor ~Submesh(); //clear data void clear(); //load data MStatus loadMaterial(MObject& shader,MStringArray& uvsets,ParamList& params); MStatus load(const MDagPath& dag,std::vector<face>& faces, std::vector<vertexInfo>& vertInfo, MPointArray& points, MFloatVectorArray& normals, MStringArray& texcoordsets,ParamList& params,bool opposite = false); //load a keyframe for the whole mesh MStatus loadKeyframe(Track& t,float time,ParamList& params); //get number of triangles composing the submesh long numTriangles(); //get number of vertices long numVertices(); //get submesh name MString& name(); //write submesh data to an Ogre compatible mesh MStatus createOgreSubmesh(Ogre::MeshPtr pMesh,const ParamList& params); //create an Ogre compatible vertex buffer MStatus createOgreVertexBuffer(Ogre::SubMesh* pSubmesh,Ogre::VertexDeclaration* pDecl,const std::vector<vertex>& vertices); public: //public members MString m_name; Material* m_pMaterial; long m_numTriangles; long m_numVertices; std::vector<long> m_indices; std::vector<vertex> m_vertices; std::vector<face> m_faces; std::vector<uvset> m_uvsets; bool m_use32bitIndexes; MDagPath m_dagPath; BlendShape* m_pBlendShape; MBoundingBox m_boundingBox; }; }; // end of namespace #endif
/* { dg-do compile } */ /* { dg-require-alias "" } */ /* { dg-options "-O0 -fipa-icf -fdump-ipa-icf" } */ static int do_work(void) { return 0; } static int foo() __attribute__((alias("do_work"))); static int bar() __attribute__((alias("do_work"))); static int a() { return foo(); } static int b() { return bar(); } int main() { return a() + b(); } /* { dg-final { scan-ipa-dump "Equal symbols: 1" "icf" } } */ /* { dg-final { cleanup-ipa-dump "icf" } } */
void foo(void) { STACK_OF(X509) *st = sk_X509_new_null(); }
/* Conversion from and to HP-THAI8. Copyright (C) 2007-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2007. 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 <stdint.h> /* Specify the conversion table. */ #define TABLES <hp-thai8.h> #define CHARSET_NAME "HP-THAI8//" #define HAS_HOLES 1 /* Not all 256 character are defined. */ #include <8bit-gap.c>
// -*- mode: c++ -*- // Copyright (c) 2010 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. // Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> // language.h: Define google_breakpad::Language. Instances of // subclasses of this class provide language-appropriate operations // for the Breakpad symbol dumper. #ifndef COMMON_LINUX_LANGUAGE_H__ #define COMMON_LINUX_LANGUAGE_H__ #include <string> #include "common/using_std_string.h" namespace google_breakpad { // An abstract base class for language-specific operations. We choose // an instance of a subclass of this when we find the CU's language. // This class's definitions are appropriate for CUs with no specified // language. class Language { public: // A base class destructor should be either public and virtual, // or protected and nonvirtual. virtual ~Language() {} // Return true if this language has functions to which we can assign // line numbers. (Debugging info for assembly language, for example, // can have source location information, but does not have functions // recorded using DW_TAG_subprogram DIEs.) virtual bool HasFunctions() const { return true; } // Construct a fully-qualified, language-appropriate form of NAME, // given that PARENT_NAME is the name of the construct enclosing // NAME. If PARENT_NAME is the empty string, then NAME is a // top-level name. // // This API sort of assumes that a fully-qualified name is always // some simple textual composition of the unqualified name and its // parent's name, and that we don't need to know anything else about // the parent or the child (say, their DIEs' tags) to do the job. // This is true for the languages we support at the moment, and // keeps things concrete. Perhaps a more refined operation would // take into account the parent and child DIE types, allow languages // to use their own data type for complex parent names, etc. But if // C++ doesn't need all that, who would? virtual string MakeQualifiedName (const string &parent_name, const string &name) const = 0; enum DemangleResult { // Demangling was not performed because it’s not appropriate to attempt. kDontDemangle = -1, kDemangleSuccess, kDemangleFailure, }; // Wraps abi::__cxa_demangle() or similar for languages where appropriate. virtual DemangleResult DemangleName(const string& mangled, string* demangled) const { demangled->clear(); return kDontDemangle; } // Instances for specific languages. static const Language * const CPlusPlus, * const Java, * const Swift, * const Rust, * const Assembler; }; } // namespace google_breakpad #endif // COMMON_LINUX_LANGUAGE_H__
/* * Copyright (C) 2015 Eistec AB * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @ingroup drivers_hih6130 * @{ * * @file * @brief Device driver implementation for Honeywell HumidIcon Digital * Humidity/Temperature Sensors: HIH-6130/6131 Series * * @author Joakim Nohlgård <joakim.nohlgard@eistec.se> * * @} */ #include <stddef.h> #include <stdint.h> #include "hih6130.h" #include "periph/i2c.h" #include "xtimer.h" #define ENABLE_DEBUG (0) #include "debug.h" /* Humidity is stored in the first 2 bytes of data */ #define HIH6130_HUMIDITY_DATA_LENGTH (2) /* Humidity + temperature data is 4 bytes long */ #define HIH6130_FULL_DATA_LENGTH (4) /* Bit mask for the status bits in the first byte transferred */ #define HIH6130_STATUS_MASK (0xc0) /* Bit mask for the humidity data */ #define HIH6130_HUMIDITY_MASK (0x3fff) /* Temperature data is left adjusted within the word */ #define HIH6130_TEMPERATURE_SHIFT (2) enum { HIH6130_STATUS_OK = 0x00, /** * stale data: data that has already been fetched since the last measurement * cycle, or data fetched before the first measurement has been completed. */ HIH6130_STATUS_STALE_DATA = 0x40, HIH6130_STATUS_COMMAND_MODE = 0x80, HIH6130_STATUS_DIAGNOSTIC = 0xc0, }; /** @brief Delay between requesting a measurement and data becoming ready */ #define MEASUREMENT_DELAY (50LU * US_PER_MS) /** @brief Trigger a new measurement on the sensor */ static inline int hih6130_measurement_request(const hih6130_t *dev) { i2c_acquire(dev->i2c); /* An empty write request triggers a new measurement */ if (i2c_write_bytes(dev->i2c, dev->addr, NULL, 0, 0) < 0) { i2c_release(dev->i2c); return -1; } i2c_release(dev->i2c); return 0; } void hih6130_init(hih6130_t *dev, i2c_t i2c, uint8_t address) { /* write device descriptor */ dev->i2c = i2c; dev->addr = address; } static inline int hih6130_get_humidity_temperature_raw(const hih6130_t *dev, uint16_t *humidity_raw, uint16_t *temperature_raw) { int status; uint8_t buf[HIH6130_FULL_DATA_LENGTH]; i2c_acquire(dev->i2c); if (i2c_read_bytes(dev->i2c, dev->addr, &buf[0], sizeof(buf), 0) < 0) { i2c_release(dev->i2c); return -1; } i2c_release(dev->i2c); /* data is in big-endian format, with status bits in the first byte. */ switch (buf[0] & HIH6130_STATUS_MASK) { case HIH6130_STATUS_OK: status = 0; break; case HIH6130_STATUS_STALE_DATA: status = 1; break; default: return -2; } *humidity_raw = ((buf[0] << 8) | buf[1]) & HIH6130_HUMIDITY_MASK; *temperature_raw = (((buf[2] << 8) | buf[3]) >> HIH6130_TEMPERATURE_SHIFT); return status; } int hih6130_get_humidity_temperature_float(const hih6130_t *dev, float *relative_humidity_percent, float *temperature_celsius) { uint16_t hum_raw, temp_raw; int status; if (hih6130_measurement_request(dev) != 0) { return -1; } xtimer_usleep(MEASUREMENT_DELAY); status = hih6130_get_humidity_temperature_raw(dev, &hum_raw, &temp_raw); if (status < 0) { return -1; } if (relative_humidity_percent != NULL) { *relative_humidity_percent = hum_raw * (100.f / 16383.f); } if (temperature_celsius != NULL) { *temperature_celsius = temp_raw * (165.f / 16383.f) - 40.f; } return status; }
/* io_scsd.h Hardware Routines for reading a Secure Digital card using the Supercard SD Copyright (c) 2006 Michael "Chishm" Chisholm Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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. 2006-07-11 - Chishm * Original release 2006-07-22 - Chishm * First release of stable code */ #ifndef IO_SCSD_H #define IO_SCSD_H // 'SCSD' #define DEVICE_TYPE_SCSD 0x44534353 #include "disc_io.h" // export interface extern const IO_INTERFACE _io_scsd ; #endif // define IO_SCSD_H
/* * lib/extable.c * Derived from arch/ppc/mm/extable.c and arch/i386/mm/extable.c. * * Copyright (C) 2004 Paul Mackerras, IBM Corp. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/sort.h> #include <asm/uaccess.h> extern struct exception_table_entry __start___ex_table[]; extern struct exception_table_entry __stop___ex_table[]; #ifndef ARCH_HAS_SORT_EXTABLE /* * The exception table needs to be sorted so that the binary * search that we use to find entries in it works properly. * This is used both for the kernel exception table and for * the exception tables of modules that get loaded. */ static int cmp_ex(const void *a, const void *b) { const struct exception_table_entry *x = a, *y = b; /* avoid overflow */ if (x->insn > y->insn) return 1; if (x->insn < y->insn) return -1; return 0; } void sort_extable(struct exception_table_entry *start, struct exception_table_entry *finish) { sort(start, finish - start, sizeof(struct exception_table_entry), cmp_ex, NULL); } #endif #ifndef ARCH_HAS_SEARCH_EXTABLE /* * Search one exception table for an entry corresponding to the * given instruction address, and return the address of the entry, * or NULL if none is found. * We use a binary search, and thus we assume that the table is * already sorted. */ const struct exception_table_entry * search_extable(const struct exception_table_entry *first, const struct exception_table_entry *last, unsigned long value) { while (first <= last) { const struct exception_table_entry *mid; mid = (last - first) / 2 + first; /* * careful, the distance between entries can be * larger than 2GB: */ if (mid->insn < value) first = mid + 1; else if (mid->insn > value) last = mid - 1; else return mid; } return NULL; } #endif
/***************************************************************************** * aout.c: audio output controls for the VLC playlist ***************************************************************************** * Copyright (C) 2002-2012 VLC authors and VideoLAN * * Authors: Christophe Massiot <massiot@via.ecp.fr> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <vlc_common.h> #include <vlc_aout.h> #include <vlc_playlist.h> #include "../audio_output/aout_internal.h" #include "playlist_internal.h" audio_output_t *playlist_GetAout(playlist_t *pl) { /* NOTE: it is assumed that the input resource exists. In practice, * the playlist must have been activated. This is automatic when calling * pl_Get(). FIXME: input resources are deleted at deactivation, this can * be too early. */ playlist_private_t *sys = pl_priv(pl); return input_resource_HoldAout(sys->p_input_resource); } float playlist_VolumeGet (playlist_t *pl) { float volume = -1.f; audio_output_t *aout = playlist_GetAout (pl); if (aout != NULL) { volume = aout_VolumeGet (aout); vlc_object_release (aout); } return volume; } int playlist_VolumeSet (playlist_t *pl, float vol) { int ret = -1; audio_output_t *aout = playlist_GetAout (pl); if (aout != NULL) { ret = aout_VolumeSet (aout, vol); vlc_object_release (aout); } return ret; } /** * Raises the volume. * \param value how much to increase (> 0) or decrease (< 0) the volume * \param volp if non-NULL, will contain contain the resulting volume */ int playlist_VolumeUp (playlist_t *pl, int value, float *volp) { int ret = -1; float delta = value * var_InheritFloat (pl, "volume-step"); audio_output_t *aout = playlist_GetAout (pl); if (aout != NULL) { float vol = aout_VolumeGet (aout); if (vol >= 0.) { vol += delta / (float)AOUT_VOLUME_DEFAULT; if (vol < 0.) vol = 0.; if (vol > 2.) vol = 2.; if (volp != NULL) *volp = vol; ret = aout_VolumeSet (aout, vol); } vlc_object_release (aout); } return ret; } int playlist_MuteGet (playlist_t *pl) { int mute = -1; audio_output_t *aout = playlist_GetAout (pl); if (aout != NULL) { mute = aout_MuteGet (aout); vlc_object_release (aout); } return mute; } int playlist_MuteSet (playlist_t *pl, bool mute) { int ret = -1; audio_output_t *aout = playlist_GetAout (pl); if (aout != NULL) { ret = aout_MuteSet (aout, mute); vlc_object_release (aout); } return ret; } void playlist_EnableAudioFilter (playlist_t *pl, const char *name, bool add) { audio_output_t *aout = playlist_GetAout (pl); if (aout_ChangeFilterString (VLC_OBJECT(pl), VLC_OBJECT(aout), "audio-filter", name, add)) { if (aout != NULL) aout_InputRequestRestart (aout); } if (aout != NULL) vlc_object_release (aout); }
#ifndef __CRAMFS_H #define __CRAMFS_H #define CRAMFS_MAGIC 0x28cd3d45 /* some random number */ #define CRAMFS_SIGNATURE "Compressed ROMFS" /* * Width of various bitfields in struct cramfs_inode. * Primarily used to generate warnings in mkcramfs. */ #define CRAMFS_MODE_WIDTH 16 #define CRAMFS_UID_WIDTH 16 #define CRAMFS_SIZE_WIDTH 24 #define CRAMFS_GID_WIDTH 8 #define CRAMFS_NAMELEN_WIDTH 6 #define CRAMFS_OFFSET_WIDTH 26 /* * Since inode.namelen is a unsigned 6-bit number, the maximum cramfs * path length is 63 << 2 = 252. */ #define CRAMFS_MAXPATHLEN (((1 << CRAMFS_NAMELEN_WIDTH) - 1) << 2) /* * Reasonably terse representation of the inode data. */ struct cramfs_inode { u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH; /* SIZE for device files is i_rdev */ u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH; /* NAMELEN is the length of the file name, divided by 4 and rounded up. (cramfs doesn't support hard links.) */ /* OFFSET: For symlinks and non-empty regular files, this contains the offset (divided by 4) of the file data in compressed form (starting with an array of block pointers; see README). For non-empty directories it is the offset (divided by 4) of the inode of the first file in that directory. For anything else, offset is zero. */ u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH; }; struct cramfs_info { u32 crc; u32 edition; u32 blocks; u32 files; }; /* * Superblock information at the beginning of the FS. */ struct cramfs_super { u32 magic; /* 0x28cd3d45 - random number */ u32 size; /* length in bytes */ u32 flags; /* feature flags */ u32 future; /* reserved for future use */ u8 signature[16]; /* "Compressed ROMFS" */ struct cramfs_info fsid; /* unique filesystem info */ u8 name[16]; /* user-defined name */ struct cramfs_inode root; /* root inode data */ }; /* * Feature flags * * 0x00000000 - 0x000000ff: features that work for all past kernels * 0x00000100 - 0xffffffff: features that don't work for past kernels */ #define CRAMFS_FLAG_FSID_VERSION_2 0x00000001 /* fsid version #2 */ #define CRAMFS_FLAG_SORTED_DIRS 0x00000002 /* sorted dirs */ #define CRAMFS_FLAG_HOLES 0x00000100 /* support for holes */ #define CRAMFS_FLAG_WRONG_SIGNATURE 0x00000200 /* reserved */ #define CRAMFS_FLAG_SHIFTED_ROOT_OFFSET 0x00000400 /* shifted root fs */ /* * Valid values in super.flags. Currently we refuse to mount * if (flags & ~CRAMFS_SUPPORTED_FLAGS). Maybe that should be * changed to test super.future instead. */ #define CRAMFS_SUPPORTED_FLAGS ( 0x000000ff \ | CRAMFS_FLAG_HOLES \ | CRAMFS_FLAG_WRONG_SIGNATURE \ | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET ) #ifdef __LITTLE_ENDIAN #define CRAMFS_16(x) (x) #define CRAMFS_24(x) (x) #define CRAMFS_32(x) (x) #define CRAMFS_GET_NAMELEN(x) ((x)->namelen) #define CRAMFS_GET_OFFSET(x) ((x)->offset) #define CRAMFS_SET_OFFSET(x,y) ((x)->offset = (y)) #define CRAMFS_SET_NAMELEN(x,y) ((x)->namelen = (y)) #elif defined __BIG_ENDIAN #ifdef __KERNEL__ #define CRAMFS_16(x) swab16(x) #define CRAMFS_24(x) ((swab32(x)) >> 8) #define CRAMFS_32(x) swab32(x) #else /* not __KERNEL__ */ #define CRAMFS_16(x) bswap_16(x) #define CRAMFS_24(x) ((bswap_32(x)) >> 8) #define CRAMFS_32(x) bswap_32(x) #endif /* not __KERNEL__ */ #define CRAMFS_GET_NAMELEN(x) (((u8*)(x))[8] & 0x3f) #define CRAMFS_GET_OFFSET(x) ((CRAMFS_24(((u32*)(x))[2] & 0xffffff) << 2) |\ ((((u32*)(x))[2] & 0xc0000000) >> 30)) #define CRAMFS_SET_NAMELEN(x,y) (((u8*)(x))[8] = (((0x3f & (y))) | \ (0xc0 & ((u8*)(x))[8]))) #define CRAMFS_SET_OFFSET(x,y) (((u32*)(x))[2] = (((y) & 3) << 30) | \ CRAMFS_24((((y) & 0x03ffffff) >> 2)) | \ (((u32)(((u8*)(x))[8] & 0x3f)) << 24)) #else #error "__BYTE_ORDER must be __LITTLE_ENDIAN or __BIG_ENDIAN" #endif /* Uncompression interfaces to the underlying zlib */ int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen); int cramfs_uncompress_init(void); void cramfs_uncompress_exit(void); #endif /* __CRAMFS_H */
/* * Copyright (C) 2001-2003 FhG Fokus * * 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 */ #include <stdlib.h> #include <stdio.h> #include <errno.h> #include <string.h> #include <ctype.h> #include <netdb.h> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> static char *id="$Id$"; static char *version="udp_test_proxy 0.1"; static char* help_msg="\ Usage: udp_test_proxy -l address -s port -d address -p port [-n no] [-v]\n\ Options:\n\ -l address listen address\n\ -s port listen(source) port\n\ -d address destination address\n\ -p port destination port\n\ -n no number of processes\n\ -2 use a different socket for sending\n\ -v increase verbosity level\n\ -V version number\n\ -h this help message\n\ "; #define BUF_SIZE 65535 static char buf[BUF_SIZE]; int main(int argc, char** argv) { int sock; int s_sock; pid_t pid; struct sockaddr_in addr; struct sockaddr_in to; int r, n, len; char c; struct hostent* he; int verbose; int sport, dport; char *dst; char *src; char* tmp; int use_diff_ssock; /* init */ verbose=0; dst=0; sport=dport=0; src=dst=0; n=0; use_diff_ssock=0; opterr=0; while ((c=getopt(argc,argv, "l:p:d:s:n:2vhV"))!=-1){ switch(c){ case '2': use_diff_ssock=1; break; case 'v': verbose++; break; case 'd': dst=optarg; break; case 'l': src=optarg; break; case 'p': dport=strtol(optarg, &tmp, 10); if ((tmp==0)||(*tmp)){ fprintf(stderr, "bad port number: -p %s\n", optarg); goto error; } break; case 's': sport=strtol(optarg, &tmp, 10); if ((tmp==0)||(*tmp)){ fprintf(stderr, "bad port number: -s %s\n", optarg); goto error; } break; case 'n': n=strtol(optarg, &tmp, 10); if ((tmp==0)||(*tmp)){ fprintf(stderr, "bad process number: -n %s\n", optarg); goto error; } break; case 'V': printf("version: %s\n", version); printf("%s\n",id); exit(0); break; case 'h': printf("version: %s\n", version); printf("%s", help_msg); exit(0); break; case '?': if (isprint(optopt)) fprintf(stderr, "Unknown option `-%c´\n", optopt); else fprintf(stderr, "Unknown character `\\x%x´\n", optopt); goto error; case ':': fprintf(stderr, "Option `-%c´ requires an argument.\n", optopt); goto error; break; default: abort(); } } /* check if all the required params are present */ if (dst==0){ fprintf(stderr, "Missing destination (-d ...)\n"); exit(-1); } if (src==0){ fprintf(stderr, "Missing listen address (-l ...)\n"); exit(-1); } if(sport==0){ fprintf(stderr, "Missing source port number (-s port)\n"); exit(-1); }else if(sport<0){ fprintf(stderr, "Invalid source port number (-s %d)\n", sport); exit(-1); } if(dport==0){ fprintf(stderr, "Missing destination port number (-p port)\n"); exit(-1); }else if(dport<0){ fprintf(stderr, "Invalid destination port number (-p %d)\n", dport); exit(-1); } if(n<0){ fprintf(stderr, "Invalid process no (-n %d)\n", n); exit(-1); } /* resolve destination */ he=gethostbyname(dst); if (he==0){ fprintf(stderr, "ERROR: could not resolve %s\n", dst); goto error; } /* set to*/ to.sin_family=he->h_addrtype; to.sin_port=htons(dport); memcpy(&to.sin_addr.s_addr, he->h_addr_list[0], he->h_length); /* resolve source/listen */ he=gethostbyname(src); if (he==0){ fprintf(stderr, "ERROR: could not resolve %s\n", dst); goto error; } /* open socket*/ addr.sin_family=he->h_addrtype; addr.sin_port=htons(sport); memcpy(&addr.sin_addr.s_addr, he->h_addr_list[0], he->h_length); s_sock=-1; sock = socket(he->h_addrtype, SOCK_DGRAM, 0); if (use_diff_ssock && (sock!=-1)) s_sock = socket(he->h_addrtype, SOCK_DGRAM, 0); else s_sock=sock; if ((sock==-1)||(s_sock==-1)){ fprintf(stderr, "ERROR: socket: %s\n", strerror(errno)); goto error; } if (bind(sock, (struct sockaddr*) &addr, sizeof(struct sockaddr_in))==-1){ fprintf(stderr, "ERROR: bind: %s\n", strerror(errno)); goto error; } if (use_diff_ssock){ if (connect(s_sock, (struct sockaddr*) &to, sizeof(struct sockaddr_in))==-1){ fprintf(stderr, "ERROR: connect: %s\n", strerror(errno)); goto error; } } for(r=1; r<n; r++){ if ((pid=fork())==-1){ fprintf(stderr, "ERROR: fork: %s\n", strerror(errno)); goto error; } if (pid==0) break; /* child, skip */ } if (verbose>3) printf("process starting\n"); for(;;){ len=read(sock, buf, BUF_SIZE); if (len==-1){ fprintf(stderr, "ERROR: read: %s\n", strerror(errno)); continue; } if (verbose>2) putchar('r'); /* send it back*/ if (use_diff_ssock) len=send(s_sock, buf, len, 0); else len=sendto(s_sock, buf, len, 0, (struct sockaddr*) &to, sizeof(struct sockaddr_in)); if (len==-1){ fprintf(stderr, "ERROR: send: %s\n", strerror(errno)); continue; } if (verbose>1) putchar('.'); } error: exit(-1); }
/* HexChat * Copyright (C) 1998-2010 Peter Zelezny. * Copyright (C) 2009-2013 Berke Viktor. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef HEXCHAT_NOTIFYGUI_H #define HEXCHAT_NOTIFYGUI_H void notify_gui_update (void); void notify_opengui (void); #endif
/*********************************************************************** Copyright (c) 2006-2011, Skype Limited. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of Internet Society, IETF or IETF Trust, nor the names of specific contributors, may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***********************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "main.h" void silk_quant_LTP_gains( opus_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O (un)quantized LTP gains */ opus_int8 cbk_index[ MAX_NB_SUBFR ], /* O Codebook Index */ opus_int8 *periodicity_index, /* O Periodicity Index */ const opus_int32 W_Q18[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I Error Weights in Q18 */ opus_int mu_Q9, /* I Mu value (R/D tradeoff) */ opus_int lowComplexity, /* I Flag for low complexity */ const opus_int nb_subfr /* I number of subframes */ ) { opus_int j, k, cbk_size; opus_int8 temp_idx[ MAX_NB_SUBFR ]; const opus_uint8 *cl_ptr_Q5; const opus_int8 *cbk_ptr_Q7; const opus_int16 *b_Q14_ptr; const opus_int32 *W_Q18_ptr; opus_int32 rate_dist_Q14_subfr, rate_dist_Q14, min_rate_dist_Q14; /***************************************************/ /* iterate over different codebooks with different */ /* rates/distortions, and choose best */ /***************************************************/ min_rate_dist_Q14 = silk_int32_MAX; for( k = 0; k < 3; k++ ) { cl_ptr_Q5 = silk_LTP_gain_BITS_Q5_ptrs[ k ]; cbk_ptr_Q7 = silk_LTP_vq_ptrs_Q7[ k ]; cbk_size = silk_LTP_vq_sizes[ k ]; /* Set up pointer to first subframe */ W_Q18_ptr = W_Q18; b_Q14_ptr = B_Q14; rate_dist_Q14 = 0; for( j = 0; j < nb_subfr; j++ ) { silk_VQ_WMat_EC( &temp_idx[ j ], /* O index of best codebook vector */ &rate_dist_Q14_subfr, /* O best weighted quantization error + mu * rate */ b_Q14_ptr, /* I input vector to be quantized */ W_Q18_ptr, /* I weighting matrix */ cbk_ptr_Q7, /* I codebook */ cl_ptr_Q5, /* I code length for each codebook vector */ mu_Q9, /* I tradeoff between weighted error and rate */ cbk_size /* I number of vectors in codebook */ ); rate_dist_Q14 = silk_ADD_POS_SAT32( rate_dist_Q14, rate_dist_Q14_subfr ); b_Q14_ptr += LTP_ORDER; W_Q18_ptr += LTP_ORDER * LTP_ORDER; } /* Avoid never finding a codebook */ rate_dist_Q14 = silk_min( silk_int32_MAX - 1, rate_dist_Q14 ); if( rate_dist_Q14 < min_rate_dist_Q14 ) { min_rate_dist_Q14 = rate_dist_Q14; *periodicity_index = (opus_int8)k; silk_memcpy( cbk_index, temp_idx, nb_subfr * sizeof( opus_int8 ) ); } /* Break early in low-complexity mode if rate distortion is below threshold */ if( lowComplexity && ( rate_dist_Q14 < silk_LTP_gain_middle_avg_RD_Q14 ) ) { break; } } cbk_ptr_Q7 = silk_LTP_vq_ptrs_Q7[ *periodicity_index ]; for( j = 0; j < nb_subfr; j++ ) { for( k = 0; k < LTP_ORDER; k++ ) { B_Q14[ j * LTP_ORDER + k ] = silk_LSHIFT( cbk_ptr_Q7[ cbk_index[ j ] * LTP_ORDER + k ], 7 ); } } }
/* * copyright (c) 2006 Oded Shimon <ods15@ods15.dyndns.org> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FFMPEG_VORBIS_H #define FFMPEG_VORBIS_H #include "avcodec.h" extern const float ff_vorbis_floor1_inverse_db_table[256]; extern const float * ff_vorbis_vwin[8]; typedef struct { uint_fast16_t x; uint_fast16_t sort; uint_fast16_t low; uint_fast16_t high; } floor1_entry_t; void ff_vorbis_ready_floor1_list(floor1_entry_t * list, int values); unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n); // x^(1/n) int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, uint_fast32_t num); void ff_vorbis_floor1_render_list(floor1_entry_t * list, int values, uint_fast16_t * y_list, int * flag, int multiplier, float * out, int samples); #define ilog(i) av_log2(2*(i)) #endif /* FFMPEG_VORBIS_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 UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_ #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "ui/views/corewm/native_cursor_manager.h" #include "ui/views/views_export.h" namespace aura { class RootWindow; } namespace ui { class CursorLoader; } namespace views { class DesktopCursorLoaderUpdater; namespace corewm { class NativeCursorManagerDelegate; } // A NativeCursorManager that interacts with only one RootWindow. (Unlike the // one in ash, which interacts with all the RootWindows that ash knows about.) class VIEWS_EXPORT DesktopNativeCursorManager : public views::corewm::NativeCursorManager { public: DesktopNativeCursorManager( aura::RootWindow* window, scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater); virtual ~DesktopNativeCursorManager(); // Builds a cursor and sets the internal platform representation. gfx::NativeCursor GetInitializedCursor(int type); private: // Overridden from views::corewm::NativeCursorManager: virtual void SetDisplay( const gfx::Display& display, views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; virtual void SetCursor( gfx::NativeCursor cursor, views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; virtual void SetVisibility( bool visible, views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; virtual void SetScale( float scale, views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; virtual void SetMouseEventsEnabled( bool enabled, views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; aura::RootWindow* root_window_; scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater_; scoped_ptr<ui::CursorLoader> cursor_loader_; DISALLOW_COPY_AND_ASSIGN(DesktopNativeCursorManager); }; } // namespace views #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_
#pragma once /*** This file is part of systemd. Copyright 2010 Lennart Poettering systemd 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. systemd 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 systemd; If not, see <http://www.gnu.org/licenses/>. ***/ typedef struct Socket Socket; typedef struct SocketPeer SocketPeer; #include "mount.h" #include "service.h" #include "socket-util.h" typedef enum SocketExecCommand { SOCKET_EXEC_START_PRE, SOCKET_EXEC_START_CHOWN, SOCKET_EXEC_START_POST, SOCKET_EXEC_STOP_PRE, SOCKET_EXEC_STOP_POST, _SOCKET_EXEC_COMMAND_MAX, _SOCKET_EXEC_COMMAND_INVALID = -1 } SocketExecCommand; typedef enum SocketType { SOCKET_SOCKET, SOCKET_FIFO, SOCKET_SPECIAL, SOCKET_MQUEUE, SOCKET_USB_FUNCTION, _SOCKET_FIFO_MAX, _SOCKET_FIFO_INVALID = -1 } SocketType; typedef enum SocketResult { SOCKET_SUCCESS, SOCKET_FAILURE_RESOURCES, SOCKET_FAILURE_TIMEOUT, SOCKET_FAILURE_EXIT_CODE, SOCKET_FAILURE_SIGNAL, SOCKET_FAILURE_CORE_DUMP, SOCKET_FAILURE_START_LIMIT_HIT, SOCKET_FAILURE_TRIGGER_LIMIT_HIT, SOCKET_FAILURE_SERVICE_START_LIMIT_HIT, _SOCKET_RESULT_MAX, _SOCKET_RESULT_INVALID = -1 } SocketResult; typedef struct SocketPort { Socket *socket; SocketType type; int fd; int *auxiliary_fds; int n_auxiliary_fds; SocketAddress address; char *path; sd_event_source *event_source; LIST_FIELDS(struct SocketPort, port); } SocketPort; struct Socket { Unit meta; LIST_HEAD(SocketPort, ports); Set *peers_by_address; unsigned n_accepted; unsigned n_connections; unsigned max_connections; unsigned max_connections_per_source; unsigned backlog; unsigned keep_alive_cnt; usec_t timeout_usec; usec_t keep_alive_time; usec_t keep_alive_interval; usec_t defer_accept; ExecCommand* exec_command[_SOCKET_EXEC_COMMAND_MAX]; ExecContext exec_context; KillContext kill_context; CGroupContext cgroup_context; ExecRuntime *exec_runtime; DynamicCreds dynamic_creds; /* For Accept=no sockets refers to the one service we'll activate. For Accept=yes sockets is either NULL, or filled when the next service we spawn. */ UnitRef service; SocketState state, deserialized_state; sd_event_source *timer_event_source; ExecCommand* control_command; SocketExecCommand control_command_id; pid_t control_pid; mode_t directory_mode; mode_t socket_mode; SocketResult result; char **symlinks; bool accept; bool remove_on_stop; bool writable; int socket_protocol; /* Socket options */ bool keep_alive; bool no_delay; bool free_bind; bool transparent; bool broadcast; bool pass_cred; bool pass_sec; /* Only for INET6 sockets: issue IPV6_V6ONLY sockopt */ SocketAddressBindIPv6Only bind_ipv6_only; int priority; int mark; size_t receive_buffer; size_t send_buffer; int ip_tos; int ip_ttl; size_t pipe_size; char *bind_to_device; char *tcp_congestion; bool reuse_port; long mq_maxmsg; long mq_msgsize; char *smack; char *smack_ip_in; char *smack_ip_out; bool selinux_context_from_net; char *user, *group; bool reset_cpu_usage:1; char *fdname; RateLimit trigger_limit; }; SocketPeer *socket_peer_ref(SocketPeer *p); SocketPeer *socket_peer_unref(SocketPeer *p); int socket_acquire_peer(Socket *s, int fd, SocketPeer **p); DEFINE_TRIVIAL_CLEANUP_FUNC(SocketPeer*, socket_peer_unref); /* Called from the service code when collecting fds */ int socket_collect_fds(Socket *s, int **fds); /* Called from the service code when a per-connection service ended */ void socket_connection_unref(Socket *s); void socket_free_ports(Socket *s); int socket_instantiate_service(Socket *s); char *socket_fdname(Socket *s); extern const UnitVTable socket_vtable; const char* socket_exec_command_to_string(SocketExecCommand i) _const_; SocketExecCommand socket_exec_command_from_string(const char *s) _pure_; const char* socket_result_to_string(SocketResult i) _const_; SocketResult socket_result_from_string(const char *s) _pure_; const char* socket_port_type_to_string(SocketPort *p) _pure_;
//--------------------------------------------------------------------*- C++ -*- // CLING - the C++ LLVM-based InterpreterG :) // author: Vassil Vassilev <vasil.georgiev.vasilev@cern.ch> // // This file is dual-licensed: you can choose to license it under the University // of Illinois Open Source License or the GNU Lesser General Public License. See // LICENSE.TXT for details. //------------------------------------------------------------------------------ #ifndef CLING_DYNAMIC_LIBRARY_MANAGER_H #define CLING_DYNAMIC_LIBRARY_MANAGER_H #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSet.h" #include "llvm/Support/Path.h" namespace cling { class InterpreterCallbacks; class InvocationOptions; ///\brief A helper class managing dynamic shared objects. /// class DynamicLibraryManager { public: ///\brief Describes the result of loading a library. /// enum LoadLibResult { kLoadLibSuccess, ///< library loaded successfully kLoadLibAlreadyLoaded, ///< library was already loaded kLoadLibNotFound, ///< library was not found kLoadLibLoadError, ///< loading the library failed kLoadLibNumResults }; private: typedef const void* DyLibHandle; typedef llvm::DenseMap<DyLibHandle, std::string> DyLibs; ///\brief DynamicLibraries loaded by this Interpreter. /// DyLibs m_DyLibs; llvm::StringSet<> m_LoadedLibraries; ///\brief Contains the list of the current include paths. /// const InvocationOptions& m_Opts; ///\brief System's include path, get initialized at construction time. /// llvm::SmallVector<std::string, 32> m_SystemSearchPaths; InterpreterCallbacks* m_Callbacks; ///\brief Concatenates current include paths and the system include paths /// and performs a lookup for the filename. ///\param[in] libStem - The filename being looked up /// ///\returns the canonical path to the file or empty string if not found /// std::string lookupLibInPaths(llvm::StringRef libStem) const; ///\brief Concatenates current include paths and the system include paths /// and performs a lookup for the filename. If still not found it tries to /// add the platform-specific extensions (such as so, dll, dylib) and /// retries the lookup (from lookupLibInPaths) ///\param[in] filename - The filename being looked up /// ///\returns the canonical path to the file or empty string if not found /// std::string lookupLibMaybeAddExt(llvm::StringRef filename) const; public: DynamicLibraryManager(const InvocationOptions& Opts); ~DynamicLibraryManager(); InterpreterCallbacks* getCallbacks() { return m_Callbacks; } const InterpreterCallbacks* getCallbacks() const { return m_Callbacks; } void setCallbacks(InterpreterCallbacks* C) { m_Callbacks = C; } ///\brief Looks up a library taking into account the current include paths /// and the system include paths. ///\param[in] libStem - The filename being looked up /// ///\returns the canonical path to the file or empty string if not found /// std::string lookupLibrary(llvm::StringRef libStem) const; ///\brief Loads a shared library. /// ///\param [in] libStem - The file to loaded. ///\param [in] permanent - If false, the file can be unloaded later. /// ///\returns kLoadLibSuccess on success, kLoadLibAlreadyLoaded if the library /// was already loaded, kLoadLibError if the library cannot be found or any /// other error was encountered. /// LoadLibResult loadLibrary(const std::string& libStem, bool permanent); void unloadLibrary(llvm::StringRef libStem); ///\brief Returns true if the file was a dynamic library and it was already /// loaded. /// bool isLibraryLoaded(llvm::StringRef fullPath) const; ///\brief Explicitly tell the execution engine to use symbols from /// a shared library that would otherwise not be used for symbol /// resolution, e.g. because it was dlopened with RTLD_LOCAL. ///\param [in] handle - the system specific shared library handle. /// static void ExposeHiddenSharedLibrarySymbols(void* handle); static std::string normalizePath(llvm::StringRef path); }; } // end namespace cling #endif // CLING_DYNAMIC_LIBRARY_MANAGER_H
/* This source file is part of KBEngine For the latest info, see http://www.kbengine.org/ Copyright (c) 2008-2016 KBEngine. KBEngine 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. KBEngine 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 KBEngine. If not, see <http://www.gnu.org/licenses/>. */ #ifndef KBE_DATA_DOWNLOADS_H #define KBE_DATA_DOWNLOADS_H #include "helper/debug_helper.h" #include "common/common.h" namespace KBEngine{ class DataDownload; class DataDownloads { public: DataDownloads(); ~DataDownloads(); int16 pushDownload(DataDownload* pdl); void onDownloadCompleted(DataDownload* pdl); int16 freeID(int16 id); private: std::map<int16, DataDownload*> downloads_; std::set< uint16 > usedIDs_; }; class DataDownloadFactory { public: enum DataDownloadType { DATA_DOWNLOAD_STREAM_FILE = 1, DATA_DOWNLOAD_STREAM_STRING = 2 }; static DataDownload * create(DataDownloadType dltype, PyObjectPtr objptr, const std::string & desc, int16 id); }; } #endif // KBE_DATA_DOWNLOADS_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_INTERNAL_CORE_IOMGR_TIMER_H #define GRPC_INTERNAL_CORE_IOMGR_TIMER_H #include "src/core/iomgr/iomgr.h" #include "src/core/iomgr/exec_ctx.h" #include <grpc/support/port_platform.h> #include <grpc/support/time.h> typedef struct grpc_timer { gpr_timespec deadline; uint32_t heap_index; /* INVALID_HEAP_INDEX if not in heap */ int triggered; struct grpc_timer *next; struct grpc_timer *prev; grpc_closure closure; } grpc_timer; /* Initialize *timer. When expired or canceled, timer_cb will be called with *timer_cb_arg and status to indicate if it expired (SUCCESS) or was canceled (CANCELLED). timer_cb is guaranteed to be called exactly once, and application code should check the status to determine how it was invoked. The application callback is also responsible for maintaining information about when to free up any user-level state. */ void grpc_timer_init(grpc_exec_ctx *exec_ctx, grpc_timer *timer, gpr_timespec deadline, grpc_iomgr_cb_func timer_cb, void *timer_cb_arg, gpr_timespec now); /* Note that there is no timer destroy function. This is because the timer is a one-time occurrence with a guarantee that the callback will be called exactly once, either at expiration or cancellation. Thus, all the internal timer event management state is destroyed just before that callback is invoked. If the user has additional state associated with the timer, the user is responsible for determining when it is safe to destroy that state. */ /* Cancel an *timer. There are three cases: 1. We normally cancel the timer 2. The timer has already run 3. We can't cancel the timer because it is "in flight". In all of these cases, the cancellation is still considered successful. They are essentially distinguished in that the timer_cb will be run exactly once from either the cancellation (with status CANCELLED) or from the activation (with status SUCCESS) Note carefully that the callback function MAY occur in the same callstack as grpc_timer_cancel. It's expected that most timers will be cancelled (their primary use is to implement deadlines), and so this code is optimized such that cancellation costs as little as possible. Making callbacks run inline matches this aim. Requires: cancel() must happen after add() on a given timer */ void grpc_timer_cancel(grpc_exec_ctx *exec_ctx, grpc_timer *timer); #endif /* GRPC_INTERNAL_CORE_IOMGR_TIMER_H */
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_COMMANDS_GLOBAL_REGISTRY_H_ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_COMMANDS_GLOBAL_REGISTRY_H_ #include <map> #include <string> #include "base/compiler_specific.h" #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" #include "chrome/browser/extensions/extension_keybinding_registry.h" #include "chrome/browser/extensions/global_shortcut_listener.h" #include "ui/base/accelerators/accelerator.h" class Profile; namespace extensions { class Extension; } namespace extensions { // ExtensionCommandsGlobalRegistry is a class that handles the cross-platform // implementation of the global shortcut registration for the Extension Commands // API). // Note: It handles regular extension commands (not browserAction and pageAction // popups, which are not bindable to global shortcuts). This class registers the // accelerators on behalf of the extensions and routes the commands to them via // the BrowserEventRouter. class ExtensionCommandsGlobalRegistry : public ProfileKeyedAPI, public ExtensionKeybindingRegistry, public GlobalShortcutListener::Observer { public: // ProfileKeyedAPI implementation. static ProfileKeyedAPIFactory< ExtensionCommandsGlobalRegistry>* GetFactoryInstance(); // Convenience method to get the ExtensionCommandsGlobalRegistry for a // profile. static ExtensionCommandsGlobalRegistry* Get(Profile* profile); explicit ExtensionCommandsGlobalRegistry(Profile* profile); virtual ~ExtensionCommandsGlobalRegistry(); private: friend class ProfileKeyedAPIFactory<ExtensionCommandsGlobalRegistry>; // ProfileKeyedAPI implementation. static const char* service_name() { return "ExtensionCommandsGlobalRegistry"; } // Overridden from ExtensionKeybindingRegistry: virtual void AddExtensionKeybinding( const Extension* extension, const std::string& command_name) OVERRIDE; virtual void RemoveExtensionKeybindingImpl( const ui::Accelerator& accelerator, const std::string& command_name) OVERRIDE; // Called by the GlobalShortcutListener object when a shortcut this class has // registered for has been pressed. virtual void OnKeyPressed(const ui::Accelerator& accelerator) OVERRIDE; // Weak pointer to our profile. Not owned by us. Profile* profile_; DISALLOW_COPY_AND_ASSIGN(ExtensionCommandsGlobalRegistry); }; } // namespace extensions #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_COMMANDS_GLOBAL_REGISTRY_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. // // Utility functions manipulating syncable::Entries, intended for use by the // syncer. #ifndef SYNC_ENGINE_SYNCER_UTIL_H_ #define SYNC_ENGINE_SYNCER_UTIL_H_ #include <set> #include <string> #include <vector> #include "sync/engine/syncer.h" #include "sync/engine/syncer_types.h" #include "sync/syncable/entry_kernel.h" #include "sync/syncable/metahandle_set.h" #include "sync/syncable/mutable_entry.h" #include "sync/syncable/syncable_id.h" namespace sync_pb { class SyncEntity; } // namespace sync_pb namespace syncer { namespace syncable { class BaseTransaction; } // namespace syncable class Cryptographer; // If the server sent down a client-tagged entry, or an entry whose // commit response was lost, it is necessary to update a local entry // with an ID that doesn't match the ID of the update. Here, we // find the ID of such an entry, if it exists. This function may // determine that |server_entry| should be dropped; if so, it returns // the null ID -- callers must handle this case. When update application // should proceed normally with a new local entry, this function will // return server_entry.id(); the caller must create an entry with that // ID. This function does not alter the database. syncable::Id FindLocalIdToUpdate( syncable::BaseTransaction* trans, const sync_pb::SyncEntity& server_entry); UpdateAttemptResponse AttemptToUpdateEntry( syncable::WriteTransaction* const trans, syncable::MutableEntry* const entry, Cryptographer* cryptographer); // Returns the most accurate position information available in this update. It // prefers to use the unique_position() field, but will fall back to using the // int64-based position_in_parent if necessary. // // The suffix parameter is the unique bookmark tag for the item being updated. // // Will return an invalid position if no valid position can be constructed, or // if this type does not support positioning. UniquePosition GetUpdatePosition(const sync_pb::SyncEntity& update, const std::string& suffix); // Fetch the cache_guid and item_id-based unique bookmark tag from an update. // Will return an empty string if someting unexpected happens. std::string GetUniqueBookmarkTagFromUpdate(const sync_pb::SyncEntity& update); // Pass in name to avoid redundant UTF8 conversion. void UpdateServerFieldsFromUpdate( syncable::MutableEntry* local_entry, const sync_pb::SyncEntity& server_entry, const std::string& name); // Creates a new Entry iff no Entry exists with the given id. void CreateNewEntry(syncable::WriteTransaction *trans, const syncable::Id& id); // This function is called on an entry when we can update the user-facing data // from the server data. void UpdateLocalDataFromServerData(syncable::WriteTransaction* trans, syncable::MutableEntry* entry); VerifyCommitResult ValidateCommitEntry(syncable::Entry* entry); VerifyResult VerifyNewEntry(const sync_pb::SyncEntity& update, syncable::Entry* target, const bool deleted); // Assumes we have an existing entry; check here for updates that break // consistency rules. VerifyResult VerifyUpdateConsistency(syncable::WriteTransaction* trans, const sync_pb::SyncEntity& update, syncable::MutableEntry* target, const bool deleted, const bool is_directory, ModelType model_type); // Assumes we have an existing entry; verify an update that seems to be // expressing an 'undelete' VerifyResult VerifyUndelete(syncable::WriteTransaction* trans, const sync_pb::SyncEntity& update, syncable::MutableEntry* target); void MarkDeletedChildrenSynced( syncable::Directory* dir, std::set<syncable::Id>* deleted_folders); } // namespace syncer #endif // SYNC_ENGINE_SYNCER_UTIL_H_
/* Test for getrandom syscall which is available on Solaris 11. */ #include "scalar.h" int main(void) { /* Uninitialised, but we know px[0] is 0x0. */ long *px = malloc(sizeof(long)); x0 = px[0]; /* SYS_getrandom 143 */ GO(SYS_getrandom, "(getrandom) 3s 1m"); SY(SYS_getrandom, x0 + 1, x0 + 1, x0); FAIL; return 0; }
/* * Arch specific extensions to struct device * * This file is released under the GPLv2 */ #ifndef _ASM_SPARC64_DEVICE_H #define _ASM_SPARC64_DEVICE_H struct device_node; struct of_device; struct dev_archdata { void *iommu; void *stc; void *host_controller; struct device_node *prom_node; struct of_device *op; }; #endif /* _ASM_SPARC64_DEVICE_H */
// Copyright (C) 2002-2012 Nikolaus Gebhardt // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h #ifndef __I_GUI_COMBO_BOX_H_INCLUDED__ #define __I_GUI_COMBO_BOX_H_INCLUDED__ #include "IGUIElement.h" namespace irr { namespace gui { //! Combobox widget /** \par This element can create the following events of type EGUI_EVENT_TYPE: \li EGET_COMBO_BOX_CHANGED */ class IGUIComboBox : public IGUIElement { public: //! constructor IGUIComboBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) : IGUIElement(EGUIET_COMBO_BOX, environment, parent, id, rectangle) {} //! Returns amount of items in box virtual u32 getItemCount() const = 0; //! Returns string of an item. the idx may be a value from 0 to itemCount-1 virtual const wchar_t* getItem(u32 idx) const = 0; //! Returns item data of an item. the idx may be a value from 0 to itemCount-1 virtual u32 getItemData(u32 idx) const = 0; //! Returns index based on item data virtual s32 getIndexForItemData(u32 data ) const = 0; //! Adds an item and returns the index of it virtual u32 addItem(const wchar_t* text, u32 data = 0) = 0; //! Removes an item from the combo box. /** Warning. This will change the index of all following items */ virtual void removeItem(u32 idx) = 0; //! Deletes all items in the combo box virtual void clear() = 0; //! Returns id of selected item. returns -1 if no item is selected. virtual s32 getSelected() const = 0; //! Sets the selected item. Set this to -1 if no item should be selected virtual void setSelected(s32 idx) = 0; //! Sets text justification of the text area /** \param horizontal: EGUIA_UPPERLEFT for left justified (default), EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text. \param vertical: EGUIA_UPPERLEFT to align with top edge, EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */ virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0; //! Set the maximal number of rows for the selection listbox virtual void setMaxSelectionRows(u32 max) = 0; //! Get the maximimal number of rows for the selection listbox virtual u32 getMaxSelectionRows() const = 0; }; } // end namespace gui } // end namespace irr #endif
#include <unistd.h> #include <fcntl.h> #include "syscall.h" int link(const char *existing, const char *new) { #ifdef SYS_link return syscall(SYS_link, existing, new); #else return syscall(SYS_linkat, AT_FDCWD, existing, AT_FDCWD, new, 0); #endif }
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_X86_VSYSCALL_H #define _ASM_X86_VSYSCALL_H #include <linux/seqlock.h> #include <uapi/asm/vsyscall.h> #ifdef CONFIG_X86_VSYSCALL_EMULATION extern void map_vsyscall(void); /* * Called on instruction fetch fault in vsyscall page. * Returns true if handled. */ extern bool emulate_vsyscall(struct pt_regs *regs, unsigned long address); #else static inline void map_vsyscall(void) {} static inline bool emulate_vsyscall(struct pt_regs *regs, unsigned long address) { return false; } #endif #endif /* _ASM_X86_VSYSCALL_H */
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_COMMON_RUNTIME_CONSTANT_FOLDING_H_ #define TENSORFLOW_COMMON_RUNTIME_CONSTANT_FOLDING_H_ #include "tensorflow/core/common_runtime/device.h" #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/graph/graph.h" #include "tensorflow/core/graph/graph_constructor.h" namespace tensorflow { // Perform constant folding optimization on "graph". // Looks for nodes in "graph" that can be completely evaluated statically, i.e., // that are only dependent on constants. Evaluates those nodes on a CPU device // and replaces those nodes with the result of the evaluation. // "partition_device", if non-null, is the device where all the graph nodes are // assumed to execute. // Returns true if and only if "graph" has been mutated. bool DoConstantFolding(const ConstantFoldingOptions& opts, FunctionLibraryRuntime* function_library, Env* env, Device* partition_device, Graph* graph); typedef std::pair<Node*, int> NodeAndOutput; // Replaces the identified Tensor in 'graph' by a 'Const' node with // the value supplied in 'constant'. 'partition_device', if non-null // is the device where the graph executes. Returns true if the // replacement was successful, false otherwise. bool ReplaceTensorWithConstant(Graph* graph, Device* partition_device, NodeAndOutput tensor, const Tensor& constant); } // namespace tensorflow #endif // TENSORFLOW_COMMON_RUNTIME_CONSTANT_FOLDING_H_
/* Copyright (C) 1996, 1997 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <errno.h> #include <sched.h> /* Get minimum priority value for a scheduler. */ int __sched_get_priority_min (int algorithm) { __set_errno (ENOSYS); return -1; } stub_warning (sched_get_priority_min) weak_alias (__sched_get_priority_min, sched_get_priority_min) #include <stub-tag.h>
/* SPDX-License-Identifier: GPL-2.0 */ /* atomic.h: These still suck, but the I-cache hit rate is higher. * * Copyright (C) 1996 David S. Miller (davem@davemloft.net) * Copyright (C) 2000 Anton Blanchard (anton@linuxcare.com.au) * Copyright (C) 2007 Kyle McMartin (kyle@parisc-linux.org) * * Additions by Keith M Wesolowski (wesolows@foobazco.org) based * on asm-parisc/atomic.h Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>. */ #ifndef __ARCH_SPARC_ATOMIC__ #define __ARCH_SPARC_ATOMIC__ #include <linux/types.h> #include <asm/cmpxchg.h> #include <asm/barrier.h> #include <asm-generic/atomic64.h> #define ATOMIC_INIT(i) { (i) } int atomic_add_return(int, atomic_t *); int atomic_fetch_add(int, atomic_t *); int atomic_fetch_and(int, atomic_t *); int atomic_fetch_or(int, atomic_t *); int atomic_fetch_xor(int, atomic_t *); int atomic_cmpxchg(atomic_t *, int, int); int atomic_xchg(atomic_t *, int); int __atomic_add_unless(atomic_t *, int, int); void atomic_set(atomic_t *, int); #define atomic_set_release(v, i) atomic_set((v), (i)) #define atomic_read(v) ACCESS_ONCE((v)->counter) #define atomic_add(i, v) ((void)atomic_add_return( (int)(i), (v))) #define atomic_sub(i, v) ((void)atomic_add_return(-(int)(i), (v))) #define atomic_inc(v) ((void)atomic_add_return( 1, (v))) #define atomic_dec(v) ((void)atomic_add_return( -1, (v))) #define atomic_and(i, v) ((void)atomic_fetch_and((i), (v))) #define atomic_or(i, v) ((void)atomic_fetch_or((i), (v))) #define atomic_xor(i, v) ((void)atomic_fetch_xor((i), (v))) #define atomic_sub_return(i, v) (atomic_add_return(-(int)(i), (v))) #define atomic_fetch_sub(i, v) (atomic_fetch_add (-(int)(i), (v))) #define atomic_inc_return(v) (atomic_add_return( 1, (v))) #define atomic_dec_return(v) (atomic_add_return( -1, (v))) #define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) /* * atomic_inc_and_test - increment and test * @v: pointer of type atomic_t * * Atomically increments @v by 1 * and returns true if the result is zero, or false for all * other cases. */ #define atomic_inc_and_test(v) (atomic_inc_return(v) == 0) #define atomic_dec_and_test(v) (atomic_dec_return(v) == 0) #define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0) #endif /* !(__ARCH_SPARC_ATOMIC__) */
/* * Copyright (c) 2000-2007 Marc Alexander Lehmann <schmorp@schmorp.de> * * Redistribution and use in source and binary forms, with or without modifica- * tion, 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 ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- * CIAL, 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 OTH- * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, the contents of this file may be used under the terms of * the GNU General Public License ("GPL") version 2 or any later version, * in which case the provisions of the GPL are applicable instead of * the above. If you wish to allow the use of your version of this file * only under the terms of the GPL and not to allow others to use your * version of this file under the BSD license, indicate your decision * by deleting the provisions above and replace them with the notice * and other provisions required by the GPL. If you do not delete the * provisions above, a recipient may use your version of this file under * either the BSD or the GPL. */ #ifndef LZFP_h #define LZFP_h #define STANDALONE 1 /* at the moment, this is ok. */ #ifndef STANDALONE # include "lzf.h" #endif /* * Size of hashtable is (1 << HLOG) * sizeof (char *) * decompression is independent of the hash table size * the difference between 15 and 14 is very small * for small blocks (and 14 is usually a bit faster). * For a low-memory/faster configuration, use HLOG == 13; * For best compression, use 15 or 16 (or more, up to 23). */ #ifndef HLOG # define HLOG 16 #endif /* * Sacrifice very little compression quality in favour of compression speed. * This gives almost the same compression as the default code, and is * (very roughly) 15% faster. This is the preferred mode of operation. */ #ifndef VERY_FAST # define VERY_FAST 1 #endif /* * Sacrifice some more compression quality in favour of compression speed. * (roughly 1-2% worse compression for large blocks and * 9-10% for small, redundant, blocks and >>20% better speed in both cases) * In short: when in need for speed, enable this for binary data, * possibly disable this for text data. */ #ifndef ULTRA_FAST # define ULTRA_FAST 0 #endif /* * Unconditionally aligning does not cost very much, so do it if unsure */ #ifndef STRICT_ALIGN # define STRICT_ALIGN !(defined(__i386) || defined (__amd64)) #endif /* * You may choose to pre-set the hash table (might be faster on some * modern cpus and large (>>64k) blocks, and also makes compression * deterministic/repeatable when the configuration otherwise is the same). */ #ifndef INIT_HTAB # define INIT_HTAB 0 #endif /* * Avoid assigning values to errno variable? for some embedding purposes * (linux kernel for example), this is necessary. NOTE: this breaks * the documentation in lzf.h. */ #ifndef AVOID_ERRNO # define AVOID_ERRNO 0 #endif /* * Whether to pass the LZF_STATE variable as argument, or allocate it * on the stack. For small-stack environments, define this to 1. * NOTE: this breaks the prototype in lzf.h. */ #ifndef LZF_STATE_ARG # define LZF_STATE_ARG 0 #endif /* * Whether to add extra checks for input validity in lzf_decompress * and return EINVAL if the input stream has been corrupted. This * only shields against overflowing the input buffer and will not * detect most corrupted streams. * This check is not normally noticeable on modern hardware * (<1% slowdown), but might slow down older cpus considerably. */ #ifndef CHECK_INPUT # define CHECK_INPUT 1 #endif /*****************************************************************************/ /* nothing should be changed below */ typedef unsigned char u8; typedef const u8 *LZF_STATE[1 << (HLOG)]; #if !STRICT_ALIGN /* for unaligned accesses we need a 16 bit datatype. */ # include <limits.h> # if USHRT_MAX == 65535 typedef unsigned short u16; # elif UINT_MAX == 65535 typedef unsigned int u16; # else # undef STRICT_ALIGN # define STRICT_ALIGN 1 # endif #endif #if ULTRA_FAST # if defined(VERY_FAST) # undef VERY_FAST # endif #endif #if INIT_HTAB # ifdef __cplusplus # include <cstring> # else # include <string.h> # endif #endif #endif
/* * Copyright 2015 Martin Peres * * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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. * * Authors: Martin Peres <martin.peres@free.fr> */ #ifndef __NOUVEAU_LED_H__ #define __NOUVEAU_LED_H__ #include "nouveau_drv.h" struct led_classdev; struct nouveau_led { struct drm_device *dev; struct led_classdev led; }; static inline struct nouveau_led * nouveau_led(struct drm_device *dev) { return nouveau_drm(dev)->led; } /* nouveau_led.c */ #if IS_ENABLED(CONFIG_LEDS_CLASS) int nouveau_led_init(struct drm_device *dev); void nouveau_led_suspend(struct drm_device *dev); void nouveau_led_resume(struct drm_device *dev); void nouveau_led_fini(struct drm_device *dev); #else static inline int nouveau_led_init(struct drm_device *dev) { return 0; }; static inline void nouveau_led_suspend(struct drm_device *dev) { }; static inline void nouveau_led_resume(struct drm_device *dev) { }; static inline void nouveau_led_fini(struct drm_device *dev) { }; #endif #endif
/* { dg-options "-Og -fPIC -fschedule-insns2 -fselective-scheduling2 -fno-tree-fre --param=max-sched-extend-regions-iters=10" } */ /* { dg-require-effective-target scheduling } */ /* { dg-require-effective-target fpic } */ void bar (unsigned int); void foo (void) { char buf[1] = { 3 }; const char *p = buf; const char **q = &p; unsigned int ch; switch (**q) { case 1: ch = 5; break; case 2: ch = 4; break; case 3: ch = 3; break; case 4: ch = 2; break; case 5: ch = 1; break; default: ch = 0; break; } bar (ch); }
// // TmuxStateParser.h // iTerm // // Created by George Nachman on 11/30/11. // Copyright (c) 2011 Georgetech. All rights reserved. // #import <Foundation/Foundation.h> extern NSString *kStateDictSavedGrid; extern NSString *kStateDictAltSavedCX; extern NSString *kStateDictAltSavedCY; extern NSString *kStateDictSavedCX; extern NSString *kStateDictSavedCY; extern NSString *kStateDictCursorX; extern NSString *kStateDictCursorY; extern NSString *kStateDictScrollRegionUpper; extern NSString *kStateDictScrollRegionLower; extern NSString *kStateDictTabstops; extern NSString *kStateDictCursorMode; extern NSString *kStateDictInsertMode; extern NSString *kStateDictKCursorMode; extern NSString *kStateDictKKeypadMode; extern NSString *kStateDictWrapMode; extern NSString *kStateDictMouseStandardMode; extern NSString *kStateDictMouseButtonMode; extern NSString *kStateDictMouseAnyMode; extern NSString *kStateDictMouseUTF8Mode; @interface TmuxStateParser : NSObject + (NSString *)format; + (TmuxStateParser *)sharedInstance; - (NSMutableDictionary *)parsedStateFromString:(NSString *)layout forPaneId:(int)paneId; @end
#ifndef XADMASTER_SUPERDUPER3_C #define XADMASTER_SUPERDUPER3_C /* $Id: SuperDuper3.c,v 1.7 2005/06/23 14:54:41 stoecker Exp $ SuperDuper3 disk image client XAD library system for archive handling Copyright (C) 1998 and later by Dirk Stöcker <soft@dstoecker.de> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "../unix/xadClient.h" #include "xadIO_XPK.c" #ifndef XADMASTERVERSION #define XADMASTERVERSION 8 #endif XADCLIENTVERSTR("SuperDuper3 1.4 (23.02.2004)") #define SUPERDUPER3_VERSION 1 #define SUPERDUPER3_REVISION 4 XADRECOGDATA(SuperDuper3) { if(EndGetM32(data) == 0x464F524D && (EndGetM32(data+8) == 0x53444444 || EndGetM32(data+8) == 0x53444844)) return 1; else return 0; } XADGETINFO(SuperDuper3) { xadINT32 err; xadUINT8 data[9*4]; xadUINT32 num = 0; struct xadDiskInfo *xdi; if(!(xdi = (struct xadDiskInfo *) xadAllocObjectA(XADM XADOBJ_DISKINFO, 0))) return XADERR_NOMEMORY; ai->xai_DiskInfo = xdi; if((err = xadHookAccess(XADM XADAC_READ, 12, data, ai))) return err; xdi->xdi_EntryNumber = 1; xdi->xdi_SectorSize = 512; xdi->xdi_Cylinders = 80; xdi->xdi_Heads = 2; xdi->xdi_Flags = XADDIF_GUESSLOWCYL|XADDIF_GUESSHIGHCYL|XADDIF_SEEKDATAPOS; /*xdi->xdi_LowCyl = 0; */ xdi->xdi_DataPos = 12; xdi->xdi_TrackSectors = (EndGetM32(data+8) == 0x53444844) ? 22 : 11; xdi->xdi_CylSectors = 2 * xdi->xdi_TrackSectors; xdi->xdi_TotalSectors = 80 * xdi->xdi_CylSectors; while(ai->xai_InPos < ai->xai_InSize) { if((err = xadHookAccess(XADM XADAC_READ, 36, data, ai))) return err; if((err = xadHookAccess(XADM XADAC_INPUTSEEK, (xadUINT32) EndGetM32(data+4)-28, 0, ai))) return err; ++num; if(EndGetM32(data) == 0x58504B46 && (EndGetM32(data+8*4) & (1<<25))) { /* check for password flag in every entry */ ai->xai_Flags |= XADAIF_CRYPTED; xdi->xdi_Flags |= XADDIF_CRYPTED; } } if(num > 80) return XADERR_ILLEGALDATA; xdi->xdi_HighCyl = num-1; return 0; } XADUNARCHIVE(SuperDuper3) { xadUINT32 i; xadINT32 err = 0; xadUINT8 data[8]; /* skip entries */ for(i = ai->xai_CurDisk->xdi_LowCyl; !err && i < ai->xai_LowCyl; ++i) { if(!(err = xadHookAccess(XADM XADAC_READ, 8, data, ai))) err = xadHookAccess(XADM XADAC_INPUTSEEK, (xadUINT32) EndGetM32(data+4), 0, ai); } for(; !err && i <= ai->xai_HighCyl; ++i) { if(!(err = xadHookAccess(XADM XADAC_READ, 8, data, ai))) { if(EndGetM32(data) == 0x58504B46) { if(!(err = xadHookAccess(XADM XADAC_INPUTSEEK, (xadUINT32) -8, 0, ai))) { struct xadInOut *io; if((io = xadIOAlloc(XADIOF_ALLOCINBUFFER|XADIOF_ALLOCOUTBUFFER |XADIOF_NOOUTENDERR, ai, xadMasterBase))) { io->xio_InSize = EndGetM32(data+4)+8; if(!(err = xadIO_XPK(io, io->xio_ArchiveInfo->xai_Password))) err = xadIOWriteBuf(io); xadFreeObjectA(XADM io, 0); } else err = XADERR_NOMEMORY; } } else /* normal BODY chunk */ err = xadHookAccess(XADM XADAC_COPY, (xadUINT32) EndGetM32(data+4), 0, ai); } } return err; } XADFIRSTCLIENT(SuperDuper3) { XADNEXTCLIENT, XADCLIENT_VERSION, XADMASTERVERSION, SUPERDUPER3_VERSION, SUPERDUPER3_REVISION, 12, XADCF_DISKARCHIVER|XADCF_FREEDISKINFO, XADCID_SUPERDUPER3, "SuperDuper3", XADRECOGDATAP(SuperDuper3), XADGETINFOP(SuperDuper3), XADUNARCHIVEP(SuperDuper3), 0 }; #undef XADNEXTCLIENT #define XADNEXTCLIENT XADNEXTCLIENTNAME(SuperDuper3) #endif /* XADMASTER_SUPERDUPER3_C */
#ifndef ___FUSE_H___ #define ___FUSE_H___ extern void fuse_request_send_background_ex(struct fuse_conn *fc, struct fuse_req *req, __u32 size); extern void fuse_request_send_ex(struct fuse_conn *fc, struct fuse_req *req, __u32 size); #ifndef USER_BUILD_KERNEL /* IO log is only enabled in eng load */ #define FUSEIO_TRACE #endif #ifdef MET_FUSEIO_TRACE #define MET_FUSE_IOLOG_INIT() struct timespec met_fuse_start_time, met_fuse_end_time #define MET_FUSE_IOLOG_START() get_monotonic_boottime(&met_fuse_start_time) #define MET_FUSE_IOLOG_END() get_monotonic_boottime(&met_fuse_end_time) #else #define MET_FUSE_IOLOG_INIT(...) #define MET_FUSE_IOLOG_START(...) #define MET_FUSE_IOLOG_END(...) #endif #ifdef FUSEIO_TRACE #include <linux/sched.h> #include <linux/xlog.h> #include <linux/kthread.h> extern void fuse_time_diff(struct timespec *start, struct timespec *end, struct timespec *diff); extern void fuse_iolog_add(__u32 io_bytes, int type, struct timespec *start, struct timespec *end); extern __u32 fuse_iolog_timeus_diff(struct timespec *start, struct timespec *end); extern void fuse_iolog_exit(void); extern void fuse_iolog_init(void); struct fuse_rw_info { __u32 count; __u32 bytes; __u32 us; }; struct fuse_proc_info { pid_t pid; __u32 valid; int misc_type; struct fuse_rw_info read; struct fuse_rw_info write; struct fuse_rw_info misc; }; #define FUSE_IOLOG_MAX 12 #define FUSE_IOLOG_BUFLEN 512 #define FUSE_IOLOG_LATENCY 1 #define FUSE_IOLOG_INIT() struct timespec _tstart, _tend #define FUSE_IOLOG_START() get_monotonic_boottime(&_tstart) #define FUSE_IOLOG_END() get_monotonic_boottime(&_tend) #define FUSE_IOLOG_US() fuse_iolog_timeus_diff(&_tstart, &_tend) #define FUSE_IOLOG_PRINT(iobytes, type) fuse_iolog_add(iobytes, type, &_tstart, &_tend) #else #define FUSE_IOLOG_INIT(...) #define FUSE_IOLOG_START(...) #define FUSE_IOLOG_END(...) #define FUSE_IOLOG_PRINT(...) #define fuse_iolog_init(...) #define fuse_iolog_exit(...) #endif #endif
/* Generated automatically. DO NOT EDIT! */ #define SIMD_HEADER "simd-avx.h" #include "../common/n2bv_20.c"
// @(#)root/minuit2:$Id$ // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005 /********************************************************************** * * * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT * * * **********************************************************************/ #ifndef ROOT_Minuit2_Numerical2PGradientCalculator #define ROOT_Minuit2_Numerical2PGradientCalculator #include "Minuit2/MnConfig.h" #include "Minuit2/GradientCalculator.h" #include <vector> namespace ROOT { namespace Minuit2 { class MnFcn; class MnUserTransformation; class MnMachinePrecision; class MnStrategy; /** class performing the numerical gradient calculation */ class Numerical2PGradientCalculator : public GradientCalculator { public: Numerical2PGradientCalculator(const MnFcn& fcn, const MnUserTransformation& par, const MnStrategy& stra) : fFcn(fcn), fTransformation(par), fStrategy(stra) {} virtual ~Numerical2PGradientCalculator() {} virtual FunctionGradient operator()(const MinimumParameters&) const; virtual FunctionGradient operator()(const std::vector<double>& params) const; virtual FunctionGradient operator()(const MinimumParameters&, const FunctionGradient&) const; const MnFcn& Fcn() const {return fFcn;} const MnUserTransformation& Trafo() const {return fTransformation;} const MnMachinePrecision& Precision() const; const MnStrategy& Strategy() const {return fStrategy;} unsigned int Ncycle() const; double StepTolerance() const; double GradTolerance() const; private: const MnFcn& fFcn; const MnUserTransformation& fTransformation; const MnStrategy& fStrategy; }; } // namespace Minuit2 } // namespace ROOT #endif // ROOT_Minuit2_Numerical2PGradientCalculator
/* ***************************************************************** * * Copyright 2016 Samsung Electronics All Rights Reserved. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "caadapterutils.h" #include "cainterface.h" #include "camessagehandler.h" #include "caremotehandler.h" #include "oic_malloc.h" #include "oic_string.h" #include "octhread.h" #include "logger.h" #include "caadapterutils.h" #include "caconnectionmanager.h" #include "capolicymanager.h" #define TAG "OIC_CM" static oc_mutex g_threadCMConfigureMutex = NULL; // context for connection manager static CAConnectionManagerContext_t g_context = {.sendThreadFunc = NULL, .receivedThreadFunc = NULL, .dataList = NULL}; void CAStartConnectionManagerService(CMConfigureInfo_t info) { OIC_LOG(DEBUG, TAG, "CAStartConnectionManagerService"); oc_mutex_lock(g_threadCMConfigureMutex); CMSetConfigure(info); oc_mutex_unlock(g_threadCMConfigureMutex); } CAData_t* CAGetConnectionManagerMessageData(CAData_t *data) { OIC_LOG(DEBUG, TAG, "CAGetConnectionManagerMessageData"); VERIFY_NON_NULL_RET(data, TAG, "data is null", NULL); // TODO // decide specific reqeust/response message return data; } CAResult_t CAInitializeConnectionManager(CASendThreadFunc sendThreadFunc, CAReceiveThreadFunc receivedThreadFunc) { OIC_LOG(DEBUG, TAG, "CAInitializeConnectionManager"); if (!g_context.sendThreadFunc) { g_context.sendThreadFunc = sendThreadFunc; } if (!g_context.receivedThreadFunc) { g_context.receivedThreadFunc = receivedThreadFunc; } if (!g_context.dataList) { g_context.dataList = u_arraylist_create(); } CAResult_t res = CAInitConnectionManagerMutexVariables(); if (CA_STATUS_OK != res) { u_arraylist_free(&g_context.dataList); g_context.dataList = NULL; OIC_LOG(ERROR, TAG, "init has failed"); } return res; } void CATerminateConnectionManager() { OIC_LOG(DEBUG, TAG, "CATerminateConnectionManager"); if (g_context.dataList) { // TODO // Remove all of management data(); u_arraylist_free(&g_context.dataList); } CATerminateConnectionManagerMutexVariables(); } CAResult_t CAInitConnectionManagerMutexVariables() { if (!g_context.dataListMutex) { g_context.dataListMutex = oc_mutex_new(); if (!g_context.dataListMutex) { OIC_LOG(ERROR, TAG, "oc_mutex_new has failed"); return CA_STATUS_FAILED; } } if (!g_context.dataSenderMutex) { g_context.dataSenderMutex = oc_mutex_new(); if (!g_context.dataSenderMutex) { OIC_LOG(ERROR, TAG, "oc_mutex_new has failed"); CATerminateConnectionManagerMutexVariables(); return CA_STATUS_FAILED; } } if (NULL == g_threadCMConfigureMutex) { g_threadCMConfigureMutex = oc_mutex_new(); if (NULL == g_threadCMConfigureMutex) { OIC_LOG(ERROR, TAG, "oc_mutex_new has failed"); return CA_STATUS_FAILED; } } return CA_STATUS_OK; } void CATerminateConnectionManagerMutexVariables() { if (g_context.dataListMutex) { oc_mutex_free(g_context.dataListMutex); g_context.dataListMutex = NULL; } if (g_context.dataSenderMutex) { oc_mutex_free(g_context.dataSenderMutex); g_context.dataSenderMutex = NULL; } if (g_threadCMConfigureMutex) { oc_mutex_free(g_threadCMConfigureMutex); g_threadCMConfigureMutex = NULL; } }
/* * Copyright (c) 2012, Freescale Semiconductor, 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: * * o Redistributions of source code must retain the above copyright notice, this list * of conditions and the following disclaimer. * * o 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. * * o Neither the name of Freescale Semiconductor, 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 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. */ /*! * @file sdma_script_info.c * @brief a global varialbe to hold the information of the script code. */ #include "sdma_script_info.h" #if defined(CHIP_MX53) #include "sdma_script_code_mx53.h" #elif defined (CHIP_MX6DQ) #include "sdma_script_code_mx6dq.h" #elif defined (CHIP_MX6SDL) || defined (CHIP_MX6SL) #include "sdma_script_code_mx6sdl.h" #endif #ifdef CHIP_MX53 const sdma_script_info_t script_info = { 0x00000001, 0x53, { {SDMA_AP_2_AP, ap_2_ap_ADDR}, {SDMA_APP_2_MCU, app_2_mcu_ADDR}, {SDMA_MCU_2_APP, mcu_2_app_ADDR}, {SDMA_UART_2_MCU, uart_2_mcu_ADDR}, {SDMA_SHP_2_MCU, shp_2_mcu_ADDR}, {SDMA_MCU_2_SHP, mcu_2_shp_ADDR}, {SDMA_SPDIF_2_MCU, spdif_2_mcu_ADDR}, {SDMA_MCU_2_SPDIF, mcu_2_spdif_ADDR}, {SDMA_FIRI_2_MCU, firi_2_mcu_ADDR}, {SDMA_MCU_2_FIRI, mcu_2_firi_ADDR}, {SDMA_MCU_2_SSIAPP, mcu_2_ssiapp_ADDR}, {SDMA_MCU_2_SSISH, mcu_2_ssish_ADDR}, {SDMA_P_2_P, p_2_p_ADDR}, {SDMA_SSIAPP_2_MCU, ssiapp_2_mcu_ADDR}, {SDMA_SSISH_2_MCU, ssish_2_mcu_ADDR}, {SDMA_NUM_SCRIPTS, 0}, }, RAM_CODE_SIZE, sdma_code }; #else const sdma_script_info_t script_info = { 0x00000001, 0x61, { {SDMA_AP_2_AP, ap_2_ap_ADDR}, {SDMA_APP_2_MCU, app_2_mcu_ADDR}, {SDMA_MCU_2_APP, mcu_2_app_ADDR}, {SDMA_UART_2_MCU, uart_2_mcu_ADDR}, {SDMA_SHP_2_MCU, shp_2_mcu_ADDR}, {SDMA_MCU_2_SHP, mcu_2_shp_ADDR}, {SDMA_SPDIF_2_MCU, spdif_2_mcu_ADDR}, {SDMA_MCU_2_SPDIF, mcu_2_spdif_ADDR}, {SDMA_MCU_2_SSIAPP, mcu_2_ssiapp_ADDR}, {SDMA_MCU_2_SSISH, mcu_2_ssish_ADDR}, {SDMA_P_2_P, p_2_p_ADDR}, {SDMA_SSIAPP_2_MCU, ssiapp_2_mcu_ADDR}, {SDMA_SSISH_2_MCU, ssish_2_mcu_ADDR}, {SDMA_NUM_SCRIPTS, 0}, }, RAM_CODE_SIZE, sdma_code }; #endif