text
stringlengths
4
6.14k
/* * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands. * See the copyright notice in the ACK home directory, in the file "Copyright". */ /* $Id$ */ #ifndef UTIL_OPT_TYPES_H #define UTIL_OPT_TYPES_H typedef char byte; typedef char bool; typedef struct line line_t; typedef struct line *line_p; typedef struct sym sym_t; typedef struct sym *sym_p; typedef struct num num_t; typedef struct num *num_p; typedef struct arg arg_t; typedef struct arg *arg_p; typedef struct argbytes argb_t; typedef struct argbytes *argb_p; typedef struct regs reg_t; typedef struct regs *reg_p; #ifdef LONGOFF typedef long offset; #else typedef short offset; #endif #endif /* UTIL_OPT_TYPES_H */
// // KBPGPDecryptAppView.h // Keybase // // Created by Gabriel on 4/27/15. // Copyright (c) 2015 Gabriel Handford. All rights reserved. // #import <Foundation/Foundation.h> #import <Tikppa/Tikppa.h> #import "KBRPC.h" @interface KBPGPDecryptAppView : YOView @property KBNavigationView *navigation; @property (nonatomic) KBRPClient *client; @end
////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2016, Image Engine Design Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above // copyright notice, this list of conditions and the following // disclaimer. // // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided with // the distribution. // // * Neither the name of John Haddon nor the names of // any other contributors to this software may be used to endorse or // promote products derived from this software without specific prior // written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////// #ifndef GAFFERSCENEUI_SHADERVIEW_H #define GAFFERSCENEUI_SHADERVIEW_H #include "GafferImageUI/ImageView.h" #include "GafferSceneUI/TypeIds.h" namespace Gaffer { IE_CORE_FORWARDDECLARE( Box ) } // namespace Gaffer namespace GafferSceneUI { class ShaderView : public GafferImageUI::ImageView { public : ShaderView( const std::string &name = defaultName<ShaderView>() ); virtual ~ShaderView(); IE_CORE_DECLARERUNTIMETYPEDEXTENSION( GafferSceneUI::ShaderView, ShaderViewTypeId, GafferImageUI::ImageView ); Gaffer::StringPlug *scenePlug(); const Gaffer::StringPlug *scenePlug() const; // The prefix for the shader currently being viewed. std::string shaderPrefix() const; // The scene currently being used. Gaffer::Node *scene(); const Gaffer::Node *scene() const; typedef boost::signal<void ( ShaderView * )> SceneChangedSignal; SceneChangedSignal &sceneChangedSignal(); virtual void setContext( Gaffer::ContextPtr context ); typedef boost::function<Gaffer::NodePtr ()> RendererCreator; static void registerRenderer( const std::string &shaderPrefix, RendererCreator rendererCreator ); typedef boost::function<Gaffer::NodePtr ()> SceneCreator; static void registerScene( const std::string &shaderPrefix, const std::string &name, SceneCreator sceneCreator ); static void registerScene( const std::string &shaderPrefix, const std::string &name, const std::string &referenceFileName ); static void registeredScenes( const std::string &shaderPrefix, std::vector<std::string> &names ); private : typedef std::pair<std::string, std::string> PrefixAndName; typedef std::map<PrefixAndName, Gaffer::NodePtr> Scenes; void viewportVisibilityChanged(); void plugSet( Gaffer::Plug *plug ); void plugDirtied( Gaffer::Plug *plug ); void sceneRegistrationChanged( const PrefixAndName &prefixAndName ); void idleUpdate(); void updateRenderer(); void updateRendererContext(); void updateRendererState(); void updateScene(); void preRender(); bool m_framed; Gaffer::BoxPtr m_imageConverter; boost::signals::scoped_connection m_idleConnection; Gaffer::NodePtr m_renderer; std::string m_rendererShaderPrefix; Scenes m_scenes; Gaffer::NodePtr m_scene; PrefixAndName m_scenePrefixAndName; SceneChangedSignal m_sceneChangedSignal; static ViewDescription<ShaderView> g_viewDescription; }; IE_CORE_DECLAREPTR( ShaderView ); } // namespace GafferSceneUI #endif // GAFFERSCENEUI_SHADERVIEW_H
// // NSItemProvider+TJImageCache.h // Wootie // // Created by Tim Johnsen on 5/13/20. // #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN @interface NSItemProvider (TJImageCache) + (nullable instancetype)tj_itemProviderForImageURLString:(nullable NSString *const)imageURLString; @end NS_ASSUME_NONNULL_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 NET_URL_REQUEST_URL_REQUEST_CONTEXT_STORAGE_H_ #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_STORAGE_H_ #include "base/basictypes.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "net/base/net_export.h" namespace net { class CertVerifier; class CookieStore; class FraudulentCertificateReporter; class FtpTransactionFactory; class HostResolver; class HttpAuthHandlerFactory; class HttpServerProperties; class HttpTransactionFactory; class NetLog; class NetworkDelegate; class ServerBoundCertService; class ProxyService; class SSLConfigService; class TransportSecurityState; class URLRequestContext; class URLRequestJobFactory; class URLRequestThrottlerManager; // URLRequestContextStorage is a helper class that provides storage for unowned // member variables of URLRequestContext. class NET_EXPORT URLRequestContextStorage { public: // Note that URLRequestContextStorage does not acquire a reference to // URLRequestContext, since it is often designed to be embedded in a // URLRequestContext subclass. explicit URLRequestContextStorage(URLRequestContext* context); ~URLRequestContextStorage(); // These setters will set both the member variables and call the setter on the // URLRequestContext object. In all cases, ownership is passed to |this|. void set_net_log(NetLog* net_log); void set_host_resolver(scoped_ptr<HostResolver> host_resolver); void set_cert_verifier(CertVerifier* cert_verifier); void set_server_bound_cert_service( ServerBoundCertService* server_bound_cert_service); void set_fraudulent_certificate_reporter( FraudulentCertificateReporter* fraudulent_certificate_reporter); void set_http_auth_handler_factory( HttpAuthHandlerFactory* http_auth_handler_factory); void set_proxy_service(ProxyService* proxy_service); void set_ssl_config_service(SSLConfigService* ssl_config_service); void set_network_delegate(NetworkDelegate* network_delegate); void set_http_server_properties(HttpServerProperties* http_server_properties); void set_cookie_store(CookieStore* cookie_store); void set_transport_security_state( TransportSecurityState* transport_security_state); void set_http_transaction_factory( HttpTransactionFactory* http_transaction_factory); void set_ftp_transaction_factory( FtpTransactionFactory* ftp_transaction_factory); void set_job_factory(URLRequestJobFactory* job_factory); void set_throttler_manager(URLRequestThrottlerManager* throttler_manager); private: // We use a raw pointer to prevent reference cycles, since // URLRequestContextStorage can often be contained within a URLRequestContext // subclass. URLRequestContext* const context_; // Owned members. scoped_ptr<NetLog> net_log_; scoped_ptr<HostResolver> host_resolver_; scoped_ptr<CertVerifier> cert_verifier_; scoped_ptr<ServerBoundCertService> server_bound_cert_service_; scoped_ptr<FraudulentCertificateReporter> fraudulent_certificate_reporter_; scoped_ptr<HttpAuthHandlerFactory> http_auth_handler_factory_; scoped_ptr<ProxyService> proxy_service_; // TODO(willchan): Remove refcounting on these members. scoped_refptr<SSLConfigService> ssl_config_service_; scoped_ptr<NetworkDelegate> network_delegate_; scoped_ptr<HttpServerProperties> http_server_properties_; scoped_refptr<CookieStore> cookie_store_; scoped_ptr<TransportSecurityState> transport_security_state_; scoped_ptr<HttpTransactionFactory> http_transaction_factory_; scoped_ptr<FtpTransactionFactory> ftp_transaction_factory_; scoped_ptr<URLRequestJobFactory> job_factory_; scoped_ptr<URLRequestThrottlerManager> throttler_manager_; DISALLOW_COPY_AND_ASSIGN(URLRequestContextStorage); }; } // namespace net #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_STORAGE_H_
/*- * Copyright (c) 1991 Keith Muller. * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Keith Muller of the University of California, San Diego. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if 0 #ifndef lint static char sccsid[] = "@(#)egetopt.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ #endif #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); #include <ctype.h> #include <stdio.h> #include <string.h> #include "extern.h" /* * egetopt: get option letter from argument vector (an extended * version of getopt). * * Non standard additions to the ostr specs are: * 1) '?': immediate value following arg is optional (no white space * between the arg and the value) * 2) '#': +/- followed by a number (with an optional sign but * no white space between the arg and the number). The - may be * combined with other options, but the + cannot. */ int eopterr = 1; /* if error message should be printed */ int eoptind = 1; /* index into parent argv vector */ int eoptopt; /* character checked for validity */ char *eoptarg; /* argument associated with option */ #define BADCH (int)'?' static char emsg[] = ""; int egetopt(int nargc, char * const *nargv, const char *ostr) { static char *place = emsg; /* option letter processing */ char *oli; /* option letter list index */ static int delim; /* which option delimiter */ char *p; static char savec = '\0'; if (savec != '\0') { *place = savec; savec = '\0'; } if (!*place) { /* * update scanning pointer */ if ((eoptind >= nargc) || ((*(place = nargv[eoptind]) != '-') && (*place != '+'))) { place = emsg; return (-1); } delim = (int)*place; if (place[1] && *++place == '-' && !place[1]) { /* * found "--" */ ++eoptind; place = emsg; return (-1); } } /* * check option letter */ if ((eoptopt = (int)*place++) == (int)':' || (eoptopt == (int)'?') || !(oli = strchr(ostr, eoptopt))) { /* * if the user didn't specify '-' as an option, * assume it means -1 when by itself. */ if ((eoptopt == (int)'-') && !*place) return (-1); if (strchr(ostr, '#') && (isdigit(eoptopt) || (((eoptopt == (int)'-') || (eoptopt == (int)'+')) && isdigit(*place)))) { /* * # option: +/- with a number is ok */ for (p = place; *p != '\0'; ++p) { if (!isdigit(*p)) break; } eoptarg = place-1; if (*p == '\0') { place = emsg; ++eoptind; } else { place = p; savec = *p; *place = '\0'; } return (delim); } if (!*place) ++eoptind; if (eopterr) { if (!(p = strrchr(*nargv, '/'))) p = *nargv; else ++p; (void)fprintf(stderr, "%s: illegal option -- %c\n", p, eoptopt); } return (BADCH); } if (delim == (int)'+') { /* * '+' is only allowed with numbers */ if (!*place) ++eoptind; if (eopterr) { if (!(p = strrchr(*nargv, '/'))) p = *nargv; else ++p; (void)fprintf(stderr, "%s: illegal '+' delimiter with option -- %c\n", p, eoptopt); } return (BADCH); } ++oli; if ((*oli != ':') && (*oli != '?')) { /* * don't need argument */ eoptarg = NULL; if (!*place) ++eoptind; return (eoptopt); } if (*place) { /* * no white space */ eoptarg = place; } else if (*oli == '?') { /* * no arg, but NOT required */ eoptarg = NULL; } else if (nargc <= ++eoptind) { /* * no arg, but IS required */ place = emsg; if (eopterr) { if (!(p = strrchr(*nargv, '/'))) p = *nargv; else ++p; (void)fprintf(stderr, "%s: option requires an argument -- %c\n", p, eoptopt); } return (BADCH); } else { /* * arg has white space */ eoptarg = nargv[eoptind]; } place = emsg; ++eoptind; return (eoptopt); }
// // OAAlarmWidget.h // OsmAnd // // Created by Alexey Kulish on 29/12/2017. // Copyright © 2017 OsmAnd. All rights reserved. // #import <Foundation/Foundation.h> @protocol OAWidgetListener; @interface OAAlarmWidget : UIView @property (nonatomic, weak) id<OAWidgetListener> delegate; - (BOOL) updateInfo; @end
#pragma once #include <ev++.h> #include <functional> #include <cstdint> #include "lev/lev.h" namespace lev { class loop; class timer { public: typedef std::function<void()> TimerFiredEvent; timer(loop& loop); void StartOneShot(uint32_t ms, TimerFiredEvent func = nullptr); void StartInterval(uint32_t intervalms, TimerFiredEvent func = nullptr); // in milliseconds void StartTimer(uint32_t ms, uint32_t repeat_ms = 0); void StopTimer(); TimerFiredEvent OnTimerFired; private: ev::timer m_timer; }; };
/**************************************************************************** * * Open Watcom Project * * Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. * * ======================================================================== * * This file contains Original Code and/or Modifications of Original * Code as defined in and that are subject to the Sybase Open Watcom * Public License version 1.0 (the 'License'). You may not use this file * except in compliance with the License. BY USING THIS FILE YOU AGREE TO * ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is * provided with the Original Code and Modifications, and is also * available at www.sybase.com/developer/opensource. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR * NON-INFRINGEMENT. Please see the License for the specific language * governing rights and limitations under the License. * * ======================================================================== * * Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE * DESCRIBE IT HERE! * ****************************************************************************/ #include "variety.h" #include <mbstring.h> #include "rtinit.h" _WCRTLINKD int __IsDBCS;
#pragma once #include <xenon/ict/unit.h> class itu_unit { public: void register_tests(ict::unit_test<itu_unit> &ut) { ut.add(&itu_unit::host); ut.add(&itu_unit::bit_lengths); ut.add(&itu_unit::splits); ut.add(&itu_unit::sanity); } /* Tests */ void host(); void bit_lengths(); void splits(); void sanity(); };
/****************************************************************************** * The MIT License * * Copyright (c) 2010 LeafLabs LLC. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. *****************************************************************************/ /** * @brief Wire library, ported from Arduino. Provides a lean * interface to I2C (two-wire) communication. */ #include "wirish.h" #ifndef _WIRE_H_ #define _WIRE_H_ #define uint8_t uint8 typedef struct { uint8 scl; uint8 sda; } Port; /* You must update the online docs if you change this value. */ #define WIRE_BUFSIZ 32 /* return codes from endTransmission() */ #define SUCCESS 0 /* transmission was successful */ #define EDATA 1 /* too much data */ #define ENACKADDR 2 /* readd nack on transmit of address */ #define ENACKTRNS 3 /* readd nack on transmit of data */ #define EOTHER 4 /* other error */ #define SDA 20 #define SCL 21 #define I2C_WRITE 0 #define I2C_READ 1 #define I2C_DELAY do{for(int i=0;i<40;i++) {asm volatile("nop");}}while(0) class TwoWire { private: uint8 rx_buf[WIRE_BUFSIZ]; /* read buffer */ uint8 rx_buf_idx; /* first unread idx in rx_buf */ uint8 rx_buf_len; /* number of bytes read */ uint8 tx_addr; /* address transmitting to */ uint8 tx_buf[WIRE_BUFSIZ]; /* transmit buffer */ uint8 tx_buf_idx; /* next idx available in tx_buf, -1 overflow */ boolean tx_buf_overflow; Port port; uint8 writeOneByte(uint8); uint8 readOneByte(uint8, uint8*); public: TwoWire(); void begin(); void begin(uint8, uint8); void beginTransmission(uint8); void beginTransmission(int); uint8 endTransmission(void); uint8 requestFrom(uint8, int); uint8 requestFrom(int, int); void write(uint8); void write(uint8*, int); void write(int); void write(int*, int); void write(char*); uint8 available(); uint8 read(); }; void i2c_start(Port port); void i2c_stop(Port port); boolean i2c_get_ack(Port port); void i2c_write_ack(Port port); void i2c_write_nack(Port port); uint8 i2c_shift_in(Port port); void i2c_shift_out(Port port, uint8 val); extern TwoWire Wire; #endif // _WIRE_H_
// // STDemoRootViewControllerEnum.h // CJStandardProjectDemo // // Created by 李超前 on 10/29/18. // Copyright © 2018 devlproad. All rights reserved. // #ifndef STDemoRootViewControllerEnum_h #define STDemoRootViewControllerEnum_h /** * 启动页类型 */ typedef NS_ENUM(NSUInteger, STDemoRootViewControllerType) { STDemoRootViewControllerTypeNone, STDemoRootViewControllerTypeGuide = 1, /**< 引导页 */ STDemoRootViewControllerTypeLogin, /**< 登录页 */ STDemoRootViewControllerTypeMain, /**< 主页 */ }; #endif /* STDemoRootViewControllerEnum_h */
/*----------------------------------------------------------------------------- * File: sr_router.h * Date: ? * Authors: Guido Apenzeller, Martin Casado, Virkam V. * Contact: casado@stanford.edu * *---------------------------------------------------------------------------*/ #ifndef SR_ROUTER_H #define SR_ROUTER_H #include <netinet/in.h> #include <sys/time.h> #include <stdio.h> #include "sr_protocol.h" #include "sr_arpcache.h" /* we dont like this debug , but what to do for varargs ? */ #ifdef _DEBUG_ #define Debug(x, args...) printf(x, ## args) #define DebugMAC(x) \ do { int ivyl; for(ivyl=0; ivyl<5; ivyl++) printf("%02x:", \ (unsigned char)(x[ivyl])); printf("%02x",(unsigned char)(x[5])); } while (0) #else #define Debug(x, args...) do{}while(0) #define DebugMAC(x) do{}while(0) #endif #define INIT_TTL 255 #define PACKET_DUMP_SIZE 1024 /* forward declare */ struct sr_if; struct sr_rt; /* ---------------------------------------------------------------------------- * struct sr_instance * * Encapsulation of the state for a single virtual router. * * -------------------------------------------------------------------------- */ struct sr_instance { int sockfd; /* socket to server */ char user[32]; /* user name */ char host[32]; /* host name */ char template[30]; /* template name if any */ unsigned short topo_id; struct sockaddr_in sr_addr; /* address to server */ struct sr_if* if_list; /* list of interfaces */ struct sr_rt* routing_table; /* routing table */ struct sr_arpcache cache; /* ARP cache */ pthread_attr_t attr; FILE* logfile; }; /* -- sr_main.c -- */ int sr_verify_routing_table(struct sr_instance* sr); /* -- sr_vns_comm.c -- */ int sr_send_packet(struct sr_instance* , uint8_t* , unsigned int , const char*); int sr_connect_to_server(struct sr_instance* ,unsigned short , char* ); int sr_read_from_server(struct sr_instance* ); /* -- sr_router.c -- */ void sr_init(struct sr_instance* ); void sr_handlepacket(struct sr_instance* , uint8_t * , unsigned int , char* ); /* -- sr_if.c -- */ void sr_add_interface(struct sr_instance* , const char* ); void sr_set_ether_ip(struct sr_instance* , uint32_t ); void sr_set_ether_addr(struct sr_instance* , const unsigned char* ); void sr_print_if_list(struct sr_instance* ); #endif /* SR_ROUTER_H */
#include <stdbool.h> #include "malloc.h" #include "lists.h" #include "stringBuffers.h" #include "sockets.h" //#include "threading.h" int main() //@ : main //@ requires true; //@ ensures true; { struct socket *s = create_client_socket(12345); struct reader *r = socket_get_reader(s); struct writer *w = socket_get_writer(s); bool stop = false; struct string_buffer *line = create_string_buffer(); struct string_buffer *nick = create_string_buffer(); struct string_buffer *text = create_string_buffer(); reader_read_line(r, line); reader_read_line(r, line); writer_write_string(w, "BoT\r\n"); while (!stop) //@ invariant reader(r) &*& writer(w) &*& stop ? emp : string_buffer(line, _) &*& string_buffer(nick, _) &*& string_buffer(text, _); { bool test = true; bool result = false; reader_read_line(r, line); result = string_buffer_split(line, " says: ", nick, text); test = string_buffer_equals_string(nick, "BoT"); if (result && !test) { test = string_buffer_equals_string(text, "!hello"); if (test) { writer_write_string(w, "Hello "); writer_write_string_buffer(w, nick); writer_write_string(w, "!\r\n"); } else { test = string_buffer_equals_string(text, "!quit"); if (test) { writer_write_string(w, "Byebye!\r\n"); stop = true; string_buffer_dispose(line); string_buffer_dispose(nick); string_buffer_dispose(text); } } } } socket_close(s); return 0; }
// // NSWorkspaceHelper.h // Enormego Helpers // // Created by Shaun Harrison on 11/18/09. // Copyright (c) 2009 enormego // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #import <Foundation/Foundation.h> @interface NSWorkspace (Helper) - (void)registerLoginLaunchBundle:(NSBundle*)bundle; - (void)unregisterLoginLaunchBundle:(NSBundle*)bundle; - (void)unregisterLoginLaunchApplication:(NSString*)appName; @end
/* Driver for routine qtrap */ #include <stdio.h> #include <math.h> #define NRANSI #include "nr.h" #define PIO2 1.5707963 /* Test function */ float func(float x) { return x*x*(x*x-2.0)*sin(x); } /* Integral of test function */ float fint(float x) { return 4.0*x*(x*x-7.0)*sin(x)-(pow(x,4.0)-14.0*x*x+28.0)*cos(x); } int main(void) { float a=0.0,b=PIO2,s; printf("Integral of func computed with QTRAP\n\n"); printf("Actual value of integral is %12.6f\n",fint(b)-fint(a)); s=qtrap(func,a,b); printf("Result from routine QTRAP is %12.6f\n",s); return 0; } #undef NRANSI
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #ifndef DYNAMIC_LIBRARY_H #define DYNAMIC_LIBRARY_H #include "azure_c_shared_utility/macro_utils.h" #include "azure_c_shared_utility/umock_c_prod.h" #ifdef __cplusplus extern "C" { #endif typedef void* DYNAMIC_LIBRARY_HANDLE; MOCKABLE_FUNCTION(, DYNAMIC_LIBRARY_HANDLE, DynamicLibrary_LoadLibrary, const char*, dynamicLibraryFileName); MOCKABLE_FUNCTION(, void, DynamicLibrary_UnloadLibrary, DYNAMIC_LIBRARY_HANDLE, libraryHandle); MOCKABLE_FUNCTION(, void*, DynamicLibrary_FindSymbol, DYNAMIC_LIBRARY_HANDLE, libraryHandle, const char*, symbolName); #ifdef __cplusplus } #endif #endif // DYNAMIC_LIBRARY_H
/************************************************************************** * * Copyright 2009-2010 VMware, Inc. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * **************************************************************************/ /** * @file * Softpipe/LLVMpipe support. * * @author Jose Fonseca <jfonseca@vmware.com> */ #include <windows.h> #include "util/u_debug.h" #include "stw_winsys.h" #include "gdi/gdi_sw_winsys.h" #include "softpipe/sp_texture.h" #include "softpipe/sp_screen.h" #include "softpipe/sp_public.h" #ifdef HAVE_LLVMPIPE #include "llvmpipe/lp_texture.h" #include "llvmpipe/lp_screen.h" #include "llvmpipe/lp_public.h" #endif static boolean use_llvmpipe = FALSE; static struct pipe_screen * gdi_screen_create(void) { const char *default_driver; const char *driver; struct pipe_screen *screen = NULL; struct sw_winsys *winsys; winsys = gdi_create_sw_winsys(); if(!winsys) goto no_winsys; #ifdef HAVE_LLVMPIPE default_driver = "llvmpipe"; #else default_driver = "softpipe"; #endif driver = debug_get_option("GALLIUM_DRIVER", default_driver); #ifdef HAVE_LLVMPIPE if (strcmp(driver, "llvmpipe") == 0) { screen = llvmpipe_create_screen( winsys ); } #endif if (screen == NULL) { screen = softpipe_create_screen( winsys ); } else { use_llvmpipe = TRUE; } if(!screen) goto no_screen; return screen; no_screen: winsys->destroy(winsys); no_winsys: return NULL; } static void gdi_present(struct pipe_screen *screen, struct pipe_resource *res, HDC hDC) { /* This will fail if any interposing layer (trace, debug, etc) has * been introduced between the state-trackers and the pipe driver. * * Ideally this would get replaced with a call to * pipe_screen::flush_frontbuffer(). * * Failing that, it may be necessary for intervening layers to wrap * other structs such as this stw_winsys as well... */ struct sw_winsys *winsys = NULL; struct sw_displaytarget *dt = NULL; #ifdef HAVE_LLVMPIPE if (use_llvmpipe) { winsys = llvmpipe_screen(screen)->winsys; dt = llvmpipe_resource(res)->dt; gdi_sw_display(winsys, dt, hDC); return; } #endif winsys = softpipe_screen(screen)->winsys, dt = softpipe_resource(res)->dt, gdi_sw_display(winsys, dt, hDC); } static const struct stw_winsys stw_winsys = { &gdi_screen_create, &gdi_present, NULL, /* get_adapter_luid */ NULL, /* shared_surface_open */ NULL, /* shared_surface_close */ NULL /* compose */ }; BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) { switch (fdwReason) { case DLL_PROCESS_ATTACH: stw_init(&stw_winsys); stw_init_thread(); break; case DLL_THREAD_ATTACH: stw_init_thread(); break; case DLL_THREAD_DETACH: stw_cleanup_thread(); break; case DLL_PROCESS_DETACH: if (lpReserved == NULL) { stw_cleanup_thread(); stw_cleanup(); } break; } return TRUE; }
// // AppDelegate.h // AMTumblrHud // // Created by Mustafin Askar on 23/05/2014. // Copyright (c) 2014 Asich. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; @end
// NSOperation-WebFetches-MadeEasy (TM) // Copyright (C) 2012 by David Hoerl // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // @protocol OperationsRunnerProtocol <NSObject> - (void)operationFinished:(NSOperation *)op; // can get this on main thread (default) or anyThread (flag below) @end
#ifndef Magnum_Implementation_BufferState_h #define Magnum_Implementation_BufferState_h /* This file is part of Magnum. Copyright © 2010, 2011, 2012, 2013, 2014, 2015 Vladimír Vondruš <mosra@centrum.cz> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "Magnum/Buffer.h" namespace Magnum { namespace Implementation { struct BufferState { enum: std::size_t { #ifndef MAGNUM_TARGET_GLES TargetCount = 13+1 #elif !defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL) TargetCount = 8+1 #elif !defined(MAGNUM_TARGET_GLES2) TargetCount = 12+1 #else TargetCount = 2+1 #endif }; /* Target <-> index mapping */ static std::size_t indexForTarget(Buffer::TargetHint target); static const Buffer::TargetHint targetForIndex[TargetCount-1]; explicit BufferState(Context& context, std::vector<std::string>& extensions); void reset(); #ifndef MAGNUM_TARGET_GLES2 void(*bindBasesImplementation)(Buffer::Target, UnsignedInt, Containers::ArrayView<Buffer* const>); void(*bindRangesImplementation)(Buffer::Target, UnsignedInt, Containers::ArrayView<const std::tuple<Buffer*, GLintptr, GLsizeiptr>>); void(*copyImplementation)(Buffer&, Buffer&, GLintptr, GLintptr, GLsizeiptr); #endif void(Buffer::*createImplementation)(); void(Buffer::*getParameterImplementation)(GLenum, GLint*); #ifndef MAGNUM_TARGET_GLES2 void(Buffer::*getSubDataImplementation)(GLintptr, GLsizeiptr, GLvoid*); #endif void(Buffer::*dataImplementation)(GLsizeiptr, const GLvoid*, BufferUsage); void(Buffer::*subDataImplementation)(GLintptr, GLsizeiptr, const GLvoid*); void(Buffer::*invalidateImplementation)(); void(Buffer::*invalidateSubImplementation)(GLintptr, GLsizeiptr); #ifndef MAGNUM_TARGET_WEBGL void*(Buffer::*mapImplementation)(Buffer::MapAccess); void*(Buffer::*mapRangeImplementation)(GLintptr, GLsizeiptr, Buffer::MapFlags); void(Buffer::*flushMappedRangeImplementation)(GLintptr, GLsizeiptr); bool(Buffer::*unmapImplementation)(); #endif /* Currently bound buffer for all targets */ GLuint bindings[TargetCount]; /* Limits */ #ifndef MAGNUM_TARGET_GLES2 GLint #ifndef MAGNUM_TARGET_GLES minMapAlignment, #endif #ifndef MAGNUM_TARGET_WEBGL maxAtomicCounterBindings, maxShaderStorageBindings, shaderStorageOffsetAlignment, #endif uniformOffsetAlignment, maxUniformBindings; #endif }; }} #endif
/* * Copyright (c) 2009, 2010, 2011, ETH Zurich. * All rights reserved. * * This file is distributed under the terms in the attached LICENSE file. * If you do not find this file, copies can be found by writing to: * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group. */ #include <stdlib.h> #include <stdio.h> #include <assert.h> #include <stdint.h> #include <omp.h> #include <arch/x86/barrelfish_kpi/asm_inlines_arch.h> #define GANG_SCHEDULING #undef MEASURE_SYNC #define MEASURE #define WORK_PERIOD 5000000000UL #define STACK_SIZE (64 * 1024) int main(int argc, char *argv[]) { uint64_t now, start; volatile uint64_t workcnt, workload = 0; int64_t workmax = 1000; int64_t i; if(argc == 1) { printf("calibrating...\n"); do { workload = 0; workmax *= 2; start = rdtsc(); #pragma omp parallel private(i,workload) for(i = 0; i < workmax; i++) { #pragma omp barrier workload++; } now = rdtsc(); } while(now - start < WORK_PERIOD); printf("workmax = %ld\n", workmax); return 0; } else { workmax = atol(argv[1]); } int nthreads = omp_get_max_threads(); if(argc == 3) { nthreads = atoi(argv[2]); assert(!"REVISE!!!"); bomp_bomp_init(nthreads); omp_set_num_threads(nthreads); } printf("threads %d, workmax %ld, CPUs %d\n", nthreads, workmax, omp_get_num_procs()); #ifdef MEASURE_SYNC uint64_t waits[16] = { 0, 1000, 1000000, 1000000000, 500, 5000000, 5000000000, 3000000, 0, 1000, 1000000, 1000000000, 500, 5000000, 5000000000, 3000000 }; uint64_t ts[16][10]; printf("before sync:\n"); #pragma omp parallel private(workcnt) { for(int j = 0; j < waits[omp_get_thread_num()]; j++) { workcnt++; } for(int j = 0; j < 10; j++) { ts[omp_get_thread_num()][j] = rdtsc(); } } for(int j = 0; j < 10; j++) { printf("timestamp %d: ", j); for(int n = 1; n < nthreads; n++) { printf("%ld ", ts[n][j] - ts[n - 1][j]); } printf("\n"); } printf("after sync:\n"); #pragma omp parallel { bomp_synchronize(); for(int j = 0; j < 10; j++) { ts[omp_get_thread_num()][j] = rdtsc(); } } for(int j = 0; j < 10; j++) { printf("timestamp %d: ", j); for(int n = 1; n < nthreads; n++) { printf("%ld ", ts[n][j] - ts[n - 1][j]); } printf("\n"); } #endif #ifdef GANG_SCHEDULING #pragma omp parallel { // bomp_synchronize(); } #endif start = rdtsc(); #ifdef MEASURE # define MAXTHREADS 16 # define WORKMAX 10000 static uint64_t starta[MAXTHREADS][WORKMAX]; static uint64_t end1[MAXTHREADS][WORKMAX]; static uint64_t end2[MAXTHREADS][WORKMAX]; #endif // Do some work #pragma omp parallel private(workcnt,i) for(i = 0; i < workmax; i++) { #ifdef MEASURE starta[omp_get_thread_num()][i < WORKMAX ? i : WORKMAX] = rdtsc(); #endif workcnt++; #ifdef MEASURE end1[omp_get_thread_num()][i < WORKMAX ? i : WORKMAX] = rdtsc(); #endif #pragma omp barrier #ifdef MEASURE end2[omp_get_thread_num()][i < WORKMAX ? i : WORKMAX] = rdtsc(); #endif } now = rdtsc(); #ifdef MEASURE printf("avg compute time: "); for(int n = 0; n < nthreads; n++) { uint64_t sum = 0, min = end1[0][0], max = 0; for(i = 0; i < WORKMAX; i++) { uint64_t val = end1[n][i] - starta[n][i]; sum += val; min = val < min ? val : min; max = val > max ? val : max; } printf("%lu(%lu,%lu) ", sum / WORKMAX, min, max); } printf("\n"); #if 0 printf("wait time dump:\n"); for(i = 0; i < WORKMAX; i++) { for(int n = 0; n < nthreads; n++) { uint64_t val = end2[n][i] - end1[n][i]; printf("%lu ", val); } printf("\n"); } #endif printf("avg wait time: "); for(int n = 0; n < nthreads; n++) { uint64_t sum = 0, min = end2[0][0], max = 0; for(i = 0; i < WORKMAX; i++) { uint64_t val = end2[n][i] - end1[n][i]; sum += val; min = val < min ? val : min; max = val > max ? val : max; } printf("%lu(%lu,%lu) ", sum / WORKMAX, min, max); } printf("\n"); #endif printf("%s: threads %d, compute time %lu ticks\n", argv[0], nthreads, now - start); for(;;); return 0; }
// This is a part of the Microsoft Foundation Classes C++ library. // Copyright (C) Microsoft Corporation // All rights reserved. // // This source code is only intended as a supplement to the // Microsoft Foundation Classes Reference and related // electronic documentation provided with the library. // See these sources for detailed information regarding the // Microsoft Foundation Classes product. #pragma once #include "afxcontrolbarutil.h" #include "afxdockablepane.h" #ifdef _AFX_PACKING #pragma pack(push, _AFX_PACKING) #endif #ifdef _AFX_MINREBUILD #pragma component(minrebuild, off) #endif ///////////////////////////////////////////////////////////////////////////// // CDockablePaneAdapter window class CDockablePaneAdapter : public CDockablePane { DECLARE_SERIAL(CDockablePaneAdapter); // Construction public: CDockablePaneAdapter(); // Attributes public: CRect m_rectInitial; DWORD m_dwEnabledAlignmentInitial; // Operations public: virtual BOOL SetWrappedWnd(CWnd* pWnd); virtual CWnd* GetWrappedWnd() const { return m_pWnd; } virtual BOOL LoadState(LPCTSTR lpszProfileName = NULL, int nIndex = -1, UINT uiID = (UINT) -1); virtual BOOL SaveState(LPCTSTR lpszProfileName = NULL, int nIndex = -1, UINT uiID = (UINT) -1); // Implementation public: virtual ~CDockablePaneAdapter(); protected: //{{AFX_MSG(CDockablePaneAdapter) afx_msg void OnSize(UINT nType, int cx, int cy); //}}AFX_MSG DECLARE_MESSAGE_MAP() protected: CWnd* m_pWnd; }; #ifdef _AFX_MINREBUILD #pragma component(minrebuild, on) #endif #ifdef _AFX_PACKING #pragma pack(pop) #endif
// // CTimeHierarchy.h // CMIDI // // Created by CHARLES GILLINGHAM on 9/8/15. // Copyright (c) 2015 CharlesGillingham. All rights reserved. // #import <Foundation/Foundation.h> #import "CTime.h" @interface CTimeHierarchy : NSObject <NSCopying, NSCoding> @property (readonly) NSArray * branchCounts; // Not needed. - (NSUInteger) depth; // Number of timeLines - (NSUInteger) maxTimeLine; // Highest timeLine - (id) initWithBranchCounts: (NSArray *) branchCounts offsets: (NSArray *) offsets NS_DESIGNATED_INITIALIZER; - (id) initWithBranchCounts: (NSArray *) branchCounts; // ----------------------------------------------------------------------------- #pragma mark Time Conversions // ----------------------------------------------------------------------------- // Convert times between representations on various levels // Note that time conversions to higher time lines are not typically reversible: details are lost. - (CTime) AsPerB: (CTimeLine) timeLineA : (CTimeLine) timeLineB; - (CTime) convertTime: (CTime) time from: (CTimeLine) timeLineA to: (CTimeLine) timeLineB; // ----------------------------------------------------------------------------- #pragma mark Time Signal // ----------------------------------------------------------------------------- // Time signals // A time signal is like an odometer, e.g // @[bars, beat since bar started, 8ths since beat started, ticks since 8th, nanoseconds since tick] // Or, similarly // @[week, day of week, hour of day, minute of hour, second in minute, nanonsecond in second] - (NSArray *) timeSignalForTime: (CTime) time timeLine: (CTimeLine) timeLine; - (CTime) timeOnTimeLine: (CTimeLine) timeLine fromTimeSignal: (NSArray *) timeSignal; // ----------------------------------------------------------------------------- #pragma mark Time strength // ----------------------------------------------------------------------------- // A measure of the "importance" of a moment in time. E.g. time strength on a bar line is higher than that of an an upbeat eighth. // If the timeStrength = S, then all relative times at levels L < S will be 0. // If you retreive a time at level L, then the time strength S will be greater than or equal to L. - (NSUInteger) timeStrengthOfTime: (CTime) time timeLine: (CTimeLine) timeLine; // ----------------------------------------------------------------------------- #pragma mark Change branch count // ----------------------------------------------------------------------------- // Do not use these routines if the time hierarchy is part of a time map. Make changes to branch counts using the time map. // Set the branch count, and reset the offsets so that [self timeAtLevel: outLevel withTime: B atLevel: levelA+1] is stays the same for all "outLevels". Used by the time map adding meter/tempo changes to a time map at time B -- the total times at B will stay exactly the same, regardless if retrieve them from the previous hierarchy or the following hierarchy. - (void) setBranchCount: (CTime) AsPerB atLevel: (CTimeLine) levelA withTimeFixedAt: (CTime) B; // Where levelB = levelA+1 // Set the branch count directly. Used by the time map for setting branch count changes for time period 0. - (void) setBranchCount: (CTime) AsPerB atLevel: (CTimeLine) levelA; @end
// // CreditCardInputViewController.h // BitStore // // Created by Dylan Marriott on 26.07.14. // Copyright (c) 2014 Dylan Marriott. All rights reserved. // #import <Foundation/Foundation.h> @class Order; @interface CreditCardInputViewController : UITableViewController - (id)init UNAVAILABLE_ATTRIBUTE; - (id)initWithStyle:(UITableViewStyle)style UNAVAILABLE_ATTRIBUTE; - (id)initWithOrder:(Order *)order; @end
/* * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include <openssl/opensslv.h> #ifdef __cplusplus extern "C" { #endif #ifdef OPENSSL_ALGORITHM_DEFINES # error OPENSSL_ALGORITHM_DEFINES no longer supported #endif /* * OpenSSL was configured with the following options: */ #ifndef OPENSSL_SYS_AIX # define OPENSSL_SYS_AIX 1 #endif #ifndef OPENSSL_NO_COMP # define OPENSSL_NO_COMP #endif #ifndef OPENSSL_NO_MD2 # define OPENSSL_NO_MD2 #endif #ifndef OPENSSL_NO_RC5 # define OPENSSL_NO_RC5 #endif #ifndef OPENSSL_THREADS # define OPENSSL_THREADS #endif #ifndef OPENSSL_RAND_SEED_OS # define OPENSSL_RAND_SEED_OS #endif #ifndef OPENSSL_NO_AFALGENG # define OPENSSL_NO_AFALGENG #endif #ifndef OPENSSL_NO_ASAN # define OPENSSL_NO_ASAN #endif #ifndef OPENSSL_NO_ASM # define OPENSSL_NO_ASM #endif #ifndef OPENSSL_NO_CRYPTO_MDEBUG # define OPENSSL_NO_CRYPTO_MDEBUG #endif #ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE # define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE #endif #ifndef OPENSSL_NO_DEVCRYPTOENG # define OPENSSL_NO_DEVCRYPTOENG #endif #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 # define OPENSSL_NO_EC_NISTP_64_GCC_128 #endif #ifndef OPENSSL_NO_EGD # define OPENSSL_NO_EGD #endif #ifndef OPENSSL_NO_EXTERNAL_TESTS # define OPENSSL_NO_EXTERNAL_TESTS #endif #ifndef OPENSSL_NO_FUZZ_AFL # define OPENSSL_NO_FUZZ_AFL #endif #ifndef OPENSSL_NO_FUZZ_LIBFUZZER # define OPENSSL_NO_FUZZ_LIBFUZZER #endif #ifndef OPENSSL_NO_HEARTBEATS # define OPENSSL_NO_HEARTBEATS #endif #ifndef OPENSSL_NO_MSAN # define OPENSSL_NO_MSAN #endif #ifndef OPENSSL_NO_SCTP # define OPENSSL_NO_SCTP #endif #ifndef OPENSSL_NO_SSL3 # define OPENSSL_NO_SSL3 #endif #ifndef OPENSSL_NO_SSL3_METHOD # define OPENSSL_NO_SSL3_METHOD #endif #ifndef OPENSSL_NO_UBSAN # define OPENSSL_NO_UBSAN #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif #ifndef OPENSSL_NO_WEAK_SSL_CIPHERS # define OPENSSL_NO_WEAK_SSL_CIPHERS #endif #ifndef OPENSSL_NO_DYNAMIC_ENGINE # define OPENSSL_NO_DYNAMIC_ENGINE #endif /* * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers * don't like that. This will hopefully silence them. */ #define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy; /* * Applications should use -DOPENSSL_API_COMPAT=<version> to suppress the * declarations of functions deprecated in or before <version>. Otherwise, they * still won't see them if the library has been built to disable deprecated * functions. */ #ifndef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f; # ifdef __GNUC__ # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif # elif defined(__SUNPRO_C) # if (__SUNPRO_C >= 0x5130) # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif # endif #endif #ifndef OPENSSL_FILE # ifdef OPENSSL_NO_FILENAMES # define OPENSSL_FILE "" # define OPENSSL_LINE 0 # else # define OPENSSL_FILE __FILE__ # define OPENSSL_LINE __LINE__ # endif #endif #ifndef OPENSSL_MIN_API # define OPENSSL_MIN_API 0 #endif #if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API # undef OPENSSL_API_COMPAT # define OPENSSL_API_COMPAT OPENSSL_MIN_API #endif /* * Do not deprecate things to be deprecated in version 1.2.0 before the * OpenSSL version number matches. */ #if OPENSSL_VERSION_NUMBER < 0x10200000L # define DEPRECATEDIN_1_2_0(f) f; #elif OPENSSL_API_COMPAT < 0x10200000L # define DEPRECATEDIN_1_2_0(f) DECLARE_DEPRECATED(f) #else # define DEPRECATEDIN_1_2_0(f) #endif #if OPENSSL_API_COMPAT < 0x10100000L # define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f) #else # define DEPRECATEDIN_1_1_0(f) #endif #if OPENSSL_API_COMPAT < 0x10000000L # define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f) #else # define DEPRECATEDIN_1_0_0(f) #endif #if OPENSSL_API_COMPAT < 0x00908000L # define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f) #else # define DEPRECATEDIN_0_9_8(f) #endif /* Generate 80386 code? */ #undef I386_ONLY #undef OPENSSL_UNISTD #define OPENSSL_UNISTD <unistd.h> #undef OPENSSL_EXPORT_VAR_AS_FUNCTION /* * The following are cipher-specific, but are part of the public API. */ #if !defined(OPENSSL_SYS_UEFI) # define BN_LLONG /* Only one for the following should be defined */ # undef SIXTY_FOUR_BIT_LONG # undef SIXTY_FOUR_BIT # define THIRTY_TWO_BIT #endif #define RC4_INT unsigned char #ifdef __cplusplus } #endif
// // ScottShowAlertView.h // QQLive // // Created by Scott_Mr on 2016/12/3. // Copyright © 2016年 Scott. All rights reserved. // #import <UIKit/UIKit.h> @interface ScottShowAlertView : UIView @property (nonatomic, weak, readonly) UIView *alertView; @property (nonatomic, strong) UIView *backgroundView; // 是否可以点击背景消失(默认为NO) @property (nonatomic, assign) BOOL tapBackgroundDismissEnable; // Default is 15 @property (nonatomic, assign) CGFloat alertViewMargin; // Default centerY @property (nonatomic, assign) CGFloat alertOriginY; // 初始化 + (instancetype)alertViewWithView:(UIView *)view; // 显示方式 + (void)showAlertViewWithView:(UIView *)alertView; + (void)showAlertViewWithView:(UIView *)alertView backgroundDismissEnable:(BOOL)backgroundDismissEnable; + (void)showAlertViewWithView:(UIView *)alertView withOriginY:(CGFloat)originY; + (void)showAlertViewWithView:(UIView *)alertView withOriginY:(CGFloat)originY backgroundDismissEnable:(BOOL)backgroundDismissEnable; - (void)show; - (void)dismiss; @end
#if !defined (_win_clip_h_) #define _win_clip_h_ /* * Copyright 1999 by Abacus Research and Development, Inc. * All rights reserved. */ #if defined (SDL) extern void write_pict_as_dib_to_clipboard (void); extern void write_surfp_to_clipboard (SDL_Surface *surfp); extern unsigned long ROMlib_executor_format (LONGINT type); extern void write_pict_as_dib_to_clipboard (void); extern void write_pict_as_pict_to_clipboard (void); #endif #endif
// Copy <array> to the device void bones_copy<direction>_<id>_<array>(<definition>) { cudaStreamSynchronize(kernel_stream); bones_memcpy(device_<array>, <array><flatten>, <variable_dimensions>*sizeof(<type>), cudaMemcpyHostToDevice, <state>, <index>); }
// // GJGCRecentChatDataManager.h // ZYChat // // Created by ZYVincent QQ:1003081775 on 15/11/18. // Copyright (c) 2015年 ZYProSoft. QQ群:219357847 All rights reserved. // #import <Foundation/Foundation.h> #import "GJGCRecentChatModel.h" #import "GJGCRecentChatTitleView.h" @class GJGCRecentChatDataManager; @protocol GJGCRecentChatDataManagerDelegate <NSObject> - (void)dataManagerRequireRefresh:(GJGCRecentChatDataManager *)dataManager; - (void)dataManagerRequireRefresh:(GJGCRecentChatDataManager *)dataManager requireDeletePaths:(NSArray *)paths; - (void)dataManager:(GJGCRecentChatDataManager *)dataManager requireUpdateTitleViewState:(GJGCRecentChatConnectState)connectState; - (BOOL)dataManagerRequireKnownViewIsShowing:(GJGCRecentChatDataManager *)dataManager; @end @interface GJGCRecentChatDataManager : NSObject @property (nonatomic,readonly)NSInteger totalCount; @property (nonatomic,weak)id<GJGCRecentChatDataManagerDelegate> delegate; - (GJGCRecentChatModel *)contentModelAtIndexPath:(NSIndexPath *)indexPath; - (CGFloat)contentHeightAtIndexPath:(NSIndexPath *)indexPath; - (void)deleteConversationAtIndexPath:(NSIndexPath *)indexPath; - (void)loadRecentConversations; - (NSArray *)allConversationModels; + (BOOL)isConversationHasBeenExist:(NSString *)chatter; @end
//****************************************************************************** // // Copyright (c) 2015 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // //****************************************************************************** // WindowsWeb.h // Generated from winmd2objc #pragma once #include "interopBase.h" @class WWWebError; @protocol WWIUriToStreamResolver , WWIWebErrorStatics; // Windows.Web.WebErrorStatus enum _WWWebErrorStatus { WWWebErrorStatusUnknown = 0, WWWebErrorStatusCertificateCommonNameIsIncorrect = 1, WWWebErrorStatusCertificateExpired = 2, WWWebErrorStatusCertificateContainsErrors = 3, WWWebErrorStatusCertificateRevoked = 4, WWWebErrorStatusCertificateIsInvalid = 5, WWWebErrorStatusServerUnreachable = 6, WWWebErrorStatusTimeout = 7, WWWebErrorStatusErrorHttpInvalidServerResponse = 8, WWWebErrorStatusConnectionAborted = 9, WWWebErrorStatusConnectionReset = 10, WWWebErrorStatusDisconnected = 11, WWWebErrorStatusHttpToHttpsOnRedirection = 12, WWWebErrorStatusHttpsToHttpOnRedirection = 13, WWWebErrorStatusCannotConnect = 14, WWWebErrorStatusHostNameNotResolved = 15, WWWebErrorStatusOperationCanceled = 16, WWWebErrorStatusRedirectFailed = 17, WWWebErrorStatusUnexpectedStatusCode = 18, WWWebErrorStatusUnexpectedRedirection = 19, WWWebErrorStatusUnexpectedClientError = 20, WWWebErrorStatusUnexpectedServerError = 21, WWWebErrorStatusMultipleChoices = 300, WWWebErrorStatusMovedPermanently = 301, WWWebErrorStatusFound = 302, WWWebErrorStatusSeeOther = 303, WWWebErrorStatusNotModified = 304, WWWebErrorStatusUseProxy = 305, WWWebErrorStatusTemporaryRedirect = 307, WWWebErrorStatusBadRequest = 400, WWWebErrorStatusUnauthorized = 401, WWWebErrorStatusPaymentRequired = 402, WWWebErrorStatusForbidden = 403, WWWebErrorStatusNotFound = 404, WWWebErrorStatusMethodNotAllowed = 405, WWWebErrorStatusNotAcceptable = 406, WWWebErrorStatusProxyAuthenticationRequired = 407, WWWebErrorStatusRequestTimeout = 408, WWWebErrorStatusConflict = 409, WWWebErrorStatusGone = 410, WWWebErrorStatusLengthRequired = 411, WWWebErrorStatusPreconditionFailed = 412, WWWebErrorStatusRequestEntityTooLarge = 413, WWWebErrorStatusRequestUriTooLong = 414, WWWebErrorStatusUnsupportedMediaType = 415, WWWebErrorStatusRequestedRangeNotSatisfiable = 416, WWWebErrorStatusExpectationFailed = 417, WWWebErrorStatusInternalServerError = 500, WWWebErrorStatusNotImplemented = 501, WWWebErrorStatusBadGateway = 502, WWWebErrorStatusServiceUnavailable = 503, WWWebErrorStatusGatewayTimeout = 504, WWWebErrorStatusHttpVersionNotSupported = 505, }; typedef unsigned WWWebErrorStatus; #include "WindowsStorageStreams.h" #include "WindowsFoundation.h" // Windows.Web.IUriToStreamResolver #ifndef __WWIUriToStreamResolver_DEFINED__ #define __WWIUriToStreamResolver_DEFINED__ @protocol WWIUriToStreamResolver - (void)uriToStreamAsync:(WFUri*)uri success:(void (^)(RTObject<WSSIInputStream>*))success failure:(void (^)(NSError*))failure; @end #endif // __WWIUriToStreamResolver_DEFINED__ // Windows.Web.WebError #ifndef __WWWebError_DEFINED__ #define __WWWebError_DEFINED__ WINRT_EXPORT @interface WWWebError : RTObject + (WWWebErrorStatus)getStatus:(int)hresult; @end #endif // __WWWebError_DEFINED__
/* * compound.h * * Created on: Jan 14, 2015 * Author: radoslav */ #ifndef COMPOUND_H_ #define COMPOUND_H_ #include "statement.h" #include <vector> class CallStackFrame {}; class CompoundStatement : public Statement { friend class CallStackFrame; std::vector<Statement> body; public: CompoundStatement() {} CompoundStatement(const char*); std::vector<Statement>::const_iterator getIterator() const { return body.begin(); } }; #endif /* COMPOUND_H_ */
#ifndef REQUEST_H #define REQUEST_H #include "response.h" #include "QThread" #include <QTcpServer> #include <QFile> #include <QStringList> #include <QTimer> #include <database.h> class Request: public QThread { Q_OBJECT public: Request(int socketDescriptor, QObject* parent = 0); virtual void run(); private: int socketDescriptor; QTcpSocket* socket; Database* redis; bool keep_alive; int keep_alive_timeout; QTimer* keep_alive_timer; QMap<QString, QString> request_header, response_header; int response_code; QString response_filename; Response* response; static bool s_initialized; static QString s_root_path; static QStringList s_index; static bool s_dir_listing; static bool s_keep_alive_enable; static bool s_keep_alive_default; static int s_keep_alive_timeout; static int s_keep_alive_timeout_max; void clearStatus(); bool getRequestHeader(); void tryResponseFile(QString filename); static void initialize(); public slots: void onReadyRead(); void onDisconnected(); void onTimeout(); }; #endif // REQUEST_H
/*************************************************************** * Generated by Hottentot CC Generator * Date: 02-05-2016 05:18:41 * Name: user.h * Description: * This file contains definition of User class. ***************************************************************/ #ifndef _NAEEM_HOTTENTOT_EXAMPLES_AUTH__USER_H_ #define _NAEEM_HOTTENTOT_EXAMPLES_AUTH__USER_H_ #include <string> #include <org/labcrypto/hottentot/primitives.h> #include "enums.h" namespace naeem { namespace hottentot { namespace examples { namespace auth { class User : public ::org::labcrypto::hottentot::Serializable { public: User() { } User(const User &); User(User *); virtual ~User() {} public: inline ::org::labcrypto::hottentot::Utf8String GetName() const { return name_; } inline void SetName(::org::labcrypto::hottentot::Utf8String name) { name_ = name; } inline ::org::labcrypto::hottentot::Utf8String GetFamily() const { return family_; } inline void SetFamily(::org::labcrypto::hottentot::Utf8String family) { family_ = family; } inline ::org::labcrypto::hottentot::UInt8 GetAge() const { return age_; } inline void SetAge(::org::labcrypto::hottentot::UInt8 age) { age_ = age; } public: virtual unsigned char * Serialize(uint32_t * /* Pointer to length */); virtual void Deserialize(unsigned char * /* Data */, uint32_t /* Data length */); private: ::org::labcrypto::hottentot::Utf8String name_; ::org::labcrypto::hottentot::Utf8String family_; ::org::labcrypto::hottentot::UInt8 age_; }; } // END OF NAMESPACE auth } // END OF NAMESPACE examples } // END OF NAMESPACE hottentot } // END OF NAMESPACE naeem #endif
#include <stdio.h> #include <math.h> void integerPower(int y, int *base1, int *base2, int *base3, int *total) { *base1 = pow(y, 2); *base2 = pow(y, 3); *base3 = pow(y, 4); *total = *base1 + *base2 + *base3; } int main(void) { int base1, base2, base3, total; integerPower(5, &base1, &base2, &base3, &total); printf("%d\n", base1); printf("%d\n", base2); printf("%d\n", base3); printf("%d\n", total); } //https://pt.stackoverflow.com/q/171149/101
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #include <stdio.h> #include <libc/file.h> #include <libc/stdiohk.h> FILE __dj_stdout = { 0, 0, 0, 0, _IOWRT | _IOFBF, 1 };
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// /// Copyright 2009 Aurora Feint, Inc. /// /// Licensed under the Apache License, Version 2.0 (the "License"); /// you may not use this file except in compliance with the License. /// You may obtain a copy of the License at /// /// http://www.apache.org/licenses/LICENSE-2.0 /// /// Unless required by applicable law or agreed to in writing, software /// distributed under the License is distributed on an "AS IS" BASIS, /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// See the License for the specific language governing permissions and /// limitations under the License. /// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #pragma once #include "OFSmartObject.h" class OFViewDataMap; class OFViewDataSetter : public OFSmartObject { public: OFViewDataSetter(UIView* targetView, OFViewDataMap* fieldMap); void setField(NSString* fieldName, NSString* value); bool isValidField(NSString* fieldName) const; private: typedef void (OFViewDataSetter::*UIViewValueSetter)(UIView* targetView, NSString* value) const; struct UITypeAndSetter { Class uiClassType; UIViewValueSetter setter; }; #if defined(_UNITTEST) static const unsigned int sNumSetters = 2; #else static const unsigned int sNumSetters = 1; #endif static const UITypeAndSetter sAvailableSetters[sNumSetters]; void setValueUILabel(UIView* targetView, NSString* value) const; #if defined(_UNITTEST) void setValueUIMockLabel(UIView* targetView, NSString* value) const; #endif OFRetainedPtr<UIView> mTargetView; OFPointer<OFViewDataMap> mFieldMap; };
void DynamicProgrammingQ2(double *Q1, double *T1, double *Q2, double *T2, int m1, int n1, int n2, double *tv1, double *tv2, int n1v, int n2v, double *G, double *T, double *size, double lam1);
/* lsSnpPdb.c was originally generated by the autoSql program, which also * generated lsSnpPdb.h and lsSnpPdb.sql. This module links the database and * the RAM representation of objects. */ /* Copyright (C) 2014 The Regents of the University of California * See README in this or parent directory for licensing information. */ #include "common.h" #include "linefile.h" #include "dystring.h" #include "jksql.h" #include "lsSnpPdb.h" /* definitions for structType column */ static char *values_structType[] = {"XRay", "NMR", NULL}; static struct hash *valhash_structType = NULL; void lsSnpPdbStaticLoad(char **row, struct lsSnpPdb *ret) /* Load a row from lsSnpPdb table into ret. The contents of ret will * be replaced at the next call to this function. */ { ret->protId = row[0]; ret->pdbId = row[1]; ret->structType = sqlEnumParse(row[2], values_structType, &valhash_structType); ret->chain = row[3][0]; ret->snpId = row[4]; ret->snpPdbLoc = sqlSigned(row[5]); } struct lsSnpPdb *lsSnpPdbLoad(char **row) /* Load a lsSnpPdb from row fetched with select * from lsSnpPdb * from database. Dispose of this with lsSnpPdbFree(). */ { struct lsSnpPdb *ret; AllocVar(ret); ret->protId = cloneString(row[0]); ret->pdbId = cloneString(row[1]); ret->structType = sqlEnumParse(row[2], values_structType, &valhash_structType); ret->chain = row[3][0]; ret->snpId = cloneString(row[4]); ret->snpPdbLoc = sqlSigned(row[5]); return ret; } struct lsSnpPdb *lsSnpPdbLoadAll(char *fileName) /* Load all lsSnpPdb from a whitespace-separated file. * Dispose of this with lsSnpPdbFreeList(). */ { struct lsSnpPdb *list = NULL, *el; struct lineFile *lf = lineFileOpen(fileName, TRUE); char *row[6]; while (lineFileRow(lf, row)) { el = lsSnpPdbLoad(row); slAddHead(&list, el); } lineFileClose(&lf); slReverse(&list); return list; } struct lsSnpPdb *lsSnpPdbLoadAllByChar(char *fileName, char chopper) /* Load all lsSnpPdb from a chopper separated file. * Dispose of this with lsSnpPdbFreeList(). */ { struct lsSnpPdb *list = NULL, *el; struct lineFile *lf = lineFileOpen(fileName, TRUE); char *row[6]; while (lineFileNextCharRow(lf, chopper, row, ArraySize(row))) { el = lsSnpPdbLoad(row); slAddHead(&list, el); } lineFileClose(&lf); slReverse(&list); return list; } struct lsSnpPdb *lsSnpPdbCommaIn(char **pS, struct lsSnpPdb *ret) /* Create a lsSnpPdb out of a comma separated string. * This will fill in ret if non-null, otherwise will * return a new lsSnpPdb */ { char *s = *pS; if (ret == NULL) AllocVar(ret); ret->protId = sqlStringComma(&s); ret->pdbId = sqlStringComma(&s); ret->structType = sqlEnumComma(&s, values_structType, &valhash_structType); sqlFixedStringComma(&s, &(ret->chain), sizeof(ret->chain)); ret->snpId = sqlStringComma(&s); ret->snpPdbLoc = sqlSignedComma(&s); *pS = s; return ret; } void lsSnpPdbFree(struct lsSnpPdb **pEl) /* Free a single dynamically allocated lsSnpPdb such as created * with lsSnpPdbLoad(). */ { struct lsSnpPdb *el; if ((el = *pEl) == NULL) return; freeMem(el->protId); freeMem(el->pdbId); freeMem(el->snpId); freez(pEl); } void lsSnpPdbFreeList(struct lsSnpPdb **pList) /* Free a list of dynamically allocated lsSnpPdb's */ { struct lsSnpPdb *el, *next; for (el = *pList; el != NULL; el = next) { next = el->next; lsSnpPdbFree(&el); } *pList = NULL; } void lsSnpPdbOutput(struct lsSnpPdb *el, FILE *f, char sep, char lastSep) /* Print out lsSnpPdb. Separate fields with sep. Follow last field with lastSep. */ { if (sep == ',') fputc('"',f); fprintf(f, "%s", el->protId); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->pdbId); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); sqlEnumPrint(f, el->structType, values_structType); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%c", el->chain); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->snpId); if (sep == ',') fputc('"',f); fputc(sep,f); fprintf(f, "%d", el->snpPdbLoc); fputc(lastSep,f); } /* -------------------------------- End autoSql Generated Code -------------------------------- */
// Copyright (c) 2011-2021 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_OPTIONSMODEL_H #define BITCOIN_QT_OPTIONSMODEL_H #include <cstdint> #include <qt/guiconstants.h> #include <QAbstractListModel> #include <assert.h> namespace interfaces { class Node; } extern const char *DEFAULT_GUI_PROXY_HOST; static constexpr uint16_t DEFAULT_GUI_PROXY_PORT = 9050; /** * Convert configured prune target MiB to displayed GB. Round up to avoid underestimating max disk usage. */ static inline int PruneMiBtoGB(int64_t mib) { return (mib * 1024 * 1024 + GB_BYTES - 1) / GB_BYTES; } /** * Convert displayed prune target GB to configured MiB. Round down so roundtrip GB -> MiB -> GB conversion is stable. */ static inline int64_t PruneGBtoMiB(int gb) { return gb * GB_BYTES / 1024 / 1024; } /** Interface from Qt to configuration data structure for Bitcoin client. To Qt, the options are presented as a list with the different options laid out vertically. This can be changed to a tree once the settings become sufficiently complex. */ class OptionsModel : public QAbstractListModel { Q_OBJECT public: explicit OptionsModel(QObject *parent = nullptr, bool resetSettings = false); enum OptionID { StartAtStartup, // bool ShowTrayIcon, // bool MinimizeToTray, // bool MapPortUPnP, // bool MapPortNatpmp, // bool MinimizeOnClose, // bool ProxyUse, // bool ProxyIP, // QString ProxyPort, // int ProxyUseTor, // bool ProxyIPTor, // QString ProxyPortTor, // int DisplayUnit, // BitcoinUnits::Unit ThirdPartyTxUrls, // QString Language, // QString UseEmbeddedMonospacedFont, // bool CoinControlFeatures, // bool SubFeeFromAmount, // bool ThreadsScriptVerif, // int Prune, // bool PruneSize, // int DatabaseCache, // int ExternalSignerPath, // QString SpendZeroConfChange, // bool Listen, // bool Server, // bool OptionIDRowCount, }; void Init(bool resetSettings = false); void Reset(); int rowCount(const QModelIndex & parent = QModelIndex()) const override; QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override; bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole) override; /** Updates current unit in memory, settings and emits displayUnitChanged(newUnit) signal */ void setDisplayUnit(const QVariant &value); /* Explicit getters */ bool getShowTrayIcon() const { return m_show_tray_icon; } bool getMinimizeToTray() const { return fMinimizeToTray; } bool getMinimizeOnClose() const { return fMinimizeOnClose; } int getDisplayUnit() const { return nDisplayUnit; } QString getThirdPartyTxUrls() const { return strThirdPartyTxUrls; } bool getUseEmbeddedMonospacedFont() const { return m_use_embedded_monospaced_font; } bool getCoinControlFeatures() const { return fCoinControlFeatures; } bool getSubFeeFromAmount() const { return m_sub_fee_from_amount; } const QString& getOverriddenByCommandLine() { return strOverriddenByCommandLine; } /* Explicit setters */ void SetPruneEnabled(bool prune, bool force = false); void SetPruneTargetGB(int prune_target_gb, bool force = false); /* Restart flag helper */ void setRestartRequired(bool fRequired); bool isRestartRequired() const; interfaces::Node& node() const { assert(m_node); return *m_node; } void setNode(interfaces::Node& node) { assert(!m_node); m_node = &node; } private: interfaces::Node* m_node = nullptr; /* Qt-only settings */ bool m_show_tray_icon; bool fMinimizeToTray; bool fMinimizeOnClose; QString language; int nDisplayUnit; QString strThirdPartyTxUrls; bool m_use_embedded_monospaced_font; bool fCoinControlFeatures; bool m_sub_fee_from_amount; /* settings that were overridden by command-line */ QString strOverriddenByCommandLine; // Add option to list of GUI options overridden through command line/config file void addOverriddenOption(const std::string &option); // Check settings version and upgrade default values if required void checkAndMigrate(); Q_SIGNALS: void displayUnitChanged(int unit); void coinControlFeaturesChanged(bool); void showTrayIconChanged(bool); void useEmbeddedMonospacedFontChanged(bool); }; #endif // BITCOIN_QT_OPTIONSMODEL_H
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2013 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CHAIN_PARAMS_H #define BITCOIN_CHAIN_PARAMS_H #include "bignum.h" #include "uint256.h" #include <vector> using namespace std; #define MESSAGE_START_SIZE 4 typedef unsigned char MessageStartChars[MESSAGE_START_SIZE]; class CAddress; class CBlock; struct CDNSSeedData { string name, host; CDNSSeedData(const string &strName, const string &strHost) : name(strName), host(strHost) {} }; /** * CChainParams defines various tweakable parameters of a given instance of the * Unpay system. There are three: the main network on which people trade goods * and services, the public test network which gets reset from time to time and * a regression test mode which is intended for private networks only. It has * minimal difficulty to ensure that blocks can be found instantly. */ class CChainParams { public: enum Network { MAIN, TESTNET, REGTEST, MAX_NETWORK_TYPES }; enum Base58Type { PUBKEY_ADDRESS, SCRIPT_ADDRESS, SECRET_KEY, // BIP16 EXT_PUBLIC_KEY, // BIP32 EXT_SECRET_KEY, // BIP32 EXT_COIN_TYPE, // BIP44 MAX_BASE58_TYPES }; const uint256& HashGenesisBlock() const { return hashGenesisBlock; } const MessageStartChars& MessageStart() const { return pchMessageStart; } const vector<unsigned char>& AlertKey() const { return vAlertPubKey; } int GetDefaultPort() const { return nDefaultPort; } const CBigNum& ProofOfWorkLimit() const { return bnProofOfWorkLimit; } int SubsidyHalvingInterval() const { return nSubsidyHalvingInterval; } virtual const CBlock& GenesisBlock() const = 0; virtual bool RequireRPCPassword() const { return true; } const string& DataDir() const { return strDataDir; } virtual Network NetworkID() const = 0; const vector<CDNSSeedData>& DNSSeeds() const { return vSeeds; } const std::vector<unsigned char> &Base58Prefix(Base58Type type) const { return base58Prefixes[type]; } virtual const vector<CAddress>& FixedSeeds() const = 0; int RPCPort() const { return nRPCPort; } protected: CChainParams() {} uint256 hashGenesisBlock; MessageStartChars pchMessageStart; // Raw pub key bytes for the broadcast alert signing key. vector<unsigned char> vAlertPubKey; int nDefaultPort; int nRPCPort; CBigNum bnProofOfWorkLimit; int nSubsidyHalvingInterval; string strDataDir; vector<CDNSSeedData> vSeeds; std::vector<unsigned char> base58Prefixes[MAX_BASE58_TYPES]; }; /** * Return the currently selected parameters. This won't change after app startup * outside of the unit tests. */ const CChainParams &Params(); /** Sets the params returned by Params() to those for the given network. */ void SelectParams(CChainParams::Network network); /** * Looks for -regtest or -testnet and then calls SelectParams as appropriate. * Returns false if an invalid combination is given. */ bool SelectParamsFromCommandLine(); inline bool TestNet() { // Note: it's deliberate that this returns "false" for regression test mode. return Params().NetworkID() == CChainParams::TESTNET; } inline bool RegTest() { return Params().NetworkID() == CChainParams::REGTEST; } #endif
/***************************************************************************** ** Copyright (C) 1998-2001 Ljubomir Milanovic & Horst Wagner ** This file is part of the g2 library ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ******************************************************************************/ #ifndef _G2_X11_H #define _G2_X11_H #if defined(__cplusplus) extern "C" { #endif int g2_open_X11(int width, int height); int g2_open_X11X(int width, int height, int x, int y, char *window_name, char *icon_name, char *icon_data, int icon_width, int icon_height); #if defined(__cplusplus) } /* end extern "C" */ #endif #endif /* _G2_X11_H */
#ifndef dplyr_tools_tools_H #define dplyr_tools_tools_H #include <tools/debug.h> #include <tools/hash.h> #include <tools/match.h> #include <tools/pointer_vector.h> #include <tools/collapse.h> #include <tools/Quosure.h> #include <tools/utils.h> #endif
/**************************************************************** * * Copyright 2013, Big Switch Networks, Inc. * * Licensed under the Eclipse Public License, Version 1.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.eclipse.org/legal/epl-v10.html * * 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. * ****************************************************************/ /****************************************************************************** * * /module/src/loci_config.c * * loci Config Information * *****************************************************************************/ #include <loci/loci_config.h> #include <loci/loci.h> #include "loci_int.h" #include <stdlib.h> #include <string.h> /* <auto.start.cdefs(LOCI_CONFIG_HEADER).source> */ #define __loci_config_STRINGIFY_NAME(_x) #_x #define __loci_config_STRINGIFY_VALUE(_x) __loci_config_STRINGIFY_NAME(_x) loci_config_settings_t loci_config_settings[] = { #ifdef LOCI_CONFIG_INCLUDE_LOGGING { __loci_config_STRINGIFY_NAME(LOCI_CONFIG_INCLUDE_LOGGING), __loci_config_STRINGIFY_VALUE(LOCI_CONFIG_INCLUDE_LOGGING) }, #else { LOCI_CONFIG_INCLUDE_LOGGING(__loci_config_STRINGIFY_NAME), "__undefined__" }, #endif #ifdef LOCI_CONFIG_LOG_OPTIONS_DEFAULT { __loci_config_STRINGIFY_NAME(LOCI_CONFIG_LOG_OPTIONS_DEFAULT), __loci_config_STRINGIFY_VALUE(LOCI_CONFIG_LOG_OPTIONS_DEFAULT) }, #else { LOCI_CONFIG_LOG_OPTIONS_DEFAULT(__loci_config_STRINGIFY_NAME), "__undefined__" }, #endif #ifdef LOCI_CONFIG_LOG_BITS_DEFAULT { __loci_config_STRINGIFY_NAME(LOCI_CONFIG_LOG_BITS_DEFAULT), __loci_config_STRINGIFY_VALUE(LOCI_CONFIG_LOG_BITS_DEFAULT) }, #else { LOCI_CONFIG_LOG_BITS_DEFAULT(__loci_config_STRINGIFY_NAME), "__undefined__" }, #endif #ifdef LOCI_CONFIG_LOG_CUSTOM_BITS_DEFAULT { __loci_config_STRINGIFY_NAME(LOCI_CONFIG_LOG_CUSTOM_BITS_DEFAULT), __loci_config_STRINGIFY_VALUE(LOCI_CONFIG_LOG_CUSTOM_BITS_DEFAULT) }, #else { LOCI_CONFIG_LOG_CUSTOM_BITS_DEFAULT(__loci_config_STRINGIFY_NAME), "__undefined__" }, #endif #ifdef LOCI_CONFIG_PORTING_STDLIB { __loci_config_STRINGIFY_NAME(LOCI_CONFIG_PORTING_STDLIB), __loci_config_STRINGIFY_VALUE(LOCI_CONFIG_PORTING_STDLIB) }, #else { LOCI_CONFIG_PORTING_STDLIB(__loci_config_STRINGIFY_NAME), "__undefined__" }, #endif #ifdef LOCI_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS { __loci_config_STRINGIFY_NAME(LOCI_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS), __loci_config_STRINGIFY_VALUE(LOCI_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS) }, #else { LOCI_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS(__loci_config_STRINGIFY_NAME), "__undefined__" }, #endif #ifdef LOCI_CONFIG_INCLUDE_UCLI { __loci_config_STRINGIFY_NAME(LOCI_CONFIG_INCLUDE_UCLI), __loci_config_STRINGIFY_VALUE(LOCI_CONFIG_INCLUDE_UCLI) }, #else { LOCI_CONFIG_INCLUDE_UCLI(__loci_config_STRINGIFY_NAME), "__undefined__" }, #endif { NULL, NULL } }; #undef __loci_config_STRINGIFY_VALUE #undef __loci_config_STRINGIFY_NAME const char* loci_config_lookup(const char* setting) { int i; for(i = 0; loci_config_settings[i].name; i++) { if(strcmp(loci_config_settings[i].name, setting)) { return loci_config_settings[i].value; } } return NULL; } int loci_config_show(struct aim_pvs_s* pvs) { int i; for(i = 0; loci_config_settings[i].name; i++) { aim_printf(pvs, "%s = %s\n", loci_config_settings[i].name, loci_config_settings[i].value); } return i; } /* <auto.end.cdefs(LOCI_CONFIG_HEADER).source> */ /** * Necessary for module initialization infrastructure. * This should register with AIM. */ void __loci_module_init__(void) { }
/****************************************************************************** * Copyright (C) 2010 by Sebastian Doerner <sebastian@sebastian-doerner.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 * ******************************************************************************/ #ifndef CHECKOUTDIALOG_H #define CHECKOUTDIALOG_H #include <kdialog.h> #include <QSet> #include <QString> class KComboBox; class KLineEdit; class QCheckBox; class QGroupBox; class QRadioButton; /** * @brief The dialog for checking out Branches or Tags in Git. */ class CheckoutDialog : public KDialog { Q_OBJECT public: CheckoutDialog(QWidget* parent = 0); /** * Returns the name of the selected tag or branch to be checkout out * @returns The name of the selected tag or branch */ QString checkoutIdentifier() const; /** * @returns True if the user selected a forced checkout, false otherwise. */ bool force() const; /** * @returns The user selected name of the new branch, if a new branch is to be * created, empty String otherwise. */ QString newBranchName() const; private slots: void branchRadioButtonToggled(bool checked); void newBranchCheckBoxStateToggled(int state); /** * Checks whether the values of all relevant widgets are valid. * Enables or disables the OK button and sets tooltips accordingly. */ void setOkButtonState(); void noteUserEditedNewBranchName(); /** * Inserts a default name for the new branch into m_newBranchName unless the user * has already edited the content. * @param baseBranchName The base name to derive the new name of. */ void setDefaultNewBranchName(const QString & baseBranchName); private: inline void setLineEditErrorModeActive(bool active); private: ///@brief true if the user has manually edited the branchName, false otherwise bool m_userEditedNewBranchName; QSet<QString> m_branchNames; QPalette m_errorColors; QGroupBox * m_branchSelectGroupBox; QRadioButton * m_branchRadioButton; KComboBox * m_branchComboBox; KComboBox * m_tagComboBox; QCheckBox * m_newBranchCheckBox; KLineEdit * m_newBranchName; QCheckBox * m_forceCheckBox; }; #endif // CHECKOUTDIALOG_H
/********************************************************************** Android-Freeciv - Copyright (C) 2010 - C Vaughn This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ***********************************************************************/ #define BUG_URL "fixme" #define META_URL "fixme" #define DEFAULT_SOCK_PORT 9999 #define MAJOR_VERSION 2 #define MINOR_VERSION 1 #define PATCH_VERSION 2 #define VERSION_LABEL "forandroid" #define VERSION_STRING "forandroid" #define FC_CONFIG_H 1 #define NETWORK_CAPSTRING_MANDATORY "+2.2b" #define NETWORK_CAPSTRING_OPTIONAL "trade_illness" #define WIKI_URL "fixme"
#ifndef _ASM_ARM_FUTEX_H #define _ASM_ARM_FUTEX_H #ifdef __KERNEL__ #include <linux/futex.h> #include <linux/uaccess.h> #include <asm/errno.h> #define __futex_atomic_ex_table(err_reg) \ "3:\n" \ " .pushsection __ex_table,\"a\"\n" \ " .align 3\n" \ " .long 1b, 4f, 2b, 4f\n" \ " .popsection\n" \ " .pushsection .fixup,\"ax\"\n" \ "4: mov %0, " err_reg "\n" \ " b 3b\n" \ " .popsection" #ifdef CONFIG_SMP #define __futex_atomic_op(insn, ret, oldval, tmp, uaddr, oparg) \ smp_mb(); \ __asm__ __volatile__( \ "1: ldrex %1, [%3]\n" \ " " insn "\n" \ "2: strex %2, %0, [%3]\n" \ " teq %2, #0\n" \ " bne 1b\n" \ " mov %0, #0\n" \ __futex_atomic_ex_table("%5") \ : "=&r" (ret), "=&r" (oldval), "=&r" (tmp) \ : "r" (uaddr), "r" (oparg), "Ir" (-EFAULT) \ : "cc", "memory") static inline int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 oldval, u32 newval) { int ret; u32 val; if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) return -EFAULT; smp_mb(); __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n" "1: ldrex %1, [%4]\n" " teq %1, %2\n" " ite eq @ explicit IT needed for the 2b label\n" "2: strexeq %0, %3, [%4]\n" " movne %0, #0\n" " teq %0, #0\n" " bne 1b\n" __futex_atomic_ex_table("%5") : "=&r" (ret), "=&r" (val) : "r" (oldval), "r" (newval), "r" (uaddr), "Ir" (-EFAULT) : "cc", "memory"); smp_mb(); *uval = val; return ret; } #else /* !SMP, we can work around lack of atomic ops by disabling preemption */ #include <linux/preempt.h> #include <asm/domain.h> #define __futex_atomic_op(insn, ret, oldval, tmp, uaddr, oparg) \ __asm__ __volatile__( \ "1: " TUSER(ldr) " %1, [%3]\n" \ " " insn "\n" \ "2: " TUSER(str) " %0, [%3]\n" \ " mov %0, #0\n" \ __futex_atomic_ex_table("%5") \ : "=&r" (ret), "=&r" (oldval), "=&r" (tmp) \ : "r" (uaddr), "r" (oparg), "Ir" (-EFAULT) \ : "cc", "memory") static inline int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 oldval, u32 newval) { int ret = 0; u32 val; if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) return -EFAULT; __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n" "1: " TUSER(ldr) " %1, [%4]\n" " teq %1, %2\n" " it eq @ explicit IT needed for the 2b label\n" "2: " TUSER(streq) " %3, [%4]\n" __futex_atomic_ex_table("%5") : "+r" (ret), "=&r" (val) : "r" (oldval), "r" (newval), "r" (uaddr), "Ir" (-EFAULT) : "cc", "memory"); *uval = val; return ret; } #endif /* !SMP */ static inline int futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr) { int op = (encoded_op >> 28) & 7; int cmp = (encoded_op >> 24) & 15; int oparg = (encoded_op << 8) >> 20; int cmparg = (encoded_op << 20) >> 20; int oldval = 0, ret, tmp; if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) oparg = 1 << oparg; if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) return -EFAULT; pagefault_disable(); /* implies preempt_disable() */ switch (op) { case FUTEX_OP_SET: __futex_atomic_op("mov %0, %4", ret, oldval, tmp, uaddr, oparg); break; case FUTEX_OP_ADD: __futex_atomic_op("add %0, %1, %4", ret, oldval, tmp, uaddr, oparg); break; case FUTEX_OP_OR: __futex_atomic_op("orr %0, %1, %4", ret, oldval, tmp, uaddr, oparg); break; case FUTEX_OP_ANDN: __futex_atomic_op("and %0, %1, %4", ret, oldval, tmp, uaddr, ~oparg); break; case FUTEX_OP_XOR: __futex_atomic_op("eor %0, %1, %4", ret, oldval, tmp, uaddr, oparg); break; default: ret = -ENOSYS; } pagefault_enable(); /* subsumes preempt_enable() */ if (!ret) { switch (cmp) { case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; default: ret = -ENOSYS; } } return ret; } #endif /* __KERNEL__ */ #endif /* _ASM_ARM_FUTEX_H */
// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2015 Cedric Hnyda <ced.hnyda@gmail.com> * * Calls getrandom(2), checks that the buffer is filled with random bytes * and expects success. */ #include "tst_test.h" #include "lapi/getrandom.h" #include "lapi/syscalls.h" #define PROC_ENTROPY_AVAIL "/proc/sys/kernel/random/entropy_avail" static int modes[] = { 0, GRND_RANDOM, GRND_NONBLOCK, GRND_RANDOM | GRND_NONBLOCK }; static int check_content(unsigned char *buf, int nb) { int table[256]; int i, index, max; memset(table, 0, sizeof(table)); max = 6 + nb * 0.2; for (i = 0; i < nb; i++) { index = buf[i]; table[index]++; } for (i = 0; i < nb; i++) { if (max > 0 && table[i] > max) return 0; } return 1; } static void verify_getrandom(unsigned int n) { unsigned char buf[256]; int bufsize = 64, entropy_avail; if (access(PROC_ENTROPY_AVAIL, F_OK) == 0) { SAFE_FILE_SCANF(PROC_ENTROPY_AVAIL, "%d", &entropy_avail); if (entropy_avail > 256) bufsize = sizeof(buf); } memset(buf, 0, sizeof(buf)); do { TEST(tst_syscall(__NR_getrandom, buf, bufsize, modes[n])); } while ((modes[n] & GRND_NONBLOCK) && TST_RET == -1 && TST_ERR == EAGAIN); if (!check_content(buf, TST_RET)) tst_res(TFAIL | TTERRNO, "getrandom failed"); else tst_res(TPASS, "getrandom returned %ld", TST_RET); } static struct tst_test test = { .tcnt = ARRAY_SIZE(modes), .test = verify_getrandom, };
#undef CONFIG_CPU_R4X00
/*****************************************************************************\ * read_config.h - functions and declarations for reading slurmdbd.conf ***************************************************************************** * Copyright (C) 2003-2007 The Regents of the University of California. * Copyright (C) 2008-2009 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette <jette1@llnl.gov> * CODE-OCEC-09-009. All rights reserved. * * This file is part of SLURM, a resource management program. * For details, see <http://slurm.schedmd.com/>. * Please also read the included file: DISCLAIMER. * * SLURM 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. * * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under * certain conditions as described in each individual source file, and * distribute linked combinations including the two. You must obey the GNU * General Public License in all respects for all of the code used other than * OpenSSL. If you modify file(s) with this exception, you may extend this * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source files in * the program, then also delete it here. * * SLURM 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 SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ #ifndef _DBD_READ_CONFIG_H #define _DBD_READ_CONFIG_H #if HAVE_CONFIG_H # include "config.h" #if HAVE_INTTYPES_H # include <inttypes.h> #else /* !HAVE_INTTYPES_H */ # if HAVE_STDINT_H # include <stdint.h> # endif #endif /* HAVE_INTTYPES_H */ #else /* !HAVE_CONFIG_H */ #include <stdint.h> #endif /* HAVE_CONFIG_H */ #include <time.h> #include <pthread.h> #include "src/common/list.h" #define DEFAULT_SLURMDBD_AUTHTYPE "auth/none" //#define DEFAULT_SLURMDBD_JOB_PURGE 12 #define DEFAULT_SLURMDBD_PIDFILE "/var/run/slurmdbd.pid" #define DEFAULT_SLURMDBD_ARCHIVE_DIR "/tmp" //#define DEFAULT_SLURMDBD_STEP_PURGE 1 /* SlurmDBD configuration parameters */ typedef struct slurm_dbd_conf { time_t last_update; /* time slurmdbd.conf read */ char * archive_dir; /* location to localy * store data if not * using a script */ char * archive_script; /* script to archive old data */ char * auth_info; /* authentication info */ char * auth_type; /* authentication mechanism */ uint16_t control_timeout;/* how long to wait before * backup takes control */ char * dbd_addr; /* network address of Slurm DBD */ char * dbd_backup; /* hostname of Slurm DBD backup */ char * dbd_host; /* hostname of Slurm DBD */ uint16_t dbd_port; /* port number for RPCs to DBD */ uint16_t debug_level; /* Debug level, default=3 */ char * default_qos; /* default qos setting when * adding clusters */ char * log_file; /* Log file */ uint16_t log_fmt; /* Log file timestamt format */ uint16_t msg_timeout; /* message timeout */ char * pid_file; /* where to store current PID */ char * plugindir; /* dir to look for plugins */ uint16_t private_data; /* restrict information */ /* purge variable format * controlled by PURGE_FLAGS */ uint32_t purge_event; /* purge events older than * this in months or days */ uint32_t purge_job; /* purge time for job info */ uint32_t purge_resv; /* purge time for reservation info */ uint32_t purge_step; /* purge time for step info */ uint32_t purge_suspend; /* purge suspend data older * than this in months or days */ uint32_t slurm_user_id; /* uid of slurm_user_name */ char * slurm_user_name;/* user that slurmcdtld runs as */ char * storage_backup_host;/* backup host where DB is * running */ char * storage_host; /* host where DB is running */ char * storage_loc; /* database name */ char * storage_pass; /* password for DB write */ uint16_t storage_port; /* port DB is listening to */ char * storage_type; /* DB to be used for storage */ char * storage_user; /* user authorized to write DB */ uint16_t track_wckey; /* Whether or not to track wckey*/ uint16_t track_ctld; /* Whether or not track when a * slurmctld goes down or not */ } slurm_dbd_conf_t; extern pthread_mutex_t conf_mutex; extern slurm_dbd_conf_t *slurmdbd_conf; /* * free_slurmdbd_conf - free storage associated with the global variable * slurmdbd_conf */ extern void free_slurmdbd_conf(void); /* Return the DbdPort value */ extern uint16_t get_dbd_port(void); /* lock and unlock the dbd_conf */ extern void slurmdbd_conf_lock(void); extern void slurmdbd_conf_unlock(void); /* Log the current configuration using verbose() */ extern void log_config(void); /* * read_slurmdbd_conf - load the SlurmDBD configuration from the slurmdbd.conf * file. This function can be called more than once if so desired. * RET SLURM_SUCCESS if no error, otherwise an error code */ extern int read_slurmdbd_conf(void); /* Dump the configuration in name,value pairs for output to * "sacctmgr show config", caller must call list_destroy() */ extern List dump_config(void); #endif /* !_DBD_READ_CONFIG_H */
/*************************************************************************** qgsactionmenu.h -------------------------------------- Date : 11.8.2014 Copyright : (C) 2014 Matthias Kuhn Email : matthias at opengis dot ch *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef QGSACTIONMENU_H #define QGSACTIONMENU_H #include <QMenu> #include <QSignalMapper> #include "qgsactionmanager.h" #include "qgsmaplayeractionregistry.h" /** * This class is a menu that is populated automatically with the actions defined for a given layer. */ class GUI_EXPORT QgsActionMenu : public QMenu { Q_OBJECT public: enum ActionType { Invalid, //!< Invalid MapLayerAction, //!< Standard actions (defined by core or plugins) AttributeAction //!< Custom actions (manually defined in layer properties) }; struct ActionData { ActionData() : actionType( Invalid ) , actionId( 0 ) , featureId( 0 ) , mapLayer( nullptr ) {} ActionData( int actionId, QgsFeatureId featureId, QgsMapLayer* mapLayer ) : actionType( AttributeAction ) , actionId( actionId ) , featureId( featureId ) , mapLayer( mapLayer ) {} ActionData( QgsMapLayerAction* action, QgsFeatureId featureId, QgsMapLayer* mapLayer ) : actionType( MapLayerAction ) , actionId( action ) , featureId( featureId ) , mapLayer( mapLayer ) {} ActionType actionType; union aid { aid( int i ) : id( i ) {} aid( QgsMapLayerAction* a ) : action( a ) {} int id; QgsMapLayerAction* action; } actionId; QgsFeatureId featureId; QgsMapLayer* mapLayer; }; /** * Constructs a new QgsActionMenu * * @param layer The layer that this action will be run upon. * @param feature The feature that this action will be run upon. Make sure that this feature is available * for the lifetime of this object. * @param parent The usual QWidget parent. */ explicit QgsActionMenu( QgsVectorLayer *layer, const QgsFeature *feature, QWidget *parent = nullptr ); /** * Constructs a new QgsActionMenu * * @param layer The layer that this action will be run upon. * @param fid The feature id of the feature for which this action will be run. * @param parent The usual QWidget parent. */ explicit QgsActionMenu( QgsVectorLayer *layer, const QgsFeatureId fid, QWidget *parent = nullptr ); /** * Destructor */ ~QgsActionMenu(); /** * Change the feature on which actions are performed * * @param feature A feature. Will not take ownership. It's the callers responsibility to keep the feature * as long as the menu is displayed and the action is running. */ void setFeature( QgsFeature* feature ); private slots: void triggerAction(); void reloadActions(); signals: void reinit(); private: void init(); const QgsFeature* feature(); QgsVectorLayer* mLayer; QgsActionManager* mActions; const QgsFeature* mFeature; QgsFeatureId mFeatureId; bool mOwnsFeature; }; Q_DECLARE_METATYPE( QgsActionMenu::ActionData ) #endif // QGSACTIONMENU_H
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ /* * plugin-debug.c * * Debug plugin, for helping track down Conglomerate bugs * * Copyright (C) 2005 David Malcolm * * Conglomerate 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. * * Conglomerate 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. * * Authors: David Malcolm <david@davemalcolm.demon.co.uk> */ #include "global.h" #include "cong-plugin.h" #include "cong-primary-window.h" #include "cong-fake-plugin-hooks.h" #if ENABLE_DEBUG_PLUGIN static gboolean dump_area_tree_doc_filter (CongServiceDocTool *tool, CongDocument *doc, gpointer user_data) { /* Only available for documents using the editor widget */ CongPrimaryWindow *primary_window = cong_document_get_primary_window(doc); return primary_window->cong_editor_widget3 != NULL; } static void dump_area_tree_action_callback (CongServiceDocTool *tool, CongPrimaryWindow *primary_window, gpointer user_data) { CongEditorWidget3 *editor_widget; xmlDocPtr xml_doc; g_return_if_fail (primary_window); editor_widget = CONG_EDITOR_WIDGET3 (primary_window->cong_editor_widget3); xml_doc = cong_editor_widget_debug_dump_area_tree (editor_widget); cong_ui_new_document_from_manufactured_xml(xml_doc, cong_primary_window_get_toplevel (primary_window)); } #endif /* would be exposed as "plugin_register"? */ /** * plugin_debug_plugin_register: * @plugin: * * TODO: Write me * Returns: */ gboolean plugin_debug_plugin_register (CongPlugin *plugin) { g_return_val_if_fail (IS_CONG_PLUGIN (plugin), FALSE); #if ENABLE_DEBUG_PLUGIN cong_plugin_register_doc_tool(plugin, "Dump area tree", "Generates a debug dump of the CongEditorArea tree of the CongEditorWidget3 as another XML document.", "dump-area-tree", "Debug: _Dump Area Tree", NULL, NULL, dump_area_tree_doc_filter, dump_area_tree_action_callback, NULL); #endif return TRUE; } /* exposed as "plugin_configure"? legitimate for it not to be present */ /** * plugin_debug_plugin_configure: * @plugin: * * TODO: Write me * Returns: */ gboolean plugin_debug_plugin_configure (CongPlugin *plugin) { g_return_val_if_fail (IS_CONG_PLUGIN (plugin), FALSE); return TRUE; }
/**************************************************************************** * (C) Copyright 2008 Samsung Electronics Co., Ltd., All rights reserved * * [File Name] :s3c-otg-oci.h * [Description] : The Header file defines the external and internal functions of OCI. * [Department] : System LSI Division/Embedded S/W Platform * [Created Date]: 2008/06/18 * [Revision History] * - Added some functions and data structure of OCI * ****************************************************************************/ /**************************************************************************** * 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 _OCI_H_ #define _OCI_H_ #ifdef __cplusplus extern "C" { #endif //#include "s3c-otg-common-const.h" #include "s3c-otg-common-errorcode.h" #include "s3c-otg-common-regdef.h" #include "s3c-otg-hcdi-kal.h" #include "s3c-otg-hcdi-memory.h" #include "s3c-otg-hcdi-debug.h" #include "s3c-otg-roothub.h" #include "s3c-otg-hcdi-hcd.h" #include <mach/map.h> //virtual address for smdk extern void otg_phy_init(void); #include <plat/regs-clock.h> ///OCI interace int oci_init(void); int oci_start(void); int oci_stop(void); u8 oci_start_transfer(stransfer_t *st_t); int oci_stop_transfer(u8 ch_num); int oci_channel_init(u8 ch_num, stransfer_t *st_t); u32 oci_get_frame_num(void); u16 oci_get_frame_interval(void); void oci_set_frame_interval(u16 intervl); ///OCI Internal Functions int oci_sys_init(void); int oci_core_init(void); int oci_init_mode(void); int oci_host_init(void); int oci_dev_init(void); int oci_channel_alloc(u8 *ch_num); int oci_channel_dealloc(u8 ch_num); void oci_config_flush_fifo(u32 mode); void oci_flush_tx_fifo(u32 num); void oci_flush_rx_fifo(void); int oci_core_reset(void); void oci_set_global_interrupt(bool set); #ifdef __cplusplus } #endif #endif /* _OCI_H_ */
/* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. * * $Id: act_cyc.c,v 1.2 2009/01/01 15:13:07 ralf Exp $ */ #if HAVE_CONFIG_H #include "config.h" #endif #include <rtems/itron.h> #include <rtems/score/thread.h> #include <rtems/score/tod.h> #include <rtems/itron/time.h> /* * act_cyc - Activate Cyclic Handler */ ER act_cyc( HNO cycno __attribute__((unused)), UINT cycact ) { Watchdog_Control *object; if(cycact != TCY_OFF || cycact != TCY_ON) return E_PAR; #if 0 if( object->Object_ID != cycno) return E_NOEXS; #endif _Watchdog_Activate(object); return E_OK; }
#section support_code_apply int APPLY_SPECIFIC(conv_desc)(PyArrayObject *filt_shp, cudnnConvolutionDescriptor_t *desc) { cudnnStatus_t err; int pad[3] = {PAD_0, PAD_1, PAD_2}; int strides[3] = {SUB_0, SUB_1, SUB_2}; int upscale[3] = {1, 1, 1}; #if BORDER_MODE == 0 pad[0] = *(npy_int64 *)PyArray_GETPTR1(filt_shp, 2) - 1; pad[1] = *(npy_int64 *)PyArray_GETPTR1(filt_shp, 3) - 1; #if NB_DIMS > 2 pad[2] = *(npy_int64 *)PyArray_GETPTR1(filt_shp, 4) - 1; #endif #endif if (PyArray_DIM(filt_shp, 0) - 2 != NB_DIMS) { PyErr_Format(PyExc_ValueError, "Filter shape has too many dimensions: " "expected %d, got %lld.", NB_DIMS, (long long)PyArray_DIM(filt_shp, 0)); return -1; } err = cudnnCreateConvolutionDescriptor(desc); if (err != CUDNN_STATUS_SUCCESS) { PyErr_Format(PyExc_MemoryError, "could not allocate convolution " "descriptor: %s", cudnnGetErrorString(err)); return -1; } err = cudnnSetConvolutionNdDescriptor(*desc, NB_DIMS, pad, strides, upscale, CONV_MODE); return 0; }
/* gsm-util.h * Copyright (C) 2008 Lucas Rocha. * * 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 * Lesser 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 __GSM_UTIL_H__ #define __GSM_UTIL_H__ #include <glib.h> #ifdef __cplusplus extern "C" { #endif #define IS_STRING_EMPTY(x) ((x)==NULL||(x)[0]=='\0') char * gsm_util_find_desktop_file_for_app_name (const char *app_name, char **dirs); gchar *gsm_util_get_empty_tmp_session_dir (void); const char *gsm_util_get_saved_session_dir (void); gchar** gsm_util_get_app_dirs (void); gchar** gsm_util_get_autostart_dirs (void); gchar ** gsm_util_get_desktop_dirs (void); gboolean gsm_util_text_is_blank (const char *str); void gsm_util_init_error (gboolean fatal, const char *format, ...); char * gsm_util_generate_startup_id (void); void gsm_util_setenv (const char *variable, const char *value); #ifdef __cplusplus } #endif #endif /* __GSM_UTIL_H__ */
/* Copyright 2005-2009 Intel Corporation. All Rights Reserved. This file is part of Threading Building Blocks. Threading Building Blocks 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. Threading Building Blocks 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 Threading Building Blocks; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA As a special exception, you may use this file as part of a free software library without restriction. Specifically, if other files instantiate templates or use macros or inline functions from this file, or you compile this file and link it with other files to produce an executable, this file does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ #ifndef _itt_shared_malloc_TypeDefinitions_H_ #define _itt_shared_malloc_TypeDefinitions_H_ // Define preprocessor symbols used to determine architecture #if _WIN32||_WIN64 # if defined(_M_AMD64) # define __ARCH_x86_64 1 # elif defined(_M_IA64) # define __ARCH_ipf 1 # elif defined(_M_IX86)||defined(__i386__) // the latter for MinGW support # define __ARCH_x86_32 1 # else # error Unknown processor architecture for Windows # endif # define USE_WINTHREAD 1 #else /* Assume generic Unix */ # if __x86_64__ # define __ARCH_x86_64 1 # elif __ia64__ # define __ARCH_ipf 1 # elif __i386__ || __i386 # define __ARCH_x86_32 1 # else # define __ARCH_other 1 # endif # define USE_PTHREAD 1 #endif // Include files containing declarations of intptr_t and uintptr_t #include <stddef.h> // size_t #if _MSC_VER typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; #else #include <stdint.h> #endif namespace rml { namespace internal { extern bool original_malloc_found; extern void* (*original_malloc_ptr)(size_t); extern void (*original_free_ptr)(void*); } } // namespaces //! PROVIDE YOUR OWN Customize.h IF YOU FEEL NECESSARY #include "Customize.h" /* * Functions to align an integer down or up to the given power of two, * and test for such an alignment, and for power of two. */ template<typename T> static inline T alignDown(T arg, uintptr_t alignment) { return T( (uintptr_t)arg & ~(alignment-1)); } template<typename T> static inline T alignUp (T arg, uintptr_t alignment) { return T(((uintptr_t)arg+(alignment-1)) & ~(alignment-1)); // /*is this better?*/ return (((uintptr_t)arg-1) | (alignment-1)) + 1; } template<typename T> static inline bool isAligned(T arg, uintptr_t alignment) { return 0==((uintptr_t)arg & (alignment-1)); } static inline bool isPowerOfTwo(uintptr_t arg) { return arg && (0==(arg & (arg-1))); } static inline bool isPowerOfTwoMultiple(uintptr_t arg, uintptr_t divisor) { // Divisor is assumed to be a power of two (which is valid for current uses). MALLOC_ASSERT( isPowerOfTwo(divisor), "Divisor should be a power of two" ); return arg && (0==(arg & (arg-divisor))); } #endif /* _itt_shared_malloc_TypeDefinitions_H_ */
/* ------------------------------------------------------------------ * Copyright (C) 2008 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. * See the License for the specific language governing permissions * and limitations under the License. * ------------------------------------------------------------------- */ /**************************************************************************************** Portions of this file are derived from the following 3GPP standard: 3GPP TS 26.073 ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec Available from http://www.3gpp.org (C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC) Permission to distribute, modify and use this file under the standard license terms listed above has been obtained from the copyright holder. ****************************************************************************************/ /* ------------------------------------------------------------------------------ Filename: /audio/gsm_amr/c/include/shl.h Date: 08/11/2000 ------------------------------------------------------------------------------ REVISION HISTORY Description: Created separate header file for shl function. Description: Changed prototype of the mult() function. Instead of using global a pointer to overflow flag is now passed into the function. Description: Updated template. Changed the parameter name from "overflow" to "pOverflow" in the function prototype declaration Description: Moved _cplusplus #ifdef after Include section. Description: ------------------------------------------------------------------------------ INCLUDE DESCRIPTION This file contains all the constant definitions and prototype definitions needed by the shl function. ------------------------------------------------------------------------------ */ /*---------------------------------------------------------------------------- ; CONTINUE ONLY IF NOT ALREADY DEFINED ----------------------------------------------------------------------------*/ #ifndef SHL_H #define SHL_H /*---------------------------------------------------------------------------- ; INCLUDES ----------------------------------------------------------------------------*/ #include "basicop_malloc.h" /*--------------------------------------------------------------------------*/ #ifdef __cplusplus extern "C" { #endif /*---------------------------------------------------------------------------- ; MACROS ; Define module specific macros here ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; DEFINES ; Include all pre-processor statements here. ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; EXTERNAL VARIABLES REFERENCES ; Declare variables used in this module but defined elsewhere ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; SIMPLE TYPEDEF'S ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; ENUMERATED TYPEDEF'S ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; STRUCTURES TYPEDEF'S ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; GLOBAL FUNCTION DEFINITIONS ; Function Prototype declaration ----------------------------------------------------------------------------*/ Word16 shl(Word16 var1, Word16 var2, Flag *pOverflow); /*---------------------------------------------------------------------------- ; END ----------------------------------------------------------------------------*/ #ifdef __cplusplus } #endif #endif /* _SHL_H_ */
/** * UGENE - Integrated Bioinformatics Tools. * Copyright (C) 2008-2017 UniPro <ugene@unipro.ru> * http://ugene.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., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef _U2_EDITABLE_TREE_VIEW_H_ #define _U2_EDITABLE_TREE_VIEW_H_ #include <U2Core/global.h> #include <QTreeView> namespace U2 { class U2GUI_EXPORT EditableTreeView : public QTreeView { public: EditableTreeView(QWidget* p); bool isEditingActive(); }; } // namespace #endif // _U2_EDITABLE_TREE_VIEW_H_
/* * Asus Mypal 600/620 GPIO definitions. * * Author: Nicolas Pouillon <nipo@ssji.net> * * 2006-02-08 by Vincent Benony : adding GPO bit definitions, and small updates * */ #ifndef _ASUS_620_GPIO_ #define _ASUS_620_GPIO_ #define GET_A620_GPIO(gpio) \ (GPLR(GPIO_NR_A620_ ## gpio) & GPIO_bit(GPIO_NR_A620_ ## gpio)) #define SET_A620_GPIO(gpio, setp) \ do { \ if (setp) \ GPSR(GPIO_NR_A620_ ## gpio) = GPIO_bit(GPIO_NR_A620_ ## gpio); \ else \ GPCR(GPIO_NR_A620_ ## gpio) = GPIO_bit(GPIO_NR_A620_ ## gpio); \ } while (0) #define SET_A620_GPIO_N(gpio, setp) \ do { \ if (setp) \ GPCR(GPIO_NR_A620_ ## gpio ## _N) = GPIO_bit(GPIO_NR_A620_ ## gpio ## _N); \ else \ GPSR(GPIO_NR_A620_ ## gpio ## _N) = GPIO_bit(GPIO_NR_A620_ ## gpio ## _N); \ } while (0) #define A620_IRQ(gpio) \ IRQ_GPIO(GPIO_NR_A620_ ## gpio) #define GPIO_NR_A620_POWER_BUTTON_N (0) /* 1 is reboot non maskable */ #define GPIO_NR_A620_HOME_BUTTON_N (2) #define GPIO_NR_A620_CALENDAR_BUTTON_N (3) #define GPIO_NR_A620_CONTACTS_BUTTON_N (4) #define GPIO_NR_A620_TASKS_BUTTON_N (5) /* 6 missing */ /* hand probed */ #define GPIO_NR_A620_CF_IRQ (7) /* hand probed */ #define GPIO_NR_A620_CF_BVD1 (8) /* Not sure, just a guess */ #define GPIO_NR_A620_CF_READY_N (9) #define GPIO_NR_A620_USB_DETECT (10) #define GPIO_NR_A620_RECORD_BUTTON_N (11) #define GPIO_NR_A620_HEARPHONE_N (12) /* 13 missing (output) */ #define GPIO_NR_A620_CF_RESET (13) /* hand probed */ #define GPIO_NR_A620_CF_POWER (14) #define GPIO_NR_A620_COM_DETECT_N (15) #define GPIO_NR_A620_BACKLIGHT (16) /* Not sure, guessed */ #define GPIO_NR_A620_CF_ENABLE (17) /* * 18 Power detect, see below * 19 missing (output) * * 18,20 * going 0/1 with Power * input * 18: Interrupt on none * 20: Interrupt on RE/FE * * Putting GPIO_NR_A620_AC_IN on 20 is arbitrary */ #define GPIO_NR_A620_AC_IN (20) /* hand probed */ #define GPIO_NR_A620_CF_VS1_N (21) #define GPIO_NR_A620_CF_DETECT_N (21) #define GPIO_NR_A620_CF_VS2_N (22) /* 23-26 is SSP to AD7873 */ #define GPIO_NR_A620_STYLUS_IRQ (27) /* * 28-32 IIS to UDA1380 * * 33 USB pull-up * Must be input when disconnected (floating) * Must be output set to 1 when connected */ #define GPIO_NR_A620_USBP_PULLUP (33) /* * Serial connector has no handshaking * 34,39 Serial port * * 38 missing * * Joystick directions and button * Center is 35 * Directions triggers one or two of 36,67,40,41 * * 36 36,37 37 * * 36,41 35 37,40 * * 41 40,41 40 */ #define GPIO_NR_A620_JOY_PUSH_N (35) #define GPIO_NR_A620_JOY_NW_N (36) #define GPIO_NR_A620_JOY_NE_N (37) #define GPIO_NR_A620_JOY_SE_N (40) #define GPIO_NR_A620_JOY_SW_N (41) #define GPIO_A620_JOY_DIR (((GPLR1&0x300)>>6)|((GPLR1&0x30)>>4)) /* * 42-45 Bluetooth * 46-47 IrDA * * 48-57 Card ? * 54 is led control */ #define GPIO_NR_A620_LED_ENABLE (54) /* * * 58 through 77 is LCD signals * 74,75 seems related to TCON chip * -74 is TCON presence probing * -75 is set to GAFR2 when TCON is here */ #define GPIO_NR_A620_TCON_HERE_N (74) #define GPIO_NR_A620_TCON_EN (75) /* * Power management (scaling to 200, 300, 400MHz) * Chart is: * 78 79 * 200 1 0 * 300 0 1 * 400 1 1 */ #define GPIO_NR_A620_PWRMGMT0 (78) #define GPIO_NR_A620_PWRMGMT1 (79) /* * 81-84 missing */ /* * Other infos */ #define ASUS_IDE_BASE 0x00000000 #define ASUS_IDE_SIZE 0x04000000 #define ASUS_IDE_VIRTUAL 0xF8000000 #define GPO_A620_USB (1 << 0) // 0x00000001 #define GPO_A620_LCD_POWER1 (1 << 1) // 0x00000002 #define GPO_A620_LCD_POWER2 (1 << 2) // 0x00000004 #define GPO_A620_LCD_POWER3 (1 << 3) // 0x00000008 #define GPO_A620_BACKLIGHT (1 << 4) // 0x00000010 #define GPO_A620_BLUETOOTH (1 << 5) // 0x00000020 #define GPO_A620_MICROPHONE (1 << 6) // 0x00000040 #define GPO_A620_SOUND (1 << 7) // 0x00000080 #define GPO_A620_UNK_1 (1 << 8) // 0x00000100 #define GPO_A620_BLUE_LED (1 << 9) // 0x00000200 #define GPO_A620_UNK_2 (1 << 10) // 0x00000400 #define GPO_A620_RED_LED (1 << 11) // 0x00000800 #define GPO_A620_UNK_3 (1 << 12) // 0x00001000 #define GPO_A620_CF_RESET (1 << 13) // 0x00002000 #define GPO_A620_IRDA_FIR_MODE (1 << 14) // 0x00004000 #define GPO_A620_IRDA_POWER_N (1 << 15) // 0x00008000 #define GPIO_I2C_EARPHONES_DETECTED (1 << 2) // 0x00000004 void asus620_gpo_set(unsigned long bits); void asus620_gpo_clear(unsigned long bits); #endif /* _ASUS_620_GPIO_ */
#import <Foundation/Foundation.h> #import "MediaServiceRemote.h" #import "ServiceRemoteWordPressXMLRPC.h" @interface MediaServiceRemoteXMLRPC : ServiceRemoteWordPressXMLRPC <MediaServiceRemote> @end
/*===================================================================== container.h -------------- Copyright (C) Vladimir Panteleev 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. http://www.gnu.org/copyleft/gpl.html.. =====================================================================*/ #pragma once #include <unordered_map> /// Find an entry with the specified key and return its value, /// or, failing that, return a default value. template<typename MAP> static typename MAP::value_type::second_type map_get(const MAP &map, const typename MAP::key_type &key, const typename MAP::value_type::second_type defaultValue = MAP::value_type::second_type()) { MAP::const_iterator i = map.find(key); if (i == map.end()) return defaultValue; return i->second; } /// Add or find an entry to the map with the specified key. /// Copies true to *pinserted if a new entry was added, false if an existing one was found. /// Returns a reference to the new/existing value. template<class MAP> static typename MAP::value_type::second_type& map_emplace(MAP &map, const typename MAP::key_type &key, bool *pinserted=NULL) { auto pair = map.emplace(std::make_pair(key, MAP::value_type::second_type())); if (pinserted) *pinserted = pair.second; return pair.first->second; } /// Add or find an entry in a string[id] vector / id[string] map pair, and return its ID. template<typename ID> static ID map_string(std::vector<std::wstring> &list, std::unordered_map<std::wstring, ID>&map, std::wstring key) { bool inserted; ID &id = map_emplace(map, key, &inserted); if (inserted) // new entry { list.push_back(key); return id = list.size() - 1; } else // existing entry return id; } #include <unordered_set> /// Nicer wrapper around set::count. template<class SET> static bool set_get(const SET &set, const typename SET::key_type &key) { return set.count(key) != 0; } /// Make sure the specified item is / isn't in the set, according to a boolean. template<class SET> static void set_set(SET &set, const typename SET::key_type &key, bool value) { if (value) set.insert(key); else { SET::const_iterator i = set.find(key); if (i != set.end()) set.erase(i); } }
/* system.h * * This include file contains information that is included in every * function in the test set. * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. * * $Id$ */ /* functions */ #include <pmacros.h> #include <unistd.h> #include <errno.h> #include <sched.h> void *POSIX_Init ( void *arg ); /* configuration information */ #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_POSIX_INIT_THREAD_TABLE #define CONFIGURE_MAXIMUM_POSIX_THREADS 1 #define CONFIGURE_MAXIMUM_POSIX_TIMERS 1 #include <rtems/confdefs.h> /* end of include file */
/* * Interface for hwdep device * * Copyright (C) 2004 Takashi Iwai <tiwai@suse.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include <sound/core.h> #include <sound/hwdep.h> #include <asm/uaccess.h> #include "emux_voice.h" #define TMP_CLIENT_ID 0x1001 /* * load patch */ static int snd_emux_hwdep_load_patch(struct snd_emux *emu, void __user *arg) { int err; struct soundfont_patch_info patch; if (copy_from_user(&patch, arg, sizeof(patch))) return -EFAULT; if (patch.type >= SNDRV_SFNT_LOAD_INFO && patch.type <= SNDRV_SFNT_PROBE_DATA) { err = snd_soundfont_load(emu->sflist, arg, patch.len + sizeof(patch), TMP_CLIENT_ID); if (err < 0) return err; } else { if (emu->ops.load_fx) return emu->ops.load_fx(emu, patch.type, patch.optarg, arg, patch.len + sizeof(patch)); else return -EINVAL; } return 0; } /* * set misc mode */ static int snd_emux_hwdep_misc_mode(struct snd_emux *emu, void __user *arg) { struct snd_emux_misc_mode info; int i; if (copy_from_user(&info, arg, sizeof(info))) return -EFAULT; if (info.mode < 0 || info.mode >= EMUX_MD_END) return -EINVAL; if (info.port < 0) { for (i = 0; i < emu->num_ports; i++) emu->portptrs[i]->ctrls[info.mode] = info.value; } else { if (info.port < emu->num_ports) emu->portptrs[info.port]->ctrls[info.mode] = info.value; } return 0; } /* * ioctl */ static int snd_emux_hwdep_ioctl(struct snd_hwdep * hw, struct file *file, unsigned int cmd, unsigned long arg) { struct snd_emux *emu = hw->private_data; switch (cmd) { case SNDRV_EMUX_IOCTL_VERSION: return put_user(SNDRV_EMUX_VERSION, (unsigned int __user *)arg); case SNDRV_EMUX_IOCTL_LOAD_PATCH: return snd_emux_hwdep_load_patch(emu, (void __user *)arg); case SNDRV_EMUX_IOCTL_RESET_SAMPLES: snd_soundfont_remove_samples(emu->sflist); break; case SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES: snd_soundfont_remove_unlocked(emu->sflist); break; case SNDRV_EMUX_IOCTL_MEM_AVAIL: if (emu->memhdr) { int size = snd_util_mem_avail(emu->memhdr); return put_user(size, (unsigned int __user *)arg); } break; case SNDRV_EMUX_IOCTL_MISC_MODE: return snd_emux_hwdep_misc_mode(emu, (void __user *)arg); } return 0; } /* * register hwdep device */ int snd_emux_init_hwdep(struct snd_emux *emu) { struct snd_hwdep *hw; int err; if ((err = snd_hwdep_new(emu->card, SNDRV_EMUX_HWDEP_NAME, emu->hwdep_idx, &hw)) < 0) return err; emu->hwdep = hw; strcpy(hw->name, SNDRV_EMUX_HWDEP_NAME); hw->iface = SNDRV_HWDEP_IFACE_EMUX_WAVETABLE; hw->ops.ioctl = snd_emux_hwdep_ioctl; /* The ioctl parameter types are compatible between 32- and * 64-bit architectures, so use the same function. */ hw->ops.ioctl_compat = snd_emux_hwdep_ioctl; hw->exclusive = 1; hw->private_data = emu; if ((err = snd_card_register(emu->card)) < 0) return err; return 0; } /* * unregister */ void snd_emux_delete_hwdep(struct snd_emux *emu) { if (emu->hwdep) { snd_device_free(emu->card, emu->hwdep); emu->hwdep = NULL; } }
/* Copyright 2016 Jack Humbert * * 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/>. */ // Sendstring lookup tables for Dvorak layouts #pragma once #include "keymap_dvorak.h" const uint8_t ascii_to_keycode_lut[128] PROGMEM = { // NUL SOH STX ETX EOT ENQ ACK BEL XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, // BS TAB LF VT FF CR SO SI KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, // DLE DC1 DC2 DC3 DC4 NAK SYN ETB XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, // CAN EM SUB ESC FS GS RS US XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, // ! " # $ % & ' KC_SPC, DV_1, DV_QUOT, DV_3, DV_4, DV_5, DV_7, DV_QUOT, // ( ) * + , - . / DV_9, DV_0, DV_8, DV_EQL, DV_COMM, DV_MINS, DV_DOT, DV_SLSH, // 0 1 2 3 4 5 6 7 DV_0, DV_1, DV_2, DV_3, DV_4, DV_5, DV_6, DV_7, // 8 9 : ; < = > ? DV_8, DV_9, DV_SCLN, DV_SCLN, DV_COMM, DV_EQL, DV_DOT, DV_SLSH, // @ A B C D E F G DV_2, DV_A, DV_B, DV_C, DV_D, DV_E, DV_F, DV_G, // H I J K L M N O DV_H, DV_I, DV_J, DV_K, DV_L, DV_M, DV_N, DV_O, // P Q R S T U V W DV_P, DV_Q, DV_R, DV_S, DV_T, DV_U, DV_V, DV_W, // X Y Z [ \ ] ^ _ DV_X, DV_Y, DV_Z, DV_LBRC, DV_BSLS, DV_RBRC, DV_6, DV_MINS, // ` a b c d e f g DV_GRV, DV_A, DV_B, DV_C, DV_D, DV_E, DV_F, DV_G, // h i j k l m n o DV_H, DV_I, DV_J, DV_K, DV_L, DV_M, DV_N, DV_O, // p q r s t u v w DV_P, DV_Q, DV_R, DV_S, DV_T, DV_U, DV_V, DV_W, // x y z { | } ~ DEL DV_X, DV_Y, DV_Z, DV_LBRC, DV_BSLS, DV_RBRC, DV_GRV, KC_DEL };
/* * AVR_SPI.h * * Created on: 21 Feb 2015 * Author: RobThePyro */ #ifndef AVR_SPI_H_ #define AVR_SPI_H_ // Includes: #include <avr/io.h> // Defines: #define SPI_SS_DDR DDRB #define SPI_SS_PORT PORTB #define SPI_SS 2 #define SPI_MOSI_DDR DDRB #define SPI_MOSI 3 #define SPI_MISO_PORT PORTB #define SPI_MISO 4 #define SPI_SCK_DDR DDRB #define SPI_SCK 5 // Functions: void SPI_Init(void); uint8_t spi_putc(uint8_t); #endif /* AVR_SPI_H_ */
#ifndef K3DSDK_HYPERBOLOID_H #define K3DSDK_HYPERBOLOID_H // K-3D // Copyright (c) 1995-2008, Timothy M. Shead // // Contact: tshead@k-3d.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include <k3dsdk/mesh.h> namespace k3d { namespace hyperboloid { /// Gathers the member arrays of a hyperboloid primitive into a convenient package class const_primitive { public: const_primitive( const mesh::matrices_t& Matrices, const mesh::materials_t& Materials, const mesh::points_t& StartPoints, const mesh::points_t& EndPoints, const mesh::doubles_t& SweepAngles, const mesh::selection_t& Selections, const mesh::table_t& ConstantAttributes, const mesh::table_t& SurfaceAttributes, const mesh::table_t& ParameterAttributes); const mesh::matrices_t& matrices; const mesh::materials_t& materials; const mesh::points_t& start_points; const mesh::points_t& end_points; const mesh::doubles_t& sweep_angles; const mesh::selection_t& selections; const mesh::table_t& constant_attributes; const mesh::table_t& surface_attributes; const mesh::table_t& parameter_attributes; }; /// Gathers the member arrays of a hyperboloid primitive into a convenient package class primitive { public: primitive( mesh::matrices_t& Matrices, mesh::materials_t& Materials, mesh::points_t& StartPoints, mesh::points_t& EndPoints, mesh::doubles_t& SweepAngles, mesh::selection_t& Selections, mesh::table_t& ConstantAttributes, mesh::table_t& SurfaceAttributes, mesh::table_t& ParameterAttributes); mesh::matrices_t& matrices; mesh::materials_t& materials; mesh::points_t& start_points; mesh::points_t& end_points; mesh::doubles_t& sweep_angles; mesh::selection_t& selections; mesh::table_t& constant_attributes; mesh::table_t& surface_attributes; mesh::table_t& parameter_attributes; }; /// Creates a new hyperboloid mesh primitive, returning references to its member arrays. /// The caller is responsible for the lifetime of the returned object. primitive* create(mesh& Mesh); /// Tests the given mesh primitive to see if it is a valid hyperboloid primitive, returning references to its member arrays, or NULL. /// The caller is responsible for the lifetime of the returned object. const_primitive* validate(const mesh& Mesh, const mesh::primitive& GenericPrimitive); /// Tests the given mesh primitive to see if it is a valid hyperboloid primitive, returning references to its member arrays, or NULL. /// The caller is responsible for the lifetime of the returned object. primitive* validate(const mesh& Mesh, mesh::primitive& GenericPrimitive); /// Tests the given mesh primitive to see if it is a valid hyperboloid primitive, returning references to its member arrays, or NULL. /// The caller is responsible for the lifetime of the returned object. primitive* validate(const mesh& Mesh, pipeline_data<mesh::primitive>& GenericPrimitive); } // namespace hyperboloid } // namespace k3d #endif // !K3DSDK_HYPERBOLOID_H
/*************************************************************************** selectgame.h Copyright (C) 2002,2003 Walter van Niftrik This program may be modified and copied freely according to the terms of the GNU general public license (GPL), as long as the above copyright notice and the licensing information contained herein are preserved. Please refer to www.gnu.org for licensing details. This work is provided AS IS, without warranty of any kind, expressed or implied, including but not limited to the warranties of merchantibility, noninfringement, and fitness for a specific purpose. The author will not be held liable for any damage caused by this work or derivatives of it. By using this source code, you agree to the licensing terms as stated above. Please contact the maintainer for bug reports or inquiries. Current Maintainer: Walter van Niftrik <w.f.b.w.v.niftrik@stud.tue.nl> ***************************************************************************/ #ifndef __SELECTGAME_H #define __SELECTGAME_H /* This function changes to the directory of the game that the user wants to ** run. Currently implemented by a Dreamcast-specific graphical interface based ** on Daniel Potter's GhettoPlay interface. It also creates a config file on ** the ram disk, based on options the user has set in the interface. ** Parameters: void. ** Returns : void. */ void choose_game(void); #endif /* __SELECTGAME_H */
/* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <unistd.h> #include <sys/types.h> /* Set the user ID of the calling process to UID. If the calling process is the super-user, the real and effective user IDs, and the saved set-user-ID to UID; if not, the effective user ID is set to UID. */ int __setuid (uid_t uid) { __set_errno (ENOSYS); return -1; } stub_warning (setuid) weak_alias (__setuid, setuid)
/* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <sys/socket.h> /* Send N bytes of BUF to socket FD. Returns the number sent or -1. */ ssize_t __send (int fd, const __ptr_t buf, size_t n, int flags) { __set_errno (ENOSYS); return -1; } libc_hidden_def (__send) weak_alias (__send, send) stub_warning (send)
#pragma once #include "Emu/Cell/PPCDisAsm.h" class RSXDisAsm final : public CPUDisAsm { public: RSXDisAsm(cpu_disasm_mode mode, const u8* offset, const cpu_thread* cpu) : CPUDisAsm(mode, offset, cpu) { } private: void Write(const std::string& str, s32 count, bool is_non_inc = false, u32 id = 0); public: u32 disasm(u32 pc) override; };
/* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ /* AbiWord * Copyright (C) 2000 AbiSource, Inc. * Copyright (C) 2004 Hubert Figuiere * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA. */ #ifndef AP_COCOADIALOG_FORMATTOC_H #define AP_COCOADIALOG_FORMATTOC_H #include <Cocoa/Cocoa.h> #include "ap_Dialog_FormatTOC.h" @class AP_CocoaDialog_FormatTOC_Controller; @protocol XAP_CocoaDialogProtocol; /*****************************************************************/ class AP_CocoaDialog_FormatTOC: public AP_Dialog_FormatTOC { public: AP_CocoaDialog_FormatTOC(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id dlgid); virtual ~AP_CocoaDialog_FormatTOC(void); virtual void runModeless(XAP_Frame * pFrame); static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id dlgid); virtual void notifyActiveFrame(XAP_Frame * pFrame); virtual void setTOCPropsInGUI(void); virtual void setSensitivity(bool bSensitive); virtual void destroy(void); virtual void activate(void); private: void _populateWindowData(void); AP_CocoaDialog_FormatTOC_Controller *m_dlg; }; @interface AP_CocoaDialog_FormatTOC_Controller : NSWindowController <XAP_CocoaDialogProtocol> { IBOutlet NSButton * _applyBtn; IBOutlet NSButton * _hasHeadingBtn; IBOutlet NSButton * _hasLabelBtn; IBOutlet NSButton * _inheritLabelBtn; IBOutlet NSButton * _displayStyleBtn; IBOutlet NSButton * _fillStyleBtn; IBOutlet NSButton * _headingStyleBtn; IBOutlet NSPopUpButton * _layoutLevelPopup; IBOutlet NSPopUpButton * _mainLevelPopup; IBOutlet NSPopUpButton * _numberingTypeData; IBOutlet NSPopUpButton * _pageNumberingData; IBOutlet NSPopUpButton * _tabLeadersData; IBOutlet NSTextField * _displayStyleLabel; IBOutlet NSTextField * _displayStyleData; IBOutlet NSTextField * _fillStyleLabel; IBOutlet NSTextField * _fillStyleData; IBOutlet NSTextField * _headingStyleLabel; IBOutlet NSTextField * _headingStyleData; IBOutlet NSTextField * _headingTextData; IBOutlet NSTextField * _headingTextLabel; IBOutlet NSTextField * _indentData; IBOutlet NSTextField * _indentLabel; IBOutlet NSTextField * _numberingTypeLabel; IBOutlet NSTextField * _pageNumberingLabel; IBOutlet NSTextField * _startAtData; IBOutlet NSTextField * _startAtLabel; IBOutlet NSTextField * _tabLeadersLabel; IBOutlet NSTextField * _textAfterData; IBOutlet NSTextField * _textAfterLabel; IBOutlet NSTextField * _textBeforeData; IBOutlet NSTextField * _textBeforeLabel; IBOutlet NSBox * _defineMainLabel; IBOutlet NSBox * _labelDefinitionsLabel; IBOutlet NSBox * _tabsPageNoLabel; IBOutlet NSStepper * _startAtStepper; IBOutlet NSStepper * _indentStepper; // IBOutlet NSBox * _hasHeadingBox; // IBOutlet NSBox * _labelDefBox; // IBOutlet NSBox * _mainPropBox; // IBOutlet NSBox * _tabsAndPageNumbBox; IBOutlet NSTabView * _tabView; AP_CocoaDialog_FormatTOC * _xap; } - (IBAction)startAtStepperAction:(id)sender; - (IBAction)startAtAction:(id)sender; - (IBAction)indentStepperAction:(id)sender; - (IBAction)indentAction:(id)sender; - (IBAction)mainLevelAction:(id)sender; - (IBAction)detailLevelAction:(id)sender; - (IBAction)headingStyleAction:(id)sender; - (IBAction)fillStyleAction:(id)sender; - (IBAction)displayStyleAction:(id)sender; - (IBAction)applyAction:(id)sender; - (void)setSensitivity:(BOOL)enable; - (void)createLevelItems:(NSPopUpButton *)popup; - (void)createNumberingItems:(NSPopUpButton *)popup; - (void)sync; - (void)syncMainLevelSettings; - (void)syncDetailLevelSettings; - (void)saveMainLevelSettings; - (void)saveDetailLevelSettings; @end #endif /* AP_COCOADIALOG_FORMATOC_H */
/** * \file l4re/lib/src/env.c * \brief Environment */ /* * (c) 2008-2009 Alexander Warg <warg@os.inf.tu-dresden.de> * economic rights: Technische Universität Dresden (Germany) * * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. * Please see the COPYING-GPL-2 file for details. * * As a special exception, you may use this file as part of a free software * library without restriction. Specifically, if other files instantiate * templates or use macros or inline functions from this file, or you compile * this file and link it with other files to produce an executable, this * file does not by itself cause the resulting executable to be covered by * the GNU General Public License. This exception does not however * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. */ #include <l4/re/env.h> l4re_env_t *l4re_global_env;
#ifndef _RAWC_CONSTANTS_H #define _RAWC_CONSTANTS_H //============================================================================= // File: RAWCControlBoard.h // // COPYRIGHT 2010 Robotics Alliance of the West Coast(RAWC) // All rights reserved. RAWC proprietary and confidential. // // The party receiving this software directly from RAWC (the "Recipient") // may use this software and make copies thereof as reasonably necessary solely // for the purposes set forth in the agreement between the Recipient and // RAWC(the "Agreement"). The software may be used in source code form // solely by the Recipient's employees/volunteers. The Recipient shall have // no right to sublicense, assign, transfer or otherwise provide the source // code to any third party. Subject to the terms and conditions set forth in // the Agreement, this software, in binary form only, may be distributed by // the Recipient to its users. RAWC retains all ownership rights in and to // the software. // // This notice shall supercede any other notices contained within the software. //============================================================================= #include "WPILib.h" //#include <string> #include <map> using namespace std; #define RAWC_CONSTANTS_DEFAULT_FILE "/home/lvuser/constants.csv" class RAWCConstants { // A RAWCConstant is contained in RAWCConstants typedef double RAWCConstant; static constexpr RAWCConstant RAWC_CONSTANTS_DEFAULT_RET_VAL = 0.0; private: map<string, RAWCConstant> data; static RAWCConstants * singletonInstance; RAWCConstants(); //TODO: Add functionality to let this map persist to a file void saveDataToFile(string fileName); // Save to another file void restoreDataFromFile(string fileName); public: void restoreData(); // from default file void save(); // Save to the default file // Get the shared object static RAWCConstants * getInstance(); // Main mechanism to input data void insertKeyAndValue(string key, RAWCConstant value); // Main mechanism to look up data // NOTE: I need to figure out how this can fail elegantly // instead of just checking to see if it exists first // Maybe pass in a pointer to a RAWCConstant and write to that? RAWCConstant getValueForKey(string key); bool doesKeyExist(string key); }; #endif // _RAWC_CONSTANTS_H
/** * vCard parser testing. * * First parameter is location of vCard, second location of Gammu backup * how it should be parsed. * * Optional third parameter can be used to generate template backup * file. */ #include <gammu.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include "../helper/memory-display.h" #include "common.h" char buffer[65536000]; char vcard_buffer[65536000]; int main(int argc, char **argv) { size_t pos = 0; GSM_MemoryEntry pbk; GSM_Error error; FILE *f; size_t len; gboolean generate = FALSE; GSM_Backup backup; int i; GSM_Debug_Info *debug_info; /* Configure debugging */ debug_info = GSM_GetGlobalDebug(); GSM_SetDebugFileDescriptor(stderr, FALSE, debug_info); GSM_SetDebugLevel("textall", debug_info); /* Check parameters */ if (argc != 3 && argc != 4) { printf("Not enough parameters!\nUsage: vcard-read file.vcf file.backup\n"); return 1; } /* Check for generating option */ if (argc == 4 && strcmp(argv[3], "generate") == 0) { generate = TRUE; } /* Open file */ f = fopen(argv[1], "r"); test_result(f != NULL); /* Read data */ len = fread(buffer, 1, sizeof(buffer) - 1, f); test_result(feof(f)); /* Zero terminate string */ buffer[len] = 0; /* We don't need file any more */ fclose(f); /* Parse vCard */ error = GSM_DecodeVCARD(NULL, buffer, &pos, &pbk, SonyEricsson_VCard21); gammu_test_result(error, "GSM_DecodeVCARD"); /* Encode vCard back */ pos = 0; error = GSM_EncodeVCARD(NULL, vcard_buffer, sizeof(vcard_buffer), &pos, &pbk, TRUE, SonyEricsson_VCard21); gammu_test_result(error, "GSM_EncodeVCARD"); /* * Best would be to compare here, but we never can get * absolutely same as original. */ printf("ORIGINAL:\n%s\n----\nENCODED:\n%s\n", buffer, vcard_buffer); /* Generate file if we should */ if (generate) { GSM_ClearBackup(&backup); strcpy(backup.Creator, "vCard tester"); pbk.Location = 0; backup.PhonePhonebook[0] = &pbk; backup.PhonePhonebook[1] = NULL; error = GSM_SaveBackupFile(argv[2], &backup, TRUE); gammu_test_result(error, "GSM_SaveBackupFile"); } /* Read file content */ GSM_ClearBackup(&backup); error = GSM_ReadBackupFile(argv[2], &backup, GSM_Backup_GammuUCS2); gammu_test_result(error, "GSM_ReadBackupFile"); /* Compare size */ test_result(pbk.EntriesNum == backup.PhonePhonebook[0]->EntriesNum); /* Compare content */ for (i = 0; i < pbk.EntriesNum; i++) { test_result(pbk.Entries[i].EntryType == backup.PhonePhonebook[0]->Entries[i].EntryType); printf("Entry type: %d\n", pbk.Entries[i].EntryType); switch (pbk.Entries[i].EntryType) { case PBK_Number_General: case PBK_Number_Mobile: case PBK_Number_Fax: case PBK_Number_Pager: case PBK_Number_Other: case PBK_Number_Messaging: case PBK_Number_Video: case PBK_Text_Note: case PBK_Text_Postal: case PBK_Text_Email: case PBK_Text_Email2: case PBK_Text_URL: case PBK_Text_LUID: case PBK_Text_Name: case PBK_Text_LastName: case PBK_Text_FirstName: case PBK_Text_SecondName: case PBK_Text_FormalName: case PBK_Text_NamePrefix: case PBK_Text_NameSuffix: case PBK_Text_NickName: case PBK_Text_Company: case PBK_Text_JobTitle: case PBK_Text_StreetAddress: case PBK_Text_City: case PBK_Text_State: case PBK_Text_Zip: case PBK_Text_Country: case PBK_Text_Custom1: case PBK_Text_Custom2: case PBK_Text_Custom3: case PBK_Text_Custom4: case PBK_Text_UserID: case PBK_Text_PictureName: case PBK_PushToTalkID: case PBK_Text_VOIP: case PBK_Text_SWIS: case PBK_Text_WVID: case PBK_Text_SIP: case PBK_Text_DTMF: test_result(mywstrncmp(pbk.Entries[i].Text, backup.PhonePhonebook[0]->Entries[i].Text, 0) == TRUE); break; case PBK_Photo: test_result((pbk.Entries[i].Picture.Length == backup.PhonePhonebook[0]->Entries[i].Picture.Length) && memcmp(pbk.Entries[i].Picture.Buffer, backup.PhonePhonebook[0]->Entries[i].Picture.Buffer, pbk.Entries[i].Picture.Length) == 0); free(pbk.Entries[i].Picture.Buffer); break; case PBK_Date: case PBK_LastModified: break; case PBK_Category: case PBK_Private: case PBK_RingtoneID: case PBK_PictureID: case PBK_CallLength: case PBK_Caller_Group: test_result(pbk.Entries[i].Number == backup.PhonePhonebook[0]->Entries[i].Number); break; } } error = PrintMemoryEntry(&pbk, NULL); gammu_test_result(error, "PrintMemoryEntry"); /* Free data */ GSM_FreeBackup(&backup); /* We're done */ return 0; } /* Editor configuration * vim: noexpandtab sw=8 ts=8 sts=8 tw=72: */
/* */ /* */ #include <linux/module.h> #include <linux/kernel.h> #include "felica_cal.h" /* */ #define FELICA_I2C_SLAVE_ADDRESS 0x56 #define FELICA_I2C_REG_ADDRSS_01 0x01 #define FELICA_I2C_REG_ADDRSS_02 0x02 /* */ /* */ static int felica_cal_open (struct inode *inode, struct file *fp) { FELICA_DEBUG_MSG_LOW("[FELICA_CAL] felica_cal_open\n"); return 0; } /* */ static int felica_cal_release (struct inode *inode, struct file *fp) { FELICA_DEBUG_MSG_LOW("[FELICA_CAL] felica_cal_release \n"); return 0; } /* */ static ssize_t felica_cal_read(struct file *fp, char *buf, size_t count, loff_t *pos) { unsigned char read_buf = 0x00; int rc = -1; FELICA_DEBUG_MSG_LOW("[FELICA_CAL] felica_cal_read - start \n"); /* */ if(NULL == fp) { FELICA_DEBUG_MSG_HIGH("[FELICA_CAL] ERROR fp \n"); return -1; } if(NULL == buf) { FELICA_DEBUG_MSG_HIGH("[FELICA_CAL] ERROR buf \n"); return -1; } if(1 != count) { FELICA_DEBUG_MSG_HIGH("[FELICA_CAL] ERROR count \n"); return -1; } if(NULL == pos) { FELICA_DEBUG_MSG_HIGH("[FELICA_CAL] ERROR file \n"); return -1; } rc = felica_i2c_read(FELICA_I2C_REG_ADDRSS_01, &read_buf, 1); if(rc) { FELICA_DEBUG_MSG_HIGH("[FELICA_CAL] felica_i2c_read : %d \n",rc); return -1; } FELICA_DEBUG_MSG_LOW("[FELICA_CAL] felica_cal : 0x%02x \n",read_buf); rc = copy_to_user(buf, &read_buf, count); if(rc) { FELICA_DEBUG_MSG_HIGH("[FELICA_CAL] ERROR - copy_from_user \n"); return -1; } FELICA_DEBUG_MSG_LOW("[FELICA_CAL] felica_cal_read - end \n"); return 1; } /* */ static ssize_t felica_cal_write(struct file *fp, const char *buf, size_t count, loff_t *pos) { unsigned char write_buf = 0x00, read_buf = 0x00; int rc = -1; FELICA_DEBUG_MSG_LOW("[FELICA_CAL] felica_cal_write - start \n"); /* */ if(NULL == fp) { FELICA_DEBUG_MSG_HIGH("[FELICA_CAL] ERROR file \n"); return -1; } if(NULL == buf) { FELICA_DEBUG_MSG_HIGH("[FELICA_CAL] ERROR buf \n"); return -1; } if(1 != count) { FELICA_DEBUG_MSG_HIGH("[FELICA_CAL]ERROR count \n"); return -1; } if(NULL == pos) { FELICA_DEBUG_MSG_HIGH("[FELICA_CAL] ERROR file \n"); return -1; } /* */ rc = copy_from_user(&write_buf, buf, count); if(rc) { FELICA_DEBUG_MSG_HIGH("[FELICA_CAL] ERROR - copy_from_user \n"); return -1; } FELICA_DEBUG_MSG_LOW("[FELICA_CAL] write_buf : 0x%02x \n",write_buf); /* */ rc = felica_i2c_read(FELICA_I2C_REG_ADDRSS_01, &read_buf, 1); udelay(50); /* */ write_buf = write_buf | 0x80; rc = felica_i2c_write(FELICA_I2C_REG_ADDRSS_01, &write_buf, 1); mdelay(2); /* */ rc = felica_i2c_read(FELICA_I2C_REG_ADDRSS_01, &read_buf, 1); udelay(50); FELICA_DEBUG_MSG_LOW("[FELICA_CAL] felica_cal_write - end \n"); return 1; } /* */ static struct file_operations felica_cal_fops = { .owner = THIS_MODULE, .open = felica_cal_open, .read = felica_cal_read, .write = felica_cal_write, .release = felica_cal_release, }; static struct miscdevice felica_cal_device = { .minor = 242, .name = FELICA_CAL_NAME, .fops = &felica_cal_fops }; /* */ static int felica_cal_init(void) { int rc = -1; FELICA_DEBUG_MSG_LOW("[FELICA_CAL] felica_cal_init - start \n"); /* */ rc = misc_register(&felica_cal_device); if (rc < 0) { FELICA_DEBUG_MSG_HIGH("[FELICA_CAL] ERROR - can not register felica_cal \n"); return rc; } FELICA_DEBUG_MSG_LOW("[FELICA_CAL] felica_cal_init - end \n"); return 0; } /* */ static void felica_cal_exit(void) { FELICA_DEBUG_MSG_LOW("[FELICA_CAL] felica_cal_exit - start \n"); /* */ misc_deregister(&felica_cal_device); FELICA_DEBUG_MSG_LOW("[FELICA_CAL] felica_cal_exit - end \n"); } module_init(felica_cal_init); module_exit(felica_cal_exit); MODULE_LICENSE("Dual BSD/GPL");
/* APPLE LOCAL file mainline */ /* Darwin pragma for __attribute__ ((ms_struct)). */ /* { dg-do compile { target *-*-darwin* } } */ /* { dg-options "-Wall" } */ #pragma ms_struct on #pragma ms_struct off #pragma ms_struct reset #pragma ms_struct /* { dg-warning "malformed" } */ #pragma ms_struct on top of spaghetti /* { dg-warning "junk" } */ struct foo { int a; int b; char c; };
/******************************************************************************* * * File archive.h * * Copyright (C) 2011 Martin Luescher * * This software is distributed under the terms of the GNU General Public * License (GPL) * *******************************************************************************/ #ifndef ARCHIVE_H #define ARCHIVE_H #ifndef SU3_H #include "su3.h" #endif /* ARCHIVE_C */ extern void write_cnfg(char *out); extern void read_cnfg(char *in); extern void export_cnfg(char *out); extern void import_cnfg(char *in); /* MARCHIVE_C */ extern void write_mfld(char *out); extern void read_mfld(char *in); extern void export_mfld(char *out); extern void import_mfld(char *in); /* SARCHIVE_C */ extern void write_sfld(char *out,spinor_dble *sd); extern void read_sfld(char *in,spinor_dble *sd); extern void export_sfld(char *out,spinor_dble *sd); extern void import_sfld(char *in,spinor_dble *sd); #endif
/* * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _LINUX_IOPOLL_H #define _LINUX_IOPOLL_H #include <linux/kernel.h> #include <linux/types.h> #include <linux/jiffies.h> #include <linux/delay.h> #include <asm-generic/errno.h> #include <asm/io.h> /** * readl_poll_timeout - Periodically poll an address until a condition is met or a timeout occurs * @addr: Address to poll * @val: Variable to read the value into * @cond: Break condition (usually involving @val) * @sleep_us: Maximum time to sleep between reads in us (0 tight-loops) * @timeout_us: Timeout in us, 0 means never timeout * * Returns 0 on success and -ETIMEDOUT upon a timeout. In either * case, the last read value at @addr is stored in @val. Must not * be called from atomic context if sleep_us or timeout_us are used. */ #define readl_poll_timeout(addr, val, cond, sleep_us, timeout_us) \ ({ \ unsigned long timeout = jiffies + usecs_to_jiffies(timeout_us); \ might_sleep_if(timeout_us); \ for (;;) { \ (val) = readl(addr); \ if (cond) \ break; \ if (timeout_us && time_after(jiffies, timeout)) { \ (val) = readl(addr); \ break; \ } \ if (sleep_us) \ usleep_range(DIV_ROUND_UP(sleep_us, 4), sleep_us); \ } \ (cond) ? 0 : -ETIMEDOUT; \ }) /** * readl_poll_timeout_noirq - Periodically poll an address until a condition is met or a timeout occurs * @addr: Address to poll * @val: Variable to read the value into * @cond: Break condition (usually involving @val) * @max_reads: Maximum number of reads before giving up * @time_between_us: Time to udelay() between successive reads * * Returns 0 on success and -ETIMEDOUT upon a timeout. */ #define readl_poll_timeout_noirq(addr, val, cond, max_reads, time_between_us) \ ({ \ int count; \ for (count = (max_reads); count > 0; count--) { \ (val) = readl(addr); \ if (cond) \ break; \ udelay(time_between_us); \ } \ (cond) ? 0 : -ETIMEDOUT; \ }) /** * readl_poll - Periodically poll an address until a condition is met * @addr: Address to poll * @val: Variable to read the value into * @cond: Break condition (usually involving @val) * @sleep_us: Maximum time to sleep between reads in us (0 tight-loops) * * Must not be called from atomic context if sleep_us is used. */ #define readl_poll(addr, val, cond, sleep_us) \ readl_poll_timeout(addr, val, cond, sleep_us, 0) /** * readl_tight_poll_timeout - Tight-loop on an address until a condition is met or a timeout occurs * @addr: Address to poll * @val: Variable to read the value into * @cond: Break condition (usually involving @val) * @timeout_us: Timeout in us, 0 means never timeout * * Returns 0 on success and -ETIMEDOUT upon a timeout. In either * case, the last read value at @addr is stored in @val. Must not * be called from atomic context if timeout_us is used. */ #define readl_tight_poll_timeout(addr, val, cond, timeout_us) \ readl_poll_timeout(addr, val, cond, 0, timeout_us) /** * readl_tight_poll - Tight-loop on an address until a condition is met * @addr: Address to poll * @val: Variable to read the value into * @cond: Break condition (usually involving @val) * * May be called from atomic context. */ #define readl_tight_poll(addr, val, cond) \ readl_poll_timeout(addr, val, cond, 0, 0) #endif /* _LINUX_IOPOLL_H */
/* ** Zabbix ** Copyright (C) 2001-2016 Zabbix SIA ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ #include "common.h" #include "sysinfo.h" ZBX_METRIC parameters_specific[] = /* KEY FLAG FUNCTION TEST PARAMETERS */ { {"kernel.maxfiles", 0, KERNEL_MAXFILES, NULL}, {"kernel.maxproc", 0, KERNEL_MAXPROC, NULL}, {"vfs.fs.size", CF_HAVEPARAMS, VFS_FS_SIZE, "/,free"}, {"vfs.fs.inode", CF_HAVEPARAMS, VFS_FS_INODE, "/,free"}, {"vfs.fs.discovery", 0, VFS_FS_DISCOVERY, NULL}, {"vfs.dev.read", CF_HAVEPARAMS, VFS_DEV_READ, "da0,operations"}, {"vfs.dev.write", CF_HAVEPARAMS, VFS_DEV_WRITE, "da0,operations"}, {"net.tcp.listen", CF_HAVEPARAMS, NET_TCP_LISTEN, "80"}, {"net.udp.listen", CF_HAVEPARAMS, NET_UDP_LISTEN, "68"}, {"net.if.in", CF_HAVEPARAMS, NET_IF_IN, "lo0,bytes"}, {"net.if.out", CF_HAVEPARAMS, NET_IF_OUT, "lo0,bytes"}, {"net.if.total", CF_HAVEPARAMS, NET_IF_TOTAL, "lo0,bytes"}, {"net.if.collisions", CF_HAVEPARAMS, NET_IF_COLLISIONS, "lo0"}, {"net.if.discovery", 0, NET_IF_DISCOVERY, "lo0"}, {"vm.memory.size", CF_HAVEPARAMS, VM_MEMORY_SIZE, "free"}, {"proc.num", CF_HAVEPARAMS, PROC_NUM, "inetd"}, {"proc.mem", CF_HAVEPARAMS, PROC_MEM, "inetd"}, {"system.cpu.switches", 0, SYSTEM_CPU_SWITCHES, NULL}, {"system.cpu.intr", 0, SYSTEM_CPU_INTR, NULL}, {"system.cpu.util", CF_HAVEPARAMS, SYSTEM_CPU_UTIL, "all,user,avg1"}, {"system.cpu.load", CF_HAVEPARAMS, SYSTEM_CPU_LOAD, "all,avg1"}, {"system.cpu.num", CF_HAVEPARAMS, SYSTEM_CPU_NUM, "online"}, {"system.cpu.discovery",0, SYSTEM_CPU_DISCOVERY, NULL}, {"system.uname", 0, SYSTEM_UNAME, NULL}, {"system.sw.arch", 0, SYSTEM_SW_ARCH, NULL}, {"system.swap.size", CF_HAVEPARAMS, SYSTEM_SWAP_SIZE, "all,free"}, {"system.uptime", 0, SYSTEM_UPTIME, NULL}, {"system.boottime", 0, SYSTEM_BOOTTIME, NULL}, {NULL} };
/* * s2mpb02.h - Driver for the Samsung s2mpb02 * * Copyright (C) 2014 Samsung Electrnoics * XXX <xxx@samsung.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * S2MPB02 has Flash LED devices. * The devices share the same I2C bus and included in * this mfd driver. */ #ifndef __S2MPB02_H__ #define __S2MPB02_H__ #include <linux/i2c.h> #define MFD_DEV_NAME "s2mpb02" #define S2MPB02_I2C_ADDR (0xB2 >> 1) #define S2MPB02_REG_INVALID (0xff) #define S2MPB02_PMIC_REV(iodev) (iodev)->rev_num enum s2mpb02_types { TYPE_S2MPB02, }; enum s2mpb02_irq_source { LED_INT = 0, S2MPB02_IRQ_GROUP_NR, }; enum s2mpb02_irq { /* FLASH */ S2MPB02_LED_IRQ_IRLED_END, S2MPB02_IRQ_NR, }; struct s2mpb02_dev { struct device *dev; struct i2c_client *i2c; /* 0xB2; PMIC, Flash LED */ struct mutex i2c_lock; int type; u8 rev_num; /* pmic Rev */ int irq; int irq_base; int irq_gpio; bool wakeup; struct mutex irqlock; int irq_masks_cur[S2MPB02_IRQ_GROUP_NR]; int irq_masks_cache[S2MPB02_IRQ_GROUP_NR]; struct pinctrl *max_pinctrl; struct pinctrl_state *gpio_state_active; struct pinctrl_state *gpio_state_suspend; struct s2mpb02_platform_data *pdata; }; #ifdef CONFIG_LEDS_S2MPB02 struct s2mpb02_led_platform_data; #endif struct s2mpb02_regulator_data { int id; struct regulator_init_data *initdata; struct device_node *reg_node; }; struct s2mpb02_platform_data { /* IRQ */ int irq_base; int irq_gpio; bool wakeup; int num_regulators; struct s2mpb02_regulator_data *regulators; #ifdef CONFIG_LEDS_S2MPB02 /* led (flash/torch) data */ struct s2mpb02_led_platform_data *led_data; #endif }; extern int s2mpb02_irq_init(struct s2mpb02_dev *s2mpb02); extern void s2mpb02_irq_exit(struct s2mpb02_dev *s2mpb02); extern int s2mpb02_irq_resume(struct s2mpb02_dev *s2mpb02); /* S2MPB02 shared i2c API function */ extern int s2mpb02_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest); extern int s2mpb02_bulk_read(struct i2c_client *i2c, u8 reg, int count, u8 *buf); extern int s2mpb02_write_reg(struct i2c_client *i2c, u8 reg, u8 value); extern int s2mpb02_bulk_write(struct i2c_client *i2c, u8 reg, int count, u8 *buf); extern int s2mpb02_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask); #endif /* __S2MPB02_H__ */
/* Common declarations for all of GNU Fortran libcaf implementations. Copyright (C) 2011-2015 Free Software Foundation, Inc. Contributed by Tobias Burnus <burnus@net-b.de> This file is part of the GNU Fortran Coarray Runtime Library (libcaf). Libcaf is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. Libcaf 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. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ #ifndef LIBCAF_H #define LIBCAF_H #include <stdbool.h> #include <stddef.h> /* For size_t. */ #include <stdint.h> /* For int32_t. */ #include "libgfortran.h" #if 0 #ifndef __GNUC__ #define __attribute__(x) #define likely(x) (x) #define unlikely(x) (x) #else #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #endif /* Definitions of the Fortran 2008 standard; need to kept in sync with ISO_FORTRAN_ENV, cf. libgfortran.h. */ #define STAT_UNLOCKED 0 #define STAT_LOCKED 1 #define STAT_LOCKED_OTHER_IMAGE 2 #define STAT_STOPPED_IMAGE 6000 #endif /* Describes what type of array we are registerring. Keep in sync with gcc/fortran/trans.h. */ typedef enum caf_register_t { CAF_REGTYPE_COARRAY_STATIC, CAF_REGTYPE_COARRAY_ALLOC, CAF_REGTYPE_LOCK_STATIC, CAF_REGTYPE_LOCK_ALLOC, CAF_REGTYPE_CRITICAL, CAF_REGTYPE_EVENT_STATIC, CAF_REGTYPE_EVENT_ALLOC } caf_register_t; typedef void* caf_token_t; typedef gfc_array_void gfc_descriptor_t; /* Linked list of static coarrays registered. */ typedef struct caf_static_t { caf_token_t token; struct caf_static_t *prev; } caf_static_t; /* When there is a vector subscript in this dimension, nvec == 0, otherwise, lower_bound, upper_bound, stride contains the bounds relative to the declared bounds; kind denotes the integer kind of the elements of vector[]. */ typedef struct caf_vector_t { size_t nvec; union { struct { void *vector; int kind; } v; struct { ptrdiff_t lower_bound, upper_bound, stride; } triplet; } u; } caf_vector_t; void _gfortran_caf_init (int *, char ***); void _gfortran_caf_finalize (void); int _gfortran_caf_this_image (int); int _gfortran_caf_num_images (int, int); void *_gfortran_caf_register (size_t, caf_register_t, caf_token_t *, int *, char *, int); void _gfortran_caf_deregister (caf_token_t *, int *, char *, int); void _gfortran_caf_sync_all (int *, char *, int); void _gfortran_caf_sync_memory (int *, char *, int); void _gfortran_caf_sync_images (int, int[], int *, char *, int); void _gfortran_caf_error_stop_str (const char *, int32_t) __attribute__ ((noreturn)); void _gfortran_caf_error_stop (int32_t) __attribute__ ((noreturn)); void _gfortran_caf_co_broadcast (gfc_descriptor_t *, int, int *, char *, int); void _gfortran_caf_co_sum (gfc_descriptor_t *, int, int *, char *, int); void _gfortran_caf_co_min (gfc_descriptor_t *, int, int *, char *, int, int); void _gfortran_caf_co_max (gfc_descriptor_t *, int, int *, char *, int, int); void _gfortran_caf_co_reduce (gfc_descriptor_t *, void* (*) (void *, void*), int, int, int *, char *, int, int); void _gfortran_caf_get (caf_token_t, size_t, int, gfc_descriptor_t *, caf_vector_t *, gfc_descriptor_t *, int, int, bool); void _gfortran_caf_send (caf_token_t, size_t, int, gfc_descriptor_t *, caf_vector_t *, gfc_descriptor_t *, int, int, bool); void _gfortran_caf_sendget (caf_token_t, size_t, int, gfc_descriptor_t *, caf_vector_t *, caf_token_t, size_t, int, gfc_descriptor_t *, caf_vector_t *, int, int, bool); void _gfortran_caf_atomic_define (caf_token_t, size_t, int, void *, int *, int, int); void _gfortran_caf_atomic_ref (caf_token_t, size_t, int, void *, int *, int, int); void _gfortran_caf_atomic_cas (caf_token_t, size_t, int, void *, void *, void *, int *, int, int); void _gfortran_caf_atomic_op (int, caf_token_t, size_t, int, void *, void *, int *, int, int); void _gfortran_caf_lock (caf_token_t, size_t, int, int *, int *, char *, int); void _gfortran_caf_unlock (caf_token_t, size_t, int, int *, char *, int); void _gfortran_caf_event_post (caf_token_t, size_t, int, int *, char *, int); void _gfortran_caf_event_wait (caf_token_t, size_t, int, int *, char *, int); void _gfortran_caf_event_query (caf_token_t, size_t, int, int *, int *); #endif /* LIBCAF_H */
#ifndef __WHOWAS_H #define __WHOWAS_H #define WW_MAXCHANNELS 20 #define WW_DEFAULT_MAXENTRIES 1000 #define WW_MASKLEN (HOSTLEN + USERLEN + NICKLEN) #define WW_REASONLEN 512 typedef struct whowas { int type; time_t timestamp; nick nick; /* unlinked nick */ chanindex *channels[WW_MAXCHANNELS]; /* WHOWAS_QUIT or WHOWAS_KILL */ sstring *reason; /* WHOWAS_RENAME */ sstring *newnick; unsigned int marker; struct whowas *next; struct whowas *prev; } whowas; extern whowas *whowasrecs; extern int whowasmax; extern int whowasoffset; /* points to oldest record */ #define WHOWAS_UNUSED 0 #define WHOWAS_USED 1 #define WHOWAS_QUIT 2 #define WHOWAS_KILL 3 #define WHOWAS_RENAME 4 whowas *whowas_fromnick(nick *np, int standalone); nick *whowas_tonick(whowas *ww); void whowas_freenick(nick *np); whowas *whowas_chase(const char *target, int maxage); const char *whowas_format(whowas *ww); const char *whowas_formatchannels(whowas *ww); void whowas_clean(whowas *ww); void whowas_free(whowas *ww); unsigned int nextwhowasmarker(void); #endif /* __WHOWAS_H */
/* Copyright 2013 David Axmark Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef _OPENGLES_H_ #define _OPENGLES_H_ namespace Base { struct SubView { int x, y, w, h; void* data; // hold handle for instance. }; bool subViewOpen(int left, int top, int width, int height, SubView& out); bool subViewClose(const SubView& sv); bool openGLInit(const SubView& subView); bool openGLClose(const SubView& subView); bool openGLSwap(const SubView& subView); bool openGLProcessEvents(const SubView &subView); } #endif // _OPENGLES_H_
/* pwsafe.c * * Password Safe cracker * Copyright (C) 2013 Dhiru Kholia <dhiru at openwall.com> * * hashkill - a hash cracking tool * Copyright (C) 2010 Milen Rangelov <gat3way@gat3way.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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <stdio.h> #include <unistd.h> #include <string.h> #include <alloca.h> #include <sys/types.h> #include <openssl/sha.h> #include <fcntl.h> #include <assert.h> #include <stdint.h> #include <stdlib.h> #include <stdio.h> #include <stdlib.h> #include <limits.h> #include <errno.h> #include <string.h> #include "plugin.h" #include "err.h" #include "hashinterface.h" int vectorsize; static struct custom_salt { int version; unsigned int iterations; unsigned char salt[32]; unsigned char hash[32]; } cs; char *hash_plugin_summary(void) { return ("pwsafe \t\tPassword Safe passphrase plugin"); } char *hash_plugin_detailed(void) { return ("pwsafe - Password Safe passphrase plugin\n" "------------------------------------------------\n" "Use this module to crack Password Safe pwsafe files\n" "Input should be a Password Safe pwsafe (specified with -f)\n" "\nAuthor: Dhiru Kholia <dhiru at openwall.com>\n"); } static char *magic = "PWS3"; /* helper functions for byte order conversions, header values are stored * in little-endian byte order */ static uint32_t fget32(FILE * fp) { uint32_t v = fgetc(fp); v |= fgetc(fp) << 8; v |= fgetc(fp) << 16; v |= fgetc(fp) << 24; return v; } hash_stat hash_plugin_parse_hash(char *hashline, char *filename) { FILE *fp; int count; unsigned char buf[32]; if (!(fp = fopen(filename, "rb"))) { //fprintf(stderr, "! %s: %s\n", filename, strerror(errno)); return hash_err; } count = fread(buf, 4, 1, fp); if (count != 1) goto bail; if(memcmp(buf, magic, 4)) { //fprintf(stderr, "%s : Couldn't find PWS3 magic string. Is this a Password Safe file?\n", filename); goto bail; } count = fread(buf, 32, 1, fp); if (count != 1) goto bail; cs.iterations = fget32(fp); memcpy(cs.salt, buf, 32); count = fread(buf, 32, 1, fp); if (count != 1) goto bail; //assert(count == 1); memcpy(cs.hash, buf, 32); fclose(fp); (void) hash_add_username(filename); (void) hash_add_hash("Password Safe pwsafe file \0", 0); (void) hash_add_salt("123"); (void) hash_add_salt2(" "); return hash_ok; bail: fclose(fp); return hash_err; } hash_stat hash_plugin_check_hash(const char *hash, const char *password[VECTORSIZE], const char *salt, char *salt2[VECTORSIZE], const char *username, int *num, int threadid) { char *buf[VECTORSIZE]; char *buf2[VECTORSIZE]; int lens[VECTORSIZE]; int lens2[VECTORSIZE]; int a; for (a = 0; a < vectorsize; a++) { buf[a] = alloca(32); buf2[a] = alloca(128); lens[a]=strlen(password[a]); memcpy(buf2[a],password[a],lens[a]); memcpy(buf2[a]+lens[a],cs.salt,32); lens[a]+=32; lens2[a]=32; } hash_sha256_unicode((const char**)buf2, buf, lens); for (a=0;a<=cs.iterations;a++) { hash_sha256_unicode((const char**)buf, buf, lens2); } for (a = 0; a < vectorsize; a++) { if (!memcmp(buf[a], cs.hash, 32)) { *num = a; return hash_ok; } } return hash_err; } int hash_plugin_hash_length(void) { return 16; } int hash_plugin_is_raw(void) { return 0; } int hash_plugin_is_special(void) { return 1; } void get_vector_size(int size) { vectorsize = size; } int get_salt_size(void) { return 4; }
/* * Copyright (C) 2010 Google Inc. All rights reserved. * Copyright (C) 2016 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #include "BaseCheckableInputType.h" namespace WebCore { class RadioInputType final : public BaseCheckableInputType { public: explicit RadioInputType(HTMLInputElement& element) : BaseCheckableInputType(element) { } private: const AtomicString& formControlType() const override; bool valueMissing(const String&) const override; String valueMissingText() const override; void handleClickEvent(MouseEvent&) override; void handleKeydownEvent(KeyboardEvent&) override; void handleKeyupEvent(KeyboardEvent&) override; bool isKeyboardFocusable(KeyboardEvent&) const override; bool shouldSendChangeEventAfterCheckedChanged() override; void willDispatchClick(InputElementClickState&) override; void didDispatchClick(Event*, const InputElementClickState&) override; bool isRadioButton() const override; bool matchesIndeterminatePseudoClass() const override; }; } // namespace WebCore
/* * Copyright (C) 2014 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef OESTextureHalfFloatLinear_h #define OESTextureHalfFloatLinear_h #include "WebGLExtension.h" #include <wtf/PassOwnPtr.h> namespace WebCore { class OESTextureHalfFloatLinear : public WebGLExtension { public: static OwnPtr<OESTextureHalfFloatLinear> create(WebGLRenderingContext*); virtual ~OESTextureHalfFloatLinear(); virtual ExtensionName getName() const override; private: OESTextureHalfFloatLinear(WebGLRenderingContext*); }; } // namespace WebCore #endif // OESTextureHalfFloatLinear_h
/* * Copyright (c) 2003, 2007-11 Matteo Frigo * Copyright (c) 2003, 2007-11 Massachusetts Institute of Technology * * 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 * */ /* This file was automatically generated --- DO NOT EDIT */ /* Generated on Wed Jul 27 06:19:01 EDT 2011 */ #include "codelet-rdft.h" #ifdef HAVE_FMA /* Generated by: ../../../genfft/gen_r2cb.native -fma -reorder-insns -schedule-for-pipeline -compact -variables 4 -pipeline-latency 4 -sign 1 -n 2 -name r2cbIII_2 -dft-III -include r2cbIII.h */ /* * This function contains 0 FP additions, 2 FP multiplications, * (or, 0 additions, 2 multiplications, 0 fused multiply/add), * 4 stack variables, 1 constants, and 4 memory accesses */ #include "r2cbIII.h" static void r2cbIII_2(R *R0, R *R1, R *Cr, R *Ci, stride rs, stride csr, stride csi, INT v, INT ivs, INT ovs) { DK(KP2_000000000, +2.000000000000000000000000000000000000000000000); { INT i; for (i = v; i > 0; i = i - 1, R0 = R0 + ovs, R1 = R1 + ovs, Cr = Cr + ivs, Ci = Ci + ivs, MAKE_VOLATILE_STRIDE(rs), MAKE_VOLATILE_STRIDE(csr), MAKE_VOLATILE_STRIDE(csi)) { E T1, T2; T1 = Cr[0]; T2 = Ci[0]; R0[0] = KP2_000000000 * T1; R1[0] = -(KP2_000000000 * T2); } } } static const kr2c_desc desc = { 2, "r2cbIII_2", {0, 2, 0, 0}, &GENUS }; void X(codelet_r2cbIII_2) (planner *p) { X(kr2c_register) (p, r2cbIII_2, &desc); } #else /* HAVE_FMA */ /* Generated by: ../../../genfft/gen_r2cb.native -compact -variables 4 -pipeline-latency 4 -sign 1 -n 2 -name r2cbIII_2 -dft-III -include r2cbIII.h */ /* * This function contains 0 FP additions, 2 FP multiplications, * (or, 0 additions, 2 multiplications, 0 fused multiply/add), * 4 stack variables, 1 constants, and 4 memory accesses */ #include "r2cbIII.h" static void r2cbIII_2(R *R0, R *R1, R *Cr, R *Ci, stride rs, stride csr, stride csi, INT v, INT ivs, INT ovs) { DK(KP2_000000000, +2.000000000000000000000000000000000000000000000); { INT i; for (i = v; i > 0; i = i - 1, R0 = R0 + ovs, R1 = R1 + ovs, Cr = Cr + ivs, Ci = Ci + ivs, MAKE_VOLATILE_STRIDE(rs), MAKE_VOLATILE_STRIDE(csr), MAKE_VOLATILE_STRIDE(csi)) { E T1, T2; T1 = Cr[0]; T2 = Ci[0]; R0[0] = KP2_000000000 * T1; R1[0] = -(KP2_000000000 * T2); } } } static const kr2c_desc desc = { 2, "r2cbIII_2", {0, 2, 0, 0}, &GENUS }; void X(codelet_r2cbIII_2) (planner *p) { X(kr2c_register) (p, r2cbIII_2, &desc); } #endif /* HAVE_FMA */
// SPDX-License-Identifier: GPL-2.0-or-later /* Copyright (c) 2021 SUSE LLC */ #include <stdlib.h> #include <stdio.h> #include "tst_test.h" static char *only_mount_v1; static char *no_cleanup; static struct tst_option opts[] = { {"v", &only_mount_v1, "-v\tOnly try to mount CGroups V1"}, {"n", &no_cleanup, "-n\tLeave CGroups created by test"}, {NULL, NULL, NULL}, }; static struct tst_cg_opts cgopts; static struct tst_cg_group *cg_child; static void do_test(void) { char buf[BUFSIZ]; size_t mem; if (!TST_CG_VER_IS_V1(tst_cg, "memory")) SAFE_CG_PRINT(tst_cg, "cgroup.subtree_control", "+memory"); if (!TST_CG_VER_IS_V1(tst_cg, "cpuset")) SAFE_CG_PRINT(tst_cg, "cgroup.subtree_control", "+cpuset"); cg_child = tst_cg_group_mk(tst_cg, "child"); if (!SAFE_FORK()) { SAFE_CG_PRINTF(cg_child, "cgroup.procs", "%d", getpid()); SAFE_CG_SCANF(cg_child, "memory.current", "%zu", &mem); tst_res(TPASS, "child/memory.current = %zu", mem); SAFE_CG_PRINTF(cg_child, "memory.max", "%zu", (1UL << 24) - 1); SAFE_CG_PRINTF(cg_child, "memory.swap.max", "%zu", 1UL << 31); SAFE_CG_READ(cg_child, "cpuset.mems", buf, sizeof(buf)); tst_res(TPASS, "child/cpuset.mems = %s", buf); SAFE_CG_PRINT(cg_child, "cpuset.mems", buf); exit(0); } SAFE_CG_PRINTF(tst_cg, "memory.max", "%zu", (1UL << 24) - 1); SAFE_CG_PRINTF(cg_child, "cgroup.procs", "%d", getpid()); SAFE_CG_SCANF(tst_cg, "memory.current", "%zu", &mem); tst_res(TPASS, "memory.current = %zu", mem); tst_reap_children(); SAFE_CG_PRINTF(tst_cg_drain, "cgroup.procs", "%d", getpid()); cg_child = tst_cg_group_rm(cg_child); } static void setup(void) { cgopts.needs_ver = !!only_mount_v1 ? TST_CG_V1 : 0; tst_cg_scan(); tst_cg_print_config(); tst_cg_require("memory", &cgopts); tst_cg_require("cpuset", &cgopts); tst_cg_init(); } static void cleanup(void) { if (cg_child) { SAFE_CG_PRINTF(tst_cg_drain, "cgroup.procs", "%d", getpid()); cg_child = tst_cg_group_rm(cg_child); } if (!no_cleanup) tst_cg_cleanup(); } static struct tst_test test = { .test_all = do_test, .setup = setup, .cleanup = cleanup, .options = opts, .forks_child = 1, };
/* * Exercise Classic API Workspace Wrappers * * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. * * $Id: init.c,v 1.4 2009/12/08 17:52:56 joel Exp $ */ #include <tmacros.h> rtems_task Init( rtems_task_argument argument ) { void *p1; bool retbool; Heap_Information_block info; puts( "\n\n*** TEST WORKSPACE CLASSIC API ***" ); puts( "rtems_workspace_get_information - null pointer" ); retbool = rtems_workspace_get_information( NULL ); rtems_test_assert( retbool == false ); puts( "rtems_workspace_get_information - OK" ); retbool = rtems_workspace_get_information( &info ); rtems_test_assert( retbool == true ); puts( "rtems_workspace_allocate - null pointer" ); retbool = rtems_workspace_allocate( 42, NULL ); rtems_test_assert( retbool == false ); puts( "rtems_workspace_allocate - 0 bytes" ); retbool = rtems_workspace_allocate( 0, &p1 ); rtems_test_assert( retbool == false ); puts( "rtems_workspace_allocate - too many bytes" ); retbool = rtems_workspace_allocate( info.Free.largest * 2, &p1 ); rtems_test_assert( retbool == false ); puts( "rtems_workspace_allocate - 42 bytes" ); retbool = rtems_workspace_allocate( 42, &p1 ); rtems_test_assert( retbool == true ); rtems_test_assert( p1 != NULL ); puts( "rtems_workspace_free - NULL" ); retbool = rtems_workspace_free( NULL ); rtems_test_assert( retbool == false ); puts( "rtems_workspace_free - previous pointer to 42 bytes" ); retbool = rtems_workspace_free( p1 ); rtems_test_assert( retbool == true ); puts( "*** END OF TEST WORKSPACE CLASSIC API ***" ); rtems_test_exit( 0 ); } /* configuration information */ #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER #define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_MAXIMUM_TASKS 1 #define CONFIGURE_INIT #include <rtems/confdefs.h>
/*************************************************************************** qgsglobefrustumhighlight.h -------------------------------------- Date : 27.10.2013 Copyright : (C) 2013 Matthias Kuhn Email : matthias dot kuhn at gmx dot ch *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef QGSGLOBEFRUSTUMHIGHLIGHT_H #define QGSGLOBEFRUSTUMHIGHLIGHT_H #include <osg/NodeCallback> class QgsRubberBand; namespace osg { class View; } namespace osgEarth { class Terrain; class SpatialReference; } class QgsGlobeFrustumHighlightCallback : public osg::NodeCallback { public: QgsGlobeFrustumHighlightCallback( osg::View *view, osgEarth::Terrain *terrain, QgsMapCanvas *mapCanvas, QColor color ); ~QgsGlobeFrustumHighlightCallback(); void operator()( osg::Node *, osg::NodeVisitor * ) override; private: osg::View *mView = nullptr; osgEarth::Terrain *mTerrain = nullptr; QgsRubberBand *mRubberBand = nullptr; osgEarth::SpatialReference *mSrs = nullptr; }; #endif // QGSGLOBEFRUSTUMHIGHLIGHT_H
#ifndef __ardour_mackie_control_protocol_fader_h__ #define __ardour_mackie_control_protocol_fader_h__ #include "controls.h" namespace Mackie { class Fader : public Control { public: Fader (int id, std::string name, Group & group) : Control (id, name, group) , position (0.0) { } MidiByteArray set_position (float); MidiByteArray zero() { return set_position (0.0); } MidiByteArray update_message (); static Control* factory (Surface&, int id, const char*, Group&); private: float position; }; } #endif
/* Copyright (c) 2002-2011 by XMLVM.org * * Project Info: http://www.xmlvm.org * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This 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. */ #import "xmlvm.h" #import "org_xmlvm_iphone_UIView.h" #import "org_xmlvm_iphone_CGPoint.h" #import "java_lang_Object.h" #import "org_xmlvm_iphone_MKAnnotation.h" #import "java_lang_String.h" #import "org_xmlvm_iphone_UIImage.h" #import <MapKit/MKAnnotationView.h> typedef MKAnnotationView org_xmlvm_iphone_MKAnnotationView; @interface MKAnnotationView (cat_org_xmlvm_iphone_MKAnnotationView) - (void) __init_org_xmlvm_iphone_MKAnnotationView___org_xmlvm_iphone_MKAnnotation_java_lang_String :(org_xmlvm_iphone_MKAnnotation*)n1 :(java_lang_String*)n2; - (void) prepareForReuse__; - (int) isEnabled__; - (void) setEnabled___boolean :(int)n1; - (org_xmlvm_iphone_MKAnnotation*) getAnnotation__; - (void) setAnnotation___org_xmlvm_iphone_MKAnnotation :(org_xmlvm_iphone_MKAnnotation*)n1; - (org_xmlvm_iphone_CGPoint*) getCalloutOffset__; - (void) setCalloutOffset___org_xmlvm_iphone_CGPoint :(org_xmlvm_iphone_CGPoint*)n1; - (org_xmlvm_iphone_CGPoint*) getCenterOffset__; - (void) setCenterOffset___org_xmlvm_iphone_CGPoint :(org_xmlvm_iphone_CGPoint*)n1; - (int) isHighlighted__; - (void) setHighlighted___boolean :(int)n1; - (org_xmlvm_iphone_UIImage*) getImage__; - (void) setImage___org_xmlvm_iphone_UIImage :(org_xmlvm_iphone_UIImage*)n1; - (java_lang_String*) getReuseIdentifier__; - (int) isSelected__; - (void) setSelected___boolean :(int)n1; - (void) setSelected___boolean_boolean :(int)n1 :(int)n2; - (int) isCanShowCallout__; - (void) setCanShowCallout___boolean :(int)n1; - (org_xmlvm_iphone_UIView*) getLeftCalloutAccessoryView__; - (void) setLeftCalloutAccessoryView___org_xmlvm_iphone_UIView :(org_xmlvm_iphone_UIView*)n1; - (org_xmlvm_iphone_UIView*) getRightCalloutAccessoryView__; - (void) setRightCalloutAccessoryView___org_xmlvm_iphone_UIView :(org_xmlvm_iphone_UIView*)n1; - (int) getDragState__; - (void) setDragState___int :(int)n1; - (void) setDragState___int_boolean :(int)n1 :(int)n2; - (int) isDraggable__; - (void) setDraggable___boolean :(int)n1; @end
#include <stdio.h> #include "main_begin.h" /*------------------------------------------------------------- * BILGILER *------------------------------------------------------------*/ // TODO: Ogrenci numaranizi asagidaki degiskene atayin const long OGRENCI_NO = 130201108; // TODO: Terminal numaranizi asagidaki degiskene atayin const int TERM_NO = 21; /*------------------------------------------------------------- * AYARLAR *------------------------------------------------------------*/ /* soruyu gecersiz yapmak icin ilgili satiri yorum yapabilirsiniz ornek: // #define SORU_123 */ #define SORU_1 #define SORU_2 #define SORU_3 #define SORU_4 #define SORU_5 #define SORU_6 #define SORU_7 /*------------------------------------------------------------- * SORU 1 *------------------------------------------------------------*/ #ifdef SORU_1 void soru_1() { // TODO: dizinin ilk 5 elemanina sirasiyla 1, 2, 3, 4, 5 degerlerini atayin. int dizi[100]={1,2,3,4,5}; // ------------ ASAGIDAKI KODU DEGISTIRMEYIN ---------------- _test_1(dizi); } #endif /* SORU_ 1 */ /*------------------------------------------------------------- * SORU 2 *------------------------------------------------------------*/ #ifdef SORU_2 void soru_2(int dizi[], int N) { // TODO: dizinin ilk elemanini asagidaki degiskene atayin int ilk=dizi[0]; // TODO: dizinin ucuncu elemanini asagidaki degiskene atayin int bastan_ucuncu=dizi[2]; // TODO: dizinin son elemanini asagidaki degiskene atayin int son=dizi[N-1]; // TODO: dizinin sondan ikinci elemanini asagidaki degiskene atayin int sondan_ikinci=dizi[N-2]; // ------------ ASAGIDAKI KODU DEGISTIRMEYIN ---------------- _test_2(dizi, N, ilk, bastan_ucuncu, son, sondan_ikinci); } #endif /* SORU_2 */ #ifdef SORU_3 /*------------------------------------------------------------- * SORU 3 *------------------------------------------------------------*/ int soru_3(int dizi[], int N) { // TODO: dizinin elemanlarinin toplamini bulun ve fonksiyondan dondurun int i,toplam=0; for(i=0;i<=N-1;i++) { toplam+=dizi[i]; } return toplam; } #endif /* SORU_3 */ /*------------------------------------------------------------- * SORU 4 *------------------------------------------------------------*/ #ifdef SORU_4 void soru_4(int dizi[], int N) { /* - @dizi 'yi kucukten buyuge dogru siralayan kodu yaziniz */ int i,j; // TODO: diziyi kucukten buyuge dogru siralayiniz for(j=1;j<N;j++) { for(i=0;i<N-1;i++) { if(dizi[i]>dizi[i+1]) { dizi[i]^=dizi[i+1]; dizi[i+1]^=dizi[i]; dizi[i]^=dizi[i+1]; } } } } #endif /* SORU_4 */ /*------------------------------------------------------------- * SORU 5 *------------------------------------------------------------*/ #ifdef SORU_5 /** * girilen diziyi buyukten kucuge siralar * NOT: Bu fonksiya kod yazmayin. Kodlari size hazir olarak verildi. */ extern void sirala_s5(int dizi[], int N); int soru_5(int dizi[], int N) { /* - dizideki en buyuk 5 elemanin toplamini bulunuz - en buyuk X tane elemani bulmanin en kolay yolu, dizinin buyukten kucuge siralanarak ilk X tane elemanin alinmasidir. */ // TODO: diziyi buyukten kucuge siralayiniz // bunun icin yukarida verilen hazir fonksiyonu (sirala_s5) kullaniniz sirala_s5(dizi,N); int toplam=0,i; // TODO: en buyuk 5 elemaninin toplamini bulun ve fonksiyondan dondurunuz for(i=0;i<5;i++){ toplam+=dizi[i]; } return toplam; } #endif /* SORU_5 */ /*------------------------------------------------------------- * SORU 6 *------------------------------------------------------------*/ #ifdef SORU_6 int soru_6(int dizi[], int N, int aranan) { /* - @aranan degerine sahip elemanlardan @dizi 'de kac tane oldugunu bulan fonksiyonu yaziniz. @N dizinin eleman sayisidir - ORNEK: {1,2,3,1,2,2,2} aranan: 1 -> 2 dondurur aranan: 2 -> 4 dondurur aranan: 4 -> 0 dondurur */ int i, tane=0; // TODO: sonucu bulun ve fonksiyondan dondurun for(i=0;i<N;i++) { if(dizi[i]==aranan) { tane++; } } return tane; } #endif /* SORU_6 */ /*------------------------------------------------------------- * SORU 7 *------------------------------------------------------------*/ #ifdef SORU_7 void soru_7(int dizi[], int N) { /* - dizide en cok olan elemani ve kac tane oldugunu bulunuz - ornek: {1, 1, 2, 2, 2, 3, 4} EN_COK: 2 EN_COK_TANE: 3 - ornek: {1, 2, 3, 1} -> 2 EN_COK: 1 EN_COK_TANE: 2 */ // TODO: soruda anlatilan islemi yapin // TODO: en cok bulunan elemanin degerini bu degiskene atayin int EN_COK = 0; // TODO: en cok bulunan elemanin kac kere bulundugu bu degiskene atayin int EN_COK_TANE = 0; int i,j; for(j=1;j<N;j++) { for(i=0;i<N-1;i++) { if(dizi[i]>dizi[i+1]) { dizi[i]^=dizi[i+1]; dizi[i+1]^=dizi[i]; dizi[i]^=dizi[i+1]; } } } int sayac=0,sayacyedek=0; int encok=0,encokyedek=0; encok = dizi[0]; for(i=1;i<N;i++) { if(encok==dizi[i]) { sayac++; } else { sayacyedek=sayac; sayac=1; encokyedek=encok; encok=dizi[i]; } } if(sayac>sayacyedek) { EN_COK=encok; EN_COK_TANE=sayac; } else { EN_COK=encokyedek; EN_COK_TANE=sayacyedek; } // ------------ ASAGIDAKI KODU DEGISTIRMEYIN ---------------- _test_7(dizi, N, EN_COK, EN_COK_TANE); } #endif /* SORU_7 */ /*------------------------------------------------------------- * SORULAR BITTI *------------------------------------------------------------*/ // ------------ ASAGIDAKI KODU DEGISTIRMEYIN ---------------- #include "main_end.h"
#include "config.h" #include <glib/gi18n.h> #include <gio/gio.h> #include <gtk/gtk.h> #include <libpanel-util/panel-error.h> #include <libpanel-util/panel-keyfile.h> #include "panel-ditem-editor.h" #include "panel-icon-names.h" #include "panel-util.h" /* FIXME Symbols needed by panel-util.c - sucky */ #include "applet.h" GSList *mate_panel_applet_list_applets (void) { return NULL; } #include "panel-config-global.h" gboolean panel_global_config_get_tooltips_enabled (void) { return FALSE; } #include "panel-lockdown.h" gboolean panel_lockdown_get_disable_lock_screen (void) { return FALSE; } static int dialogs = 0; static gboolean create_new = FALSE; static char **desktops = NULL; static GOptionEntry options[] = { { "create-new", 0, 0, G_OPTION_ARG_NONE, &create_new, N_("Create new file in the given directory"), NULL }, { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &desktops, NULL, N_("[FILE...]") }, { NULL } }; static void dialog_destroyed (GtkWidget *dialog, gpointer data) { dialogs --; if (dialogs <= 0) gtk_main_quit (); } static void validate_for_filename (char *file) { char *ptr; g_return_if_fail (file != NULL); ptr = file; while (*ptr != '\0') { if (*ptr == '/') *ptr = '_'; ptr++; } } static char * find_uri_on_save (PanelDItemEditor *dialog, gpointer data) { GKeyFile *keyfile; char *name; char *filename; char *uri; char *dir; keyfile = panel_ditem_editor_get_key_file (dialog); name = panel_key_file_get_string (keyfile, "Name"); validate_for_filename (name); filename = g_filename_from_utf8 (name, -1, NULL, NULL, NULL); g_free (name); if (filename == NULL) filename = g_strdup ("foo"); dir = g_object_get_data (G_OBJECT (dialog), "dir"); uri = panel_make_unique_desktop_path_from_name (dir, filename); g_free (filename); return uri; } static void error_reported (GtkWidget *dialog, const char *primary, const char *secondary, gpointer data) { panel_error_dialog (GTK_WINDOW (dialog), NULL, "error_editing_launcher", TRUE, primary, secondary); } int main (int argc, char * argv[]) { GError *error = NULL; int i; bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); if (!gtk_init_with_args (&argc, &argv, _("- Edit .desktop files"), options, GETTEXT_PACKAGE, &error)) { g_printerr ("%s\n", error->message); g_error_free (error); return 1; } gtk_window_set_default_icon_name (PANEL_ICON_LAUNCHER); if (desktops == NULL || desktops[0] == NULL) { g_printerr ("mate-desktop-item-edit: no file to edit\n"); return 0; } for (i = 0; desktops[i] != NULL; i++) { GFile *file; GFileInfo *info; GFileType type; char *uri; char *path; GtkWidget *dlg = NULL; file = g_file_new_for_commandline_arg (desktops[i]); uri = g_file_get_uri (file); path = g_file_get_path (file); info = g_file_query_info (file, "standard::type", G_FILE_QUERY_INFO_NONE, NULL, NULL); g_object_unref (file); if (info) { type = g_file_info_get_file_type (info); if (type == G_FILE_TYPE_DIRECTORY && create_new) { dlg = panel_ditem_editor_new (NULL, NULL, _("Create Launcher")); g_object_set_data_full (G_OBJECT (dlg), "dir", g_strdup (path), (GDestroyNotify)g_free); panel_ditem_register_save_uri_func (PANEL_DITEM_EDITOR (dlg), find_uri_on_save, NULL); } else if (type == G_FILE_TYPE_DIRECTORY) { /* Rerun this iteration with the .directory * file * Note: No need to free, for one we can't free * an individual member of desktops and * secondly we will soon exit */ desktops[i] = g_build_path ("/", uri, ".directory", NULL); i--; } else if (type == G_FILE_TYPE_REGULAR && g_str_has_suffix (desktops [i], ".directory") && !create_new) { dlg = panel_ditem_editor_new_directory (NULL, uri, _("Directory Properties")); } else if (type == G_FILE_TYPE_REGULAR && g_str_has_suffix (desktops [i], ".desktop") && !create_new) { dlg = panel_ditem_editor_new (NULL, uri, _("Launcher Properties")); } else if (type == G_FILE_TYPE_REGULAR && create_new) { g_printerr ("mate-desktop-item-edit: %s " "already exists\n", uri); } else { g_printerr ("mate-desktop-item-edit: %s " "does not look like a desktop " "item\n", uri); } g_object_unref (info); } else if (g_str_has_suffix (desktops [i], ".directory")) { /* a non-existant file. Well we can still edit that * sort of. We will just create it new */ dlg = panel_ditem_editor_new_directory (NULL, uri, _("Directory Properties")); } else if (g_str_has_suffix (desktops [i], ".desktop")) { /* a non-existant file. Well we can still edit that * sort of. We will just create it new */ dlg = panel_ditem_editor_new (NULL, uri, _("Create Launcher")); } else { g_printerr ("mate-desktop-item-edit: %s does not " "have a .desktop or .directory " "suffix\n", uri); } if (dlg != NULL) { dialogs ++; g_signal_connect (G_OBJECT (dlg), "destroy", G_CALLBACK (dialog_destroyed), NULL); g_signal_connect (G_OBJECT (dlg), "error_reported", G_CALLBACK (error_reported), NULL); gtk_widget_show (dlg); } g_free (uri); g_free (path); } if (dialogs > 0) gtk_main (); return 0; }
/* Copyright 2013 David Axmark Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef EXTENSIONS_H #define EXTENSIONS_H #include "helpers/types.h" void loadExtensions(const char* extConfFileName); #endif //EXTENSIONS_H
/* -*- mode: C -*- */ /* IGraph library. Copyright (C) 2010 Gabor Csardi <csardi.gabor@gmail.com> Rue de l'Industrie 5, Lausanne 1005, Switzerland 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 */
/*************************************************************************** esrip.h Interface file for the Entertainment Sciences RIP Written by Phil Bennett ***************************************************************************/ #ifndef _ESRIP_H #define _ESRIP_H /*************************************************************************** COMPILE-TIME DEFINITIONS ***************************************************************************/ /*************************************************************************** GLOBAL CONSTANTS ***************************************************************************/ /*************************************************************************** REGISTER ENUMERATION ***************************************************************************/ enum { ESRIP_PC = 1, ESRIP_ACC, ESRIP_DLATCH, ESRIP_ILATCH, ESRIP_RAM00, ESRIP_RAM01, ESRIP_RAM02, ESRIP_RAM03, ESRIP_RAM04, ESRIP_RAM05, ESRIP_RAM06, ESRIP_RAM07, ESRIP_RAM08, ESRIP_RAM09, ESRIP_RAM0A, ESRIP_RAM0B, ESRIP_RAM0C, ESRIP_RAM0D, ESRIP_RAM0E, ESRIP_RAM0F, ESRIP_RAM10, ESRIP_RAM11, ESRIP_RAM12, ESRIP_RAM13, ESRIP_RAM14, ESRIP_RAM15, ESRIP_RAM16, ESRIP_RAM17, ESRIP_RAM18, ESRIP_RAM19, ESRIP_RAM1A, ESRIP_RAM1B, ESRIP_RAM1C, ESRIP_RAM1D, ESRIP_RAM1E, ESRIP_RAM1F, ESRIP_STATW, ESRIP_FDTC, ESRIP_IPTC, ESRIP_XSCALE, ESRIP_YSCALE, ESRIP_BANK, ESRIP_LINE, ESRIP_FIG, ESRIP_ATTR, ESRIP_ADRL, ESRIP_ADRR, ESRIP_COLR, ESRIP_IADDR, }; /*************************************************************************** CONFIGURATION STRUCTURE ***************************************************************************/ typedef struct _esrip_config_ esrip_config; struct _esrip_config_ { read16_device_func fdt_r; write16_device_func fdt_w; UINT8 (*status_in)(running_machine &machine); int (*draw)(running_machine &machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank); const char* const lbrm_prom; }; /*************************************************************************** PUBLIC FUNCTIONS ***************************************************************************/ DECLARE_LEGACY_CPU_DEVICE(ESRIP, esrip); extern UINT8 get_rip_status(device_t *cpu); #endif /* _ESRIP_H */
// RegisterCodec.h #ifndef __REGISTERCODEC_H #define __REGISTERCODEC_H #include "../Common/MethodId.h" #include "DeclareCodecs.h" typedef void * (*CreateCodecP)(); struct CCodecInfo { CreateCodecP CreateDecoder; CreateCodecP CreateEncoder; CMethodId Id; const wchar_t *Name; UInt32 NumInStreams; bool IsFilter; }; void RegisterCodec(const CCodecInfo *codecInfo); #define REGISTER_CODEC(x) CRegisterCodec##x::CRegisterCodec##x() { RegisterCodec(&g_CodecInfo); } \ CRegisterCodec##x g_RegisterCodec##x; #define REGISTER_CODECS(x) CRegisterCodecs##x::CRegisterCodecs##x() { \ for(int i=0;i<sizeof(g_CodecsInfo)/sizeof(*g_CodecsInfo);i++) \ RegisterCodec(&g_CodecsInfo[i]); } \ CRegisterCodecs##x g_RegisterCodecs##x; #endif
/* ============================================================ * * This file is a part of kipi-plugins project * http://www.digikam.org * * Date : 2004-10-01 * Description : a kipi plugin to batch process images * * Copyright (C) 2004-2009 by Gilles Caulier <caulier dot gilles at gmail dot com> * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef EFFECTOPTIONSDIALOG_H #define EFFECTOPTIONSDIALOG_H // Qt includes #include <QString> // KDE includes #include <kdialog.h> class KIntNumInput; namespace KIPIBatchProcessImagesPlugin { class EffectOptionsDialog : public KDialog { Q_OBJECT public: explicit EffectOptionsDialog(QWidget *parent = 0, int EffectType = 0); ~EffectOptionsDialog(); KIntNumInput *m_latWidth; KIntNumInput *m_latHeight; KIntNumInput *m_latOffset; KIntNumInput *m_charcoalRadius; KIntNumInput *m_charcoalDeviation; KIntNumInput *m_edgeRadius; KIntNumInput *m_embossRadius; KIntNumInput *m_embossDeviation; KIntNumInput *m_implodeFactor; KIntNumInput *m_paintRadius; KIntNumInput *m_shadeAzimuth; KIntNumInput *m_shadeElevation; KIntNumInput *m_solarizeFactor; KIntNumInput *m_spreadRadius; KIntNumInput *m_swirlDegrees; KIntNumInput *m_waveAmplitude; KIntNumInput *m_waveLength; }; } // namespace KIPIBatchProcessImagesPlugin #endif // EFFECTOPTIONSDIALOG_H