text
stringlengths
4
6.14k
/* * linux/drivers/usbd/usb-module.h * * Copyright (c) 2000, 2001, 2002 Lineo * Copyright (c) 2001 Hewlett Packard * * By: * Stuart Lynne <sl@lineo.com>, * Tom Rushworth <tbr@lineo.com>, * Bruce Balden <balden@lineo.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., 675 Mass Ave, Cambridge, MA 02139, USA. * */ /* * * USBD_MODULE_INFO(info) * * * The info parameter should take the form: * * "usbdcore 0.1-beta" * * name usbdcore * major 0 * minor 1 * status beta * * Status should be one of: * * alpha work in progress, preview only * beta initial testing, not for deployment * * early suitable for production use where new features are needed * limited suitable for new installations * production most stable * * deprectated no longer maintained * abandoned no longer available * * Additional information added from usbd-export.h and usbd-build.h will * record the build number and date exported. */ #if 1 #define USBD_MODULE_INFO(info) \ const char __usbd_module_info[] = info " " USBD_BUILD " " USBD_EXPORT_DATE; #else #define USBD_MODULE_INFO(info) #endif
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_FRAME_TEST_NET_TEST_AUTOMATION_RESOURCE_MESSAGE_FILTER_H_ #define CHROME_FRAME_TEST_NET_TEST_AUTOMATION_RESOURCE_MESSAGE_FILTER_H_ #include <map> #include "base/synchronization/lock.h" #include "chrome/browser/automation/automation_provider.h" #include "chrome/browser/automation/automation_resource_message_filter.h" #include "chrome/browser/automation/url_request_automation_job.h" // URL request tests to run sequentially as they were written while still class TestAutomationResourceMessageFilter : public AutomationResourceMessageFilter { public: explicit TestAutomationResourceMessageFilter(AutomationProvider* automation); virtual bool Send(IPC::Message* message); static void OnRequestMessage(URLRequestAutomationJob* job, IPC::Message* msg); virtual bool OnMessageReceived(const IPC::Message& message); virtual bool RegisterRequest(URLRequestAutomationJob* job); virtual void UnRegisterRequest(URLRequestAutomationJob* job); protected: AutomationProvider* automation_; struct RequestJob { base::MessageLoop* loop_; scoped_refptr<URLRequestAutomationJob> job_; }; typedef std::map<int, RequestJob> RequestMap; RequestMap requests_; base::Lock requests_lock_; }; #endif
/* * Copyright 2004-2005 Timo Hirvonen * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ #include "op.h" #include "sf.h" #include "xmalloc.h" #include "debug.h" #if defined(__OpenBSD__) #include <soundcard.h> #else #include <sys/soundcard.h> #endif #include <sys/ioctl.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <fcntl.h> static sample_format_t oss_sf; static int oss_fd = -1; /* configuration */ static char *oss_dsp_device = NULL; static int oss_close(void); static int oss_reset(void) { if (fcntl(oss_fd, SNDCTL_DSP_RESET, 0) == -1) { return -1; } return 0; } /* defined only in OSSv4, but seem to work in OSSv3 (Linux) */ #ifndef AFMT_S32_LE #define AFMT_S32_LE 0x00001000 #endif #ifndef AFMT_S32_BE #define AFMT_S32_BE 0x00002000 #endif #ifndef AFMT_S24_PACKED #define AFMT_S24_PACKED 0x00040000 #endif static int oss_set_sf(sample_format_t sf) { int tmp, log2_fragment_size, nr_fragments, bytes_per_second; oss_reset(); oss_sf = sf; #ifdef SNDCTL_DSP_CHANNELS tmp = sf_get_channels(oss_sf); if (ioctl(oss_fd, SNDCTL_DSP_CHANNELS, &tmp) == -1) return -1; #else tmp = sf_get_channels(oss_sf) - 1; if (ioctl(oss_fd, SNDCTL_DSP_STEREO, &tmp) == -1) return -1; #endif if (sf_get_bits(oss_sf) == 16) { if (sf_get_signed(oss_sf)) { if (sf_get_bigendian(oss_sf)) { tmp = AFMT_S16_BE; } else { tmp = AFMT_S16_LE; } } else { if (sf_get_bigendian(oss_sf)) { tmp = AFMT_U16_BE; } else { tmp = AFMT_U16_LE; } } } else if (sf_get_bits(oss_sf) == 8) { if (sf_get_signed(oss_sf)) { tmp = AFMT_S8; } else { tmp = AFMT_U8; } } else if (sf_get_bits(oss_sf) == 32 && sf_get_signed(oss_sf)) { if (sf_get_bigendian(oss_sf)) { tmp = AFMT_S32_BE; } else { tmp = AFMT_S32_LE; } } else if (sf_get_bits(oss_sf) == 24 && sf_get_signed(oss_sf) && !sf_get_bigendian(oss_sf)) { tmp = AFMT_S24_PACKED; } else { d_print("unsupported sample format: %c%u_%s\n", sf_get_signed(oss_sf) ? 'S' : 'U', sf_get_bits(oss_sf), sf_get_bigendian(oss_sf) ? "BE" : "LE"); return -1; } if (ioctl(oss_fd, SNDCTL_DSP_SAMPLESIZE, &tmp) == -1) return -1; tmp = sf_get_rate(oss_sf); if (ioctl(oss_fd, SNDCTL_DSP_SPEED, &tmp) == -1) return -1; bytes_per_second = sf_get_second_size(oss_sf); log2_fragment_size = 0; while (1 << log2_fragment_size < bytes_per_second / 25) log2_fragment_size++; log2_fragment_size--; nr_fragments = 32; /* bits 0..15 = size of fragment, 16..31 = log2(number of fragments) */ tmp = (nr_fragments << 16) + log2_fragment_size; if (ioctl(oss_fd, SNDCTL_DSP_SETFRAGMENT, &tmp) == -1) return -1; return 0; } static int oss_device_exists(const char *device) { struct stat s; if (stat(device, &s)) return 0; return 1; } static int oss_init(void) { const char *new_dsp_dev = "/dev/sound/dsp"; const char *dsp_dev = "/dev/dsp"; if (oss_dsp_device) { if (oss_device_exists(oss_dsp_device)) return 0; free(oss_dsp_device); oss_dsp_device = NULL; return -1; } if (oss_device_exists(new_dsp_dev)) { oss_dsp_device = xstrdup(new_dsp_dev); return 0; } if (oss_device_exists(dsp_dev)) { oss_dsp_device = xstrdup(dsp_dev); return 0; } return -1; } static int oss_exit(void) { free(oss_dsp_device); oss_dsp_device = NULL; return 0; } static int oss_open(sample_format_t sf) { int oss_version = 0; oss_fd = open(oss_dsp_device, O_WRONLY); if (oss_fd == -1) return -1; ioctl(oss_fd, OSS_GETVERSION, &oss_version); d_print("oss version: %#08x\n", oss_version); if (oss_set_sf(sf) == -1) { oss_close(); return -1; } return 0; } static int oss_close(void) { close(oss_fd); oss_fd = -1; return 0; } static int oss_write(const char *buffer, int count) { int rc; count -= count % sf_get_frame_size(oss_sf); rc = write(oss_fd, buffer, count); return rc; } static int oss_pause(void) { if (ioctl(oss_fd, SNDCTL_DSP_POST, NULL) == -1) return -1; return 0; } static int oss_unpause(void) { return 0; } static int oss_buffer_space(void) { audio_buf_info info; int space; if (ioctl(oss_fd, SNDCTL_DSP_GETOSPACE, &info) == -1) return -1; space = (info.fragments - 1) * info.fragsize; return space; } static int op_oss_set_option(int key, const char *val) { switch (key) { case 0: free(oss_dsp_device); oss_dsp_device = xstrdup(val); break; default: return -OP_ERROR_NOT_OPTION; } return 0; } static int op_oss_get_option(int key, char **val) { switch (key) { case 0: if (oss_dsp_device) *val = xstrdup(oss_dsp_device); break; default: return -OP_ERROR_NOT_OPTION; } return 0; } const struct output_plugin_ops op_pcm_ops = { .init = oss_init, .exit = oss_exit, .open = oss_open, .close = oss_close, .write = oss_write, .pause = oss_pause, .unpause = oss_unpause, .buffer_space = oss_buffer_space, .set_option = op_oss_set_option, .get_option = op_oss_get_option }; const char * const op_pcm_options[] = { "device", NULL }; const int op_priority = 1;
/* Copyright (C) 2011 by Alexandru Pana <r.whitesoul@gmail.com> Part of the Fire and Sword Project http://code.google.com/p/fire-and-sword/ 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. See the COPYING file for more details. */ #ifndef __C_BUTTON_H__ #define __C_BUTTON_H__ #include <list> #include "CUiManager.h" #include "CEventListener.h" #include "CWidget.h" #include "CTheme.h" #include "CRenderQueue.h" namespace miniui { class CWidget; enum BUTTON_STATE { STATE_NORMAL, STATE_HOVER, STATE_CLICKED, _STATE_SIZE }; class CButton : public CWidget { friend class CUiManager; private: std::string caption; std::vector< CImage* > images; CImage* textImage; void repaint( ); CRect textPosition; std::list< CEventListener* > events; BUTTON_STATE state; bool isMouseHovering; // EVENTS int onMouseEnter(); int onMouseLeave(); int onMouseMove(); int onMouseDown(); int onMouseUp(); int onMouseClick(); public: CButton( CWidget* parent ); ~CButton(); void setCaption( std::string caption ){ this->caption = caption; repaint(); } std::string getCaption(){ return this->caption; repaint(); } void addEventListener( CEventListener* eventListener ); void removeEventListener( CEventListener* eventListener ); BUTTON_STATE getState(); void render(); bool handleEvent( SDL_Event& evt ); }; } #endif
/* * The ManaPlus Client * Copyright (C) 2011-2019 The ManaPlus Developers * Copyright (C) 2019-2022 Andrei Karas * * This file is part of The ManaPlus Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef RESOURCES_DB_DEADDB_H #define RESOURCES_DB_DEADDB_H #include "enums/simpletypes/skiperror.h" #include <string> /** * Char information database. */ namespace DeadDB { /** * Loads the chars data. */ void load(); void loadXmlFile(const std::string &fileName, const SkipError skipError); /** * Clear the chars data */ void unload(); std::string getRandomString(); } // namespace DeadDB #endif // RESOURCES_DB_DEADDB_H
/** * MaNGOS is a full featured server for World of Warcraft, supporting * the following clients: 1.12.x, 2.4.3, 3.3.5a, 4.3.4a and 5.4.8 * * Copyright (C) 2005-2018 MaNGOS project <https://getmangos.eu> * * 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 * * World of Warcraft, and all World of Warcraft or Warcraft art, images, * and lore are copyrighted by Blizzard Entertainment, Inc. */ #ifndef MANGOSSERVER_SERVERDEFINES_H #define MANGOSSERVER_SERVERDEFINES_H /** * @brief * */ enum AccountTypes { SEC_PLAYER = 0, SEC_MODERATOR = 1, SEC_GAMEMASTER = 2, SEC_ADMINISTRATOR = 3, SEC_CONSOLE = 4 // must be always last in list, accounts must have less security level always also }; /** * @brief Used in mangosd/realmd * */ enum RealmFlags { REALM_FLAG_NONE = 0x00, REALM_FLAG_INVALID = 0x01, REALM_FLAG_OFFLINE = 0x02, REALM_FLAG_SPECIFYBUILD = 0x04, // client will show realm version in RealmList screen in form "RealmName (major.minor.revision.build)" REALM_FLAG_UNK1 = 0x08, REALM_FLAG_UNK2 = 0x10, REALM_FLAG_NEW_PLAYERS = 0x20, REALM_FLAG_RECOMMENDED = 0x40, REALM_FLAG_FULL = 0x80 }; #endif
#pragma once #include <vector> #include <functional> #include "EventArgs.h" namespace EightBit { template<class T> class Signal final { private: typedef std::function<void(T&)> delegate_t; typedef std::vector<delegate_t> delegates_t; delegates_t m_delegates; public: void connect(const delegate_t functor) { m_delegates.push_back(functor); } void fire(T& e = EventArgs::empty()) const noexcept { for (auto& delegate : m_delegates) delegate(e); } }; }
/* ncmpc (Ncurses MPD Client) * (c) 2004-2010 The Music Player Daemon Project * Project homepage: http://musicpd.org * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef NCMPC_WINDOW_H #define NCMPC_WINDOW_H #include "config.h" #include "ncmpc_curses.h" struct window { WINDOW *w; unsigned rows, cols; }; static inline void window_init(struct window *window, unsigned height, unsigned width, int y, int x) { window->w = newwin(height, width, y, x); window->cols = width; window->rows = height; } #endif
/************************************************************************** * Copyright (C) 2007 by Michel Ludwig (michel.ludwig@kdemail.net) * * 2011 by Felix Mauch (felix_mauch@web.de) * ***************************************************************************/ /************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef HELPCONFIGWIDGET_H #define HELPCONFIGWIDGET_H #include <QWidget> #include "kilehelp.h" #include "ui_helpconfigwidget.h" class KileWidgetHelpConfig : public QWidget, public Ui::KileWidgetHelpConfig { Q_OBJECT public: KileWidgetHelpConfig(QWidget *parent = 0); ~KileWidgetHelpConfig(); void setHelp(KileHelp::Help *help); protected Q_SLOTS: void slotConfigure(); void selectHelpLocation(); protected: KileHelp::Help *m_help; }; #endif
#ifndef PROBLEM_H #define PROBLEM_H #include <iostream> #include <vector> #include "img.h" using namespace std; struct question { int q; int a; }; class Problem { public: Problem(); ~Problem(); // void copyTo(Problem& p); // vector<float> image; Img image; // vector<question> questions; question currentquestion; private: }; #endif
#include "adriver.h" #include "../../alsa-kernel/isa/cs423x/cs4236.c"
#ifndef __GSMD_STRL_H #define __GSMD_STRL_H #ifdef __GSMD__ /* safe strcpy and strcat versions */ extern size_t strlcpy(char *dest, const char *src, size_t size); extern size_t strlcat(char *dest, const char *src, size_t count); #endif /* __GSMD__ */ #endif
/* This file is part of the Astrometry.net suite. Copyright 2011 Dustin Lang. The Astrometry.net suite is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. The Astrometry.net suite 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 the Astrometry.net suite ; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <stdint.h> #include <stdio.h> #include "ucac3.h" #include "an-endian.h" #include "starutil.h" static uint32_t grab_u32(void** v) { uint32_t uval = u32_letoh(*((uint32_t*)(*v))); *v = (((uint32_t*)(*v)) + 1); //((uint32_t*)(*v)) += 1; return uval; } static int32_t grab_i32(void** v) { int32_t val = (int32_t)u32_letoh(*((uint32_t*)(*v))); *v = (((int32_t*)(*v)) + 1); return val; } static uint16_t grab_u16(void** v) { uint16_t uval = u16_letoh(*((uint16_t*)(*v))); *v = (((uint16_t*)(*v)) + 1); //((uint16_t*)(*v)) += 1; return uval; } static int16_t grab_i16(void** v) { int16_t val = (int16_t)u16_letoh(*((uint16_t*)(*v))); *v = (((int16_t*)(*v)) + 1); return val; } static int8_t grab_i8(void** v) { int8_t val = *((int8_t*)(*v)); *v = (((int8_t*)(*v)) + 1); return val; } static uint8_t grab_u8(void** v) { uint8_t val = *((uint8_t*)(*v)); *v = (((uint8_t*)(*v)) + 1); return val; } int ucac3_parse_entry(ucac3_entry* entry, const void* encoded) { //const uint32_t* udata = encoded; uint32_t uval; void* buf = (void*)encoded; int i; // RESIST THE URGE TO RE-ORDER THESE, bonehead! uval = grab_u32(&buf); entry->ra = arcsec2deg(uval * 0.001); uval = grab_u32(&buf); entry->dec = arcsec2deg(uval * 0.001) - 90.0; entry->mag = 0.001 * grab_i16(&buf); entry->apmag = 0.001 * grab_i16(&buf); entry->mag_err = 0.001 * grab_i16(&buf); entry->objtype = grab_i8(&buf); entry->doublestar = grab_i8(&buf); entry->sigma_ra = arcsec2deg(0.001 * grab_u16(&buf)); entry->sigma_dec = arcsec2deg(0.001 * grab_u16(&buf)); entry->navail = grab_i8(&buf); entry->nused = grab_i8(&buf); entry->npm = grab_i8(&buf); entry->nmatch = grab_i8(&buf); entry->epoch_ra = 1900. + 0.01 * grab_u16(&buf); entry->epoch_dec = 1900. + 0.01 * grab_u16(&buf); entry->pm_ra = 1e-4 * grab_i32(&buf); entry->pm_dec = 1e-4 * grab_i32(&buf); entry->sigma_pm_ra = 1e-4 * grab_u16(&buf); entry->sigma_pm_dec = 1e-4 * grab_u16(&buf); entry->twomass_id = grab_u32(&buf); entry->jmag = 0.001 * grab_i16(&buf); entry->hmag = 0.001 * grab_i16(&buf); entry->kmag = 0.001 * grab_i16(&buf); entry->twomass_jflags = grab_u8(&buf); entry->twomass_hflags = grab_u8(&buf); entry->twomass_kflags = grab_u8(&buf); entry->jmag_err = 0.01 * grab_u8(&buf); entry->hmag_err = 0.01 * grab_u8(&buf); entry->kmag_err = 0.01 * grab_u8(&buf); entry->bmag = 0.001 * grab_i16(&buf); entry->r2mag = 0.001 * grab_i16(&buf); entry->imag = 0.001 * grab_i16(&buf); entry->clbl = grab_u8(&buf); entry->bquality = grab_u8(&buf); entry->r2quality = grab_u8(&buf); entry->iquality = grab_u8(&buf); for (i=0; i<10; i++) entry->matchflags[i] = grab_u8(&buf); entry->yale_gflag = grab_u8(&buf); entry->yale_cflag = grab_u8(&buf); entry->leda_flag = grab_u8(&buf); entry->twomass_extsource_flag = grab_u8(&buf); entry->mpos = grab_u32(&buf); /* printf("ra=%g, dec=%g\n", entry->ra, entry->dec); printf("mag=%g, apmag=%g\n", entry->mag, entry->apmag); printf("objt=%i\n", entry->objtype); */ return 0; }
#pragma once #ifndef __EMU_H__ #error Dont include this file directly; include emu.h instead. #endif #ifndef __DISERIAL_H__ #define __DISERIAL_H__ //************************************************************************** // TYPE DEFINITIONS //************************************************************************** /* parity selections */ /* if all the bits are added in a byte, if the result is: even -> parity is even odd -> parity is odd */ enum { SERIAL_PARITY_NONE, /* no parity. a parity bit will not be in the transmitted/received data */ SERIAL_PARITY_ODD, /* odd parity */ SERIAL_PARITY_EVEN /* even parity */ }; /* CTS = Clear to Send. (INPUT) Other end of connection is ready to accept data NOTE: This output is active low on serial chips (e.g. 0 is CTS is set), but here it is active high! */ #define SERIAL_STATE_CTS 0x0001 /* RTS = Request to Send. (OUTPUT) This end is ready to send data, and requests if the other end is ready to accept it NOTE: This output is active low on serial chips (e.g. 0 is RTS is set), but here it is active high! */ #define SERIAL_STATE_RTS 0x0002 /* DSR = Data Set ready. (INPUT) Other end of connection has data NOTE: This output is active low on serial chips (e.g. 0 is DSR is set), but here it is active high! */ #define SERIAL_STATE_DSR 0x0004 /* DTR = Data terminal Ready. (OUTPUT) TX contains new data. NOTE: This output is active low on serial chips (e.g. 0 is DTR is set), but here it is active high! */ #define SERIAL_STATE_DTR 0x0008 /* RX = Recieve data. (INPUT) */ #define SERIAL_STATE_RX_DATA 0x00010 /* TX = Transmit data. (OUTPUT) */ #define SERIAL_STATE_TX_DATA 0x00020 // ======================> device_serial_interface class device_serial_interface : public device_interface { public: // construction/destruction device_serial_interface(const machine_config &mconfig, device_t &device); virtual ~device_serial_interface(); virtual void input_callback(UINT8 state) = 0; void set_data_frame(int num_data_bits, int stop_bit_count, int parity_code); void receive_register_reset(); void receive_register_update_bit(int bit); void receive_register_extract(); void transmit_register_reset(); void transmit_register_add_bit(int bit); void transmit_register_setup(UINT8 data_byte); UINT8 transmit_register_get_data_bit(); void transmit_register_send_bit(); UINT8 serial_helper_get_parity(UINT8 data) { return m_serial_parity_table[data]; } UINT8 get_in_data_bit() { return ((m_input_state & SERIAL_STATE_RX_DATA)>>4) & 1; } void set_out_data_bit(UINT8 data) { m_connection_state &=~SERIAL_STATE_TX_DATA; m_connection_state |=(data<<5); } void serial_connection_out(); bool is_receive_register_full(); bool is_transmit_register_empty(); UINT8 get_received_char() { return m_rcv_byte_received; } void set_other_connection(device_serial_interface *other_connection); void connect(device_serial_interface *other_connection); protected: UINT8 m_input_state; UINT8 m_connection_state; private: UINT8 m_serial_parity_table[256]; // Data frame // length of word in bits UINT8 m_df_word_length; // parity state UINT8 m_df_parity; // number of stop bits UINT8 m_df_stop_bit_count; // Receive register /* data */ UINT16 m_rcv_register_data; /* flags */ UINT8 m_rcv_flags; /* bit count received */ UINT8 m_rcv_bit_count_received; /* length of data to receive - includes data bits, parity bit and stop bit */ UINT8 m_rcv_bit_count; /* the byte of data received */ UINT8 m_rcv_byte_received; // Transmit register /* data */ UINT16 m_tra_register_data; /* flags */ UINT8 m_tra_flags; /* number of bits transmitted */ UINT8 m_tra_bit_count_transmitted; /* length of data to send */ UINT8 m_tra_bit_count; device_serial_interface *m_other_connection; }; class serial_source_device : public device_t, public device_serial_interface { public: // construction/destruction serial_source_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); virtual void input_callback(UINT8 state); void send_bit(UINT8 data); protected: // device-level overrides virtual void device_start(); }; extern const device_type SERIAL_SOURCE; #define MCFG_SERIAL_SOURCE_ADD(_tag) \ MCFG_DEVICE_ADD((_tag), SERIAL_SOURCE, 0) #endif /* __DISERIAL_H__ */
/* * getparts.h * * Copyright (C) 2007 Red Hat, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef GETPARTS_H #define GETPARTS_H #include <glib.h> gchar **getPartitionsList(gchar * disk); #endif
// // LHTagRetrievalOperation.h // LastHistory // // Created by Frederik Seiffert on 19.11.09. // Copyright 2009 Frederik Seiffert. All rights reserved. // #import <Cocoa/Cocoa.h> #import "LHOperation.h" @interface LHTagRetrievalOperation : LHOperation { NSEntityDescription *_tagEntity; NSEntityDescription *_trackTagEntity; } @end
// 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 MEDIA_BASE_AUDIO_SPLICER_H_ #define MEDIA_BASE_AUDIO_SPLICER_H_ #include <deque> #include "base/memory/ref_counted.h" #include "media/base/audio_timestamp_helper.h" #include "media/base/media_export.h" namespace media { class AudioBuffer; class AudioDecoderConfig; class MEDIA_EXPORT AudioSplicer { public: AudioSplicer(int samples_per_second); ~AudioSplicer(); void Reset(); bool AddInput(const scoped_refptr<AudioBuffer>& input); bool HasNextBuffer() const; scoped_refptr<AudioBuffer> GetNextBuffer(); private: void AddOutputBuffer(const scoped_refptr<AudioBuffer>& buffer); AudioTimestampHelper output_timestamp_helper_; int min_gap_size_; std::deque<scoped_refptr<AudioBuffer> > output_buffers_; bool received_end_of_stream_; DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSplicer); }; } #endif
/** * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. * Copyright (c) 2016 Tino Reichardt * 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. */ #include "../lizard/lizard_frame.h" #include "lizard-mt.h" /* will be used for lib errors */ size_t lizardmt_errcode; /* **************************************** * LIZARDMT Error Management ******************************************/ /** * LIZARDMT_isError() - tells if a return value is an error code */ unsigned LIZARDMT_isError(size_t code) { return (code > ERROR(maxCode)); } /** * LIZARDMT_getErrorString() - give error code string from function result */ const char *LIZARDMT_getErrorString(size_t code) { static const char *noErrorCode = "Unspecified lizardmt error code"; if (LizardF_isError(lizardmt_errcode)) return LizardF_getErrorName(lizardmt_errcode); switch ((LIZARDMT_ErrorCode) (0 - code)) { case PREFIX(no_error): return "No error detected"; case PREFIX(memory_allocation): return "Allocation error : not enough memory"; case PREFIX(read_fail): return "Read failure"; case PREFIX(write_fail): return "Write failure"; case PREFIX(data_error): return "Malformed input"; case PREFIX(frame_compress): return "Could not compress frame at once"; case PREFIX(frame_decompress): return "Could not decompress frame at once"; case PREFIX(compressionParameter_unsupported): return "Compression parameter is out of bound"; case PREFIX(compression_library): return "Compression library reports failure"; case PREFIX(maxCode): default: return noErrorCode; } }
/* Hyperspace Explorer - visualizing higher-dimensional geometry Copyright (C) 2008-2010 Lene Preuss <lene.preuss@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. */ class RotopeInterface; template <unsigned D> class VertexData; #include <string> /// A class to generate Rotopes /** Sports a static method generate() which takes a list of extrusion actions as * string and creates a Rotope of the actions, performing them in the order in * which they were specified * * \ingroup RotopeGroup */ class RotopeFactory { public: /// Generate a Rotope static RotopeInterface *generate(const std::string &actions); private: /// Functor class to perform an extrusion on a Rotope or vertex array /** \tparam D Dimension of vector space we operate in * \tparam d Dimension we want to extrude into */ template <unsigned D, unsigned d> struct RotopeAction: public RotopeAction<D, d-1> { /// Perform the extrusion operations VertexData<D> *operator()(std::string actions, VertexData<D> *rotope); }; /// Specialization for extruding into the dimension 0 to end recursion /** \tparam D Dimension of vector space we operate in */ template <unsigned D> struct RotopeAction<D, 0> { /// Perform the extrusion operations VertexData<D> *operator()(std::string actions, VertexData<D> *rotope); }; };
/* a10 425 * Copyright (c) 2001-2012 Nicolas Léveillé <knos.free.fr> * * You should have received this file ('src/system/pan_driver.h') with a license * agreement. ('LICENSE' file) * * Copying, using, modifying and distributing this file are rights * covered under this licensing agreement and are conditioned by its * full acceptance and understanding. * e 425 */ #ifndef PAN_DRIVER_H #define PAN_DRIVER_H #include "pan.h" #include <library/map.h> #include <system/demo.h> #include <library/memory.h> typedef struct pan_driver_t { object_t super; int (*new)(struct pan_driver_t *self, const char *device, int sample_rate); int (*destroy)(struct pan_driver_t *self); void (*start)(struct pan_driver_t *self); void (*stop)(struct pan_driver_t *self); int (*get_samples_number)(struct pan_driver_t *self); int (*get_sample_rate)(struct pan_driver_t *self); int (*has_fd)(struct pan_driver_t *self); long int (*get_fd)(struct pan_driver_t *self); int (*is_ready)(struct pan_driver_t *self); void (*update)(struct pan_driver_t *self, sample_t *samples); double (*get_time)(struct pan_driver_t *self); int (*configure_demo)(struct pan_driver_t *self, demo_t *demo); } pan_driver_t; CLASS_INHERIT(pan_driver, object); map_t *get_pan_drivers(); void put_pan_driver(const char *name, pan_driver_t *driver); /* an immutable, <non operating> driver */ pan_driver_t *null_pan_driver_instantiate(); #endif
// // G0ActionCenter.h // G0Engine // // Created by Chase on 6/21/15. // Copyright (c) 2015 littleendiangamestudios. All rights reserved. // #ifndef __G0Engine__G0ActionCenter__ #define __G0Engine__G0ActionCenter__ #include <stdio.h> #include <string> #include <map> #include "G0Action.h" /* class in question must inherit G0Actionable in order to have its funcitons registered registering a method will look like this: class Foo : G0Actionable { void Bar(G0ActionValue * value); } //... // register out of line to prevent // the same key from being written and // causing exceptions Foo * instance_of_foo = new Foo(); G0ActionCenter::registerAction(instance_of_foo, Foo::Bar); */ class G0ActionCenter { static std::map<std::string, G0Action<G0Actionable, void> *> actions; public: template<typename T, typename A> static void registerAction(std::string key, G0Action<T,A>* action ){ actions[key] = reinterpret_cast< G0Action<G0Actionable, void> *> (action); } static void removeAction(std::string key){ actions.erase(key); } /* static void replaceAction(std::string key, G0Action * new_action){ actions[key] = new_action; } */ static void executeAction(std::string key, void * value){ if(actions.find(key) != actions.end()) actions[key]->doThis(value); else printf("Action not found\n"); } }; #endif /* defined(__G0Engine__G0ActionCenter__) */
/********************************************************************************** ********************************************************************************** *** *** argparse_commcmd.c *** - parsing of comms related commands (flash upload, etc) *** *** Copyright (C) 2014 Christian Klippel <ck@atelier-klippel.de> *** *** This program is free software; you can redistribute it and/or modify *** it under the terms of the GNU General Public License as published by *** the Free Software Foundation; either version 2 of the License, or *** (at your option) any later version. *** *** This program is distributed in the hope that it will be useful, *** but WITHOUT ANY WARRANTY; without even the implied warranty of *** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *** GNU General Public License for more details. *** *** You should have received a copy of the GNU General Public License along *** with this program; if not, write to the Free Software Foundation, Inc., *** 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *** **/ #include <stdio.h> #include <stdint.h> #include <stddef.h> #include "infohelper.h" #include "esptool_elf.h" #include "esptool_elf_object.h" #include "esptool_binimage.h" #include "espcomm.h" int argparse_commcmd(int num_args, char **arg_ptr) { char *cur_cmd; if(arg_ptr[0][1] == 'c' && num_args--) { cur_cmd = &arg_ptr[0][2]; arg_ptr++; switch(*cur_cmd++) { case 'p': if(num_args < 1) { return 0; } if(espcomm_set_port(arg_ptr[0])) { return 2; } break; case 'b': if(num_args < 1) { return 0; } if(espcomm_set_baudrate(arg_ptr[0])) { return 2; } break; case 'a': if(num_args < 1) { return 0; } if(espcomm_set_address(arg_ptr[0])) { return 2; } break; case 'f': if(num_args < 1) { return 0; } if(espcomm_upload_file(arg_ptr[0])) { return 2; } break; case 'z': if (num_args < 1) { return 0; } if (espcomm_erase_region(arg_ptr[0])) { return 2; } break; case 'd': if (num_args < 1) { return 0; } if (espcomm_set_board(arg_ptr[0])) { return 2; } break; case 'e': if (espcomm_erase_flash()) { return 1; } break; case 'r': if (espcomm_reset()) { return 1; } break; default: return 0; break; } } /* Catch-all for errors returned by commands */ return -1; }
#pragma once #include <string> class TestList { public: typedef void* Test; Test* m_Head; //0x0000 Test* m_Tail; //0x0008 };//Size=0x0010 struct MemberInfoFlags { unsigned short m_FlagBits; //0x0000 };//Size=0x0002 class ModuleInfo { public: char* m_ModuleName; //0x0000 ModuleInfo* m_NextModule; //0x0008 TestList* m_TestList; //0x0010 };//Size=0x0018 enum BasicTypesEnum { kTypeCode_Void, kTypeCode_DbObject, kTypeCode_ValueType, kTypeCode_Class, kTypeCode_Array, kTypeCode_FixedArray, kTypeCode_String, kTypeCode_CString, kTypeCode_Enum, kTypeCode_FileRef, kTypeCode_Boolean, kTypeCode_Int8, kTypeCode_Uint8, kTypeCode_Int16, kTypeCode_Uint16, kTypeCode_Int32, kTypeCode_Uint32, kTypeCode_Int64, kTypeCode_Uint64, kTypeCode_Float32, kTypeCode_Float64, kTypeCode_Guid, kTypeCode_SHA1, kTypeCode_ResourceRef, kTypeCode_BasicTypeCount }; class MemberInfo { public: #pragma pack(push, 2) struct MemberInfoData { char* m_Name; //0x0000 MemberInfoFlags m_Flags; //0x0008 };//Size=0x000A #pragma pack(pop) MemberInfoData* m_InfoData; //0x0000 BasicTypesEnum GetTypeCode(); std::string GetTypeName(); MemberInfoData* GetMemberInfoData(); };//Size=0x0008 BasicTypesEnum MemberInfo::GetTypeCode() { MemberInfo::MemberInfoData* memberInfoData = GetMemberInfoData(); if (memberInfoData) { return (BasicTypesEnum)((memberInfoData->m_Flags.m_FlagBits & 0x1F0) >> 0x4); } return kTypeCode_BasicTypeCount; } std::string MemberInfo::GetTypeName() { switch (GetTypeCode()) { case kTypeCode_Void: return "Void"; case kTypeCode_DbObject: return "DbObject"; case kTypeCode_ValueType: return "ValueType"; case kTypeCode_Class: return "Class"; case kTypeCode_Array: return "Array"; case kTypeCode_FixedArray: return "FixedArray"; case kTypeCode_String: return "String"; case kTypeCode_CString: return "CString"; case kTypeCode_Enum: return "Enum"; case kTypeCode_FileRef: return "FileRef"; case kTypeCode_Boolean: return "Boolean"; case kTypeCode_Int8: return "Int8"; case kTypeCode_Uint8: return "Uint8"; case kTypeCode_Int16: return "Int16"; case kTypeCode_Uint16: return "Uint16"; case kTypeCode_Int32: return "Int32"; case kTypeCode_Uint32: return "Uint32"; case kTypeCode_Int64: return "Int64"; case kTypeCode_Uint64: return "Uint64"; case kTypeCode_Float32: return "Float32"; case kTypeCode_Float64: return "Float64"; case kTypeCode_Guid: return "Guid"; case kTypeCode_SHA1: return "SHA1"; case kTypeCode_ResourceRef: return "ResourceRef"; default: char buffer[32]; sprintf_s(buffer, "Undefined[%i]", GetTypeCode()); return buffer; } } MemberInfo::MemberInfoData* MemberInfo::GetMemberInfoData() { return ((MemberInfoData*)m_InfoData); } class TypeInfo : public MemberInfo { public: struct TypeInfoData : MemberInfoData { unsigned short m_TotalSize; //0x000A #if defined(_WIN64) char _0x000C[4]; #endif ModuleInfo* m_Module; //0x0010 unsigned char m_Alignment; //0x0018 unsigned char m_FieldCount; //0x0019 #if defined(_WIN64) char _0x001A[6]; #else char _0x001A[2]; #endif };//Size=0x0020 TypeInfo* m_Next; //0x0008 unsigned short m_RuntimeId; //0x0010 unsigned short m_Flags; //0x0012 #if defined(_WIN64) char _0x0014[4]; #endif TypeInfoData* GetTypeInfoData(); static TypeInfo* GetFirst() { return *(TypeInfo**)OFFSET_FIRSTTYPEINFO; } };//Size=0x0018 TypeInfo::TypeInfoData* TypeInfo::GetTypeInfoData() { return ((TypeInfoData*)m_InfoData); } class FieldInfo : public MemberInfo { public: struct FieldInfoData : MemberInfo::MemberInfoData { unsigned short m_FieldOffset; //0x000A #if defined(_WIN64) char _0x000C[4]; #endif TypeInfo* m_FieldTypePtr; //0x0010 };//Size=0x0018 virtual TypeInfo* GetDeclaringType(); virtual unsigned short GetFieldIndex(); TypeInfo* m_DeclaringType; //0x0010 unsigned short m_FieldIndex; //0x0018 unsigned short m_AttributeMask; //0x001A #if defined(_WIN64) char _0x001C[4]; #endif FieldInfoData* GetFieldInfoData(); };//Size=0x0020 FieldInfo::FieldInfoData* FieldInfo::GetFieldInfoData() { return ((FieldInfoData*)m_InfoData); } class ClassInfo : public TypeInfo { public: struct ClassInfoData : TypeInfo::TypeInfoData { ClassInfo* m_SuperClass; //0x0020 void* m_CreateFun; //0x0028 FieldInfo::FieldInfoData* m_Fields; //0x0030 };//Size=0x0038 ClassInfo* m_Super; //0x0018 void* m_DefaultInstance; //0x0020 unsigned short m_ClassId; //0x0028 unsigned short m_LastSubClassId; //0x002A #if defined(_WIN64) char _0x002C[4]; #endif ClassInfo* m_FirstDerivedClass; //0x0030 ClassInfo* m_NextSiblingClass; //0x0038 FieldInfo** m_FieldInfos; //0x0040 unsigned int m_TotalFieldCount; //0x0048 #if defined(_WIN64) char _0x004C[4]; #endif ClassInfoData* GetClassInfoData(); };//Size=0x0050 ClassInfo::ClassInfoData* ClassInfo::GetClassInfoData() { return ((ClassInfoData*)m_InfoData); } class ArrayTypeInfo : public TypeInfo { public: struct ArrayTypeInfoData : TypeInfo::TypeInfoData { TypeInfo* m_ElementType; //0x0020 };//Size=0x0028 ArrayTypeInfoData* GetArrayTypeInfoData(); };//Size=0x0018 ArrayTypeInfo::ArrayTypeInfoData* ArrayTypeInfo::GetArrayTypeInfoData() { return ((ArrayTypeInfoData*)m_InfoData); } class EnumFieldInfo : public TypeInfo { public: struct EnumFieldInfoData : TypeInfo::TypeInfoData { FieldInfo::FieldInfoData* m_Fields; //0x0020 };//Size=0x0028 FieldInfo** m_FieldInfos; //0x0018 EnumFieldInfoData* GetEnumInfoData(); };//Size=0x0020 EnumFieldInfo::EnumFieldInfoData* EnumFieldInfo::GetEnumInfoData() { return ((EnumFieldInfoData*)m_InfoData); } class ValueTypeInfo : public TypeInfo { public: struct ValueTypeInfoData : TypeInfo::TypeInfoData { void* m_DefaultValue; FieldInfo::FieldInfoData* m_Fields; //0x0020 };//Size=0x0028 FieldInfo** m_FieldInfos; //0x0018 ValueTypeInfoData* GetValueInfoData(); };//Size=0x0020 ValueTypeInfo::ValueTypeInfoData* ValueTypeInfo::GetValueInfoData() { return ((ValueTypeInfoData*)m_InfoData); } class ITypedObject { public: virtual TypeInfo* GetType(); };//Size=0x0008
// // Tracklist.h // DevAbo.de // // Created by Ingmar Drewing on 20/12/15. // Copyright © 2015 Ingmar Drewing. All rights reserved. // #import "Track.h" #import <Foundation/Foundation.h> @interface Tracklist : NSObject { NSArray *tracks; } - (id) init; - (NSURL *) getSoundUrlAtLongitude: (float) longitude_ andLatitiude: (float) latitude_; @end
/* ** Zabbix ** Copyright (C) 2001-2015 Zabbix SIA ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ #ifndef ZABBIX_COMMS_H #define ZABBIX_COMMS_H #if defined(_WINDOWS) # if defined(__INT_MAX__) && __INT_MAX__ == 2147483647 typedef int ssize_t; # else typedef long ssize_t; # endif # define ZBX_TCP_WRITE(s, b, bl) ((ssize_t)send((s), (b), (bl), 0)) # define ZBX_TCP_READ(s, b, bl) ((ssize_t)recv((s), (b), (bl), 0)) # define zbx_sock_close(s) if (ZBX_SOCK_ERROR != (s)) closesocket(s) # define zbx_sock_last_error() WSAGetLastError() # define ZBX_TCP_ERROR SOCKET_ERROR # define ZBX_SOCK_ERROR INVALID_SOCKET #else # define ZBX_TCP_WRITE(s, b, bl) ((ssize_t)write((s), (b), (bl))) # define ZBX_TCP_READ(s, b, bl) ((ssize_t)read((s), (b), (bl))) # define zbx_sock_close(s) if (ZBX_SOCK_ERROR != (s)) close(s) # define zbx_sock_last_error() errno # define ZBX_TCP_ERROR -1 # define ZBX_SOCK_ERROR -1 #endif #if defined(SOCKET) || defined(_WINDOWS) typedef SOCKET ZBX_SOCKET; #else typedef int ZBX_SOCKET; #endif typedef enum { ZBX_BUF_TYPE_STAT = 0, ZBX_BUF_TYPE_DYN } zbx_buf_type_t; #define ZBX_SOCKET_COUNT 256 #define ZBX_STAT_BUF_LEN 2048 typedef struct { int num_socks; ZBX_SOCKET sockets[ZBX_SOCKET_COUNT]; ZBX_SOCKET socket; ZBX_SOCKET socket_orig; size_t read_bytes; zbx_buf_type_t buf_type; char buf_stat[ZBX_STAT_BUF_LEN]; char *buffer; unsigned char accepted; char *error; char *next_line; int timeout; } zbx_sock_t; const char *zbx_tcp_strerror(void); #if !defined(_WINDOWS) void zbx_gethost_by_ip(const char *ip, char *host, size_t hostlen); #endif void zbx_tcp_init(zbx_sock_t *s, ZBX_SOCKET o); int zbx_tcp_connect(zbx_sock_t *s, const char *source_ip, const char *ip, unsigned short port, int timeout); #define ZBX_TCP_PROTOCOL 0x01 #define zbx_tcp_send(s, d) zbx_tcp_send_ext((s), (d), strlen(d), ZBX_TCP_PROTOCOL, 0) #define zbx_tcp_send_to(s, d, timeout) zbx_tcp_send_ext((s), (d), strlen(d), ZBX_TCP_PROTOCOL, timeout) #define zbx_tcp_send_bytes_to(s, d, len, timeout) zbx_tcp_send_ext((s), (d), len, ZBX_TCP_PROTOCOL, timeout) #define zbx_tcp_send_raw(s, d) zbx_tcp_send_ext((s), (d), strlen(d), 0, 0) int zbx_tcp_send_ext(zbx_sock_t *s, const char *data, size_t len, unsigned char flags, int timeout); void zbx_tcp_close(zbx_sock_t *s); #if defined(HAVE_IPV6) int get_address_family(const char *addr, int *family, char *error, int max_error_len); #endif int zbx_tcp_listen(zbx_sock_t *s, const char *listen_ip, unsigned short listen_port); int zbx_tcp_accept(zbx_sock_t *s); void zbx_tcp_unaccept(zbx_sock_t *s); void zbx_tcp_free(zbx_sock_t *s); #define ZBX_TCP_READ_UNTIL_CLOSE 0x01 #define zbx_tcp_recv(s) SUCCEED_OR_FAIL(zbx_tcp_recv_ext(s, 0, 0)) #define zbx_tcp_recv_to(s, timeout) SUCCEED_OR_FAIL(zbx_tcp_recv_ext(s, 0, timeout)) ssize_t zbx_tcp_recv_ext(zbx_sock_t *s, unsigned char flags, int timeout); const char *zbx_tcp_recv_line(zbx_sock_t *s); char *get_ip_by_socket(zbx_sock_t *s); int zbx_tcp_check_security(zbx_sock_t *s, const char *ip_list, int allow_if_empty); #define ZBX_DEFAULT_FTP_PORT 21 #define ZBX_DEFAULT_SSH_PORT 22 #define ZBX_DEFAULT_TELNET_PORT 23 #define ZBX_DEFAULT_SMTP_PORT 25 #define ZBX_DEFAULT_DNS_PORT 53 #define ZBX_DEFAULT_HTTP_PORT 80 #define ZBX_DEFAULT_POP_PORT 110 #define ZBX_DEFAULT_NNTP_PORT 119 #define ZBX_DEFAULT_NTP_PORT 123 #define ZBX_DEFAULT_IMAP_PORT 143 #define ZBX_DEFAULT_LDAP_PORT 389 #define ZBX_DEFAULT_HTTPS_PORT 443 #define ZBX_DEFAULT_AGENT_PORT 10050 #define ZBX_DEFAULT_SERVER_PORT 10051 #define ZBX_DEFAULT_GATEWAY_PORT 10052 #define ZBX_DEFAULT_AGENT_PORT_STR "10050" #define ZBX_DEFAULT_SERVER_PORT_STR "10051" int zbx_send_response_ext(zbx_sock_t *sock, int result, const char *info, int protocol, int timeout); #define zbx_send_response(sock, result, info, timeout) \ zbx_send_response_ext(sock, result, info, ZBX_TCP_PROTOCOL, timeout) #define zbx_send_response_raw(sock, result, info, timeout) \ zbx_send_response_ext(sock, result, info, 0, timeout) int zbx_recv_response(zbx_sock_t *sock, int timeout, char **error); #if defined(HAVE_IPV6) #define zbx_getnameinfo(sa, host, hostlen, serv, servlen, flags) \ getnameinfo(sa, AF_INET == (sa)->sa_family ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6), \ host, hostlen, serv, servlen, flags) #endif #endif
// Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // // $Id$ // // Copyright (C) 1993-1996 by id Software, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //-------------------------------------------------------------------------- // // DESCRIPTION: // Typedefs related to to textures etc., // isolated here to make it easier separating modules. // //----------------------------------------------------------------------------- #ifndef __D_TEXTUR__ #define __D_TEXTUR__ #include "doomtype.h" // NOTE: Checking all BOOM sources, there is nothing used called pic_t. // // Flats? // // a pic is an unmasked block of pixels typedef struct { byte width; byte height; byte data; } pic_t; #endif //---------------------------------------------------------------------------- // // $Log$ // Revision 1.1 2000-04-30 19:12:08 fraggle // Initial revision // // //----------------------------------------------------------------------------
/***************************************************** * * Header language: German * * @author Glenn De Backer <glenn@simplicity.be> * *****************************************************/ #include <string> extern std::string deText;
#include <stm32f4xx.h> #include <core_cm4.h> #include <stddef.h> #include <stdbool.h> #include <stm32f4xx_misc.h> #include <stm32f4xx_crc.h> #include <stm32f4xx_rcc.h> /* CRC's a block of 32 bit words */ uint32_t crc_block(uint32_t *start, size_t len, bool reset) { uint32_t res; /* Enable CRC clock */ RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_CRC, ENABLE); if (reset) CRC_ResetDR(); res = CRC_CalcBlockCRC(start, len); /* Disable CRC clock */ RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_CRC, DISABLE); return res; }
/* * Jailhouse, a Linux-based partitioning hypervisor * * Copyright (c) ARM Limited, 2014 * * Authors: * Jean-Philippe Brucker <jean-philippe.brucker@arm.com> * * This work is licensed under the terms of the GNU GPL, version 2. See * the COPYING file in the top-level directory. */ #include <asm/io.h> #include <asm/irqchip.h> #include <asm/processor.h> #include <asm/smp.h> #include <asm/traps.h> /* Taken from the ARM ARM pseudocode for taking a data abort */ static void arch_inject_dabt(struct trap_context *ctx, unsigned long addr) { unsigned int lr_offset; unsigned long vbar; bool is_thumb; u32 sctlr, ttbcr; arm_read_sysreg(SCTLR_EL1, sctlr); arm_read_sysreg(TTBCR, ttbcr); /* Set cpsr */ is_thumb = ctx->cpsr & PSR_T_BIT; ctx->cpsr &= ~(PSR_MODE_MASK | PSR_IT_MASK(0xff) | PSR_T_BIT | PSR_J_BIT | PSR_E_BIT); ctx->cpsr |= (PSR_ABT_MODE | PSR_I_BIT | PSR_A_BIT); if (sctlr & SCTLR_TE_BIT) ctx->cpsr |= PSR_T_BIT; if (sctlr & SCTLR_EE_BIT) ctx->cpsr |= PSR_E_BIT; lr_offset = (is_thumb ? 4 : 0); arm_write_banked_reg(LR_abt, ctx->pc + lr_offset); /* Branch to dabt vector */ if (sctlr & SCTLR_V_BIT) vbar = 0xffff0000; else arm_read_sysreg(VBAR, vbar); ctx->pc = vbar + 0x10; /* Signal a debug fault. DFSR layout depends on the LPAE bit */ if (ttbcr >> 31) arm_write_sysreg(DFSR, (1 << 9) | 0x22); else arm_write_sysreg(DFSR, 0x2); arm_write_sysreg(DFAR, addr); } int arch_mmio_access(struct mmio_access *access) { void *addr = (void *)access->addr; if (access->is_write) { switch (access->size) { case 1: writeb_relaxed(access->val, addr); break; case 2: writew_relaxed(access->val, addr); break; case 4: writel_relaxed(access->val, addr); break; default: return -EINVAL; } } else { switch (access->size) { case 1: access->val = readb_relaxed(addr); break; case 2: access->val = readw_relaxed(addr); break; case 4: access->val = readl_relaxed(addr); break; default: return -EINVAL; } } return 0; } int arch_handle_dabt(struct per_cpu *cpu_data, struct trap_context *ctx) { struct mmio_access access; unsigned long hpfar; unsigned long hdfar; int ret = TRAP_UNHANDLED; /* Decode the syndrome fields */ u32 icc = ESR_ICC(ctx->esr); u32 isv = icc >> 24; u32 sas = icc >> 22 & 0x3; u32 sse = icc >> 21 & 0x1; u32 srt = icc >> 16 & 0xf; u32 ea = icc >> 9 & 0x1; u32 cm = icc >> 8 & 0x1; u32 s1ptw = icc >> 7 & 0x1; u32 is_write = icc >> 6 & 0x1; u32 size = 1 << sas; arm_read_sysreg(HPFAR, hpfar); arm_read_sysreg(HDFAR, hdfar); access.addr = hpfar << 8; access.addr |= hdfar & 0xfff; cpu_data->stats[JAILHOUSE_CPU_STAT_VMEXITS_MMIO]++; /* * Invalid instruction syndrome means multiple access or writeback, there * is nothing we can do. */ if (!isv || size > sizeof(unsigned long)) goto error_unhandled; /* Re-inject abort during page walk, cache maintenance or external */ if (s1ptw || ea || cm) { arch_inject_dabt(ctx, hdfar); return TRAP_HANDLED; } if (is_write) { /* Load the value to write from the src register */ access_cell_reg(ctx, srt, &access.val, true); if (sse) access.val = sign_extend(access.val, 8 * size); } else { access.val = 0; } access.is_write = is_write; access.size = size; ret = irqchip_mmio_access(cpu_data, &access); if (ret == TRAP_UNHANDLED) ret = arch_smp_mmio_access(cpu_data, &access); if (ret == TRAP_HANDLED) { /* Put the read value into the dest register */ if (!is_write) { if (sse) access.val = sign_extend(access.val, 8 * size); access_cell_reg(ctx, srt, &access.val, false); } arch_skip_instruction(ctx); } if (ret != TRAP_UNHANDLED) return ret; error_unhandled: panic_printk("Unhandled data %s at 0x%x(%d)\n", (is_write ? "write" : "read"), access.addr, size); return ret; }
/* ///////////////////////////////////////////////////////////////////////// */ /* This file is a part of the BSTools package */ /* written by Przemyslaw Kiciak */ /* ///////////////////////////////////////////////////////////////////////// */ /* (C) Copyright by Przemyslaw Kiciak, 2008, 2009 */ /* this package is distributed under the terms of the */ /* Lesser GNU Public License, see the file COPYING.LIB */ /* ///////////////////////////////////////////////////////////////////////// */ #include <stdio.h> #include <stdlib.h> #include <math.h> #include <malloc.h> #include <string.h> #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/cursorfont.h> #include <GL/gl.h> #include <GL/glx.h> #include "xgledit.h" #include "xgeprivate.h" /* ///////////////////////////////////////////////////////////////////// */ /* This function sets up the OpenGL viewport and geometry transformation */ /* matrices so as to obtain the coordinate system coinciding with the */ /* XWindow coordinate system for a window, i.e. with (0,0) at the upper */ /* left corner of the window, y growing downwards. The viewport covers */ /* the widget rectangle. */ void xgle_SetIdentMapping ( xge_widget *er ) { glViewport ( 0, 0, er->w, er->h ); glMatrixMode ( GL_PROJECTION ); glLoadIdentity (); glOrtho ( (double)er->x, (double)(er->x+er->w), (double)(er->y+er->h), (double)er->y, -1.0, 1.0 ); glMatrixMode ( GL_MODELVIEW ); glLoadIdentity (); } /*xgle_SetIdentMapping*/
#include <iostream> #include <deque> #include <graph/oslom_net_global.h> using namespace std; inline double log_zero(double a) { if (a <= 0) return -1e20; else return log(a); } class oslomnet_evaluate : public oslomnet_louvain { public: oslomnet_evaluate(deque<deque<int> > &b, deque<deque<pair<int, double> > > &c, deque<int> &d) : oslomnet_louvain() { set_graph(b, c, d); set_maxbord(); set_changendi_cum(); }; oslomnet_evaluate(string a) : oslomnet_louvain() { set_graph(a); set_maxbord(); set_changendi_cum(); }; oslomnet_evaluate(map<int, map<int, pair<int, double> > > &A) : oslomnet_louvain() { set_graph(A); set_maxbord(); set_changendi_cum(); }; ~oslomnet_evaluate() {}; double CUP_both(const deque<int> &_c_, deque<int> &gr_cleaned, int); double CUP_check(const deque<int> &_c_, deque<int> &gr_cleaned, int); double group_inflation(const deque<int> &_c_, deque<int> &gr_cleaned, int); int try_to_assign_homeless_help(module_collection &module_coll, map<int, deque<int> > &to_check); private: double CUP_iterative(const deque<int> &_c_, deque<int> &gr_cleaned, int); double CUP_search(const deque<int> &_c_, deque<int> &gr_cleaned, int); void erase_cgroup(int wnode); void insert_cgroup(int wnode); bool erase_the_worst(int &wnode); int set_maxbord(); void set_cgroup_and_neighs(const deque<int> &G); double all_external_test(int kout_g_in, int tmin, int kout_g_out, int tmout, int Nstar, int nneighs, const double &max_r_one, const double &maxr_two, deque<int> &gr_cleaned, bool only_c, weighted_tabdeg &previous_tab_c); double cup_on_list(cup_data_struct &a, deque<int> &gr_cleaned); void get_external_scores(weighted_tabdeg &neighs, cup_data_struct &fitness_label_to_sort, int kout_g_in, int tmin, int kout_g_out, int tmout, int Nstar, int nneighs, const double &max_r, bool only_c, weighted_tabdeg &previous_tab_c); double CUP_runs(weighted_tabdeg &previous_tab_c, weighted_tabdeg &previous_tab_n, int kin_cgroup_prev, int ktot_cgroup_prev_in, int ktot_cgroup_prev_out, deque<int> &gr_cleaned, bool only_c, int number_of_runs); void initialize_for_evaluation(const deque<int> &_c_, weighted_tabdeg &previous_tab_c, weighted_tabdeg &previous_tab_n, int &kin_cgroup_prev, int &ktot_cgroup_prev_in, int &ktot_cgroup_prev_out); void initialize_for_evaluation(weighted_tabdeg &previous_tab_c, weighted_tabdeg &previous_tab_n, int &kin_cgroup_prev, int &ktot_cgroup_prev_in, int &ktot_cgroup_prev_out); double partial_CUP(weighted_tabdeg &previous_tab_c, weighted_tabdeg &previous_tab_n, int kin_cgroup_prev, int ktot_cgroup_prev_in, int ktot_cgroup_prev_out, deque<int> &border_group, bool only_c); void set_changendi_cum(); void insertion(int changendi); bool insert_the_best(); /* DATA ***************************************************/ double max_r_bord; // this is the maximum r allowed for the external nodes (we don't want to look at all the graph, it would take too long) int maxb_nodes; // this is the maximum number of nodes allowed in the border (similar as above) deque<double> changendi_cum; // this is the cumulative distribution of the number of nodes to add to the cluster in the group_inflation function // ************* things to update ************************* weighted_tabdeg cgroup; //* weighted_tabdeg neighs; //* //* int kin_cgroup; //* int ktot_cgroup_in; //* int ktot_cgroup_out; //* /*********************************************************/ };
#include "zcompress.h" #include "misko_mempool.h" #ifndef MAX_PATH #define MAX_PATH 256 #endif const char * base64char = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; char * base64_encode( const unsigned char * bindata, char * base64, int binlength ) { int i, j; unsigned char current; for ( i = 0, j = 0 ; i < binlength ; i += 3 ) { current = (bindata[i] >> 2) ; current &= (unsigned char)0x3F; base64[j++] = base64char[(int)current]; current = ( (unsigned char)(bindata[i] << 4 ) ) & ( (unsigned char)0x30 ) ; if ( i + 1 >= binlength ) { base64[j++] = base64char[(int)current]; base64[j++] = '='; base64[j++] = '='; break; } current |= ( (unsigned char)(bindata[i+1] >> 4) ) & ( (unsigned char) 0x0F ); base64[j++] = base64char[(int)current]; current = ( (unsigned char)(bindata[i+1] << 2) ) & ( (unsigned char)0x3C ) ; if ( i + 2 >= binlength ) { base64[j++] = base64char[(int)current]; base64[j++] = '='; break; } current |= ( (unsigned char)(bindata[i+2] >> 6) ) & ( (unsigned char) 0x03 ); base64[j++] = base64char[(int)current]; current = ( (unsigned char)bindata[i+2] ) & ( (unsigned char)0x3F ) ; base64[j++] = base64char[(int)current]; } base64[j] = '\0'; return base64; } int base64_decode( const char * base64, unsigned char * bindata ) { int i, j; unsigned char k; unsigned char temp[4]; for ( i = 0, j = 0; base64[i] != '\0' ; i += 4 ) { memset( temp, 0xFF, sizeof(temp) ); for ( k = 0 ; k < 64 ; k ++ ) { if ( base64char[k] == base64[i] ) temp[0]= k; } for ( k = 0 ; k < 64 ; k ++ ) { if ( base64char[k] == base64[i+1] ) temp[1]= k; } for ( k = 0 ; k < 64 ; k ++ ) { if ( base64char[k] == base64[i+2] ) temp[2]= k; } for ( k = 0 ; k < 64 ; k ++ ) { if ( base64char[k] == base64[i+3] ) temp[3]= k; } bindata[j++] = ((unsigned char)(((unsigned char)(temp[0] << 2))&0xFC)) | ((unsigned char)((unsigned char)(temp[1]>>4)&0x03)); if ( base64[i+2] == '=' ) break; bindata[j++] = ((unsigned char)(((unsigned char)(temp[1] << 4))&0xF0)) | ((unsigned char)((unsigned char)(temp[2]>>2)&0x0F)); if ( base64[i+3] == '=' ) break; bindata[j++] = ((unsigned char)(((unsigned char)(temp[2] << 6))&0xF0)) | ((unsigned char)(temp[3]&0x3F)); } return j; } unsigned long misko_compress(void *src, unsigned long src_len,void **comp_data){ if(src_len < 1) return 0; unsigned long comp_bound_len = compressBound(src_len); char *comp_str = (char *)malloc(comp_bound_len); memset (comp_str,0,comp_bound_len); compress2(comp_str, &comp_bound_len, src, src_len,9); if(comp_bound_len > 0){ *comp_data = comp_str; }else{ *comp_data = NULL; } return comp_bound_len; } unsigned long misko_uncompress(void *src,unsigned long src_len,void **uncomp_data,unsigned long uncomp_bound_len){ printf("len:%lld comp len:%lld\n",src_len,uncomp_bound_len); if(src_len < 1) return 0; char *uncmp_str = (char *)malloc(uncomp_bound_len); memset (uncmp_str,0,uncomp_bound_len); uncompress(uncmp_str, &uncomp_bound_len, src, src_len); if(uncomp_bound_len > 0){ *uncomp_data = uncmp_str; }else{ *uncomp_data = NULL; } return uncomp_bound_len; } unsigned long misko_compress_with_base64(void *src, unsigned long src_len,void **comp_data){ char *comp_data_str = NULL; unsigned long comp_data_str_len = misko_compress (src,src_len,&comp_data_str); if(comp_data_str_len < 1){ *comp_data = NULL; return 0; } unsigned long base64_str_bound_len = 4 * src_len / 3 + 256; char *base64_str = (char *)malloc(base64_str_bound_len); base64_encode(comp_data_str,base64_str,comp_data_str_len); unsigned long base_64_str_len = strlen(base64_str); if(base_64_str_len > 0){ *comp_data = base64_str; }else{ *comp_data = NULL; } return base_64_str_len; } unsigned long misko_uncompress_with_base64(void *src,unsigned long src_len,void **uncomp_data,unsigned long uncomp_bound_len){ unsigned long base64_str_bound_len = 3 * src_len / 4 + 256; char *base64_str = (char *)malloc(base64_str_bound_len); unsigned long base64_str_len = base64_decode (src,base64_str); char *uncomp_data_str = NULL; unsigned long uncomp_data_str_len = misko_uncompress (base64_str,base64_str_len,&uncomp_data_str,uncomp_bound_len); if(uncomp_data_str_len < 1){ *uncomp_data = NULL; return 0; } if(uncomp_data_str_len > 0){ *uncomp_data = uncomp_data_str; }else{ *uncomp_data = NULL; } return uncomp_data_str_len; }
/* HulK - GUIPro Project ( http://glatigny.github.io/guipro/ ) Author : Glatigny Jérôme <jerome@darksage.fr> 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 */ #pragma once // http://www.cyberforum.ru/blogs/105416/blog3605.html #include <objbase.h> #include <ObjectArray.h> #include <windows.h> #include <shobjidl.h> // const CLSID CLSID_ImmersiveShell = { 0xC2F03A33, 0x21F5, 0x47FA, 0xB4, 0xBB, 0x15, 0x63, 0x62, 0xA2, 0xF2, 0x39 }; const CLSID CLSID_VirtualDesktopAPI_Unknown = { 0xC5E0CDCA, 0x7B6E, 0x41B2, 0x9F, 0xC4, 0xD9, 0x39, 0x75, 0xCC, 0x46, 0x7B }; const IID IID_IVirtualDesktopManagerInternal = { 0xEF9F1A6C, 0xD3CC, 0x4358, 0xB7, 0x12, 0xF8, 0x4B, 0x63, 0x5B, 0xEB, 0xE7 }; // struct IApplicationView : public IUnknown {}; // EXTERN_C const IID IID_IVirtualDesktop; MIDL_INTERFACE("FF72FFDD-BE7E-43FC-9C03-AD81681E88E4") IVirtualDesktop : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE IsViewVisible(IApplicationView *pView, int *pfVisible) = 0; virtual HRESULT STDMETHODCALLTYPE GetID(GUID *pGuid) = 0; }; // enum AdjacentDesktop { LeftDirection = 3, RightDirection = 4 }; const IID UUID_IVirtualDesktopManagerInternal_10130 { 0xEF9F1A6C, 0xD3CC, 0x4358, 0xB7, 0x12, 0xF8, 0x4B, 0x63, 0x5B, 0xEB, 0xE7 }; const IID UUID_IVirtualDesktopManagerInternal_10240 { 0xAF8DA486, 0x95BB, 0x4460, 0xB3, 0xB7, 0x6E, 0x7A, 0x6B, 0x29, 0x62, 0xB5 }; const IID UUID_IVirtualDesktopManagerInternal_14393 { 0xf31574d6, 0xb682, 0x4cdc, 0xbd, 0x56, 0x18, 0x27, 0x86, 0x0a, 0xbe, 0xc6 }; // EXTERN_C const IID IID_IVirtualDesktopManagerInternal; MIDL_INTERFACE("AF8DA486-95BB-4460-B3B7-6E7A6B2962B5") IVirtualDesktopManagerInternal : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE GetCount(UINT *pCount) = 0; virtual HRESULT STDMETHODCALLTYPE MoveViewToDesktop(IApplicationView *pView, IVirtualDesktop *pDesktop) = 0; virtual HRESULT STDMETHODCALLTYPE CanViewMoveDesktops(IApplicationView *pView, int *pfCanViewMoveDesktops) = 0; virtual HRESULT STDMETHODCALLTYPE GetCurrentDesktop(IVirtualDesktop** desktop) = 0; virtual HRESULT STDMETHODCALLTYPE GetDesktops(IObjectArray **ppDesktops) = 0; virtual HRESULT STDMETHODCALLTYPE GetAdjacentDesktop(IVirtualDesktop *pDesktopReference, AdjacentDesktop uDirection, IVirtualDesktop **ppAdjacentDesktop) = 0; virtual HRESULT STDMETHODCALLTYPE SwitchDesktop(IVirtualDesktop *pDesktop) = 0; virtual HRESULT STDMETHODCALLTYPE CreateDesktopW(IVirtualDesktop **ppNewDesktop) = 0; virtual HRESULT STDMETHODCALLTYPE RemoveDesktop(IVirtualDesktop *pRemove, IVirtualDesktop *pFallbackDesktop) = 0; virtual HRESULT STDMETHODCALLTYPE FindDesktop(GUID *desktopId, IVirtualDesktop **ppDesktop) = 0; }; // EXTERN_C const IID IID_IVirtualDesktopManager; MIDL_INTERFACE("a5cd92ff-29be-454c-8d04-d82879fb3f1b") IVirtualDesktopManager : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE IsWindowOnCurrentVirtualDesktop(/* [in] */ __RPC__in HWND topLevelWindow, /* [out] */ __RPC__out BOOL *onCurrentDesktop) = 0; virtual HRESULT STDMETHODCALLTYPE GetWindowDesktopId(/* [in] */ __RPC__in HWND topLevelWindow, /* [out] */ __RPC__out GUID *desktopId) = 0; virtual HRESULT STDMETHODCALLTYPE MoveWindowToDesktop(/* [in] */ __RPC__in HWND topLevelWindow, /* [in] */ __RPC__in REFGUID desktopId) = 0; }; // EXTERN_C const IID IID_IVirtualDesktopNotification; MIDL_INTERFACE("C179334C-4295-40D3-BEA1-C654D965605A") IVirtualDesktopNotification : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE VirtualDesktopCreated(IVirtualDesktop *pDesktop) = 0; virtual HRESULT STDMETHODCALLTYPE VirtualDesktopDestroyBegin(IVirtualDesktop *pDesktopDestroyed, IVirtualDesktop *pDesktopFallback) = 0; virtual HRESULT STDMETHODCALLTYPE VirtualDesktopDestroyFailed(IVirtualDesktop *pDesktopDestroyed, IVirtualDesktop *pDesktopFallback) = 0; virtual HRESULT STDMETHODCALLTYPE VirtualDesktopDestroyed(IVirtualDesktop *pDesktopDestroyed, IVirtualDesktop *pDesktopFallback) = 0; virtual HRESULT STDMETHODCALLTYPE ViewVirtualDesktopChanged(IApplicationView *pView) = 0; virtual HRESULT STDMETHODCALLTYPE CurrentVirtualDesktopChanged(IVirtualDesktop *pDesktopOld, IVirtualDesktop *pDesktopNew) = 0; }; // EXTERN_C const IID IID_IVirtualDesktopNotificationService; MIDL_INTERFACE("0CD45E71-D927-4F15-8B0A-8FEF525337BF") IVirtualDesktopNotificationService : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE Register(IVirtualDesktopNotification *pNotification, DWORD *pdwCookie) = 0; virtual HRESULT STDMETHODCALLTYPE Unregister(DWORD dwCookie) = 0; };
/************************** The fork call basically makes a duplicate of the current process, identical in almost every way The new process (child) gets a different process ID (PID) and has the the PID of the old process (parent) as its parent PID (PPID). Because the two processes are now running exactly the same code, they can tell which is which by the return code of fork: The child gets 0 The parent gets the PID of the child. The exec call is a way to basically replace the entire current process with a new program. It loads the program into the current process space and runs it from the entry point. IE: +--------+ | pid=7 | | ppid=4 | | bash | +--------+ | | calls fork V +--------+ +--------+ | pid=7 | forks | pid=22 | | ppid=4 | ----------> | ppid=7 | | bash | | bash | +--------+ +--------+ | | | waits for pid 22 | calls exec to run ls | V | +--------+ | | pid=22 | | | ppid=7 | | | ls | V +--------+ +--------+ | | pid=7 | | exits | ppid=4 | <---------------+ | bash | +--------+ | | continues V *************************/ #include <sys/types.h> #include <stdio.h> #include <unistd.h> #include <errno.h> #include <sys/wait.h> #include <stdlib.h> int main() { pid_t pid; /* fork a child process */ pid = fork(); if (pid < 0) { /* error occurred */ fprintf(stderr, "Fork Failed"); exit (-1) ; } else if (pid == 0) { /* child process */ execlp("/bin/ls","ls",NULL); } /* fork a child process */ pid = fork(); if (pid < 0) { /* error occurred */ fprintf(stderr, "Fork Failed"); exit (-1) ; } else if (pid == 0) { /* child process */ execlp("/bin/pwd","pwd",NULL); } else { /* parent process */ /* parent will wait for the child to complete */ wait(NULL); printf("Child Complete\n"); exit(0); } }
/* created by click/linuxmodule/fixincludes.pl on Tue Nov 25 22:39:40 2014 */ /* from /lib/modules/2.6.27.5-117.fc10.i686/build/include/config/snd/hdspm.h */
// -*- Mode: C++ -*- // // Copyright (c) 2006 Rice University // // 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 // File: LocalityDFSetIterator.h // // Iterator over DFSetElement objects in a DFSet. // // Author: John Garvin (garvin@cs.rice.edu) #ifndef LOCALITY_DF_SET_ITERATOR_H #define LOCALITY_DF_SET_ITERATOR_H #include <set> #include <OpenAnalysis/Utils/OA_ptr.hpp> #include <analysis/LocalityDFSetElement.h> namespace Locality { /// Iterator over each DFSetElement in an DFSet class DFSetIterator { public: explicit DFSetIterator (OA::OA_ptr<std::set<OA::OA_ptr<DFSetElement> > > _set); ~DFSetIterator () {} void operator++(); bool isValid() const; OA::OA_ptr<DFSetElement> current() const; void reset(); private: OA::OA_ptr<std::set<OA::OA_ptr<DFSetElement> > > mSet; std::set<OA::OA_ptr<DFSetElement> >::const_iterator mIter; }; } // namespace Locality #endif
#pragma once /* ---------------------------------------------------------------------------- // Modified to do reflectivity fitting // au.gafitm.cpp should be optimized to do monolayer fitting // restrict the beta profile by relating it to the density profile rho= k ( rho_a (1-x) + rho_b x) beta= k ( beta_a (1-x) + beta_b x) modified to do nph-cgi ---------------------------------------------------------------------------- */ #include <iostream> #include <string> #include <cstdlib> #include <cmath> #include <fstream> #include <istream> #include <sstream> #include <vector> #include <algorithm> #include <iterator> #include <complex> #include <cctype> #include <unistd.h> #include <pthread.h> #include <sys/time.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/wait.h> #include <gsl/gsl_errno.h> #include <gsl/gsl_spline.h> #include "GARealGenome.h" #include "gixosmultilayer.h" #include "defines.h" #include "logUtility.h" #include "Task.h" #define N_Av 6.02214179e23 using namespace std; ostream& operator << (ostream& os, GARealGenome genome); void read_in_data(string * data0, char ** argv, int argc); void getData(int id, string *data0, Task *t); void run(int taskId); int file_copy(string,string);
/* f90_unix_io_ccode.c : c stub code for f90_unix_io This file is part of Posix90 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <stdio.h> int c_feof_(FILE **stream){ return feof(*stream); } void c_fseek_(FILE **stream, long *offset, int *whence){ fseek(*stream, *offset, *whence); } long c_ftell_(FILE **stream){ return ftell(*stream); } void c_fopen_(FILE **fp, char *path, char *mode){ *fp = fopen(path, mode); } void c_fclose_(FILE **fp){ fclose(*fp); } void c_popen_(FILE **fp, char *cmd, char *mode){ *fp = popen(cmd, mode); } void c_pclose_(FILE **fp){ pclose(*fp); } int c_fread_str_(char *str, int *size, FILE **fp, int maxsize){ return fread(str, (size_t) *size, (size_t) 1, *fp); } int c_fread_str_array_(char *str, int *size, int *nelem, FILE **fp, int maxsize){ if(*size == maxsize) { return fread(str, (size_t) *size, (size_t) *nelem, *fp); } else { int i,j=0,k; for(i=0; i<*nelem; i++){ k = fread(str+i*maxsize, (size_t) *size, (size_t) 1, *fp); if(k==0) break; j+=k; } return j; } } int c_fread_real_(float *f, int *nf, FILE **fp){ return fread(f, (size_t)sizeof(float), (size_t)*nf, *fp); } int c_fread_double_(double *f, int *nf, FILE **fp){ return fread(f, (size_t)sizeof(double), (size_t)*nf, *fp); } int c_fread_int_(int *i, int *ni, FILE **fp){ return fread(i, (size_t)sizeof(int), (size_t)*ni, *fp); } int c_fwrite_str_(char *str, int *size, FILE **fp, int maxsize){ return fwrite(str, (size_t) *size, (size_t) 1, *fp); } int c_fwrite_str_array_(char *str, int *size, int *nelem, FILE **fp, int maxsize){ if(*size == maxsize) { return fwrite(str, (size_t) *size, (size_t) *nelem, *fp); } else { int i,j=0,k; for(i=0; i<*nelem; i++){ k = fwrite(str+i*maxsize, (size_t) *size, (size_t) 1, *fp); if(k==0) break; j+=k; } return j; } } int c_fwrite_real_(float *f, int *nf, FILE **fp){ return fwrite(f, (size_t)sizeof(float), (size_t)*nf, *fp); } int c_fwrite_double_(double *f, int *nf, FILE **fp){ return fwrite(f, (size_t)sizeof(double), (size_t)*nf, *fp); } int c_fwrite_int_(int *i, int *ni, FILE **fp){ return fwrite(i, (size_t)sizeof(int), (size_t)*ni, *fp); } void c_fgets_(char *str, FILE **fp, int len){ fgets(str, len, *fp); } void c_fputs_(char *str, FILE **fp, int len){ fputs(str, *fp); } void c_stdin_(FILE **fp){ *fp = stdin; } void c_stdout_(FILE **fp){ *fp = stdout; } void c_stderr_(FILE **fp){ *fp = stderr; }
#ifndef __EMC_CHANGE_FREQ_DADTA_H #define __EMC_CHANGE_FREQ_DADTA_H u32 cp_code_data[] = { 0xE59FF024, 0xE3A0F004, 0xE3A0F008, 0xE3A0F00C, 0xE3A0F010, 0xE3A0F014, 0xE3A0F018, 0xE3A0F01C, 0xE3A03E80, 0xE1A0D003, 0xEA0001AE, 0x00000020, 0x68104AF7, 0x43082101, 0x47706010, 0x680148F4, 0x00490849, 0x47706001, 0x2800B5F0, 0xE7FED000, 0x1C0E48F0, 0x3B401C03, 0x24032102, 0x2E002500, 0x2209D03E, 0x2E012701, 0x2E03D018, 0x1C3ED137, 0x270D621F, 0x4FE8619F, 0x270561DF, 0x2708631F, 0x639C635F, 0x600163D9, 0x60816044, 0x61C56182, 0x60C1210E, 0x60182064, 0xE018200A, 0x621F1C3E, 0x619F271A, 0x37014FDC, 0x631A61DF, 0x635A220D, 0x639A2204, 0x210263D9, 0x60446001, 0x21126081, 0x61C56181, 0x60C1211C, 0x601820C8, 0x60D82014, 0x62DE629C, 0x210248CE, 0x62013038, 0xBDF06146, 0x2A642606, 0x6219D120, 0x61992134, 0x61D949CB, 0x63192111, 0x63592119, 0x63992108, 0x63D92104, 0x60466004, 0x21246084, 0x61C56181, 0x60C12138, 0x60180090, 0x60D82028, 0x62DC629E, 0x210548BC, 0x62013038, 0xBDF06144, 0xD1FC2A4B, 0x212C6219, 0x49BA6199, 0x61D93901, 0x6319210D, 0x63592113, 0x63DC639E, 0x60012103, 0x60412105, 0x60822203, 0x6182221B, 0x222A61C5, 0x20FF60C2, 0x6018302D, 0x60D8201E, 0x2003629E, 0x48A962D8, 0x62013038, 0x61412103, 0xB570BDF0, 0xCE70AE04, 0xD1172800, 0x011A0150, 0x00E24310, 0x43284310, 0x48A41C02, 0x60866042, 0x381448A2, 0x233F6802, 0x439A015B, 0x014A6002, 0x43110209, 0x43116802, 0xBD706001, 0x0440E7FE, 0x43080409, 0x430803D1, 0x43080319, 0xB5104998, 0x48934301, 0x38C09C02, 0x68016001, 0xDBFC2900, 0x03214A93, 0x43113210, 0x68016001, 0xDBFC2900, 0x488EBD10, 0x6801382C, 0x4A8C0700, 0x3A2C4381, 0x498C6011, 0x4A8B6809, 0x60114381, 0x32404A89, 0x43816811, 0x4A876011, 0x68113280, 0x60114381, 0x32C04A84, 0x43816811, 0x47706011, 0x382C487F, 0x07006801, 0x43014A7D, 0x60113A2C, 0x6809497D, 0x43014A7C, 0x4A7B6011, 0x68113240, 0x60114301, 0x32804A78, 0x43016811, 0x4A766011, 0x681132C0, 0x60104308, 0xB5104770, 0x23011C04, 0x21092201, 0xF0004871, 0x4870F9FD, 0x220B08A3, 0x30282100, 0xF9F6F000, 0x22012300, 0x486B2109, 0xF9F0F000, 0x4A69BD10, 0x6813B530, 0x02642401, 0x60134323, 0x35284D65, 0x0ADB682B, 0x431902DB, 0x68116029, 0x601143A1, 0x6A514A61, 0x021B230F, 0x02004399, 0x62504308, 0xB570BD30, 0x68A04C5D, 0x0F400740, 0x26012502, 0x2800E019, 0x2801D00E, 0x2803D006, 0x6060D110, 0xF0002005, 0xBD70F9EF, 0x20036065, 0xF9EAF000, 0xE7EE2003, 0x20016066, 0xF9E4F000, 0xE7E82001, 0x074068A0, 0x28050F40, 0xBD70D1E3, 0x382C4846, 0x07406801, 0x43014A44, 0x60113A2C, 0x68094944, 0x43014A43, 0x4A426011, 0x68113240, 0x60114301, 0x32804A3F, 0x43016811, 0x4A3D6011, 0x681132C0, 0x60104308, 0x48384770, 0x6801382C, 0x08490049, 0x48376001, 0x00406800, 0x08404935, 0x48346008, 0x68013040, 0x08490049, 0x48316001, 0x68013080, 0x08490049, 0x482E6001, 0x680130C0, 0x08490049, 0x47706001, 0x1C17B5F0, 0x1C041C0D, 0xB0852903, 0x2600D301, 0x2601E000, 0xFE4EF7FF, 0xF986F000, 0xFF8FF7FF, 0xF974F000, 0x20014A1F, 0x68113A30, 0x2E0005C0, 0x4308D002, 0xE0016010, 0x60114381, 0xFFA4F7FF, 0x1C281C39, 0xFF61F7FF, 0xF967F000, 0x1C291C3A, 0xF7FF1C20, 0x2C00FE3B, 0x2001D140, 0x23019004, 0x27022500, 0x21012601, 0x96021C20, 0x95009701, 0x9A049303, 0xFEC1F7FF, 0x20044C0F, 0x20036060, 0xF95EF000, 0x60602001, 0xF95AF000, 0x1C3B9600, 0x0000E014, 0x60200208, 0x60200100, 0x00010003, 0x00020008, 0x60201040, 0x80F00013, 0x602011CC, 0x4B000018, 0x20900200, 0x60200000, 0x98041C2A, 0xF7FF9903, 0x2002FEB8, 0x20036060, 0xF938F000, 0xFDF6F7FF, 0xF92EF000, 0xBDF0B005, 0xB5F7E7FE, 0x1C0C4E9B, 0x1C156830, 0x2108B086, 0x60304388, 0xFDE0F7FF, 0xF918F000, 0xFF21F7FF, 0xF906F000, 0xFF5FF7FF, 0xF0002004, 0xF7FFF8E6, 0x2002FEAE, 0xF8E1F000, 0x1C201C29, 0xFEF7F7FF, 0xF8FDF000, 0xF0002002, 0xF7FFF8D8, 0x4889FEBD, 0x22012301, 0x38202100, 0xF8B9F000, 0x48864F85, 0x61B83F2C, 0x60782005, 0xF8C7F000, 0x23014881, 0x21002201, 0xF0003820, 0x4880F8AA, 0x20056078, 0xF8BBF000, 0x2301487B, 0x21002201, 0xF0003820, 0x6830F89E, 0x43082108, 0x1C2A6030, 0x98061C21, 0xFDA6F7FF, 0x28009806, 0x2C00D138, 0x2C01D009, 0x2001D133, 0x26002301, 0x27012502, 0x90059304, 0x2004E006, 0x26002301, 0x27042502, 0x90059304, 0x2C002102, 0x95019600, 0xD0009702, 0x98062101, 0x9B049A05, 0xFE1BF7FF, 0x20044C65, 0x20036060, 0xF8B8F000, 0x60602001, 0xF8B4F000, 0x1C321C2B, 0x98059700, 0xF7FF9904, 0x2002FE28, 0xF7FF6060, 0xF000FD69, 0xB009F8A1, 0xE7FEBDF0, 0xB570E7FE, 0x061B2321, 0x07416818, 0x4D560F89, 0x686AD115, 0x1C012410, 0x601943A1, 0xE0064E53, 0x1A896869, 0xD902291E, 0x60184320, 0x6931BD70, 0xD4F503C9, 0x6868BD70, 0x281E1A80, 0x6818D8FA, 0xD4F806C0, 0x2121BD70, 0x68080609, 0x0F920742, 0x2210D102, 0x60084310, 0xB5F84770, 0x68484944, 0x0F0E0501, 0x06040401, 0x0E070180, 0x0E242003, 0x2D010F0D, 0xD1019000, 0xFFC3F7FF, 0xD1052C01, 0x1C311C3A, 0xF7FF2000, 0xE006FEBF, 0xD1042C02, 0x1C311C3A, 0xF7FF2000, 0x2D01FF26, 0xF7FFD101, 0x4933FFD2, 0x0A006848, 0x02009A00, 0x60484310, 0xB5FFE7FE, 0x24002500, 0xE0042701, 0x1C3E190B, 0x4335409E, 0x42943401, 0x9B03D3F8, 0x6801408B, 0x402A1C0A, 0xD1FA429A, 0xB0041C08, 0x4A1EBDF0, 0x3A2C2100, 0x68D3E001, 0x42813101, 0x4770D3FB, 0x6805B5FF, 0x27012400, 0x190BE004, 0x409E1C3E, 0x340143B5, 0xD3F84294, 0x408B9B03, 0x1C19432B, 0xBDFF6001, 0x3A404A16, 0x04D16810, 0x60104388, 0x4A134770, 0x68103A40, 0x430804D1, 0x47706010, 0x6801480C, 0x00490849, 0x47706001, 0x68104A09, 0x43082101, 0x47706010, 0x68914A06, 0x0F490749, 0xD1FA4281, 0x00004770, 0x6020102C, 0x0020219B, 0x00040001, 0x60200000, 0x47003000, 0x21000080, 0x20900240, 0xE59FC000, 0xE12FFF1C, 0x000005CF, }; #endif
// // Created by alex on 4/7/17. // #ifndef DAVIDIAN_BODY_H #define DAVIDIAN_BODY_H #include <memory> #include "GlobalDefinitions.h" namespace orbital{ class CelestialBody; class Orbit; class StateVector; class Body { public: /** * Constructing a Generic body that is in orbit around some other body. The parent and orbit may change as the system * evolves over time. * @param mass Mass, in kg, of this body * @param orbitalElements Description of (initial) orbit around (initial) parent body using orbital elements * @param parent Pointer to the (Celestial) body this body orbits. */ Body(double mass, const OrbitalElements& orbitalElements, const CelestialBody* parent); virtual ~Body(); /// Using the more precise definition of GM_1 + GM_2, rather than just approximating it to be GM_1 (as appropriate) double standardGravitationalParameter() const; /// Just the mass of this body. double mass() const {return m_mass;} const Orbit* orbit() const {return m_orbit.get();} const CelestialBody* parent() const {return _parent;} /** * Generally speaking, these are likely to be updated together as a body transfers from one parent to another * * @note depending on threading, we may want to consider adding "truer" atomicity to this operation * * @param parent New parent body of this body * @param orbitalElements New orbit around parent body that this body occupies. */ void setParentAndOrbit(const CelestialBody* parent, const OrbitalElements& orbitalElements); protected: /** * Construct a 'root' parent body that is at the origin of the coordinate system and does not orbit or move. * Protected because CelestialBody subclass is what needs access to it. * @param mass */ explicit Body(double mass); private: // allowing mass to be mutable if we wish to do more general cases like rockets that lose mass during burns. double m_mass; const CelestialBody* _parent; std::unique_ptr<Orbit> m_orbit; }; } // namespace orbital #endif //DAVIDIAN_BODY_H
#ifndef __ROCCAT_PROFILE_PAGE_TAB_LABEL_H__ #define __ROCCAT_PROFILE_PAGE_TAB_LABEL_H__ /* * This file is part of roccat-tools. * * roccat-tools 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. * * roccat-tools 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 roccat-tools. If not, see <http://www.gnu.org/licenses/>. */ #include <gtk/gtk.h> G_BEGIN_DECLS #define ROCCAT_PROFILE_PAGE_TAB_LABEL_TYPE (roccat_profile_page_tab_label_get_type()) #define ROCCAT_PROFILE_PAGE_TAB_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ROCCAT_PROFILE_PAGE_TAB_LABEL_TYPE, RoccatProfilePageTabLabel)) #define IS_ROCCAT_PROFILE_PAGE_TAB_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ROCCAT_PROFILE_PAGE_TAB_LABEL_TYPE)) #define ROCCAT_PROFILE_PAGE_TAB_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ROCCAT_PROFILE_PAGE_TAB_LABEL_TYPE, RoccatProfilePageTabLabelClass)) #define IS_ROCCAT_PROFILE_PAGE_TAB_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ROCCAT_PROFILE_PAGE_TAB_LABEL_TYPE)) typedef struct _RoccatProfilePageTabLabelClass RoccatProfilePageTabLabelClass; typedef struct _RoccatProfilePageTabLabel RoccatProfilePageTabLabel; typedef struct _RoccatProfilePageTabLabelPrivate RoccatProfilePageTabLabelPrivate; struct _RoccatProfilePageTabLabel { GtkHBox parent; RoccatProfilePageTabLabelPrivate *priv; }; struct _RoccatProfilePageTabLabelClass { GtkHBoxClass parent_class; }; GType roccat_profile_page_tab_label_get_type(void); GtkWidget *roccat_profile_page_tab_label_new(void); void roccat_profile_page_tab_label_set_name(RoccatProfilePageTabLabel *tab_label, gchar const *name); gchar *roccat_profile_page_tab_label_get_name(RoccatProfilePageTabLabel *tab_label); void roccat_profile_page_tab_label_set_index(RoccatProfilePageTabLabel *tab_label, gint index); gint roccat_profile_page_tab_label_get_index(RoccatProfilePageTabLabel *tab_label); void roccat_profile_page_tab_label_set_group(RoccatProfilePageTabLabel *tab_label, GSList *group); GSList *roccat_profile_page_tab_label_get_group(RoccatProfilePageTabLabel *tab_label); void roccat_profile_page_tab_label_set_active(RoccatProfilePageTabLabel *tab_label); gboolean roccat_profile_page_tab_label_get_closeable(RoccatProfilePageTabLabel *tab_label); void roccat_profile_page_tab_label_set_closeable(RoccatProfilePageTabLabel *tab_label, gboolean closeable); G_END_DECLS #endif
#ifndef _MACROS_H_ #define _MACROS_H_ #define ROUNDTOINT(F) (DECIMAL(F)>=.5? int(F)+1:int(F)) #define ROUNDUP(F) (DECIMAL(F)>0? int(F)+1:int(F)) #define IS_ASCII(C) (((unsigned char)C)>=0x20 && ((unsigned char)C)<=0xFE) #define DECIMAL(N) (N-int(N)) #define ABS(X) ((X)<0? (-1*(X)):(X)) #define MAX(X,Y) (X>Y? X:Y) #define MIN(X,Y) (X>Y? Y:X) #define CLOSER(A,B,C) (ABS((A)-(C))<ABS((B)-(C))) //TRUE if A is closer to C than B is #define CLOSE_TO(A,B,T) (ABS((A)-(B))<=ROUNDTOINT((B)*(T))? true:false) #define IS_BETWEEN_A(X,Y,Z) ((X)>=(Y) && (X)<=(Z)) #define IS_BETWEEN(X,Y,Z) (Y<Z? IS_BETWEEN_A(X,Y,Z):IS_BETWEEN_A(X,Z,Y)) #define IS_LOWER_LTR(c) ((c>='a' && c<='z')? 1:0) #define IS_UPPER_LTR(c) ((c>='A' && c<='Z')? 1:0) #endif
/* * viking -- GPS Data and Topo Analyzer, Explorer, and Manager * * Copyright (C) 2003-2005, Evan Battaglia <gtoevan@gmx.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef _VIKING_TREEVIEW_H #define _VIKING_TREEVIEW_H #include "config.h" #include "uibuilder.h" #include <glib.h> #include <glib-object.h> #include <gtk/gtk.h> G_BEGIN_DECLS #define VIK_TREEVIEW_TYPE (vik_treeview_get_type ()) #define VIK_TREEVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIK_TREEVIEW_TYPE, VikTreeview)) #define VIK_TREEVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIK_TREEVIEW_TYPE, VikTreeviewClass)) #define IS_VIK_TREEVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIK_TREEVIEW_TYPE)) #define IS_VIK_TREEVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIK_TREEVIEW_TYPE)) typedef struct _VikTreeview VikTreeview; typedef struct _VikTreeviewClass VikTreeviewClass; struct _VikTreeviewClass { GtkTreeViewClass vbox_class; void (* item_edited) (VikTreeview *vt, GtkTreeIter *iter, const gchar *new_name); void (* item_toggled) (VikTreeview *vt,GtkTreeIter *iter); }; enum { VIK_TREEVIEW_TYPE_LAYER = 0, VIK_TREEVIEW_TYPE_SUBLAYER }; GType vik_treeview_get_type (); VikTreeview *vik_treeview_new (); GtkWidget *vik_treeview_get_widget ( VikTreeview *vt ); gint vik_treeview_item_get_data ( VikTreeview *vt, GtkTreeIter *iter ); gint vik_treeview_item_get_type ( VikTreeview *vt, GtkTreeIter *iter ); gchar *vik_treeview_item_get_name ( VikTreeview *vt, GtkTreeIter *iter ); gpointer vik_treeview_item_get_pointer ( VikTreeview *vt, GtkTreeIter *iter ); void vik_treeview_item_set_pointer ( VikTreeview *vt, GtkTreeIter *iter, gpointer pointer ); void vik_treeview_item_set_timestamp ( VikTreeview *vt, GtkTreeIter *iter, gdouble timestamp ); gpointer vik_treeview_item_get_parent ( VikTreeview *vt, GtkTreeIter *iter ); gboolean vik_treeview_item_get_visible_tree ( VikTreeview *vt, GtkTreeIter *iter ); void vik_treeview_item_set_visible_tree ( VikTreeview *vt, GtkTreeIter *iter ); void vik_treeview_select_iter ( VikTreeview *vt, GtkTreeIter *iter, gboolean view_all ); gboolean vik_treeview_get_selected_iter ( VikTreeview *vt, GtkTreeIter *iter ); gboolean vik_treeview_get_editing ( VikTreeview *vt ); void vik_treeview_item_set_icon ( VikTreeview *vt, GtkTreeIter *iter, const GdkPixbuf *icon ); void vik_treeview_item_set_name ( VikTreeview *vt, GtkTreeIter *iter, const gchar *to ); void vik_treeview_item_set_visible ( VikTreeview *vt, GtkTreeIter *iter, gboolean to ); void vik_treeview_item_toggle_visible ( VikTreeview *vt, GtkTreeIter *iter ); void vik_treeview_item_delete ( VikTreeview *vt, GtkTreeIter *iter ); gboolean vik_treeview_get_iter_at_pos ( VikTreeview *vt, GtkTreeIter *iter, gint x, gint y ); gboolean vik_treeview_get_iter_from_path_str ( VikTreeview *vt, GtkTreeIter *iter, const gchar *path_str ); gboolean vik_treeview_move_item ( VikTreeview *vt, GtkTreeIter *iter, gboolean up ); void vik_treeview_item_select ( VikTreeview *vt, GtkTreeIter *iter ); void vik_treeview_item_unselect ( VikTreeview *vt, GtkTreeIter *iter ); gboolean vik_treeview_item_get_parent_iter ( VikTreeview *vt, GtkTreeIter *iter, GtkTreeIter *parent ); void vik_treeview_expand ( VikTreeview *vt, GtkTreeIter *iter ); void vik_treeview_add_layer ( VikTreeview *vt, GtkTreeIter *parent_iter, GtkTreeIter *iter, const gchar *name, gpointer parent, gboolean above, gpointer item, gint data, VikLayerTypeEnum layer_type, gdouble timestamp ); void vik_treeview_insert_layer ( VikTreeview *vt, GtkTreeIter *parent_iter, GtkTreeIter *iter, const gchar *name, gpointer parent, gboolean above, gpointer item, gint data, VikLayerTypeEnum layer_type, GtkTreeIter *sibling, gdouble timestamp ); void vik_treeview_add_sublayer ( VikTreeview *vt, GtkTreeIter *parent_iter, GtkTreeIter *iter, const gchar *name, gpointer parent, gpointer item, gint data, GdkPixbuf *icon, gboolean editable, gdouble timestamp ); gboolean vik_treeview_get_iter_with_name ( VikTreeview *vt, GtkTreeIter *iter, GtkTreeIter *parent_iter, const gchar *name ); void vik_treeview_sort_children ( VikTreeview *vt, GtkTreeIter *parent, vik_layer_sort_order_t order ); G_END_DECLS #endif
enum {LOCAL, REMOTE}; const int* clists_get_ss(const Clist *c) {return c->starts;} const int* clists_get_cc(const Clist *c) {return c->counts;} int3 clists_get_dim(const Clist *c) {return c->dims;} int clists_get_n(const Clist *c) {return c->ncells;} const uint* clist_get_ids(const ClistMap *m) {return m->ii;} void clist_ini_counts(/**/ Clist *c) { if (c->ncells) CC(d::MemsetAsync(c->counts, 0, (c->ncells + 16) * sizeof(int))); } static void check_input_size(int id, long n, const ClistMap *m) { long cap = m->maxp; if (n > cap) ERR("Too many input particles for array %d (%ld / %ld)", id, n, cap); } static void comp_subindices(bool project, int n, const PartList lp, int3 dims, /**/ int *cc, uchar4 *ee) { if (n) KL(clist_dev::subindex, (k_cnf(n)), (project, dims, n, lp, /*io*/ cc, /**/ ee)); } void clist_subindex(bool project, int aid, int n, const PartList lp, /**/ Clist *c, ClistMap *m) { UC(check_input_size(aid, n, m)); UC(comp_subindices(project, n, lp, c->dims, /**/ c->counts, m->ee[aid])); } void clist_subindex_local(int n, const PartList lp, /**/ Clist *c, ClistMap *m) { UC(clist_subindex(false, LOCAL, n, lp, /**/ c, m)); } void clist_subindex_remote(int n, const PartList lp, /**/ Clist *c, ClistMap *m) { UC(clist_subindex(false, REMOTE, n, lp, /**/ c, m)); } void clist_build_map(const int nn[], /**/ Clist *c, ClistMap *m) { int nc, *cc, *ss, n, i; const uchar4 *ee; uint *ii = m->ii; int3 dims = c->dims; nc = c->ncells; cc = c->counts; ss = c->starts; scan_apply(cc, nc + 16, /**/ ss, /*w*/ m->scan); for (i = 0; i < m->nA; ++i) { n = nn[i]; ee = m->ee[i]; UC(check_input_size(i, n, m)); if (n) KL(clist_dev::get_ids, (k_cnf(n)), (i, dims, n, ss, ee, /**/ ii)); } } static void check_map_capacity(long n, const ClistMap *m) { long cap = m->maxp * m->nA; if (n > cap) ERR("Too many particles for this cell list (%ld / %ld)", n, cap); } void clist_gather_pp(const Particle *pplo, const Particle *ppre, const ClistMap *m, long nout, /**/ Particle *ppout) { Sarray <const Particle*, 2> src = {pplo, ppre}; UC(check_map_capacity(nout, m)); if (nout) KL(clist_dev::gather, (k_cnf(nout)), (src, m->ii, nout, /**/ ppout)); } void clist_gather_ii(const int *iilo, const int *iire, const ClistMap *m, long nout, /**/ int *iiout) { Sarray <const int*, 2> src = {iilo, iire}; UC(check_map_capacity(nout, m)); if (nout) KL(clist_dev::gather, (k_cnf(nout)), (src, m->ii, nout, /**/ iiout)); } void clist_build(int nlo, int nout, const Particle *pplo, /**/ Particle *ppout, Clist *c, ClistMap *m) { const int nn[] = {nlo, 0}; PartList lp; lp.pp = pplo; lp.deathlist = NULL; UC(clist_ini_counts(/**/ c)); UC(clist_subindex_local (nlo, lp, /**/ c, m)); UC(clist_build_map(nn, /**/ c, m)); UC(clist_gather_pp(pplo, NULL, m, nout, ppout)); }
/* Linux backend * * Copyright (C) 2008-2010 Robert Ernst <robert.ernst@linux-solutions.at> * * This file may be distributed and/or modified under the terms of the * GNU General Public License version 2 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * See COPYING for GPL licensing information. */ #ifdef __linux__ #include <sys/sysinfo.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/time.h> #include <sys/vfs.h> #include <net/if.h> #include <netinet/in.h> #include <arpa/inet.h> #include <syslog.h> #include <unistd.h> #include <string.h> #include <stdlib.h> #include <stdio.h> #include <errno.h> #include <ctype.h> #include <time.h> #include <math.h> #include "mini_snmpd.h" /* We need the uptime in 1/100 seconds, so we can't use sysinfo() */ unsigned int get_process_uptime(void) { static unsigned int uptime_start = 0; unsigned int uptime_now = get_system_uptime(); if (uptime_start == 0) uptime_start = uptime_now; return uptime_now - uptime_start; } /* We need the uptime in 1/100 seconds, so we can't use sysinfo() */ unsigned int get_system_uptime(void) { char buf[128]; if (read_file("/proc/uptime", buf, sizeof(buf)) == -1) return -1; return (unsigned int)(atof(buf) * 100); } void get_loadinfo(loadinfo_t *loadinfo) { int i; char buf[128]; char *ptr; if (read_file("/proc/loadavg", buf, sizeof(buf)) == -1) { memset(loadinfo, 0, sizeof(loadinfo_t)); return; } ptr = buf; for (i = 0; i < 3; i++) { while (isspace(*ptr)) ptr++; if (*ptr != 0) loadinfo->avg[i] = strtod(ptr, &ptr) * 100; } } void get_meminfo(meminfo_t *meminfo) { field_t fields[] = { { "MemTotal", 1, { &meminfo->total }}, { "MemFree", 1, { &meminfo->free }}, { "MemShared", 1, { &meminfo->shared }}, { "Buffers", 1, { &meminfo->buffers }}, { "Cached", 1, { &meminfo->cached }}, { NULL } }; if (parse_file("/proc/meminfo", fields)) memset(meminfo, 0, sizeof(meminfo_t)); } void get_cpuinfo(cpuinfo_t *cpuinfo) { field_t fields[] = { { "cpu ", 4, { &cpuinfo->user, &cpuinfo->nice, &cpuinfo->system, &cpuinfo->idle }}, { "intr ", 1, { &cpuinfo->irqs }}, { "ctxt ", 1, { &cpuinfo->cntxts }}, { NULL } }; if (parse_file("/proc/stat", fields)) memset(cpuinfo, 0, sizeof(cpuinfo_t)); } void get_diskinfo(diskinfo_t *diskinfo) { size_t i; struct statfs fs; for (i = 0; i < g_disk_list_length; i++) { if (statfs(g_disk_list[i], &fs) == -1) { diskinfo->total[i] = 0; diskinfo->free[i] = 0; diskinfo->used[i] = 0; diskinfo->blocks_used_percent[i] = 0; diskinfo->inodes_used_percent[i] = 0; continue; } diskinfo->total[i] = ((float)fs.f_blocks * fs.f_bsize) / 1024; diskinfo->free[i] = ((float)fs.f_bfree * fs.f_bsize) / 1024; diskinfo->used[i] = ((float)(fs.f_blocks - fs.f_bfree) * fs.f_bsize) / 1024; diskinfo->blocks_used_percent[i] = ((float)(fs.f_blocks - fs.f_bfree) * 100 + fs.f_blocks - 1) / fs.f_blocks; if (fs.f_files <= 0) diskinfo->inodes_used_percent[i] = 0; else diskinfo->inodes_used_percent[i] = ((float)(fs.f_files - fs.f_ffree) * 100 + fs.f_files - 1) / fs.f_files; } } void get_netinfo(netinfo_t *netinfo) { int fd = socket(AF_INET, SOCK_DGRAM, 0); size_t i; struct ifreq ifreq; field_t fields[MAX_NR_INTERFACES + 1]; memset(fields, 0, (MAX_NR_INTERFACES + 1) * sizeof(field_t)); for (i = 0; i < g_interface_list_length; i++) { fields[i].prefix = g_interface_list[i]; fields[i].len = 12; fields[i].value[0] = &netinfo->rx_bytes[i]; fields[i].value[1] = &netinfo->rx_packets[i]; fields[i].value[2] = &netinfo->rx_errors[i]; fields[i].value[3] = &netinfo->rx_drops[i]; fields[i].value[8] = &netinfo->tx_bytes[i]; fields[i].value[9] = &netinfo->tx_packets[i]; fields[i].value[10] = &netinfo->tx_errors[i]; fields[i].value[11] = &netinfo->tx_drops[i]; snprintf(ifreq.ifr_name, sizeof(ifreq.ifr_name), "%s", g_interface_list[i]); if (fd == -1 || ioctl(fd, SIOCGIFFLAGS, &ifreq) == -1) { netinfo->status[i] = 4; continue; } if (ifreq.ifr_flags & IFF_UP) netinfo->status[i] = (ifreq.ifr_flags & IFF_RUNNING) ? 1 : 7; else netinfo->status[i] = 2; } if (fd != -1) close(fd); if (parse_file("/proc/net/dev", fields)) memset(netinfo, 0, sizeof(*netinfo)); } #endif /* __linux__ */ /* vim: ts=4 sts=4 sw=4 nowrap */
/* * "$Id: backend.h 5023 2006-01-29 14:39:44Z mike $" * * Backend definitions for the Common UNIX Printing System (CUPS). * * Copyright 1997-2005 by Easy Software Products. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal * copyright law. Distribution and use rights are outlined in the file * "LICENSE.txt" which should have been included with this file. If this * file is missing or damaged please contact Easy Software Products * at: * * Attn: CUPS Licensing Information * Easy Software Products * 44141 Airport View Drive, Suite 204 * Hollywood, Maryland 20636 USA * * Voice: (301) 373-9600 * EMail: cups-info@cups.org * WWW: http://www.cups.org * * This file is subject to the Apple OS-Developed Software exception. */ #ifndef _CUPS_BACKEND_H_ # define _CUPS_BACKEND_H_ /* * Constants... */ typedef enum cups_backend_e /**** Backend exit codes ****/ { CUPS_BACKEND_OK = 0, /* Job completed successfully */ CUPS_BACKEND_FAILED = 1, /* Job failed, use error-policy */ CUPS_BACKEND_AUTH_REQUIRED = 2, /* Job failed, authentication required */ CUPS_BACKEND_HOLD = 3, /* Job failed, hold job */ CUPS_BACKEND_STOP = 4, /* Job failed, stop queue */ CUPS_BACKEND_CANCEL = 5 /* Job failed, cancel job */ } cups_backend_t; /* * Prototypes... */ extern const char *cupsBackendDeviceURI(char **argv); #endif /* !_CUPS_BACKEND_H_ */ /* * End of "$Id: backend.h 5023 2006-01-29 14:39:44Z mike $". */
#include "gl.h" #ifndef __UNIFORM_H_ #define __UNIFORM_H_ int uniformsize(GLenum type); int is_uniform_int(GLenum type); int is_uniform_float(GLenum type); int is_uniform_matrix(GLenum type); int n_uniform(GLenum type); void gl4es_glGetUniformfv(GLuint program, GLint location, GLfloat *params); void gl4es_glGetUniformiv(GLuint program, GLint location, GLint *params); void gl4es_glUniform1f(GLint location, GLfloat v0); void gl4es_glUniform2f(GLint location, GLfloat v0, GLfloat v1); void gl4es_glUniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); void gl4es_glUniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); void gl4es_glUniform1i(GLint location, GLint v0); void gl4es_glUniform2i(GLint location, GLint v0, GLint v1); void gl4es_glUniform3i(GLint location, GLint v0, GLint v1, GLint v2); void gl4es_glUniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); void gl4es_glUniform1fv(GLint location, GLsizei count, const GLfloat *value); void gl4es_glUniform2fv(GLint location, GLsizei count, const GLfloat *value); void gl4es_glUniform3fv(GLint location, GLsizei count, const GLfloat *value); void gl4es_glUniform4fv(GLint location, GLsizei count, const GLfloat *value); void gl4es_glUniform1iv(GLint location, GLsizei count, const GLint *value); void gl4es_glUniform2iv(GLint location, GLsizei count, const GLint *value); void gl4es_glUniform3iv(GLint location, GLsizei count, const GLint *value); void gl4es_glUniform4iv(GLint location, GLsizei count, const GLint *value); void gl4es_glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); void gl4es_glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); void gl4es_glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); #endif
#include "terrain_perlin_noise.h" /* drawing the perlin terrain here by giving start and end point rows and columns. */ void draw_perlin_noise_terrain(float start_row, float end_row, float start_col, float end_col, float counter) { float z = 0; glColor3f(1.0f, 1.0f, 1.0f); printf("\nstartcol= %f\tend_row = %f\tstart_col = %f\yend_col = %f\tcounter = %f\n", start_row, end_row, start_col, end_col, counter); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); for (z = -6.0f; z <= 6.0f; z+= 0.1f) { float x; printf("\nhere\n"); glBegin(GL_TRIANGLE_STRIP); for (x = -6.0f; x <= 6.0f; x += 0.1f) { float vec[] = {0, 0}; vec[0] = x; vec[1] = z; float y = noise2(vec); glVertex3f(x, y, z); printf("\ny = %f\n", y); vec[0] = x; vec[1] = z+counter; y = noise2(vec); glVertex3f(x, y, z+counter); printf("\ny = %f\n", y); } glEnd(); } } void initialise_perlin_noise_terrain() { }
#ifndef U_LOG_H #define U_LOG_H #if !defined(__INSIDE_UTILS__) && !defined(UTILS_COMPILATION) #error "Only <utils.h> can be included directly" #endif #define U_WARN 1 #define U_ERROR 2 void u_log(int level, const char *format, ...); #define u_warn(format, ...) \ do { \ u_log(U_WARN, "[%s:%d] " format, __FILE__, __LINE__, ##__VA_ARGS__); \ } while (0) #define u_error(format, ...) \ do { \ u_log(U_ERROR, "[%s:%d] " format, __FILE__, __LINE__, ##__VA_ARGS__); \ } while (0) #endif /* U_LOG_H */
/* * Copyright (C) 2016-2018, Nils Asmussen <nils@os.inf.tu-dresden.de> * Economic rights: Technische Universitaet Dresden (Germany) * * This file is part of M3 (Microkernel-based SysteM for Heterogeneous Manycores). * * M3 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * M3 is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License version 2 for more details. */ #pragma once #include <base/Common.h> #include <cstring> namespace m3 { class OStream; class String { public: static const size_t DEFAULT_MAX_LEN = 64; /** * Constructor. Creates an empty string (without allocation on the heap) */ explicit String() : _str(0), _len() { } /** * Constructor. Copies the given string onto the heap. * * @param str the string * @param len the length of the string (-1 by default, which means: use strlen()) */ String(const char *str, size_t len = static_cast<size_t>(-1)) : _str(), _len() { if(str) init(str, len); } explicit String(const String& s) : _str(), _len() { init(s._str, s._len); } String(String &&s) : _str(s._str), _len(s._len) { s._str = nullptr; } String & operator=(const String& s) { if(&s != this) reset(s._str, s._len); return *this; } ~String() { delete[] _str; } /** * @param i the index * @return the <i>th character of the string. */ char operator[](size_t i) const { return _str[i]; } /** * Gives you access to a character. But keep in mind: there are no checks and the string * length can NOT be changed in this way! * * @param i the index * @return a reference to the <i>th character of the string. */ char &operator[](size_t i) { return _str[i]; } /** * @return the string (always null-terminated) */ const char *c_str() const { return _str ? _str : ""; } /** * @return the length of the string */ size_t length() const { return _len; } /** * @return true if <this> contains <str> */ bool contains(const String &str) const { if(!_str || !str._str) return false; return strstr(_str, str._str) != nullptr; } /** * Resets the string to the given one. That is, it free's the current string and copies * the given one into a new place on the heap * * @param str the string * @param len the length of the string (-1 by default, which means: use strlen()) */ void reset(const char *str, size_t len = static_cast<size_t>(-1)) { delete[] _str; init(str, len); } private: void init(const char *str, size_t len) { _len = len == static_cast<size_t>(-1) ? strlen(str) : len; if(_len > 0) { _str = new char[_len + 1]; memcpy(_str, str, _len); _str[_len] = '\0'; } else _str = nullptr; } char *_str; size_t _len; }; /** * @return true if s1 and s2 are equal */ static inline bool operator==(const String &s1, const String &s2) { return s1.length() == s2.length() && strcmp(s1.c_str(), s2.c_str()) == 0; } /** * @return true if s1 and s2 are not equal */ static inline bool operator!=(const String &s1, const String &s2) { return !operator==(s1, s2); } /** * Writes the string into the given output-stream * * @param os the stream * @param str the string * @return the stream */ OStream &operator<<(OStream &os, const String &str); }
/*---------------------------------------------- fft_test.c - demonstration program for fft.c ----------------------------------------------*/ /****************************************************************************** * This program demonstrates how to use the file fft.c to calculate an FFT * * of given time-domain samples, as well as to calculate an inverse FFT * * (IFFT) of given frequency-domain samples. First, N complex-valued time- * * domain samples x, in rectangular form (Re x, Im x), are read from a * * specified file; the 2N values are assumed to be separated by whitespace. * * Then, an N-point FFT of these samples is found by calling the function * * fft, thereby yielding N complex-valued frequency-domain samples X in * * rectangular form (Re X, Im X). Next, an N-point IFFT of these samples is * * is found by calling the function ifft, thereby recovering the original * * samples x. Finally, the calculated samples X are saved to a specified * * file, if desired. * ******************************************************************************/ #include "common.h" #include <stdio.h> #include <stdlib.h> #include "fft.c" int main() { int i; /* generic index */ int N; /* number of points in FFT */ double (*x)[2]; /* pointer to time-domain samples */ double (*X)[2]; /* pointer to frequency-domain samples */ double (*Xexp)[2]; /* pointer expected frequency-domain samples */ double epsilon; /* tolerance factor */ /* Initialize parameters */ N=2; /* Check that N = 2^n for some integer n >= 1. */ if(N >= 2) { i = N; while(i==2*(i/2)) i = i/2; /* While i is even, factor out a 2. */ } /* For N >=2, we now have N = 2^n iff i = 1. */ if(N < 2 || i != 1) { printf(", which does not equal 2^n for an integer n >= 1."); exit(EXIT_FAILURE); } /* Allocate time- and frequency-domain memory. */ x = malloc(2 * N * sizeof(double)); X = malloc(2 * N * sizeof(double)); Xexp = malloc(2 * N * sizeof(double)); /* Initialize time domain samples */ x[0][0] = 1.2 ; x[0][1] = 3.4; x[1][0] = 5.6 ; x[1][1] = 0.4; /* Initialize freq domain expected samples */ Xexp[0][0] = 6.8 ; Xexp[0][1] = 3.8 ; Xexp[1][0] = -4.4 ; Xexp[1][1] = 3.0 ; epsilon = 0.1; /* Calculate FFT. */ fft(N, x, X); /* check results */ for(i=0; i<N; i++){ if(!(FLOAT_EQ(X[i][0], Xexp[i][0], epsilon) && FLOAT_EQ(X[i][1], Xexp[i][1], epsilon))){ LOG_FAIL(); } } /* Print time-domain samples and resulting frequency-domain samples. */ #if 0 printf("\nx(n):"); for(i=0; i<N; i++) printf("\n n=%d: %12f %12f", i, x[i][0], x[i][1]); printf("\nX(k):"); for(i=0; i<N; i++) printf("\n k=%d: %12f %12f", i, X[i][0], X[i][1]); printf("\n"); #endif /* Free memory. */ free(x); free(X); LOG_PASS(); }
/* Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. obtain a copy of the License at http://www.imagemagick.org/script/license.php 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. MagickWand pixel wand methods. */ #ifndef _MAGICKWAND_PIXEL_WAND_H #define _MAGICKWAND_PIXEL_WAND_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _PixelWand PixelWand; extern WandExport char *PixelGetColorAsNormalizedString(const PixelWand *), *PixelGetColorAsString(const PixelWand *), *PixelGetException(const PixelWand *,ExceptionType *); extern WandExport double PixelGetAlpha(const PixelWand *), PixelGetBlack(const PixelWand *), PixelGetBlue(const PixelWand *), PixelGetCyan(const PixelWand *), PixelGetFuzz(const PixelWand *), PixelGetGreen(const PixelWand *), PixelGetMagenta(const PixelWand *), PixelGetOpacity(const PixelWand *), PixelGetRed(const PixelWand *), PixelGetYellow(const PixelWand *); extern WandExport ExceptionType PixelGetExceptionType(const PixelWand *); extern WandExport IndexPacket PixelGetIndex(const PixelWand *); extern WandExport MagickBooleanType IsPixelWand(const PixelWand *), IsPixelWandSimilar(PixelWand *,PixelWand *,const double), PixelClearException(PixelWand *), PixelSetColor(PixelWand *,const char *); extern WandExport PixelWand *ClonePixelWand(const PixelWand *), **ClonePixelWands(const PixelWand **,const size_t), *DestroyPixelWand(PixelWand *), **DestroyPixelWands(PixelWand **,const size_t), *NewPixelWand(void), **NewPixelWands(const size_t); extern WandExport Quantum PixelGetAlphaQuantum(const PixelWand *), PixelGetBlackQuantum(const PixelWand *), PixelGetBlueQuantum(const PixelWand *), PixelGetCyanQuantum(const PixelWand *), PixelGetGreenQuantum(const PixelWand *), PixelGetMagentaQuantum(const PixelWand *), PixelGetOpacityQuantum(const PixelWand *), PixelGetRedQuantum(const PixelWand *), PixelGetYellowQuantum(const PixelWand *); extern WandExport size_t PixelGetColorCount(const PixelWand *); extern WandExport void ClearPixelWand(PixelWand *), PixelGetHSL(const PixelWand *,double *,double *,double *), PixelGetMagickColor(const PixelWand *,MagickPixelPacket *), PixelGetQuantumColor(const PixelWand *,PixelPacket *), PixelSetAlpha(PixelWand *,const double), PixelSetAlphaQuantum(PixelWand *,const Quantum), PixelSetBlack(PixelWand *,const double), PixelSetBlackQuantum(PixelWand *,const Quantum), PixelSetBlue(PixelWand *,const double), PixelSetBlueQuantum(PixelWand *,const Quantum), PixelSetColorFromWand(PixelWand *,const PixelWand *), PixelSetColorCount(PixelWand *,const size_t), PixelSetCyan(PixelWand *,const double), PixelSetCyanQuantum(PixelWand *,const Quantum), PixelSetFuzz(PixelWand *,const double), PixelSetGreen(PixelWand *,const double), PixelSetGreenQuantum(PixelWand *,const Quantum), PixelSetHSL(PixelWand *,const double,const double,const double), PixelSetIndex(PixelWand *,const IndexPacket), PixelSetMagenta(PixelWand *,const double), PixelSetMagentaQuantum(PixelWand *,const Quantum), PixelSetMagickColor(PixelWand *,const MagickPixelPacket *), PixelSetOpacity(PixelWand *,const double), PixelSetOpacityQuantum(PixelWand *,const Quantum), PixelSetQuantumColor(PixelWand *,const PixelPacket *), PixelSetRed(PixelWand *,const double), PixelSetRedQuantum(PixelWand *,const Quantum), PixelSetYellow(PixelWand *,const double), PixelSetYellowQuantum(PixelWand *,const Quantum); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif
#ifndef DBALLE_PYTHON_H #define DBALLE_PYTHON_H #include <dballe/fwd.h> #include <memory> #ifndef PyObject_HEAD // Forward-declare PyObjetc and PyTypeObject // see https://mail.python.org/pipermail/python-dev/2003-August/037601.html extern "C" { struct _object; typedef _object PyObject; struct _typeobject; typedef _typeobject PyTypeObject; } #endif extern "C" { /** * C++ functions exported by the wreport python bindings, to be used by other * C++ bindings. * * To use them, retrieve a pointer to the struct via the Capsule system: * \code * dbapy_c_api* dbapy = (dbapy_c_api*)PyCapsule_Import("_dballe._C_API", 0); * \endcode * */ struct dbapy_c_api { // API version 1.x /// C API major version (updated on incompatible changes) unsigned version_major; /// C API minor version (updated on backwards-compatible changes) unsigned version_minor; /// dballe.Message type PyTypeObject* message_type; /// Create a dballe.Message with a new empty message of the given type PyObject* (*message_create_new)(dballe::MessageType); /// Create a dballe.Message referencing the given message PyObject* (*message_create)(std::shared_ptr<dballe::Message>); }; } #endif
#include "q_shared.h" #include "linkedlist.h" linkedList_t *LinkedList_PushObject( linkedList_t **root, void *data ) { if ( *root == NULL ) {//No root object linkedList_t *newNode = (linkedList_t *)malloc( sizeof( linkedList_t ) ); memset( newNode, 0, sizeof( linkedList_t ) ); newNode->data = data; *root = newNode; return newNode; } else {//Add new object at end of list linkedList_t *currNode = *root; while ( currNode->next ) currNode = currNode->next; currNode->next = (linkedList_t *)malloc( sizeof( linkedList_t ) ); currNode = currNode->next; memset( currNode, 0, sizeof( linkedList_t ) ); currNode->data = data; return currNode; } } void LinkedList_RemoveObject( linkedList_t **root, linkedList_t *node ) { linkedList_t *currNode = *root; if ( node == *root ) {//hm o.o *root = (*root)->next; free( currNode ); return; } while ( currNode != NULL ) { if ( currNode->next == node ) { currNode->next = node->next; free( node ); return; } currNode = currNode->next; } } // for ( node=root; node; node=Traverse( node ) ) linkedList_t *LinkedList_Traverse( linkedList_t *node ) { return node ? node->next : NULL; }
#pragma once #include "../../lib/VCMI_Lib.h" #include "../../lib/CBuildingHandler.h" #include "../../lib/CCreatureHandler.h" #include "../../lib/CTownHandler.h" #include "../../lib/CSpellHandler.h" #include "../../lib/CObjectHandler.h" #include "../../lib/Connection.h" #include "../../lib/CGameState.h" #include "../../lib/mapping/CMap.h" #include "../../lib/NetPacks.h" #include "../../lib/CStopWatch.h" /* * AIUtility.h, part of VCMI engine * * Authors: listed in file AUTHORS in main folder * * License: GNU General Public License v2.0 or later * Full text of license available in license.txt file, in main folder * */ typedef const int3& crint3; typedef const std::string& crstring; const int HERO_GOLD_COST = 2500; const int GOLD_MINE_PRODUCTION = 1000, WOOD_ORE_MINE_PRODUCTION = 2, RESOURCE_MINE_PRODUCTION = 1; const int ACTUAL_RESOURCE_COUNT = 7; const int ALLOWED_ROAMING_HEROES = 8; //implementation-dependent extern const double SAFE_ATTACK_CONSTANT; extern const int GOLD_RESERVE; //provisional class for AI to store a reference to an owned hero object //checks if it's valid on access, should be used in place of const CGHeroInstance* struct HeroPtr { const CGHeroInstance *h; ObjectInstanceID hid; public: std::string name; HeroPtr(); HeroPtr(const CGHeroInstance *H); ~HeroPtr(); operator bool() const { return validAndSet(); } bool operator<(const HeroPtr &rhs) const; const CGHeroInstance *operator->() const; const CGHeroInstance *operator*() const; //not that consistent with -> but all interfaces use CGHeroInstance*, so it's convenient const CGHeroInstance *get(bool doWeExpectNull = false) const; bool validAndSet() const; template <typename Handler> void serialize(Handler &h, const int version) { h & this->h & hid & name; } }; enum BattleState { NO_BATTLE, UPCOMING_BATTLE, ONGOING_BATTLE, ENDING_BATTLE }; // AI lives in a dangerous world. CGObjectInstances under pointer may got deleted/hidden. // This class stores object id, so we can detect when we lose access to the underlying object. struct ObjectIdRef { ObjectInstanceID id; const CGObjectInstance *operator->() const; operator const CGObjectInstance *() const; ObjectIdRef(ObjectInstanceID _id); ObjectIdRef(const CGObjectInstance *obj); bool operator<(const ObjectIdRef &rhs) const; template <typename Handler> void serialize(Handler &h, const int version) { h & id; } }; struct TimeCheck { CStopWatch time; std::string txt; TimeCheck(crstring TXT) : txt(TXT) { } ~TimeCheck() { logAi->traceStream() << boost::format("Time of %s was %d ms.") % txt % time.getDiff(); } }; struct AtScopeExit { std::function<void()> foo; AtScopeExit(const std::function<void()> &FOO) : foo(FOO) {} ~AtScopeExit() { foo(); } }; class ObjsVector : public std::vector<ObjectIdRef> { private: }; template<int id> bool objWithID(const CGObjectInstance *obj) { return obj->ID == id; } template <typename Container, typename Item> bool erase_if_present(Container &c, const Item &item) { auto i = std::find(c.begin(), c.end(), item); if (i != c.end()) { c.erase(i); return true; } return false; } template <typename V, typename Item, typename Item2> bool erase_if_present(std::map<Item,V> & c, const Item2 &item) { auto i = c.find(item); if (i != c.end()) { c.erase(i); return true; } return false; } template <typename Container, typename Pred> void erase(Container &c, Pred pred) { c.erase(boost::remove_if(c, pred), c.end()); } template<typename T> void removeDuplicates(std::vector<T> &vec) { boost::sort(vec); vec.erase(std::unique(vec.begin(), vec.end()), vec.end()); } std::string strFromInt3(int3 pos); void foreach_tile_pos(std::function<void(const int3& pos)> foo); void foreach_neighbour(const int3 &pos, std::function<void(const int3& pos)> foo); int howManyTilesWillBeDiscovered(const int3 &pos, int radious); int howManyTilesWillBeDiscovered(int radious, int3 pos, crint3 dir); void getVisibleNeighbours(const std::vector<int3> &tiles, std::vector<int3> &out); bool canBeEmbarkmentPoint(const TerrainTile *t); bool isBlockedBorderGate(int3 tileToHit); bool isReachable(const CGObjectInstance *obj); bool isCloser(const CGObjectInstance *lhs, const CGObjectInstance *rhs); bool isWeeklyRevisitable (const CGObjectInstance * obj); bool shouldVisit (HeroPtr h, const CGObjectInstance * obj); ui64 evaluateDanger(const CGObjectInstance *obj); ui64 evaluateDanger(crint3 tile, const CGHeroInstance *visitor); bool isSafeToVisit(HeroPtr h, crint3 tile); bool boundaryBetweenTwoPoints (int3 pos1, int3 pos2); bool compareMovement(HeroPtr lhs, HeroPtr rhs); bool compareHeroStrength(HeroPtr h1, HeroPtr h2); bool compareArmyStrength(const CArmedInstance *a1, const CArmedInstance *a2); ui64 howManyReinforcementsCanGet(HeroPtr h, const CGTownInstance *t); int3 whereToExplore(HeroPtr h);
#ifndef MTK_RTC_H #define MTK_RTC_H #ifdef CONFIG_RTC_DRV_MTK #include <mach/rtc.h> static inline bool crystal_exist_status(void) { return rtc_crystal_exist_status(); } #else #include <linux/ioctl.h> #include <linux/rtc.h> #include <mach/mt_typedefs.h> typedef enum { RTC_GPIO_USER_WIFI = 8, RTC_GPIO_USER_GPS = 9, RTC_GPIO_USER_BT = 10, RTC_GPIO_USER_FM = 11, RTC_GPIO_USER_PMIC = 12, } rtc_gpio_user_t; enum rtc_reboot_reason { RTC_REBOOT_REASON_WARM, RTC_REBOOT_REASON_PANIC, RTC_REBOOT_REASON_SW_WDT, RTC_REBOOT_REASON_FROM_POC }; #ifdef CONFIG_MTK_RTC /* * NOTE: * 1. RTC_GPIO always exports 32K enabled by some user even if the phone is powered off */ extern unsigned long rtc_read_hw_time(void); extern void rtc_gpio_enable_32k(rtc_gpio_user_t user); extern void rtc_gpio_disable_32k(rtc_gpio_user_t user); extern bool rtc_gpio_32k_status(void); extern void hal_write_dcxo_c2(u16 val, bool flag); /* for AUDIOPLL (deprecated) */ extern void rtc_enable_abb_32k(void); extern void rtc_disable_abb_32k(void); /* NOTE: used in Sleep driver to workaround Vrtc-Vore level shifter issue */ extern void rtc_enable_writeif(void); extern void rtc_disable_writeif(void); extern int rtc_get_reboot_reason(void); extern void rtc_mark_reboot_reason(int); extern void rtc_mark_recovery(void); #if defined(CONFIG_MTK_KERNEL_POWER_OFF_CHARGING) extern void rtc_mark_kpoc(void); extern void rtc_mark_enter_kpoc(void); #endif extern void rtc_mark_fast(void); extern void rtc_mark_emergency(void); extern void rtc_mark_clear_lprst(void); extern void rtc_mark_enter_lprst(void); extern void rtc_mark_enter_sw_lprst(void); extern u16 rtc_rdwr_uart_bits(u16 *val); extern void rtc_bbpu_power_down(void); extern void rtc_read_pwron_alarm(struct rtc_wkalrm *alm); extern int get_rtc_spare_fg_value(void); extern int set_rtc_spare_fg_value(int val); extern void rtc_irq_handler(void); extern bool crystal_exist_status(void); extern bool rtc_lprst_detected(void); extern bool rtc_enter_kpo_detected(void); #else #define rtc_read_hw_time() ({ 0; }) #define rtc_gpio_enable_32k(user) do {} while (0) #define rtc_gpio_disable_32k(user) do {} while (0) #define rtc_gpio_32k_status() do {} while (0) #define rtc_enable_abb_32k() do {} while (0) #define rtc_disable_abb_32k() do {} while (0) #define rtc_enable_writeif() do {} while (0) #define rtc_disable_writeif() do {} while (0) #define rtc_mark_recovery() do {} while (0) #if defined(CONFIG_MTK_KERNEL_POWER_OFF_CHARGING) #define rtc_mark_kpoc() do {} while (0) #define rtc_mark_enter_kpoc() do {} while (0) #endif #define rtc_mark_fast() do {} while (0) #define rtc_mark_emergency() do {} while (0) #define rtc_mark_clear_lprst() do {} while (0) #define rtc_mark_enter_lprst() do {} while (0) #define rtc_mark_enter_sw_lprst() do {} while (0) #define rtc_rdwr_uart_bits(val) ({ 0; }) #define rtc_bbpu_power_down() do {} while (0) #define rtc_read_pwron_alarm(alm) do {} while (0) #define get_rtc_spare_fg_value() ({ 0; }) #define set_rtc_spare_fg_value(val) ({ 0; }) #define rtc_get_reboot_reason() (0) #define rtc_mark_reboot_reason(arg) do {} while (0) #define rtc_irq_handler() do {} while (0) #define crystal_exist_status() do {} while (0) #define rtc_lprst_detected() do {} while (0) #define rtc_enter_kpoc_detected() ({ 0; }) #define hal_write_dcxo_c2(val, flag) do {} while (0) #endif #endif #endif
/*1:*/ #line 26 "./gb_rand.w" #define random_graph r_graph #define random_bigraph r_bigraph #define random_lengths r_lengths extern Graph*random_graph(); extern Graph*random_bigraph(); extern long random_lengths(); /*:1*/
/* android jconfig.h */ /* * jconfig.doc * * Copyright (C) 1991-1994, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * * This file documents the configuration options that are required to * customize the JPEG software for a particular system. * * The actual configuration options for a particular installation are stored * in jconfig.h. On many machines, jconfig.h can be generated automatically * or copied from one of the "canned" jconfig files that we supply. But if * you need to generate a jconfig.h file by hand, this file tells you how. * * DO NOT EDIT THIS FILE --- IT WON'T ACCOMPLISH ANYTHING. * EDIT A COPY NAMED JCONFIG.H. */ /* * These symbols indicate the properties of your machine or compiler. * #define the symbol if yes, #undef it if no. */ /* Does your compiler support function prototypes? * (If not, you also need to use ansi2knr, see install.doc) */ #define HAVE_PROTOTYPES /* Does your compiler support the declaration "unsigned char" ? * How about "unsigned short" ? */ #define HAVE_UNSIGNED_CHAR #define HAVE_UNSIGNED_SHORT /* Define "void" as "char" if your compiler doesn't know about type void. * NOTE: be sure to define void such that "void *" represents the most general * pointer type, e.g., that returned by malloc(). */ /* #define void char */ /* Define "const" as empty if your compiler doesn't know the "const" keyword. */ /* #define const */ /* Define this if an ordinary "char" type is unsigned. * If you're not sure, leaving it undefined will work at some cost in speed. * If you defined HAVE_UNSIGNED_CHAR then the speed difference is minimal. */ #undef CHAR_IS_UNSIGNED /* Define this if your system has an ANSI-conforming <stddef.h> file. */ #define HAVE_STDDEF_H /* Define this if your system has an ANSI-conforming <stdlib.h> file. */ #define HAVE_STDLIB_H /* Define this if your system does not have an ANSI/SysV <string.h>, * but does have a BSD-style <strings.h>. */ #undef NEED_BSD_STRINGS /* Define this if your system does not provide typedef size_t in any of the * ANSI-standard places (stddef.h, stdlib.h, or stdio.h), but places it in * <sys/types.h> instead. */ #undef NEED_SYS_TYPES_H /* For 80x86 machines, you need to define NEED_FAR_POINTERS, * unless you are using a large-data memory model or 80386 flat-memory mode. * On less brain-damaged CPUs this symbol must not be defined. * (Defining this symbol causes large data structures to be referenced through * "far" pointers and to be allocated with a special version of malloc.) */ #undef NEED_FAR_POINTERS /* Define this if your linker needs global names to be unique in less * than the first 15 characters. */ #undef NEED_SHORT_EXTERNAL_NAMES /* Although a real ANSI C compiler can deal perfectly well with pointers to * unspecified structures (see "incomplete types" in the spec), a few pre-ANSI * and pseudo-ANSI compilers get confused. To keep one of these bozos happy, * define INCOMPLETE_TYPES_BROKEN. This is not recommended unless you * actually get "missing structure definition" warnings or errors while * compiling the JPEG code. */ #undef INCOMPLETE_TYPES_BROKEN /* * The following options affect code selection within the JPEG library, * but they don't need to be visible to applications using the library. * To minimize application namespace pollution, the symbols won't be * defined unless JPEG_INTERNALS has been defined. */ #ifdef JPEG_INTERNALS /* Define this if your compiler implements ">>" on signed values as a logical * (unsigned) shift; leave it undefined if ">>" is a signed (arithmetic) shift, * which is the normal and rational definition. */ #undef RIGHT_SHIFT_IS_UNSIGNED #endif /* JPEG_INTERNALS */ /* * The remaining options do not affect the JPEG library proper, * but only the sample applications cjpeg/djpeg (see cjpeg.c, djpeg.c). * Other applications can ignore these. */ #ifdef JPEG_CJPEG_DJPEG /* These defines indicate which image (non-JPEG) file formats are allowed. */ #define BMP_SUPPORTED /* BMP image file format */ #define GIF_SUPPORTED /* GIF image file format */ #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ #undef RLE_SUPPORTED /* Utah RLE image file format */ #define TARGA_SUPPORTED /* Targa image file format */ /* Define this if you want to name both input and output files on the command * line, rather than using stdout and optionally stdin. You MUST do this if * your system can't cope with binary I/O to stdin/stdout. See comments at * head of cjpeg.c or djpeg.c. */ #undef TWO_FILE_COMMANDLINE /* Define this if your system needs explicit cleanup of temporary files. * This is crucial under MS-DOS, where the temporary "files" may be areas * of extended memory; on most other systems it's not as important. */ #undef NEED_SIGNAL_CATCHER /* By default, we open image files with fopen(...,"rb") or fopen(...,"wb"). * This is necessary on systems that distinguish text files from binary files, * and is harmless on most systems that don't. If you have one of the rare * systems that complains about the "b" spec, define this symbol. */ #undef DONT_USE_B_MODE /* Define this if you want percent-done progress reports from cjpeg/djpeg. */ #undef PROGRESS_REPORT #endif /* JPEG_CJPEG_DJPEG */
/* * VIA technology CBP series SoC Camera driver * * ISP driver routine, header for ISP processing service routine */ #ifndef __ISP_SERVICE__ #define __ISP_SERVICE__ int isp_process_thread(void *data); void *isp_service_start(const char *name, int (*fn)(void *), void *data); void isp_service_stop(struct cbp_cam_isp *isp); #endif
/* * Copyright (C) 2011 Matthew Rheaume * * 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 */ #include <stdio.h> #include "multi.h" #include "common.h" // For some reason, these two registers are switched // in this instruction #undef ADIS_RD #undef ADIS_RN #define ADIS_RD(_op) ((_op & 0x000F0000) >> 16) #define ADIS_RS(_op) ((_op & 0x0000F000) >> 12) #define ADIS_RN(_op) ((_op & 0x00000F00) >> 8) // Same as ADIS_RD and ADIS_RN, just different names // for long multiplication #define ADIS_RDHI(_op) ((_op & 0x000F0000) >> 16) #define ADIS_RDLO(_op) ((_op & 0x0000F000) >> 12) #define ADIS_ACCUM_BIT(_op) (_op & 0x00200000) #define ADIS_SIGNED_BIT(_op) (_op & 0x00400000) #define ADIS_LONG_BIT(_op) (_op & 0x00800000) /* * Halfword Multiplies - classified in 4 different categories: * - 32-bit accumulate (ACCUM) * - 64-bit accumulate (LACCUM) * - 32-bit result (RESULT) * - "Mixed-size" operand multiplication, meaning the instruction * multiplies 32-bits of RN by the top or bottom 16-bits of (MIXED) * RM * * The first 3 are pretty straightforward, but the last one is a bit * complicated. ADIS_HW_MIXED_RESULTBIT determines whether we are left * with a 32-bit result or a 32-bit accumulate */ #define ADIS_HW_ACCUM(_op) (! (_op & 0x00600000)) #define ADIS_HW_LACCUM(_op) (!((_op & 0x00600000) ^ 0x00400000)) #define ADIS_HW_RESULT(_op) (!((_op & 0x00600000) ^ 0x00600000)) // If it isn't one of those three, then it must be a "mixed-size" instruction #define ADIS_HW_MIXED_RESULT_BIT(_op) (_op & 0x00000020) #define ADIS_HW_RMHI_BIT(_op) (_op & 0x00000020) #define ADIS_HW_RNHI_BIT(_op) (_op & 0x00000040) static int is_mls_instr(uint32_t op) { return !((op & 0x00F00000) ^ 0x00600000); } // Used for long multiplication instructions static char *get_operation_string(uint32_t op) { static char *opstr[4] = {"SMULL", "SMLAL", "UMULL", "UMLAL"}; return opstr[ADIS_ACCUM_BIT(op) | (ADIS_SIGNED_BIT(op) << 1)]; } static void long_multi_instr(uint32_t op) { char *cond, *opstr, setcond; cond = get_condition_string(op); opstr = get_operation_string(op); setcond = ADIS_SETCOND_BIT(op) ? 'S' : 0; printf("%s%s%c R%d,R%d,R%d,R%d\n", opstr, cond, setcond, ADIS_RDLO(op), ADIS_RDHI(op), ADIS_RM(op), ADIS_RN(op)); } void multi_instr(uint32_t op) { char *cond, setcond; cond = get_condition_string(op); if (is_mls_instr(op)) { // We can process this immediately without checking other bits printf("MLS%s R%d,R%d,R%d,R%d\n", cond, ADIS_RD(op), ADIS_RN(op), ADIS_RS(op), ADIS_RM(op)); return; } else if (ADIS_LONG_BIT(op)) { // long multiplication instruction long_multi_instr(op); return; } // If we get here, this is just a regular multiplication instruction setcond = ADIS_SETCOND_BIT(op) ? 'S' : 0; if (ADIS_ACCUM_BIT(op)) { // multiply and accumulate printf("MLA%s%c R%d,R%d,R%d,R%d\n", cond, setcond, ADIS_RD(op), ADIS_RM(op), ADIS_RN(op), ADIS_RS(op)); } else { printf("MUL%s%c R%d,R%d,R%d\n", cond, setcond, ADIS_RD(op), ADIS_RM(op), ADIS_RN(op)); } } void halfword_multi_instr(uint32_t op) { char *cond, *opstr, rn_half = 0, rm_half = 0; uint32_t accum = 0; cond = get_condition_string(op); if (ADIS_HW_ACCUM(op)) { opstr = "SMLA"; accum = 1; } else if (ADIS_HW_LACCUM(op)) { opstr = "SMLAL"; accum = 1; } else if (ADIS_HW_RESULT(op)) { opstr = "SMUL"; } else { // Mixed size instruction if (ADIS_HW_MIXED_RESULT_BIT(op)) { opstr = "SMUL"; } else { opstr = "SMLA"; accum = 1; } rm_half = 'W'; } if (!rm_half) { rm_half = ADIS_HW_RMHI_BIT(op) ? 'T' : 'B'; } rn_half = ADIS_HW_RNHI_BIT(op) ? 'T' : 'B'; if (accum) { printf("%s%s%c%c R%d,R%d,R%d,R%d\n", opstr, cond, rm_half, rn_half, ADIS_RD(op), ADIS_RM(op), ADIS_RN(op), ADIS_RS(op)); } else { printf("%s%s%c%c R%d,R%d,R%d\n", opstr, cond, rm_half, rn_half, ADIS_RD(op), ADIS_RM(op), ADIS_RN(op)); } }
// // TMUImageListItemTableViewCell.h // yetAnotherImageGallery // // Created by tim millington on 12/03/2015. // Copyright (c) 2015 tmuApps. All rights reserved. // #import <UIKit/UIKit.h> @interface TMUImageListTableViewCell : UITableViewCell @property (weak, nonatomic) IBOutlet UILabel *imageTitle; @property (weak, nonatomic) IBOutlet UILabel *imageAuthor; @property (weak, nonatomic) IBOutlet UILabel *dateImagePublished; @property (weak, nonatomic) IBOutlet UILabel *dateImageCaptured; @property (weak, nonatomic) IBOutlet UIImageView *image; @end
/* * c64commonmachinecontroller.h - C64 common machine controller * * Written by * Christian Vogelgsang <chris@vogelgsang.org> * * This file is part of VICE, the Versatile Commodore Emulator. * See README for copyright notice. * * 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. * */ #import <UIKit/UIKit.h> #import "c64machinecontroller.h" @interface C64CommonMachineController : C64MachineController { } -(void)selectModel:(int)model; -(int)getModel; @end
////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // // copyright : (C) 2014 Eran Ifrah // file name : GitConsole.h // // ------------------------------------------------------------------------- // A // _____ _ _ _ _ // / __ \ | | | | (_) | // | / \/ ___ __| | ___| | _| |_ ___ // | | / _ \ / _ |/ _ \ | | | __/ _ ) // | \__/\ (_) | (_| | __/ |___| | || __/ // \____/\___/ \__,_|\___\_____/_|\__\___| // // F i l e // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// #ifndef GITCONSOLE_H #define GITCONSOLE_H #include "bitmap_loader.h" #include "clGenericSTCStyler.h" #include "clWorkspaceEvent.hpp" #include "gitui.h" #include <wx/dataview.h> class clToolBar; class GitPlugin; class GitConsole : public GitConsoleBase { GitPlugin* m_git; bool m_isVerbose; BitmapLoader* m_bitmapLoader; wxBitmap m_modifiedBmp; wxBitmap m_untrackedBmp; wxBitmap m_folderBmp; wxBitmap m_newBmp; wxBitmap m_deleteBmp; size_t m_indent = 0; std::unordered_set<wxString> m_errorPatterns; std::unordered_set<wxString> m_successPatterns; std::unordered_set<wxString> m_warningPatterns; wxString m_buffer; public: GitConsole(wxWindow* parent, GitPlugin* git); virtual ~GitConsole(); void AddText(const wxString& text); void AddLine(const wxString& line); void PrintPrompt(); bool IsVerbose() const; void UpdateTreeView(const wxString& output); /** * @brief return true if there are any deleted/new/modified items * @return */ bool IsDirty() const; // // Progress bar API // void ShowProgress(const wxString& message, bool pulse = false); void HideProgress(); void UpdateProgress(unsigned long current, const wxString& message); bool IsProgressShown() const; void PulseProgress(); void ShowLog(); void SetIndent(size_t depth = 1) { m_indent = depth; } protected: wxString GetIndent() const { return wxString(' ', (m_indent * 4)); } virtual void OnUnversionedFileActivated(wxDataViewEvent& event); virtual void OnUnversionedFileContextMenu(wxDataViewEvent& event); virtual void OnUpdateUI(wxUpdateUIEvent& event); virtual void OnStclogStcChange(wxStyledTextEvent& event); virtual void OnApplyPatch(wxCommandEvent& event); virtual void OnFileActivated(wxDataViewEvent& event); virtual void OnItemSelectedUI(wxUpdateUIEvent& event); virtual void OnResetFile(wxCommandEvent& event); virtual void OnContextMenu(wxDataViewEvent& event); virtual void OnStopGitProcessUI(wxUpdateUIEvent& event); virtual void OnClearGitLogUI(wxUpdateUIEvent& event); virtual void OnClearGitLog(wxCommandEvent& event); virtual void OnStopGitProcess(wxCommandEvent& event); virtual void OnOpenUnversionedFiles(wxCommandEvent& event); virtual void OnAddUnversionedFiles(wxCommandEvent& event); void OnSysColoursChanged(clCommandEvent& event); void OnOpenFile(wxCommandEvent& e); void OnWorkspaceClosed(clWorkspaceEvent& e); void OnConfigurationChanged(wxCommandEvent& e); wxString GetPrompt() const; bool IsPatternFound(const wxString& buffer, const std::unordered_set<wxString>& m) const; bool HasAnsiEscapeSequences(const wxString& buffer) const; void OnGitPullDropdown(wxCommandEvent& event) { DoOnDropdown("git_pull", XRCID("git_pull")); } void OnGitRebaseDropdown(wxCommandEvent& event) { DoOnDropdown("git_rebase", XRCID("git_rebase")); } void DoOnDropdown(const wxString& commandName, int id); void OnDropDownMenuEvent(wxCommandEvent& e); void Clear(); wxArrayString GetSelectedUnversionedFiles() const; }; #endif // GITCONSOLE_H
/* SPDX-FileCopyrightText: 2010 Jan Lepper <dehtris@yahoo.de> SPDX-FileCopyrightText: 2010-2020 Krusader Krew <https://krusader.org> SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef JOBMAN_H #define JOBMAN_H // QtCore #include <QAction> // QtWidgets #include <QMessageBox> #include <QPushButton> #include <QProgressBar> #include <KCoreAddons/KJob> #include <KWidgetsAddons/KToolBarPopupAction> class KrJob; /** * @brief The job manager provides a progress dialog and control over (KIO) file operation jobs. * * Job manager does not have a window (or dialog). All functions are provided via toolbar actions. * Icon, text and tooltip are already set but shortcuts are not set here. * * If job managers queue mode is activated, only the first job (incoming via manageJob()) is started * and more incoming jobs are delayed: If the running job finishes, the next job in line is * started. * * NOTE: The desktop system (e.g. KDE Plasma Shell) may also can control the jobs. * Reference: plasma-workspace/kuiserver/progresslistdelegate.h * * NOTE: If a job still exists, Krusader does not exit on quit() and waits until the job is * finished. If the job is paused, this takes forever. Call waitForJobs() before exit to prevent * this. * * About undoing jobs: If jobs are recorded (all KrJobs are, some in FileSystem) we can undo them * with FileUndoManager (which is a singleton) here. * It would be great if each job in the job list could be undone individually but FileUndoManager * is currently (Frameworks 5.27) only able to undo the last recorded job. */ class JobMan : public QObject { Q_OBJECT public: /** Job start mode for new jobs. */ enum StartMode { /** Enqueue or start job - depending on QueueMode. */ Default, /** Enqueue job. I.e. start if no other jobs are running. */ Enqueue, /** Job is always started. */ Start, /** Job is always not started now. */ Delay }; explicit JobMan(QObject *parent = nullptr); /** Toolbar action icon for pausing/starting all jobs with drop down menu showing all jobs.*/ QAction *controlAction() const { return m_controlAction; } /** Toolbar action progress bar showing the average job progress percentage of all jobs.*/ QAction *progressAction() const { return m_progressAction; } /** Toolbar action combo box for changing the .*/ QAction *modeAction() const { return m_modeAction; } QAction *undoAction() const { return m_undoAction; } /** Wait for all jobs to terminate (blocking!). * * Returns true immediately if there are no jobs and user input is not required. Otherwise a * modal UI dialog is shown and the user can abort all jobs or cancel the dialog. * * @param waitForUserInput if true dialog is only closed after user interaction (button click) * @return true if no jobs are running (anymore) and user wants to quit. Else false */ bool waitForJobs(bool waitForUserInput); /** Return if queue mode is enabled or not. */ bool isQueueModeEnabled() const { return m_queueMode; } /** Display, monitor and give user ability to control a job. * * Whether the job is started now or delayed depends on startMode (and current queue mode flag). */ void manageJob(KrJob *krJob, StartMode startMode = Default); /** * Like manageJob(), but for already started jobs. */ void manageStartedJob(KrJob *krJob, KJob *job); protected slots: void slotKJobStarted(KJob *krJob); void slotControlActionTriggered(); void slotPercent(KJob *, unsigned long); void slotDescription(KJob*,const QString &description, const QPair<QString,QString> &field1, const QPair<QString,QString> &field2); void slotTerminated(KrJob *krJob); void slotUpdateControlAction(); void slotUndoTextChange(const QString &text); void slotUpdateMessageBox(); private: void managePrivate(KrJob *job, KJob *kJob = nullptr); void cleanupMenu(); // remove old entries if menu is too long void updateUI(); bool jobsAreRunning(); QList<KrJob *> m_jobs; // all jobs not terminated (finished or canceled) yet bool m_queueMode; KToolBarPopupAction *m_controlAction; QProgressBar *m_progressBar; QAction *m_progressAction; QAction *m_modeAction; QAction *m_undoAction; QMessageBox *m_messageBox; bool m_autoCloseMessageBox; static const QString sDefaultToolTip; }; #endif // JOBMAN_H
/* * This file is part of D3DShark - DirectX Component Framework * Copyright (C) 2012-2013 Michael Bleis * * 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/>. */ #pragma once #include "IRenderTarget.h" class RenderTarget11 : public IRenderTarget { public: RenderTarget11(IDXGISwapChain *pSwapChain, ID3D11Device *pDevice, ID3D11DeviceContext *pContext); virtual bool GetSurfaceRect(RECT *pRect) const; virtual bool GetClippingArea(RECT *pRect) const; virtual void SetClippingArea(const RECT *pRect) const; virtual boost::shared_ptr<UI::D3DTexture> CreateRenderTargetTexture(uint32 width, uint32 height) const; virtual boost::shared_ptr<UI::ID3DSurface> CreateRenderTargetSurface(uint32 width, uint32 height) const; virtual void SetRenderTargetSurface(const boost::shared_ptr<const UI::ID3DSurface> &pSurface, uint32 index = 0, bool shouldClear = false); virtual boost::shared_ptr<UI::ID3DSurface> GetRenderTargetSurface(uint32 index = 0) const; virtual void DrawRectangle(const Utils::Vector2 &position, const std::array<Utils::Vector2, 4> &dimensions, const std::array<D3DXCOLOR, 4> &gradient, float stroke) const; virtual void FillRectangle(const Utils::Vector2 &position, const std::array<Utils::Vector2, 4> &dimensions, const std::array<D3DXCOLOR, 4> &gradient) const; virtual void DrawRoundedRectangle(const Utils::Vector2 &position, const std::array<Utils::Vector2, 4> &dimensions, const float4 &horizontalRadius, const float4 &verticalRadius, const std::array<D3DXCOLOR, 4> &gradient, float stroke) const; virtual void FillRoundedRectangle(const Utils::Vector2 &position, const std::array<Utils::Vector2, 4> &dimensions, const float4 &horizontalRadius, const float4 &verticalRadius, const std::array<D3DXCOLOR, 4> &gradient) const; virtual void DrawBlurredSprite(const Utils::Vector2 &position, boost::shared_ptr<const UI::D3DTexture> pTexture, const std::array<Utils::Vector2, 4> &dimensions, const std::array<D3DXCOLOR, 4> &gradient) const; virtual void DrawSprite(const Utils::Vector2 &position, boost::shared_ptr<const UI::D3DTexture> pTexture, const std::array<Utils::Vector2, 4> &dimensions, const std::array<D3DXCOLOR, 4> &gradient) const; protected: IDXGISwapChain *m_swapChain; ID3D11Device *m_device11; ID3D11DeviceContext *m_context11; };
/* * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * Further, this software is distributed without any warranty that it is * free of the rightful claim of any third person regarding infringement * or the like. Any license provided herein, whether implied or * otherwise, applies only to this software file. Patent licenses, if * any, provided herein do not apply to combinations of this program with * other software, or any other product whatsoever. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, * Mountain View, CA 94043, or: * * http://www.sgi.com * * For further information regarding this notice, see: * * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ * */ /* $Id: rename02.c,v 1.8 2009/11/02 13:57:18 subrata_modak Exp $ */ /********************************************************** * * OS Test - Silicon Graphics, Inc. * * TEST IDENTIFIER : rename02 * * EXECUTED BY : anyone * * TEST TITLE : Basic test for rename(2) * * PARENT DOCUMENT : usctpl01 * * TEST CASE TOTAL : 1 * * WALL CLOCK TIME : 1 * * CPU TYPES : ALL * * AUTHOR : William Roske * * CO-PILOT : Dave Fenner * * DATE STARTED : 03/30/92 * * INITIAL RELEASE : UNICOS 7.0 * * TEST CASES * * 1.) rename(2) returns...(See Description) * * INPUT SPECIFICATIONS * The standard options for system call tests are accepted. * (See the parse_opts(3) man page). * * OUTPUT SPECIFICATIONS *$ * DURATION * Terminates - with frequency and infinite modes. * * SIGNALS * Uses SIGUSR1 to pause before test if option set. * (See the parse_opts(3) man page). * * RESOURCES * None * * ENVIRONMENTAL NEEDS * No run-time environmental needs. * * SPECIAL PROCEDURAL REQUIREMENTS * None * * INTERCASE DEPENDENCIES * None * * DETAILED DESCRIPTION * This is a Phase I test for the rename(2) system call. It is intended * to provide a limited exposure of the system call, for now. It * should/will be extended when full functional tests are written for * rename(2). * * Setup: * Setup signal handling. * Pause for SIGUSR1 if option specified. * * Test: * Loop if the proper options are given. * Execute system call * Check return code, if system call failed (return=-1) * Log the errno and Issue a FAIL message. * Otherwise, Issue a PASS message. * * Cleanup: * Print errno log and/or timing stats if options given * * *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/ #include <sys/types.h> #include <sys/fcntl.h> #include <errno.h> #include <string.h> #include <signal.h> #include "test.h" #include "usctest.h" void setup(); void cleanup(); extern void do_file_setup(char *); char *TCID = "rename02"; /* Test program identifier. */ int TST_TOTAL = 1; /* Total number of test cases. */ int exp_enos[] = { 0, 0 }; int fd; char fname[255], mname[255]; int main(int ac, char **av) { int lc; char *msg; if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); /* set the expected errnos... */ TEST_EXP_ENOS(exp_enos); for (lc = 0; TEST_LOOPING(lc); lc++) { Tst_count = 0; /* * Call rename(2) */ TEST(rename(fname, mname)); /* check return code */ if (TEST_RETURN == -1) { TEST_ERROR_LOG(TEST_ERRNO); tst_resm(TFAIL, "rename(%s, %s) Failed, errno=%d : %s", fname, mname, TEST_ERRNO, strerror(TEST_ERRNO)); } else { if (STD_FUNCTIONAL_TEST) { /* No Verification test, yet... */ tst_resm(TPASS, "rename(%s, %s) returned %ld", fname, mname, TEST_RETURN); } if (unlink(mname) == -1) { tst_resm(TWARN, "unlink(%s) Failed, errno=%d : %s", mname, errno, strerror(errno)); } do_file_setup(fname); } } cleanup(); tst_exit(); } /*************************************************************** * setup() - performs all ONE TIME setup for this test. ***************************************************************/ void setup() { tst_sig(NOFORK, DEF_HANDLER, cleanup); TEST_PAUSE; tst_tmpdir(); sprintf(fname, "./tfile_%d", getpid()); sprintf(mname, "./rnfile_%d", getpid()); do_file_setup(fname); } /*************************************************************** * cleanup() - performs all ONE TIME cleanup for this test at * completion or premature exit. ***************************************************************/ void cleanup() { /* * print timing stats if that option was specified. * print errno log if that option was specified. */ TEST_CLEANUP; tst_rmdir(); }
#ifndef DILEPTONTRACKROTATOR_H #define DILEPTONTRACKROTATOR_H //############################################################# //# # //# Class PairAnalysisTrackRotator # //# # //# Authors: # //# Julian Book, Uni Ffm / Julian.Book@cern.ch # //# # //############################################################# #include <TNamed.h> #include <TMath.h> #include <TRandom3.h> class PairAnalysisTrackRotator : public TNamed { public: enum ERotationType {kRotatePositive, kRotateNegative, kRotateBothRandom}; PairAnalysisTrackRotator(); PairAnalysisTrackRotator(const char*name, const char* title); virtual ~PairAnalysisTrackRotator(); //Setters void SetIterations(UInt_t niter) { fIterations=niter; } void SetRotationType(ERotationType type) { fRotationType=type; } void SetStartAnglePhi(Double_t phi) { fStartAnglePhi=phi; } void SetConeAnglePhi(Double_t phi) { fConeAnglePhi=phi; } //Getters Int_t GetIterations() const { return fIterations; } ERotationType GetRotationType() const { return fRotationType; } Double_t GetStartAnglePhi() const { return fStartAnglePhi; } Double_t GetConeAnglePhi() const { return fConeAnglePhi; } Double_t GetAngle() const { return fStartAnglePhi+(2*gRandom->Rndm()-1)*fConeAnglePhi; } Double_t GetCharge() const { return TMath::Nint(gRandom->Rndm()); } private: UInt_t fIterations; // number of iterations ERotationType fRotationType; // which track to rotate Double_t fStartAnglePhi; // starting angle for rotation Double_t fConeAnglePhi; // opening angle in phi for multiple rotation PairAnalysisTrackRotator(const PairAnalysisTrackRotator &c); PairAnalysisTrackRotator &operator=(const PairAnalysisTrackRotator &c); ClassDef(PairAnalysisTrackRotator,1) // PairAnalysis TrackRotator }; #endif
#ifndef __REGISTRATION_H #define __REGISTRATION_H enum { REGISTRATION_ERROR_UNAUTHORIZED = 401, REGISTRATION_ERROR_UNAUTHORIZED_REG = 407, REGISTRATION_ERROR_UNIMPLEMENTED = 501, REGISTRATION_ERROR_UNAVAILABLE = 503, REGISTRATION_ERROR_CONFLICT = 409, REGISTRATION_ERROR_TIMEOUT = 408, REGISTRATION_ERROR_TIMEOUT_SERVER = 504, REGISTRATION_ERROR_CONNECTION = -3, REGISTRATION_ERROR_INFO = -2, REGISTRATION_ERROR_UNKNOWN = -1, }; __BEGIN_DECLS void registration_init(void); void registration_deinit(void); __END_DECLS #endif
#ifndef HYPNOENEMY_H #define HYPNOENEMY_H #include "./Enemy.h" class HypnoEnemy: public Enemy { public: HypnoEnemy(); ~HypnoEnemy(); void reset(); void defaults(); void setTexture(); void setX(float x); void setY(float y); void update(float Px, float Py, float deltaTime); protected: }; #endif
#ifndef __LS1B_CAMERA_H__ #define __LS1B_CAMERA_H__ struct ls1b_camera_platform_data { int bl; int ts; int hsync; int vsync; }; #endif
//----------------------------------------------------------------------------- // File: ComDefinition.h //----------------------------------------------------------------------------- // Project: Kactus 2 // Author: Joni-Matti Määttä // Date: 29.3.2012 // // Description: // Class which encapsulates the handling of custom communication definition // object. //----------------------------------------------------------------------------- #ifndef COMDEFINITION_H #define COMDEFINITION_H #include <IPXACTmodels/common/Document.h> #include <IPXACTmodels/kactusExtensions/ComProperty.h> #include <IPXACTmodels/ipxactmodels_global.h> //----------------------------------------------------------------------------- //! Communication definition class. //----------------------------------------------------------------------------- class IPXACTMODELS_EXPORT ComDefinition : public Document { public: /*! * Constructor which creates an empty communication definition. * * @param [in] vlnv The VLNV of the communication definition. */ ComDefinition(VLNV const& vlnv = VLNV()); /*! * Copy constructor. */ ComDefinition(ComDefinition const& rhs); /*! * Destructor. */ virtual ~ComDefinition(); /*! * Makes a copy of the document. * * @return The created copy of the COM definition. */ virtual QSharedPointer<Document> clone() const; /*! * Returns the dependent files (none). */ virtual QStringList getDependentFiles() const; /*! * Returns the dependent VLNVs (none). */ virtual QList<VLNV> getDependentVLNVs() const; /*! * Adds a new transfer type to the communication definition. * * @param [in] type The name of the transfer type to add. */ void addTransferType(QString const& type); /*! * Removes a transfer type from the communication definition. * * @param [in] type The name of the transfer type to remove. */ void removeTransferType(QString const& type); /*! * Sets the supported transfer types. * * @param [in] types A list of transfer type names. */ void setTransferTypes(QStringList const& types); /*! * Adds a property to the definition. * * @param [in] prop The property to add. */ void addProperty(QSharedPointer<ComProperty> prop); /*! * Removes a property from the definition. * * @param [in] name The name of the property to remove. */ void removeProperty(QString const& name); /*! * Sets the properties. * * @param [in] properties A list of properties to set. */ void setProperties(QList< QSharedPointer<ComProperty> > const& properties); /*! * Returns the supported transfer types. */ QSharedPointer< QStringList > getTransferTypes() const; /*! * Returns the list of properties. */ QSharedPointer< QList< QSharedPointer<ComProperty> > > getProperties() const; private: //----------------------------------------------------------------------------- // Data. //----------------------------------------------------------------------------- //! The list of transfer types. QSharedPointer< QStringList > transferTypes_; //! The list of properties. QSharedPointer< QList< QSharedPointer<ComProperty> > > properties_; }; //----------------------------------------------------------------------------- #endif // COMDEFINITION_H
//----------------------------------------------------------------------------- // File: DesignConfigurationInstantiationParameterFinder.h //----------------------------------------------------------------------------- // Project: Kactus2 // Author: Janne Virtanen // Date: 05.05.2017 // // Description: // For finding parameters with the correct ID. //----------------------------------------------------------------------------- #ifndef DESIGNCONFIGURATIONINSTANTIATIONPARAMETERFINDER_H #define DESIGNCONFIGURATIONINSTANTIATIONPARAMETERFINDER_H #include "ParameterFinder.h" class AbstractParameterModel; class DesignConfigurationInstantiation; //----------------------------------------------------------------------------- //! The implementation for finding parameters with the correct ID. //----------------------------------------------------------------------------- class DesignConfigurationInstantiationParameterFinder : public ParameterFinder { public: /*! * Constructor. * * @param [in] designConfigurationInstantiation The element which parameters are being searched for. */ DesignConfigurationInstantiationParameterFinder (QSharedPointer<DesignConfigurationInstantiation const> designConfigurationInstantiation); /*! * Destructor. */ ~DesignConfigurationInstantiationParameterFinder(); /*! * Get the parameter with the given id. * * @param [in] parameterId The id of the parameter being searched for. */ virtual QSharedPointer<Parameter> getParameterWithID(QString const& parameterId) const; /*! * Checks if a parameter with the given id exists. * * @param [in] id The id to search for. * * @return True, if the parameter with the given id exists, otherwise false. */ virtual bool hasId(QString const& id) const; /*! * Finds the name of the parameter with the given id. * * @param [in] id The id to search for. * * @return The name of the parameter. */ virtual QString nameForId(QString const& id) const; /*! * Finds the value of the parameter with the given id. * * @param [in] id The id of the parameter to search for. * * @return The value of the parameter. */ virtual QString valueForId(QString const& id) const; /*! * Gets all of the ids of design configuration instantiation parameters. * * @return A list containing all of the ids. */ virtual QStringList getAllParameterIds() const; /*! * Gets the number of design configuration instantiation in the component. * * @return The number of design configuration instantiation in the component. */ virtual int getNumberOfParameters() const; /*! * Sets a new component for the parameter finder. */ virtual void setDesignConfigurationInstantiation (QSharedPointer<DesignConfigurationInstantiation const> DesignConfigurationInstantiation); /*! * Registers a parameter model that can modify parameters for the finder. * * @param [in] model The model to register. */ virtual void registerParameterModel(QAbstractItemModel const* model); private: //! No copying DesignConfigurationInstantiationParameterFinder(const DesignConfigurationInstantiationParameterFinder& other); //! No assignment DesignConfigurationInstantiationParameterFinder& operator=(const DesignConfigurationInstantiationParameterFinder& other); /*! * Returns a parameter corresponding given id, if any exists. */ QSharedPointer<Parameter> searchParameter(QString const& parameterId) const; //----------------------------------------------------------------------------- // Data. //----------------------------------------------------------------------------- //! The parameters are searched from this component instantiation. QSharedPointer<DesignConfigurationInstantiation const> designConfigurationInstantiation_; }; #endif // DESIGNCONFIGURATIONINSTANTIATIONPARAMETERFINDER_H
//------------------------------------------------------------------------------ // Copyright (c) 2004-2010 Atheros Communications Inc. // All rights reserved. // // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above // copyright notice and this permission notice appear in all copies. // // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. // // //------------------------------------------------------------------------------ //============================================================================== // // Author(s): ="Atheros" //============================================================================== #ifndef BMI_INTERNAL_H #define BMI_INTERNAL_H #include "a_config.h" #include "athdefs.h" #include "a_types.h" #include "a_osapi.h" #define ATH_MODULE_NAME bmi #include "a_debug.h" #include "AR6002/hw2.0/hw/mbox_host_reg.h" #include "bmi_msg.h" #define ATH_DEBUG_BMI ATH_DEBUG_MAKE_MODULE_MASK(0) #define BMI_COMMUNICATION_TIMEOUT 100000 /* ------ Global Variable Declarations ------- */ static A_BOOL bmiDone; A_STATUS bmiBufferSend(HIF_DEVICE *device, A_UCHAR *buffer, A_UINT32 length); A_STATUS bmiBufferReceive(HIF_DEVICE *device, A_UCHAR *buffer, A_UINT32 length, A_BOOL want_timeout); #endif
/* * arch/arm/kernel/topology.c * * Copyright (C) 2011 Linaro Limited. * Written by: Vincent Guittot * * based on arch/sh/kernel/topology.c * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include <linux/cpu.h> #include <linux/cpumask.h> #include <linux/export.h> #include <linux/init.h> #include <linux/percpu.h> #include <linux/node.h> #include <linux/nodemask.h> #include <linux/sched.h> #include <asm/cputype.h> #include <asm/topology.h> #define MPIDR_SMP_BITMASK (0x3 << 30) #define MPIDR_SMP_VALUE (0x2 << 30) #define MPIDR_MT_BITMASK (0x1 << 24) /* * These masks reflect the current use of the affinity levels. * The affinity level can be up to 16 bits according to ARM ARM */ #define MPIDR_LEVEL0_MASK 0x3 #define MPIDR_LEVEL0_SHIFT 0 #define MPIDR_LEVEL1_MASK 0xF #define MPIDR_LEVEL1_SHIFT 8 #define MPIDR_LEVEL2_MASK 0xFF #define MPIDR_LEVEL2_SHIFT 16 struct cputopo_arm cpu_topology[NR_CPUS]; EXPORT_SYMBOL_GPL(cpu_topology); int arch_sd_local_flags(int level) { /* Powergate at threading level doesn't make sense */ if (level & SD_SHARE_CPUPOWER) return 1*SD_SHARE_POWERDOMAIN; return 0*SD_SHARE_POWERDOMAIN; } const struct cpumask *cpu_coregroup_mask(int cpu) { return &cpu_topology[cpu].core_sibling; } /* * store_cpu_topology is called at boot when only one cpu is running * and with the mutex cpu_hotplug.lock locked, when several cpus have booted, * which prevents simultaneous write access to cpu_topology array */ void store_cpu_topology(unsigned int cpuid) { struct cputopo_arm *cpuid_topo = &cpu_topology[cpuid]; unsigned int mpidr; unsigned int cpu; /* If the cpu topology has been already set, just return */ if (cpuid_topo->core_id != -1) return; mpidr = read_cpuid_mpidr(); /* create cpu topology mapping */ if ((mpidr & MPIDR_SMP_BITMASK) == MPIDR_SMP_VALUE) { /* * This is a multiprocessor system * multiprocessor format & multiprocessor mode field are set */ if (mpidr & MPIDR_MT_BITMASK) { /* core performance interdependency */ cpuid_topo->thread_id = (mpidr >> MPIDR_LEVEL0_SHIFT) & MPIDR_LEVEL0_MASK; cpuid_topo->core_id = (mpidr >> MPIDR_LEVEL1_SHIFT) & MPIDR_LEVEL1_MASK; cpuid_topo->socket_id = (mpidr >> MPIDR_LEVEL2_SHIFT) & MPIDR_LEVEL2_MASK; } else { /* largely independent cores */ cpuid_topo->thread_id = -1; cpuid_topo->core_id = (mpidr >> MPIDR_LEVEL0_SHIFT) & MPIDR_LEVEL0_MASK; cpuid_topo->socket_id = (mpidr >> MPIDR_LEVEL1_SHIFT) & MPIDR_LEVEL1_MASK; } } else { /* * This is an uniprocessor system * we are in multiprocessor format but uniprocessor system * or in the old uniprocessor format */ cpuid_topo->thread_id = -1; cpuid_topo->core_id = 0; cpuid_topo->socket_id = -1; } /* update core and thread sibling masks */ for_each_possible_cpu(cpu) { struct cputopo_arm *cpu_topo = &cpu_topology[cpu]; if (cpuid_topo->socket_id == cpu_topo->socket_id) { cpumask_set_cpu(cpuid, &cpu_topo->core_sibling); if (cpu != cpuid) cpumask_set_cpu(cpu, &cpuid_topo->core_sibling); if (cpuid_topo->core_id == cpu_topo->core_id) { cpumask_set_cpu(cpuid, &cpu_topo->thread_sibling); if (cpu != cpuid) cpumask_set_cpu(cpu, &cpuid_topo->thread_sibling); } } } smp_wmb(); printk(KERN_INFO "CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n", cpuid, cpu_topology[cpuid].thread_id, cpu_topology[cpuid].core_id, cpu_topology[cpuid].socket_id, mpidr); } /* * init_cpu_topology is called at boot when only one cpu is running * which prevent simultaneous write access to cpu_topology array */ void init_cpu_topology(void) { unsigned int cpu; /* init core mask */ for_each_possible_cpu(cpu) { struct cputopo_arm *cpu_topo = &(cpu_topology[cpu]); cpu_topo->thread_id = -1; cpu_topo->core_id = -1; cpu_topo->socket_id = -1; cpumask_clear(&cpu_topo->core_sibling); cpumask_clear(&cpu_topo->thread_sibling); } smp_wmb(); }
/* * Copyright 2003 by Adam Luter * This file is part of Squash, a C/Ncurses-based unix music player. * * Squash 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. * * Squash 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 Squash; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * global_squash.c * Global Functions (For squash only) */ #include "global.h" #include "global_squash.h" #include "playlist_manager.h" /* for playlist_queue_song() */ #include "display.h" #ifdef EMPEG_DSP #include <sys/ioctl.h> /* for ioctl() */ #include "sys/soundcard.h" /* for _SIO*() macros */ #endif #include "database.h" /* Used by parse_file() to set state values read */ void load_state_callback( void *data, char *header, char *key, char *value ) { state_info_t *pass = data; squash_ensure_alloc( pass->raw_song_count, pass->raw_song_alloc, pass->raw_songs, sizeof(state_raw_song_t), 10, *=2 ); /* Add it to the structure */ if( strncasecmp("entry_filename", key, 16) == 0 ) { pass->raw_songs[pass->raw_song_count].filename = value; pass->raw_songs[pass->raw_song_count].position = 0; } else if( strncasecmp("entry_position", key, 16) == 0 ) { pass->raw_songs[pass->raw_song_count].position = atol(value); pass->raw_song_count++; squash_free( value ); } else if( strncasecmp("current_entry", key, 15) == 0 ) { pass->current_song = atol(value); squash_free( value ); } #ifdef EMPEG_DSP else if( strncasecmp("volume", key, 7) == 0 ) { pass->volume = atoi(value); squash_free( value ); } #endif #ifdef EMPEG else if( strncasecmp("brightness", key, 11) == 0 ) { pass->brightness = atoi(value); squash_free( value ); } #endif #ifndef NO_NCURSES else if( strncasecmp("window_number", key, 14) == 0 ) { pass->cur_window_number = atoi(value); squash_free( value ); } else if ( strncasecmp("window_state", key, 13) == 0 ) { pass->window_states[pass->cur_window_number] = atoi(value); squash_free( value ); } #endif else { squash_free( value ); } squash_free( key ); } /* * Load state * */ void load_state() { song_info_t *song; int i; squash_lock( state_info.lock ); state_info.raw_songs = NULL; state_info.current_song = 0; state_info.raw_song_count = 0; state_info.raw_song_alloc = 0; state_info.cur_window_number = 0; state_info.volume = 50; state_info.brightness = 100; #ifndef NO_NCURSES for( i = 0; i < WIN_COUNT; i++ ) { state_info.window_states[i] = WIN_STATE_NORMAL; } #endif parse_file( config.global_state_path, load_state_callback, &state_info ); #ifdef EMPEG_DSP { int mixer; int raw_vol = state_info.volume + (state_info.volume << 8); if ((mixer = open("/dev/mixer", O_RDWR)) == -1) { fprintf(stderr, "Can't open /dev/mixer"); exit(1); } ioctl( mixer, _SIOWR('M', 0, int), &raw_vol ); } #endif #ifdef EMPEG squash_lock( display_info.lock ); display_info.brightness = state_info.brightness; set_display_brightness_empeg( display_info.brightness ); squash_unlock( display_info.lock ); #endif squash_unlock( state_info.lock ); #ifndef NO_NCURSES squash_lock( state_info.lock ); squash_lock( display_info.lock ); for( i = 0; i < WIN_COUNT; i++ ) { display_info.window[i].state = state_info.window_states[i]; } squash_unlock( display_info.lock ); squash_unlock( state_info.lock ); #endif squash_lock(state_info.lock); while( state_info.current_song < state_info.raw_song_count ) { squash_wlock(database_info.lock); squash_lock(song_queue.lock); squash_log("adding: %d, %s", state_info.raw_songs[state_info.current_song].position, state_info.raw_songs[state_info.current_song].filename); song = find_song_by_filename(state_info.raw_songs[state_info.current_song].filename); if( song != NULL ) { playlist_queue_song( song, state_info.raw_songs[state_info.current_song].position ); } state_info.current_song++; squash_wunlock(database_info.lock); squash_unlock(song_queue.lock); squash_unlock(state_info.lock); squash_broadcast( song_queue.not_empty ); squash_broadcast( display_info.changed ); sched_yield(); squash_lock(state_info.lock); } for( i = 0; i < state_info.raw_song_count; i++ ) { squash_free( state_info.raw_songs[i].filename ); } squash_free( state_info.raw_songs ); state_info.current_song = 0; state_info.raw_song_count = 0; state_info.raw_song_alloc = 0; squash_unlock( state_info.lock ); }
#include "../include/Silabs_L0_API.h" extern unsigned int jiffies_to_msecs(const unsigned long j); long system_time() { return jiffies_to_msecs(jiffies); } void system_wait(int time) { msleep(time); } unsigned int L0_WriteCommandBytes(unsigned char slaveaddress, unsigned char length, unsigned char *pucDataBuffer) { slaveaddress = 0x64; I2CWrite(slaveaddress,pucDataBuffer,length); return length; } unsigned int L0_ReadCommandBytes(unsigned char slaveaddress, unsigned char length, unsigned char *pucDataBuffer) { slaveaddress = 0x64; I2CRead(slaveaddress,pucDataBuffer,length); return length; } extern int si2168_get_fe_config(struct si2168_fe_config *cfg); extern unsigned int I2CWrite(unsigned char I2CSlaveAddr, unsigned char *data, unsigned char length) { struct si2168_fe_config cfg; // I2CSlaveAddr=cfg.demod_addr; // printk("I2CSlaveAddr is %d\n",I2CSlaveAddr); // printk("I2CSlaveAddr is %d,length is %d,data is %x\n",I2CSlaveAddr,length,data[0]); /* I2C write, please port this function*/ int ret = 0; // unsigned char regbuf[1]; /*8 bytes reg addr, regbuf 1 byte*/ struct i2c_msg msg; /*construct 2 msgs, 1 for reg addr, 1 for reg value, send together*/ memset(&msg, 0, sizeof(msg)); si2168_get_fe_config(&cfg); /*write reg address*/ /* msg[0].addr = (state->config.demod_addr); msg[0].flags = 0; msg[0].buf = regbuf; msg[0].len = 1;*/ /*write value*/ msg.addr = I2CSlaveAddr; msg.flags = 0; //I2C_M_NOSTART; /*i2c_transfer will emit a stop flag, so we should send 2 msg together, // * and the second msg's flag=I2C_M_NOSTART, to get the right timing*/ msg.buf = data; msg.len = length; #if 0 /*write reg address*/ msg[0].addr = 0x80; msg[0].flags = 0; msg[0].buf = 0x7; msg[0].len = 1; /*write value*/ msg[1].addr = 0x80; msg[1].flags = I2C_M_NOSTART; /*i2c_transfer will emit a stop flag, so we should send 2 msg together, * and the second msg's flag=I2C_M_NOSTART, to get the right timing*/ msg[1].buf = 0x8; msg[1].len = 1; #endif ret = i2c_transfer(cfg.i2c_adapter, &msg, 1); if(ret<0){ printk(" %s: writereg error, errno is %d \n", __FUNCTION__, ret); return 0; } else{ //printk(" %s:write success, errno is %d \n", __FUNCTION__, ret); return 1; } return 1; } extern unsigned int I2CRead(unsigned char I2CSlaveAddr, unsigned char *data, unsigned char length) { /* I2C read, please port this function*/ // printk("I2CSlaveAddr is %d,length is %d\n",I2CSlaveAddr,length); // printk("I2CSlaveAddr is %d\n",I2CSlaveAddr); struct si2168_fe_config cfg; // I2CSlaveAddr=cfg.demod_addr; int nRetCode = 0; struct i2c_msg msg[1]; if(data == 0 || length == 0) { printk("si2168 read register parameter error !!\n"); return 0; } si2168_get_fe_config(&cfg); //read real data memset(msg, 0, sizeof(msg)); msg[0].addr = I2CSlaveAddr; msg[0].flags |= I2C_M_RD; //write I2C_M_RD=0x01 msg[0].len = length; msg[0].buf = data; nRetCode = i2c_transfer(cfg.i2c_adapter, msg, 1); if(nRetCode != 1) { printk("si2168_readregister reg failure!\n"); return 0; } return 1; }
/** * $Id$ * * Copyright (C) 2009 Daniel-Constantin Mierla (asipto.com) * * 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 */ /*! \file * \brief Kamailio xmlops :: Core * \ingroup xmlops */ /*! \defgroup xmlops Xmlops :: This module implements a range of XML-based * operations */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <libxml/parser.h> #include <time.h> #include "../../sr_module.h" #include "../../dprint.h" #include "pv_xml.h" MODULE_VERSION extern int pv_xml_buf_size; static pv_export_t mod_pvs[] = { { {"xml", sizeof("xml")-1}, PVT_OTHER, pv_get_xml, pv_set_xml, pv_parse_xml_name, 0, 0, 0 }, { {0, 0}, 0, 0, 0, 0, 0, 0, 0 } }; static param_export_t params[]={ { "buf_size", INT_PARAM, &pv_xml_buf_size }, { "xml_ns", STR_PARAM|USE_FUNC_PARAM, (void*)pv_xml_ns_param }, { 0, 0, 0} }; /** module exports */ struct module_exports exports= { "xmlops", /* module name */ DEFAULT_DLFLAGS, /* dlopen flags */ 0, /* exported functions */ params, /* exported parameters */ 0, /* exported statistics */ 0, /* exported MI functions */ mod_pvs, /* exported pseudo-variables */ 0, /* extra processes */ 0, /* module initialization function */ 0, /* response handling function */ 0, /* destroy function */ 0 /* per-child init function */ };
/* * Copyright (c) 2002, Intel Corporation. All rights reserved. * Created by: rolla.n.selbak REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. * Test that pthread_exit() * * terminates the calling thread and makes the value 'value_ptr' available * to any successful join with the terminating thread. * * Steps: * 1. Create a new thread. Have it return a return code on pthread_exit(); * 2. Call pthread_join() in main(), and pass to it 'value_ptr'. * 3. Check to see of the value_ptr and the value returned by pthread_exit() are the same; * */ #include <pthread.h> #include <stdio.h> #include <unistd.h> #include "posixtest.h" #define RETURN_CODE 100 /* Set a random return code number. This shall be the return code of the thread when using pthread_exit().*/ # define INTHREAD 0 /* Control going to or is already for Thread */ # define INMAIN 1 /* Control going to or is already for Main */ int sem; /* Manual semaphore used to indicate when the thread has been created. */ /* Thread's function. */ void *a_thread_func() { sem=INMAIN; pthread_exit((void*)RETURN_CODE); return NULL; } int main() { pthread_t new_th; int *value_ptr; /* Initializing variables. */ value_ptr=0; sem=INTHREAD; /* Create a new thread. */ if (pthread_create(&new_th, NULL, a_thread_func, NULL) != 0) { perror("Error creating thread\n"); return PTS_UNRESOLVED; } /* Make sure the thread was created before we join it. */ while (sem==INTHREAD) sleep(1); /* Wait for thread to return */ if (pthread_join(new_th, (void*)&value_ptr) != 0) { perror("Error in pthread_join()\n"); return PTS_UNRESOLVED; } /* Check to make sure that 'value_ptr' that was passed to pthread_join() and the * pthread_exit() return code that was used in the thread funciton are the same. */ if ((long)value_ptr != RETURN_CODE) { printf("Test FAILED: pthread_exit() could not pass the return value of the thread in 'value_ptr' to pthread_join().\n"); return PTS_FAIL; } printf("Test PASSED\n"); return PTS_PASS; }
/* Formatted output to strings. Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc. 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, 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. */ #include <config.h> /* Specification. */ #ifdef IN_LIBASPRINTF # include "vasprintf.h" #else # include <stdio.h> #endif #include <errno.h> #include <limits.h> #include <stdlib.h> #include "vasnprintf.h" /* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */ #ifndef EOVERFLOW # define EOVERFLOW E2BIG #endif int vasprintf (char **resultp, const char *format, va_list args) { size_t length; char *result = vasnprintf (NULL, &length, format, args); if (result == NULL) return -1; if (length > INT_MAX) { free (result); errno = EOVERFLOW; return -1; } *resultp = result; /* Return the number of resulting bytes, excluding the trailing NUL. */ return length; }
/* created by click/linuxmodule/fixincludes.pl on Tue Nov 25 22:39:41 2014 */ /* from /lib/modules/2.6.27.5-117.fc10.i686/build/include/linux/mfd/tc6393xb.h */ /* * Toshiba TC6393XB SoC support * * Copyright(c) 2005-2006 Chris Humbert * Copyright(c) 2005 Dirk Opfer * Copyright(c) 2005 Ian Molton <spyro@f2s.com> * Copyright(c) 2007 Dmitry Baryshkov * * Based on code written by Sharp/Lineo for 2.4 kernels * Based on locomo.c * * 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 MFD_TC6393XB_H #if defined(__cplusplus) && !CLICK_CXX_PROTECTED # error "missing #include <click/cxxprotect.h>" #endif #define MFD_TC6393XB_H /* Also one should provide the CK3P6MI clock */ struct tc6393xb_platform_data { u16 scr_pll2cr; /* PLL2 Control */ u16 scr_gper; /* GP Enable */ u32 scr_gpo_doecr; /* GPO Data OE Control */ u32 scr_gpo_dsr; /* GPO Data Set */ int (*enable)(struct platform_device *dev); int (*disable)(struct platform_device *dev); int (*suspend)(struct platform_device *dev); int (*resume)(struct platform_device *dev); int irq_base; /* base for subdevice irqs */ int gpio_base; struct tmio_nand_data *nand_data; }; /* * Relative to irq_base */ #define IRQ_TC6393_NAND 0 #define IRQ_TC6393_MMC 1 #define TC6393XB_NR_IRQS 8 #endif
#include <string.h> #include <stdio.h> #define MAXLINE 1000 int reverse (char origin[], char dest[]); int mygetline(char s[],int lim); int reverse (char origin[], char dest[]) { int i, idx; for (i = 0; origin[i] != '\0'; i++) ; idx = i; for (i = 0; i < idx; i++) dest[i] = origin[idx - i - 1]; dest[i] = '\0'; return 0; } int mygetline(char s[],int lim) { int c, i; for (i=0; i < lim-1 && (c=getchar())!=EOF && c!='\n'; ++i) s[i] = c; if (c == '\n') { s[i] = c; ++i; } s[i] = '\0'; return i; } int main() { char original_line[MAXLINE]; char reversed_line[MAXLINE]; while (0 != mygetline(original_line, MAXLINE)) { reverse(original_line, reversed_line); printf("%s", reversed_line); } return 0; }
/* * * Copyright (c) 2001-2002, Biswapesh Chattopadhyay * * This source code is released for free distribution under the terms of the * GNU General Public License. * */ #ifndef TM_SOURCE_FILE_H #define TM_SOURCE_FILE_H #include <stdio.h> #include <glib.h> #include <glib-object.h> #include "tm_parser.h" G_BEGIN_DECLS /* Casts a pointer to a pointer to a TMSourceFile structure */ #define TM_SOURCE_FILE(source_file) ((TMSourceFile *) source_file) /* Evaluates to X is X is defined, else evaluates to Y */ #define FALLBACK(X,Y) (X)?(X):(Y) /** * The TMSourceFile structure represents the source file and its tags in the tag manager. **/ typedef struct TMSourceFile { TMParserType lang; /* Programming language used */ char *file_name; /**< Full file name (inc. path) */ char *short_name; /**< Just the name of the file (without the path) */ GPtrArray *tags_array; /**< Sorted tag array obtained by parsing the object */ } TMSourceFile; GType tm_source_file_get_type(void); TMSourceFile *tm_source_file_new(const char *file_name, const char *name); void tm_source_file_free(TMSourceFile *source_file); gchar *tm_get_real_path(const gchar *file_name); #ifdef GEANY_PRIVATE const gchar *tm_source_file_get_lang_name(TMParserType lang); TMParserType tm_source_file_get_named_lang(const gchar *name); gboolean tm_source_file_parse(TMSourceFile *source_file, guchar* text_buf, gsize buf_size, gboolean use_buffer); GPtrArray *tm_source_file_read_tags_file(const gchar *tags_file, TMParserType mode); gboolean tm_source_file_write_tags_file(const gchar *tags_file, GPtrArray *tags_array); #endif /* GEANY_PRIVATE */ G_END_DECLS #endif /* TM_SOURCE_FILE_H */
// $Id: hitcmp.h,v 2.11 2004/05/28 19:22:08 o Exp $ // philologic 2.8 -- TEI XML/SGML Full-text database engine // Copyright (C) 2004 University of Chicago // // This program is free software; you can redistribute it and/or modify // it under the terms of the Affero General Public License as published by // Affero, Inc.; either version 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 // Affero General Public License for more details. // // You should have received a copy of the Affero General Public License // along with this program; if not, write to Affero, Inc., // 510 Third Street, Suite 225, San Francisco, CA 94107 USA. #ifdef HITCMP_H #error "hitcmp.h multiply included" #else #define HITCMP_H #ifndef STDIO_H #include <stdio.h> #include <stdlib.h> #endif #ifndef C_H #include "../c.h" #endif #ifndef HITCON_H #include "hitcon.h" #endif typedef struct hitcmp_st hitcmp; #ifndef HITDEF_H #include "hitdef.h" #endif struct hitcmp_st { Z32 (*h2h_cmp_func) (Z32 *, Z32 *, hitdef *, Z32); Z32 (*h2m_cmp_func) (Z32 *, Z32 *, hitdef *, Z32); Z32 (*m2m_cmp_func) (Z32 *, Z32 *, hitdef *, Z32); Z32 (*h2h_sort_func) (Z32 *, Z32 *, hitdef *, Z32); Z32 (*h2m_sort_func) (Z32 *, Z32 *, hitdef *, Z32); Z32 (*cntxt_cmp_func)(Z32 *, Z32 *, hitdef *, Z32); Z32 (*h2m_cntxt_cmp_func)(Z32 *, Z32 *, hitdef *, Z32); Z32 (*h2m_put_func) (Z32 *, Z32 *, Z32 *, hitdef *, Z32); Z32 (*hitsize_func) (hitdef *, N8); void *config; void *opt; N8 type; N8 context; N8 s_context; N8 r_context; N8 merge; N8 distance; N8 n_level; N8 n_real; N8 boolean_op; }; #define HIT_CMP_COOC 1 #define HIT_CMP_PHRASE 2 #define HIT_CMP_PROXY 3 #include "hitcmp_cooc.h" #include "hitcmp_phrase.h" #include "hitcmp_proxy.h" #define HIT_CMP_ARGZ_USAGE "{SEARCH OPTIONS} are: \ (cooc[:context]|phrase[:distance]|proxy[:distance])" #endif
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <sys/stat.h> #include <fcntl.h> #include <errno.h> #include <getopt.h> #include <kerrighed.h> #include <config.h> enum ipctype { UNDEF, MSG, SEM, SHM }; enum ipctype ipc_type = UNDEF; int ipcid; void version(char * program_name) { printf("\ %s %s\n\ Copyright (C) 2010 Kerlabs.\n\ This is free software; see source for copying conditions. There is NO\n\ warranty; not even for MERCHANBILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ \n", program_name, VERSION); } void show_help(char * program_name) { printf("Usage: %s [-h|--help] [-v|--version] {-q|-s|-m} <IPC ID> pathname\n" " -h|--help Show this information and exit\n" " -v|--version Show version informations and exit\n" " -q|--queue for a message queue\n" " -s|--semaphore for a semaphore array\n" " -m|--memory for a shared memory segment\n", program_name); } void parse_args(int argc, char *argv[]) { char c; int option_index = 0; char * short_options= "hq:s:m:"; static struct option long_options[] = { {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'v'}, {"queue", required_argument, 0, 'q'}, {"semaphore", required_argument, 0, 's'}, {"memory", required_argument, 0, 'm'}, {0, 0, 0, 0} }; while ((c = getopt_long(argc, argv, short_options, long_options, &option_index)) != -1) { switch (c) { case 'h': show_help(argv[0]); exit(EXIT_SUCCESS); case 'v': version(argv[0]); exit(EXIT_SUCCESS); case 'q': ipc_type = MSG; ipcid = atoi(optarg); break; case 's': ipc_type = SEM; ipcid = atoi(optarg); break; case 'm': ipc_type = SHM; ipcid = atoi(optarg); break; default: show_help(argv[0]); exit(EXIT_FAILURE); break; } } } int msgq_checkpoint(int ipcid, int fd) { int r, _errno; r = ipc_msgq_checkpoint(ipcid, fd); if (r) { _errno = errno; fprintf(stderr, "ipc_msgq_checkpoint: %s\n", strerror(_errno)); } return r; } int sem_checkpoint(int ipcid, int fd) { int r, _errno; r = ipc_sem_checkpoint(ipcid, fd); if (r) { _errno = errno; fprintf(stderr, "ipc_sem_checkpoint: %s\n", strerror(_errno)); } return r; } int shm_checkpoint(int ipcid, int fd) { int r, _errno; r = ipc_shm_checkpoint(ipcid, fd); if (r) { _errno = errno; fprintf(stderr, "ipc_shm_checkpoint: %s\n", strerror(_errno)); } return r; } int main(int argc, char *argv[]) { int r, fd, _errno; parse_args(argc, argv); if (ipc_type == UNDEF || argc - optind != 1) { show_help(argv[0]); exit(EXIT_FAILURE); } fd = open(argv[optind], O_CREAT|O_EXCL|O_WRONLY, S_IRUSR|S_IWUSR); if (fd == -1) { _errno = errno; fprintf(stderr, "%s: %s\n", argv[optind], strerror(_errno)); exit(EXIT_FAILURE); } switch (ipc_type) { case MSG: r = msgq_checkpoint(ipcid, fd); break; case SEM: r = sem_checkpoint(ipcid, fd); break; case SHM: r = shm_checkpoint(ipcid, fd); break; default: show_help(argv[0]); exit(EXIT_FAILURE); } close(fd); if (r) { unlink(argv[optind]); exit(EXIT_FAILURE); } exit(EXIT_SUCCESS); }
/*PGR-GNU***************************************************************** File: line_vertex.h Generated with Template by: Copyright (c) 2015 pgRouting developers Mail: project@pgrouting.org Function's developer: Copyright (c) 2017 Vidhan Jain Mail: vidhanj1307@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. ********************************************************************PGR-GNU*/ /*! @file */ #ifndef INCLUDE_CPP_COMMON_LINE_VERTEX_H_ #define INCLUDE_CPP_COMMON_LINE_VERTEX_H_ #pragma once #include <vector> #include <ostream> #include "c_types/pgr_edge_t.h" namespace pgrouting { class Line_vertex { public: Line_vertex() : id(0) {} Line_vertex(const pgr_edge_t& edge) : id(edge.id), vertex_id(edge.id), source(edge.source), target(edge.target), cost(edge.cost) {} Line_vertex(const Line_vertex &v) : id(v.id), vertex_id(v.vertex_id), source(v.source), target(v.target), cost(v.cost) {} void cp_members(const Line_vertex &other) { this->id = other.id; this->vertex_id = other.vertex_id; this->cost = other.cost; this->source = other.source; this->target = other.target; } void cp_members(int64_t _id, int64_t _source) { this->id = _id; this->vertex_id = -1; this->cost = 0; this->source = _source; this->target = -1; } friend std::ostream& operator<<(std::ostream& log, const Line_vertex &v) { log << "\nid = " << v.id; log << " | vertex_id = " << v.vertex_id; log << " | source = " << v.source; log << " | target = " << v.target; log << " | cost = " << v.cost; return log; } public: int64_t id; int64_t vertex_id; int64_t source; int64_t target; double cost; }; } // namespace pgrouting #endif // INCLUDE_CPP_COMMON_LINE_VERTEX_H_
#define UTS_RELEASE "2.6.32.9-silver-v3"
/* * Copyright (c) 2002-2003, Intel Corporation. All rights reserved. * Created by: rusty.lynch REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. Test case for assertion #5 of the sigaction system call that verifies setting the SA_INFO bit in the signal mask for SIGTTOU will result in sa_sigaction identifying the signal-catching function. */ #define _XOPEN_SOURCE 600 #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <sys/wait.h> #include <unistd.h> #include "posixtest.h" int handler_called = 0; void handler(int signo, siginfo_t *info, void *context) { handler_called = 1; } int main() { struct sigaction act; act.sa_sigaction = handler; act.sa_flags = SA_SIGINFO; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGSTOP); if (sigaction(SIGTTOU, &act, 0) == -1) { printf("Unexpected error while attempting to setup test " "pre-conditions\n"); return PTS_UNRESOLVED; } if (raise(SIGTTOU) == -1) { printf("Unexpected error while attempting to setup test " "pre-conditions\n"); return PTS_UNRESOLVED; } if (handler_called) { printf("Test PASSED\n"); return PTS_PASS; } printf("Test FAILED\n"); return PTS_FAIL; }
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /** * \file fsm.h * \brief Finite State Machine header. * Copyright (C) 2010 Signove Tecnologia Corporation. * All rights reserved. * Contact: Signove Tecnologia Corporation (contact@signove.com) * * $LICENSE_TEXT:BEGIN$ * 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 and appearing * in the file LICENSE included in the packaging of this file; 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 * $LICENSE_TEXT:END$ * * IEEE 11073 Communication Model - Finite State Machine implementation * * \author Fabricio Silva, Jose Martins * \date Jun 21, 2010 */ /** * @addtogroup FSM * @{ */ #ifndef FSM_H_ #define FSM_H_ #include "../asn1/phd_types.h" /** * Machine States */ typedef enum { /* Disconnected Group*/ fsm_state_disconnected = 0, /* Connected Group */ fsm_state_disassociating, fsm_state_unassociated, fsm_state_associating, fsm_state_config_sending, fsm_state_waiting_approval, fsm_state_operating, fsm_state_checking_config, fsm_state_waiting_for_config, fsm_state_size // !< The last value of states enumeration, it does not represent a real state } fsm_states; /** * Machine Events */ typedef enum { // IND - Transport layer indications fsm_evt_ind_transport_connection = 0, fsm_evt_ind_transport_disconnect, fsm_evt_ind_timeout, // REQ - Manager requests fsm_evt_req_assoc_rel, fsm_evt_req_assoc_abort, fsm_evt_req_agent_supplied_unknown_configuration, fsm_evt_req_agent_supplied_known_configuration, // REQ - Agent requests fsm_evt_req_send_config, fsm_evt_req_send_event, fsm_evt_req_assoc, // Rx - Received APDU /** * aarq(*) */ fsm_evt_rx_aarq, fsm_evt_rx_aarq_acceptable_and_known_configuration, fsm_evt_rx_aarq_acceptable_and_unknown_configuration, fsm_evt_rx_aarq_unacceptable_configuration, fsm_evt_rx_aare, fsm_evt_rx_aare_rejected, fsm_evt_rx_aare_accepted_known, fsm_evt_rx_aare_accepted_unknown, fsm_evt_rx_rlrq, fsm_evt_rx_rlre, fsm_evt_rx_abrt, fsm_evt_rx_prst, /** * roiv-* */ fsm_evt_rx_roiv, fsm_evt_rx_roiv_event_report, fsm_evt_rx_roiv_confirmed_event_report, fsm_evt_rx_roiv_all_except_confirmed_event_report, fsm_evt_rx_roiv_get, fsm_evt_rx_roiv_set, fsm_evt_rx_roiv_confirmed_set, fsm_evt_rx_roiv_action, fsm_evt_rx_roiv_confirmed_action, /** * rors-* */ fsm_evt_rx_rors, fsm_evt_rx_rors_confirmed_event_report, fsm_evt_rx_rors_confirmed_event_report_unknown, fsm_evt_rx_rors_confirmed_event_report_known, fsm_evt_rx_rors_get, fsm_evt_rx_rors_confirmed_set, fsm_evt_rx_rors_confirmed_action, fsm_evt_rx_roer, fsm_evt_rx_rorj, fsm_evt_size } fsm_events; /** * Event Data types */ typedef enum { FSM_EVT_DATA_ASSOCIATION_RESULT_CHOSEN = 1, FSM_EVT_DATA_RELEASE_REQUEST_REASON, FSM_EVT_DATA_RELEASE_RESPONSE_REASON, FSM_EVT_DATA_CONFIGURATION_RESULT, FSM_EVT_DATA_ERROR_RESULT, FSM_SVT_PHD_ASSOC_INFORMATION } FSMEventData_choice_values; /** * Event status */ typedef enum { FSM_PROCESS_EVT_RESULT_STATE_UNCHANGED = 0, // !< Represent the result of event processing when machine state keeps the state FSM_PROCESS_EVT_RESULT_STATE_CHANGED, // !< Represent the result of event processing when machine go to new state FSM_PROCESS_EVT_RESULT_NOT_PROCESSED // !< Represent the result of event processing when could not process the event } FSM_PROCESS_EVT_STATUS; /** * State Machine Event Data */ typedef struct FSMEventData { /** * Set when the incoming APDU is associated with the event */ APDU *received_apdu; /** * Union type selected */ FSMEventData_choice_values choice; /** * Possible data tokens, given the choice */ union { Associate_result association_result; Release_request_reason release_request_reason; Release_response_reason release_response_reason; ConfigResult configuration_result; ErrorResult error_result; PhdAssociationInformation assoc_information; } u; } FSMEventData; /** * Finite State Machine */ typedef struct FSM { /** * Current machine state */ fsm_states state; /** * Array of transition rules */ struct FsmTransitionRule *transition_table; /** * State table size */ int32 transition_table_size; } FSM; /** * FSM typedef for Context */ typedef struct Context FSMContext; /** * Action to be executed during state transition * * @param fsm state machine * @param evt input event * @param data event data */ typedef void (*fsm_action)(FSMContext *ctx, fsm_events evt, FSMEventData *data); /** * State Machine Transition Rule */ typedef struct FsmTransitionRule { fsm_states currentState; fsm_events inputEvent; fsm_states nextState; fsm_action post_action; } FsmTransitionRule; FSM *fsm_instance(); void fsm_destroy(FSM *fsm); void fsm_set_manager_state_table(FSM *fsm); void fsm_set_agent_state_table(FSM *fsm); void fsm_init(FSM *fsm, fsm_states entry_point_state, FsmTransitionRule *transition_table, int table_size); FSM_PROCESS_EVT_STATUS fsm_process_evt(FSMContext *ctx, fsm_events evt, FSMEventData *data); char *fsm_get_current_state_name(FSM *fsm); char *fsm_state_to_string(fsm_states state); char *fsm_event_to_string(fsm_events evt); /** @} */ #endif /* FSM_H_ */
/*! \file tsl2550extconf.h \brief TAOS TSL2550 Ambient Light Sensor interface extention configuration. */ //***************************************************************************** // // File Name : 'tsl2550extconf.h' // Title : TAOS TSL2550 Ambient Light Sensor interface configuration // Author : Carlos Antonio Neves // Created : 2006.08.08 // Revised : 2006.08.08 // Version : 0.1 // Target MCU : Atmel AVR series // Editor Tabs : 4 // //***************************************************************************** #ifndef TSL2550CONF_H #define TSL2550CONF_H // define enable functions // uncomment to enable these functions //#define TSL2550_ENABLE_COUNT_VALUE_WITH_REJECTION_FUNCTION #define TSL2550_ENABLE_CALCULATE_LUX_FUNCTION #endif
// ********************************************************************** // // Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** #ifndef TEST_I_H #define TEST_I_H #include <Test.h> class TimeoutI : virtual public Test::Timeout { public: virtual void op(const Ice::Current&); virtual void sendData(const Test::ByteSeq&, const Ice::Current&); virtual void sleep(Ice::Int, const Ice::Current&); virtual void holdAdapter(Ice::Int, const Ice::Current&); virtual void shutdown(const Ice::Current&); }; #endif
/*************************************************************************** * search.c * * Copyright 2005 Ian McIntosh * ian_mcintosh@linuxadvocate.org ****************************************************************************/ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <gtk/gtk.h> #include "main.h" #include "util.h" #include "search.h" #include "search_road.h" #include "search_location.h" #include "search_city.h" #include "search_coordinate.h" #include "searchwindow.h" // functions common to all searches void search_clean_string(gchar* p) { g_assert(p != NULL); gchar* pReader = p; gchar* pWriter = p; // skip white while(g_ascii_isspace(*pReader)) { pReader++; } // remove double spaces while(*pReader != '\0') { if(g_ascii_isspace(*pReader)) { if(g_ascii_isspace(*(pReader+1)) || *(pReader+1) == '\0') { // don't copy this character (space) if the next one is a space // or if it's the last character } else { // yes, copy this space *pWriter = ' '; // this also turns newlines etc. into spaces pWriter++; } } else if(g_ascii_isalnum(*pReader)) { // copy alphanumeric only // yes, copy this character *pWriter = *pReader; pWriter++; } pReader++; } *pWriter = '\0'; } gboolean search_address_number_atoi(const gchar* pszText, gint* pnReturn) { g_assert(pszText != NULL); g_assert(pnReturn != NULL); const gchar* pReader = pszText; gint nNumber = 0; while(*pReader != '\0') { if(g_ascii_isdigit(*pReader)) { nNumber *= 10; nNumber += g_ascii_digit_value(*pReader); } else { return FALSE; } pReader++; } *pnReturn = nNumber; return TRUE; } static GList *(*search_functions[])(const char *) = { search_city_execute, search_location_execute, search_road_execute, search_coordinate_execute, }; void search_all(const gchar* pszSentence) { GList *p; int i; if(pszSentence[0] == 0) { return; // no results... } TIMER_BEGIN(search, "BEGIN SearchAll"); gchar* pszCleanedSentence = g_strdup(pszSentence); search_clean_string(pszCleanedSentence); // Search each object type for (i = 0; i < G_N_ELEMENTS(search_functions); i++) { GList *results = (search_functions[i])(pszCleanedSentence); for (p = results; p; p = g_list_next(p)) { struct search_result *hit = g_list_nth_data(p, 0); searchwindow_add_result(hit->type, hit->text, hit->glyph, hit->point, hit->zoom_level); g_free(hit->point); g_free(hit->text); g_free(hit); } g_list_free(results); } TIMER_END(search, "END SearchAll"); g_free(pszCleanedSentence); }
/* * 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 _FR_DHCP_H #define _FR_DHCP_H /** * $Id$ * * @file include/dhcp.h * @brief Implementation of the DHCPv4 protocol. * * @copyright 2008 The FreeRADIUS server project * @copyright 2008 Alan DeKok <aland@deployingradius.com> */ RCSIDH(dhcp_h, "$Id$") #ifdef __cplusplus extern "C" { #endif /* * Not for production use. */ RADIUS_PACKET *fr_dhcp_recv_socket(int sockfd); int fr_dhcp_send_socket(RADIUS_PACKET *packet); #ifdef HAVE_PCAP_H typedef struct fr_pcap fr_pcap_t; RADIUS_PACKET *fr_dhcp_recv_pcap(fr_pcap_t *pcap); int fr_dhcp_send_pcap(fr_pcap_t *pcap, uint8_t *dst_ether_addr, RADIUS_PACKET *packet); #endif int fr_dhcp_add_arp_entry(int fd, char const *interface, VALUE_PAIR *hwvp, VALUE_PAIR *clvp); int8_t fr_dhcp_attr_cmp(void const *a, void const *b); ssize_t fr_dhcp_encode_option(uint8_t *out, size_t outlen, vp_cursor_t *cursor, void *encoder_ctx); int fr_dhcp_encode(RADIUS_PACKET *packet); ssize_t fr_dhcp_decode_option(TALLOC_CTX *ctx, vp_cursor_t *cursor, fr_dict_attr_t const *parent, uint8_t const *data, size_t len, void *decoder_ctx); int fr_dhcp_decode(RADIUS_PACKET *packet); #ifdef HAVE_LINUX_IF_PACKET_H #include <linux/if_packet.h> int fr_socket_packet(int iface_index, struct sockaddr_ll *p_ll); int fr_dhcp_send_raw_packet(int sockfd, struct sockaddr_ll *p_ll, RADIUS_PACKET *packet); RADIUS_PACKET *fr_dhcp_recv_raw_packet(int sockfd, struct sockaddr_ll *p_ll, RADIUS_PACKET *request); #endif int dhcp_init(void); /* * This is a horrible hack. */ #define PW_DHCP_OFFSET (1024) typedef enum { PW_DHCP_DISCOVER = (PW_DHCP_OFFSET + 1), PW_DHCP_OFFER = (PW_DHCP_OFFSET + 2), PW_DHCP_REQUEST = (PW_DHCP_OFFSET+ 3), PW_DHCP_DECLINE = (PW_DHCP_OFFSET + 4), PW_DHCP_ACK = (PW_DHCP_OFFSET + 5), PW_DHCP_NAK = (PW_DHCP_OFFSET + 6), PW_DHCP_RELEASE = (PW_DHCP_OFFSET + 7), PW_DHCP_INFORM = (PW_DHCP_OFFSET + 8), PW_DHCP_FORCE_RENEW = (PW_DHCP_OFFSET + 9), PW_DHCP_LEASE_QUERY = (PW_DHCP_OFFSET + 10), PW_DHCP_LEASE_UNASSIGNED = (PW_DHCP_OFFSET + 11), PW_DHCP_LEASE_UNKNOWN = (PW_DHCP_OFFSET + 12), PW_DHCP_LEASE_ACTIVE = (PW_DHCP_OFFSET + 13), PW_DHCP_BULK_LEASE_QUERY = (PW_DHCP_OFFSET + 14), PW_DHCP_LEASE_QUERY_DONE = (PW_DHCP_OFFSET + 15), PW_DHCP_MAX = (PW_DHCP_OFFSET + 16) } fr_dhcp_codes_t; extern char const *dhcp_header_names[]; extern char const *dhcp_message_types[]; #define DHCP_MAGIC_VENDOR (54) #define PW_DHCP_OPTION_82 (82) #define DHCP_PACK_OPTION1(x,y) ((x) | ((y) << 8)) #define DHCP_BASE_ATTR(x) (x & 0xff) #define DHCP_UNPACK_OPTION1(x) (((x) & 0xff00) >> 8) #define PW_DHCP_MESSAGE_TYPE (53) #define PW_DHCP_YOUR_IP_ADDRESS (264) #define PW_DHCP_SUBNET_MASK (1) #define PW_DHCP_IP_ADDRESS_LEASE_TIME (51) #ifdef __cplusplus } #endif #endif /* _FR_DHCP_H */
/************************************************************************************************** * * * Project: NextGIS Formbuilder * * Authors: Mikhail Gusev, gusevmihs@gmail.com * * Copyright (C) 2014-2019 NextGIS * * * * 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/. * * * **************************************************************************************************/ #pragma once #include "gui/attrwatcher.h" namespace Fb { namespace Gui { class StringWatcher: public AttrWatcher { Q_OBJECT public: explicit StringWatcher (Core::Attr *attr); virtual ~StringWatcher (); virtual QWidget *createWidget (MainWindow *window = nullptr) const override; protected: void onLineEditTextChanged (QString text); }; FB_ATTRWATCHER_FACTORY(StringWatcher, StringWatcherFct) } }
/* The functions inside of here emulate the overhead of a system call. Usable for benchmarking purposes. Copyright (C) 2011 Hadrien Grasland 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 _FAKE_SYSCALL_H_ #define _FAKE_SYSCALL_H_ void fake_syscall(); //The overhead of a system call is taken as that of two context switches //and two lock allocation/liberation cycles. void fake_context_switch(); //Emulates the overhead of a context switch as closely as possible #endif
/* ui-commit.c: generate commit view * * Copyright (C) 2006-2014 cgit Development Team <cgit@lists.zx2c4.com> * * Licensed under GNU General Public License v2 * (see COPYING for full license text) */ #include "cgit.h" #include "ui-commit.h" #include "html.h" #include "ui-shared.h" #include "ui-diff.h" #include "ui-log.h" void cgit_print_commit(char *hex, const char *prefix) { struct commit *commit, *parent; struct commitinfo *info, *parent_info; struct commit_list *p; struct strbuf notes = STRBUF_INIT; unsigned char sha1[20]; char *tmp, *tmp2; int parents = 0; if (!hex) hex = ctx.qry.head; if (get_sha1(hex, sha1)) { cgit_print_error_page(400, "Bad request", "Bad object id: %s", hex); return; } commit = lookup_commit_reference(sha1); if (!commit) { cgit_print_error_page(404, "Not found", "Bad commit reference: %s", hex); return; } info = cgit_parse_commit(commit); format_display_notes(sha1, &notes, PAGE_ENCODING, 0); load_ref_decorations(DECORATE_FULL_REFS); cgit_print_layout_start(); cgit_print_diff_ctrls(); html("<table summary='commit info' class='commit-info'>\n"); html("<tr><th>author</th><td>"); cgit_open_filter(ctx.repo->email_filter, info->author_email, "commit"); html_txt(info->author); if (!ctx.cfg.noplainemail) { html(" "); html_txt(info->author_email); } cgit_close_filter(ctx.repo->email_filter); html("</td><td class='right'>"); html_txt(show_date(info->author_date, info->author_tz, cgit_date_mode(DATE_ISO8601))); html("</td></tr>\n"); html("<tr><th>committer</th><td>"); cgit_open_filter(ctx.repo->email_filter, info->committer_email, "commit"); html_txt(info->committer); if (!ctx.cfg.noplainemail) { html(" "); html_txt(info->committer_email); } cgit_close_filter(ctx.repo->email_filter); html("</td><td class='right'>"); html_txt(show_date(info->committer_date, info->committer_tz, cgit_date_mode(DATE_ISO8601))); html("</td></tr>\n"); html("<tr><th>commit</th><td colspan='2' class='sha1'>"); tmp = oid_to_hex(&commit->object.oid); cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix); html(" ("); cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix); html(")</td></tr>\n"); html("<tr><th>tree</th><td colspan='2' class='sha1'>"); tmp = xstrdup(hex); cgit_tree_link(oid_to_hex(&commit->tree->object.oid), NULL, NULL, ctx.qry.head, tmp, NULL); if (prefix) { html(" /"); cgit_tree_link(prefix, NULL, NULL, ctx.qry.head, tmp, prefix); } free(tmp); html("</td></tr>\n"); for (p = commit->parents; p; p = p->next) { parent = lookup_commit_reference(p->item->object.oid.hash); if (!parent) { html("<tr><td colspan='3'>"); cgit_print_error("Error reading parent commit"); html("</td></tr>"); continue; } html("<tr><th>parent</th>" "<td colspan='2' class='sha1'>"); tmp = tmp2 = oid_to_hex(&p->item->object.oid); if (ctx.repo->enable_subject_links) { parent_info = cgit_parse_commit(parent); tmp2 = parent_info->subject; } cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, prefix); html(" ("); cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex, oid_to_hex(&p->item->object.oid), prefix); html(")</td></tr>"); parents++; } if (ctx.repo->snapshots) { html("<tr><th>download</th><td colspan='2' class='sha1'>"); cgit_print_snapshot_links(ctx.qry.repo, ctx.qry.head, hex, ctx.repo->snapshots); html("</td></tr>"); } html("</table>\n"); html("<div class='commit-subject'>"); cgit_open_filter(ctx.repo->commit_filter); html_txt(info->subject); cgit_close_filter(ctx.repo->commit_filter); show_commit_decorations(commit); html("</div>"); html("<div class='commit-msg'>"); cgit_open_filter(ctx.repo->commit_filter); html_txt(info->msg); cgit_close_filter(ctx.repo->commit_filter); html("</div>"); if (notes.len != 0) { html("<div class='notes-header'>Notes</div>"); html("<div class='notes'>"); cgit_open_filter(ctx.repo->commit_filter); html_txt(notes.buf); cgit_close_filter(ctx.repo->commit_filter); html("</div>"); html("<div class='notes-footer'></div>"); } if (parents < 3) { if (parents) tmp = oid_to_hex(&commit->parents->item->object.oid); else tmp = NULL; cgit_print_diff(ctx.qry.sha1, tmp, prefix, 0, 0); } strbuf_release(&notes); cgit_free_commitinfo(info); cgit_print_layout_end(); }
#ifndef ORG_ESB_HIVE_JOBUTIL_H #define ORG_ESB_HIVE_JOBUTIL_H #include <string> #include "org/esb/db/HiveDb.hpp" #include "org/esb/lang/Ptr.h" #include "org/esb/util/Log.h" //int jobcreator(int fileid, int profileid, std::string outpath); //int jobcreator(db::MediaFile, db::Profile, std::string outpath); //int jobcreator(int argc, char*argv[]); namespace org { namespace esb { namespace hive { class JobUtil { classlogger("org::esb::hive::JobUtil"); public: static void createJob(Ptr<db::Project> p); static int createJob(db::MediaFile, db::Profile, std::string outpath); static int createJob(db::MediaFile, db::Preset, std::string outpath); private: JobUtil(); ~JobUtil(); }; } } } #endif
/* jlh */ /* this file is part of: wmblob the GNU GPL license applies to this file, see file COPYING for details. author: jean-luc herren. */ #ifndef RCFILE_H #define RCFILE_H #include <glib.h> #include "wmblob.h" typedef struct { char name[256]; SETTINGS settings; } PRESET; extern GList *preset_list; extern int init_rcfile_c(); extern void done_rcfile_c(); extern int settings_save(); extern void settings_load(); extern void preset_save(const char *, SETTINGS *); extern void preset_delete(const char *); extern int preset_load(const char *, SETTINGS *); #endif
/* * Qiaosong Wang * University of Delaware * */ #ifndef UD_CURSOR_TOOL_H #define UD_CURSOR_TOOL_H #include <string> #include <rviz/tool.h> #include <rviz/properties/string_property.h> #include <ros/node_handle.h> #include <ros/publisher.h> #include "rviz/tool.h" #include <QCursor> #include <QObject> #include <QMenu> #include <OGRE/OgreSceneNode.h> #include <OGRE/OgreSceneManager.h> #include <OGRE/OgreEntity.h> #include <OGRE/OgreRay.h> #include <OGRE/OgreVector3.h> #include "rviz/tool_manager.h" #include "ud_cursor/UDCursor.h" #define UD_CURSOR_EDIT_MODE_ADD 0 #define UD_CURSOR_EDIT_MODE_MOVE 1 #define UD_CURSOR_EDIT_MODE_DELETE 2 #define UD_CURSOR_EDIT_MODE_DELETE_ALL 3 // as with ud_imarker trying to see the defines above, // i cannot figure out how to include ud_imarker.hh from here... // aaaaarrggghhhhhh catkin blows #ifndef MEASUREMENT_TYPE_DISTANCE #define MEASUREMENT_TYPE_DISTANCE 0 #define MEASUREMENT_TYPE_PLANE 1 #define MEASUREMENT_TYPE_LINE 2 #define MEASUREMENT_TYPE_CIRCLE 3 #define MEASUREMENT_TYPE_TRANSFORM 4 #define MEASUREMENT_TYPE_ERROR 5 #endif namespace Ogre { class SceneNode; class Vector3; } namespace rviz { class VectorProperty; class VisualizationManager; class ViewportMouseEvent; class StringProperty; class BoolProperty; } namespace rviz_plugin_tutorials { // BEGIN_TUTORIAL // Here we declare our new subclass of rviz::Tool. Every tool // which can be added to the tool bar is a subclass of // rviz::Tool. class UDCursorTool: public rviz::Tool { Q_OBJECT public: UDCursorTool(); ~UDCursorTool(); virtual void onInitialize(); virtual void activate(); virtual void deactivate(); virtual int processMouseEvent( rviz::ViewportMouseEvent& event ); virtual void load( const rviz::Config& config ); virtual void save( rviz::Config config ) const; Ogre::Plane selection_plane; public Q_SLOTS: void updateTopic(); void menu_edit_add(); void menu_edit_move_selected(); void menu_edit_delete_selected(); void menu_edit_delete_all(); void menu_display_indices(); void menu_display_connections(); void menu_plane_selection(); private: void makeFlag( const Ogre::Vector3& position ); std::vector<Ogre::SceneNode*> flag_nodes_; Ogre::SceneNode* moving_flag_node_; std::string flag_resource_; rviz::VectorProperty* current_flag_property_; rviz::StringProperty* topic_property_; ros::NodeHandle nh_; // ros::Publisher pub_; ros::Publisher cursor_pub; ros::Subscriber selection_plane_sub; bool use_selection_plane; QAction *action_add; QAction *action_move_selected; QAction *action_delete_selected; QAction *action_delete_all; QAction *action_display_indices; QAction *action_display_connections; QAction *action_plane_selection; ud_cursor::UDCursor cursor_msg; protected: QCursor std_cursor_; QCursor hit_cursor_; QCursor plane_hit_cursor_; QCursor move_cursor_; QCursor delete_cursor_; char *status_string; boost::shared_ptr<QMenu> tool_menu; }; // END_TUTORIAL } // end namespace rviz_plugin_tutorials #endif // UD_CURSOR_TOOL_H
/* flutter.h generated by valac 0.10.0, the Vala compiler, do not modify */ #ifndef __FLUTTER_H__ #define __FLUTTER_H__ #include <glib.h> #include <clutter/clutter.h> #include <glib-object.h> G_BEGIN_DECLS #define FLUTTER_TYPE_CONTAINER (flutter_container_get_type ()) #define FLUTTER_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FLUTTER_TYPE_CONTAINER, FlutterContainer)) #define FLUTTER_IS_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FLUTTER_TYPE_CONTAINER)) #define FLUTTER_CONTAINER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), FLUTTER_TYPE_CONTAINER, FlutterContainerIface)) typedef struct _FlutterContainer FlutterContainer; typedef struct _FlutterContainerIface FlutterContainerIface; #define FLUTTER_CONTAINER_TYPE_ITERATOR (flutter_container_iterator_get_type ()) #define FLUTTER_CONTAINER_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FLUTTER_CONTAINER_TYPE_ITERATOR, FlutterContainerIterator)) #define FLUTTER_CONTAINER_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FLUTTER_CONTAINER_TYPE_ITERATOR, FlutterContainerIteratorClass)) #define FLUTTER_CONTAINER_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FLUTTER_CONTAINER_TYPE_ITERATOR)) #define FLUTTER_CONTAINER_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FLUTTER_CONTAINER_TYPE_ITERATOR)) #define FLUTTER_CONTAINER_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FLUTTER_CONTAINER_TYPE_ITERATOR, FlutterContainerIteratorClass)) typedef struct _FlutterContainerIterator FlutterContainerIterator; typedef struct _FlutterContainerIteratorClass FlutterContainerIteratorClass; typedef struct _FlutterContainerIteratorPrivate FlutterContainerIteratorPrivate; #define FLUTTER_TYPE_GROUP (flutter_group_get_type ()) #define FLUTTER_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FLUTTER_TYPE_GROUP, FlutterGroup)) #define FLUTTER_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FLUTTER_TYPE_GROUP, FlutterGroupClass)) #define FLUTTER_IS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FLUTTER_TYPE_GROUP)) #define FLUTTER_IS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FLUTTER_TYPE_GROUP)) #define FLUTTER_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FLUTTER_TYPE_GROUP, FlutterGroupClass)) typedef struct _FlutterGroup FlutterGroup; typedef struct _FlutterGroupClass FlutterGroupClass; typedef struct _FlutterGroupPrivate FlutterGroupPrivate; #define FLUTTER_TYPE_STAGE (flutter_stage_get_type ()) #define FLUTTER_STAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FLUTTER_TYPE_STAGE, FlutterStage)) #define FLUTTER_STAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FLUTTER_TYPE_STAGE, FlutterStageClass)) #define FLUTTER_IS_STAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FLUTTER_TYPE_STAGE)) #define FLUTTER_IS_STAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FLUTTER_TYPE_STAGE)) #define FLUTTER_STAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FLUTTER_TYPE_STAGE, FlutterStageClass)) typedef struct _FlutterStage FlutterStage; typedef struct _FlutterStageClass FlutterStageClass; typedef struct _FlutterStagePrivate FlutterStagePrivate; #define FLUTTER_TYPE_BOX (flutter_box_get_type ()) #define FLUTTER_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FLUTTER_TYPE_BOX, FlutterBox)) #define FLUTTER_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FLUTTER_TYPE_BOX, FlutterBoxClass)) #define FLUTTER_IS_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FLUTTER_TYPE_BOX)) #define FLUTTER_IS_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FLUTTER_TYPE_BOX)) #define FLUTTER_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FLUTTER_TYPE_BOX, FlutterBoxClass)) typedef struct _FlutterBox FlutterBox; typedef struct _FlutterBoxClass FlutterBoxClass; typedef struct _FlutterBoxPrivate FlutterBoxPrivate; struct _FlutterContainerIface { GTypeInterface parent_iface; }; struct _FlutterContainerIterator { GTypeInstance parent_instance; volatile int ref_count; FlutterContainerIteratorPrivate * priv; }; struct _FlutterContainerIteratorClass { GTypeClass parent_class; void (*finalize) (FlutterContainerIterator *self); }; struct _FlutterGroup { ClutterGroup parent_instance; FlutterGroupPrivate * priv; }; struct _FlutterGroupClass { ClutterGroupClass parent_class; }; struct _FlutterStage { ClutterStage parent_instance; FlutterStagePrivate * priv; }; struct _FlutterStageClass { ClutterStageClass parent_class; }; struct _FlutterBox { ClutterBox parent_instance; FlutterBoxPrivate * priv; }; struct _FlutterBoxClass { ClutterBoxClass parent_class; }; GType flutter_container_get_type (void) G_GNUC_CONST; gpointer flutter_container_iterator_ref (gpointer instance); void flutter_container_iterator_unref (gpointer instance); GParamSpec* flutter_container_param_spec_iterator (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); void flutter_container_value_set_iterator (GValue* value, gpointer v_object); void flutter_container_value_take_iterator (GValue* value, gpointer v_object); gpointer flutter_container_value_get_iterator (const GValue* value); GType flutter_container_iterator_get_type (void) G_GNUC_CONST; FlutterContainerIterator* flutter_container_iterator (FlutterContainer* self); FlutterContainerIterator* flutter_container_iterator_new (FlutterContainer* _self_); FlutterContainerIterator* flutter_container_iterator_construct (GType object_type, FlutterContainer* _self_); gboolean flutter_container_iterator_next (FlutterContainerIterator* self); ClutterActor* flutter_container_iterator_get (FlutterContainerIterator* self); GType flutter_group_get_type (void) G_GNUC_CONST; FlutterGroup* flutter_group_new (void); FlutterGroup* flutter_group_construct (GType object_type); GType flutter_stage_get_type (void) G_GNUC_CONST; FlutterStage* flutter_stage_new (void); FlutterStage* flutter_stage_construct (GType object_type); GType flutter_box_get_type (void) G_GNUC_CONST; FlutterBox* flutter_box_new (void); FlutterBox* flutter_box_construct (GType object_type); G_END_DECLS #endif
#ifndef lint static char *RCSid = "$Header: strcdr.c,v 1.1 87/08/21 16:34:19 rnovak Exp $"; #endif /* *------------------------------------------------------------------ * * $Source: /u3/syseng/rnovak/src/lib/RCS/strcdr.c,v $ * $Revision: 1.1 $ * $Date: 87/08/21 16:34:19 $ * $State: Exp $ * $Author: rnovak $ * $Locker: $ * *------------------------------------------------------------------ * $Log: strcdr.c,v $ * Revision 1.1 87/08/21 16:34:19 rnovak * Initial revision * *------------------------------------------------------------------ */ /* * $Header: strcdr.c,v 1.1 87/08/21 16:34:19 rnovak Exp $ * $Log: strcdr.c,v $ * Revision 1.1 87/08/21 16:34:19 rnovak * Initial revision * * Revision 1.2 86/12/29 16:10:22 rnovak * Handle the includes for an include directory. * * Revision 1.1 86/12/29 15:24:07 rnovak * Initial revision * * Revision 1.3 86/12/29 15:10:22 rnovak * Added a Header. * * Revision 1.2 86/12/29 15:03:32 rnovak * Added a log. * */ #include <boolean.h> #include <malloc.h> char * strcdr(string,delimit) char * string ; char * delimit ; { char * return_val ; int length1 ; int length2 ; boolean found = FALSE ; int i ; int j ; int k = 0 ; length1 = strlen(string) ; length2 = strlen(delimit) ; return_val = malloc(length1+1) ; for (i=0;i<length1;i++) { for (j=0;j<length2;j++) { if (string[i] == delimit[j]) { found = TRUE ; } } if (found == TRUE) break ; } return_val[k] = EOS ; if (found == FALSE) { return return_val ; } for (;(i<length1)&&(found==TRUE);i++) { for (j=0;j<length2;j++) { if (string[i] != delimit[j]) { found = FALSE ; } } } strcpy(return_val,&string[i]) ; return return_val ; }