max_stars_repo_path
stringlengths
2
976
max_stars_repo_name
stringlengths
5
109
max_stars_count
float64
0
191k
id
stringlengths
1
7
content
stringlengths
1
11.6M
score
float64
-0.83
3.86
int_score
int64
0
4
src/GameSpy/Voice2/gvPS2Headset.h
OPNA2608/GameSpy
38
7996283
/* GameSpy Voice2 SDK Dan "Mr. Pants" Schoenblum <EMAIL> Copyright 2004 GameSpy Industries, Inc 18002 Skypark Circle Irvine, California 92614 949.798.4200 (Tel) 949.798.4299 (Fax) <EMAIL> http://gamespy.net */ #ifndef _GV_PS2_HEADSET_H_ #define _GV_PS2_HEADSET_H_ #include "gvMain.h" GVBool gviPS2HeadsetStartup(void); void gviPS2HeadsetCleanup(void); void gviPS2HeadsetThink(void); int gviPS2HeadsetListDevices(GVDeviceInfo devices[], int maxDevices, GVDeviceType types); GVDevice gviPS2HeadsetNewDevice(GVDeviceID deviceID, GVDeviceType type); #endif
0.158203
0
Plane3dWithLight/Table.h
Shauqi/Computer-Vision-Lab
0
7996291
#ifndef TABLE_H_INCLUDED #define TABLE_H_INCLUDED #include "Shape.h" void drawBaseCube(){ drawCube(1,1, -1,-1 ,1,-1); } void drawAnotherCube() { drawCube(1,1, -1,-1, 1,-1,1); } #endif // HOUSE_H_INCLUDED
0.527344
1
RainbowChat/FFEF.framework/Versions/A/Headers/FFUser.h
lephuocdai/RainbowChat
4
7996299
// // FFUser.h // FatFractal // // Copyright (c) 2012, 2013 FatFractal, Inc. All rights reserved. // #import <Foundation/Foundation.h> @class FFUserGroup; @class FatFractal; @protocol FFUserProtocol @property (strong, nonatomic) NSString *guid; @property (strong, nonatomic) NSString *userName; @end /*! \brief A special kind of FatFractal object for managing users of your application. */ /*! This is the special class for managing users in the FatFractal Emergent Framework. */ @interface FFUser : NSObject <NSCoding, FFUserProtocol> { /*! The FatFractal instance which is managing this FFUser object */ FatFractal *ff; NSMutableDictionary *_groupsDict; BOOL _groupsLoaded; } /*! An NSString with the unique identifier for the user. */ @property (strong, nonatomic) NSString *guid; /*! An NSString with the unique username for the user. */ @property (strong, nonatomic) NSString *userName; /*! An NSString with the first name of the user. */ @property (strong, nonatomic) NSString *firstName; /*! An NSString with the last name of the user. White spaces and special characters are allowed*/ @property (strong, nonatomic) NSString *lastName; /*! An NSString with the email of the user. This string is validated for proper formatting. */ @property (strong, nonatomic) NSString *email; /*! Boolean - is this user 'active' or not. Inactive users may be able to log in and read data, but will be unable to modify data. */ @property (nonatomic) BOOL active; /*! The user's authDomain. This will be removed from the FFUser object in a forthcoming release, and should never be modified. */ @property (strong, nonatomic) NSString *authDomain; /*! The user's associated scriptAuthService. This will be removed from the FFUser object in a forthcoming release, and should never be modified. */ @property (strong, nonatomic) NSString *scriptAuthService; /*! Standard initializer. No-args initializer calls this initializer with [FatFractal main] as parameter. */ - (id)initWithFF:(FatFractal *)_ff; /*! Add a group to this user's list of groups @param FFUserGroup - the user group to be added @param NSError - will be set to non-nil if an error occurs */ - (void) addGroup:(FFUserGroup *)group error:(NSError **)outErr; /*! Remove a group from this user's list of groups @param FFUserGroup - the user group to be removed @param NSError - will be set to non-nil if an error occurs */ - (void) removeGroup:(FFUserGroup *)group error:(NSError **)outErr; /*! Find a specific group in this user's list of groups @param NSString - the group's name @param NSError - will be set to non-nil if an error occurs @return FFUserGroup - the group, if found, or nil otherwise */ - (FFUserGroup *) groupWithName:(NSString *)groupName error:(NSError **)outErr; /*! Get all of this user's groups. @param NSError - will be set to non-nil if an error occurs @return NSArray - the array of groups */ - (NSArray *) getGroupsWithError:(NSError **)outErr; /*! Set the FatFractal instance to be associated with this object. NOTE: This method is intended to be used after de-archiving via initWithCoder. As such, it will only have an effect when no FatFractal instance has been set. */ - (BOOL)setFF:(FatFractal *)ff; @end
1.015625
1
src/plugins/gbp/gbp_policy.h
amithbraj/vpp
751
7996307
/* * Copyright (c) 2018 Cisco and/or its affiliates. * 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 __GBP_POLICY_H__ #define __GBP_POLICY_H__ #include <plugins/gbp/gbp_contract.h> /** * per-packet trace data */ typedef struct gbp_policy_trace_t_ { /* per-pkt trace data */ gbp_scope_t scope; sclass_t sclass; sclass_t dclass; gbp_rule_action_t action; u32 flags; u32 acl_match; u32 rule_match; } gbp_policy_trace_t; /* packet trace format function */ u8 * format_gbp_policy_trace (u8 * s, va_list * args); static_always_inline void gbp_policy_trace(vlib_main_t * vm, vlib_node_runtime_t * node, vlib_buffer_t *b, const gbp_contract_key_t *key, gbp_rule_action_t action, u32 acl_match, u32 rule_match) { gbp_policy_trace_t *t; if (PREDICT_TRUE (!(b->flags & VLIB_BUFFER_IS_TRACED))) return; t = vlib_add_trace (vm, node, b, sizeof (*t)); t->sclass = key->gck_src; t->dclass = key->gck_dst; t->scope = key->gck_scope; t->action = action; t->flags = vnet_buffer2 (b)->gbp.flags; t->acl_match = acl_match; t->rule_match = rule_match; } #endif /* __GBP_POLICY_H__ */
1.109375
1
samples/gui/wasm-runtime-wgl/src/platform/zephyr/XPT2046.h
oubotong/wasm-micro-runtime
0
7996315
/** * @file XPT2046.h * */ #ifndef XPT2046_H #define XPT2046_H #define USE_XPT2046 1 #ifndef LV_CONF_INCLUDE_SIMPLE #define LV_CONF_INCLUDE_SIMPLE #endif # define XPT2046_HOR_RES 320 # define XPT2046_VER_RES 240 # define XPT2046_X_MIN 200 # define XPT2046_Y_MIN 200 # define XPT2046_X_MAX 3800 # define XPT2046_Y_MAX 3800 # define XPT2046_AVG 4 # define XPT2046_INV 0 #define CMD_X_READ 0b10010000 #define CMD_Y_READ 0b11010000 #ifdef __cplusplus extern "C" { #endif /********************* * INCLUDES *********************/ #ifdef LV_CONF_INCLUDE_SIMPLE //#include "lv_drv_conf.h" #else //#include "../../lv_drv_conf.h" #endif #if USE_XPT2046 #include <autoconf.h> #include <stdint.h> #include <stdbool.h> #include "lv_hal/lv_hal_indev.h" #include "device.h" #include "gpio.h" /********************* * DEFINES *********************/ /********************** * TYPEDEFS **********************/ /********************** * GLOBAL PROTOTYPES **********************/ void xpt2046_init(void); bool xpt2046_read(lv_indev_data_t * data); /********************** * MACROS **********************/ #endif /* USE_XPT2046 */ #ifdef __cplusplus } /* extern "C" */ #endif #endif /* XPT2046_H */
0.976563
1
windows/netdde/incs/nscommn.h
npocmaka/Windows-Server-2003
17
7996323
/* * NSCOMMON.H NetDDE setup code common to NetDDE tools and NT setup code. * * Created 10/3/93 SanfordS */ BOOL CreateShareDBInstance(VOID); BOOL CreateDefaultTrust(HKEY hKeyUserRoot); 
0.069824
0
RemoteDataSync/RemoteDataSync/NSManagedObject+RDS.h
remizorrr/RemoteDataSync
0
7996331
// // NSManagedObject+RDS.h // PhotoKeeper // // Created by <NAME> on 12/1/15. // Copyright © 2015 PhotoKeeper. All rights reserved. // #import <CoreData/CoreData.h> typedef NS_ENUM(NSUInteger, RDSManagedObjectState) { RDSManagedObjectUnkown, RDSManagedObjectNew, RDSManagedObjectSynced, RDSManagedObjectChanged, RDSManagedObjectRemoved }; @interface NSManagedObject (RDS) @property (nonatomic, assign) RDSManagedObjectState state; - (void) markState:(RDSManagedObjectState)state; - (void) remoteCallWithScheme:(nonnull NSString*)scheme forKey:(nullable NSString*)keyName withParameters:(nullable NSDictionary*)parameters success:(nullable void (^)(id __nonnull responseObject, NSInteger newObjects))success failure:(nullable void (^)(NSError* __nullable error))failure; - (void) remoteCallWithScheme:(nonnull NSString*)scheme forKey:(nullable NSString*)keyName withParameters:(nullable NSDictionary*)parameters byReplacingData:(BOOL)replace success:(nullable void (^)(id __nonnull responseObject, NSInteger newObjects))success failure:(nullable void (^)(NSError* __nullable error))failure; - (void) remoteSyncWithSuccess:(nullable void (^)(id __nonnull responseObject, NSInteger newObjects))success failure:(nullable void (^)(NSError* __nullable error))failure; @end
0.957031
1
R3D/src/R3D/Graphics/Core/VertexArray.h
physteo/R3D
0
7996339
#pragma once #include<glad/glad.h> #include<GLFW/glfw3.h> #include "Buffer.h" namespace r3d { //!< Wrapper of the OpenGL Vertex Array Object (VAO). /*! Stores what is needed to draw vertices. Includes the format of the data, and the data (as Vertex Buffer Objects), which is owned by the VAO object (but it does not copy such data, only has reference to it). Stores the handle of the data m_id and the m_ibo / m_vbo. IMPORTANT: The default object (m_id = 0) is not accepted while in CORE profile. */ class VertexArray { private: Buffer m_vbo; Buffer m_ibo; unsigned int m_id; unsigned int m_numIndices; public: VertexArray() : m_vbo{}, m_ibo{}, m_id(0), m_numIndices(0) {} VertexArray(const std::vector<std::vector<float> >& attributes, const std::vector<unsigned int>& components, const std::vector<unsigned int>& indices); ~VertexArray(); VertexArray(const VertexArray& other) = delete; VertexArray& operator=(const VertexArray& other) = delete; VertexArray(VertexArray&& other); VertexArray& operator=(VertexArray&& other); void bind() const { glBindVertexArray(m_id); } void unbind() const { glBindVertexArray(0); } void draw(GLenum mode) const; inline unsigned int numIndices() const { return m_numIndices; } private: void generate() { glGenVertexArrays(1, &m_id); } void fillData(const std::vector<std::vector<float> >& attributes, const std::vector<unsigned int>& components); void setIbo(const std::vector<unsigned int>& indices); void swapData(VertexArray& other); void release(); }; class Vaos { public: static Vaos& getInstance(); static VertexArray createCubeVNTUMesh(); static VertexArray createSphereMesh(); static VertexArray createSkyDomeMesh(float radius); const VertexArray point; const VertexArray quad; const VertexArray plane; const VertexArray cube; const VertexArray cubeVNTU; const VertexArray cubeWithUv; const VertexArray skyDome; const VertexArray circle; private: Vaos(); }; }
1.75
2
tests/samples/Cycles.h
ekrich/scala-native-bindgen
8
7996347
struct node { int value; struct node *next; }; struct b; struct c; struct a { struct b *bb; }; struct b { struct c **cc; // type will be replace with Ptr[Ptr[Byte]] }; struct c { struct a aa; }; /* function pointer type */ struct FuncPointerCycle2; struct FuncPointerCycle1 { struct FuncPointerCycle2 *s; }; struct FuncPointerCycle2 { struct FuncPointerCycle1 *(*memberFunction)( void); // type will be replace with CFunctionPtr0[Ptr[Byte]] }; /* type has typedef alias */ struct TypeWithTypedef1; typedef struct TypeWithTypedef1 TypeWithTypedef1; struct TypeWithTypedef2 { TypeWithTypedef1 *s; // replaced with Ptr[Byte] }; struct TypeWithTypedef1 { struct TypeWithTypedef2 *s; }; /* two types should be replaced */ struct TwoTypesReplaced1; struct TwoTypesReplaced2; struct TwoTypesReplaced3 { struct TwoTypesReplaced1 *(*memberFunction)(struct TwoTypesReplaced2 *); }; struct TwoTypesReplaced1 { struct TwoTypesReplaced2 *s; }; struct TwoTypesReplaced2 { struct TwoTypesReplaced3 *s; }; /* cycle contains union. * unions are represented as arrays therefore they cannot belong to Scala Native * cycle of types */ union cycleWithUnionU; struct cycleWithUnionS { union cycleWithUnionU *u; }; union cycleWithUnionU { struct cycleWithUnionS *s; }; /* function pointer uses value type instead of pointer type */ struct FuncPointerWithValueType2; struct FuncPointerWithValueType1 { struct FuncPointerWithValueType2 *s; }; struct FuncPointerWithValueType2 { struct FuncPointerWithValueType1 (*memberFunction)( void); // return type will be replaced by CStruct0 };
2.09375
2
c_api/error_c.h
yuhonghong66/faiss
51
7996355
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD+Patents license found in the * LICENSE file in the root directory of this source tree. */ // Copyright 2004-present Facebook. All Rights Reserved. // -*- c -*- #ifndef FAISS_ERROR_C_H #define FAISS_ERROR_C_H #ifdef __cplusplus extern "C" { #endif typedef enum FaissErrorCode { OK = 0, UNKNOWN_EXCEPT = -1, FAISS_EXCEPT = -2, STD_EXCEPT = -4 } FaissErrorCode; /** * Get the error message of the last failed operation performed by Faiss. * The given pointer is only invalid until another Faiss function is * called. */ const char* faiss_get_last_error(); #ifdef __cplusplus } #endif #endif
0.964844
1
The Better Me/The Better Me/LoginViewController.h
iOS-Mobile-Applications/The-Better-Me
0
7996363
// // LoginViewController.h // The Better Me // // Created by <NAME> on 2/3/16. // Copyright © 2016 <NAME>. All rights reserved. // #import <UIKit/UIKit.h> @interface LoginViewController : UIViewController @end
0.11084
0
SPH/Project/SourceCode/BalancingRobot_R0.1/BalancingRobot/PrjHeader/PIDctrl.h
CodingBoxer/Homework001
1
7996371
/* * PIDctrl.h * * Created: 2021-01-30 오전 11:57:59 * Author: SON */ #ifndef PIDCTRL_H_ #define PIDCTRL_H_ #include "PrjHeader.h" #include "MotorCtrl.h" #include "Filter.h" void InitPIDCtrl(void); void RunPID_MotorCtrl(Angle_3Dim* AngleData); #endif /* PIDCTRL_H_ */
0.359375
0
ProjectNingIOS/Helpers/VCHolder.h
DerekFangming/ProjectNingIOS
0
7996379
// // VCHolder.h // ProjectNingIOS // // Created by NingFangming on 10/24/16. // Copyright © 2016 fangming. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import "Utils.h" #import "SlideNavigationController.h" @interface VCHolder : NSObject{ NSInteger currentVC; UIViewController *homeViewController; UIViewController *chatViewController; UIViewController *friendViewController; UIViewController *momentViewController; UIViewController *profileViewController; } + (instancetype)sharedInstance; - (UIViewController *)getVC:(NSInteger) VCIndicator; @end
0.519531
1
src/mkdirs.c
viifo/mkdirs
1
7996387
#include <stdio.h> #include <stdlib.h> #include <string.h> #define WINDOWS 1 #define LINUX 2 // Windows #if defined(WIN32) || defined (WIN64) #define OS_TYPE WINDOWS #define MKDIR "mkdir " #endif // LINUX #ifdef linux #define OS_TYPE LINUX #define MKDIR "mkdir -p " #endif /** 替换字符串中的字符 */ int strReplace(char*, char, char); /** 创建多级目录 */ void mkdirs(char*); int main(int argc, char *argv[]) { char *str; int i; if (argc >= 2) { for (i = 1; i < argc; i ++) { mkdirs(argv[i]); } } else { // 从路径中取出程序名 str = strrchr(argv[0], '/'); if (str == NULL) str = strrchr(argv[0], '\\'); if (str != NULL) str = str + 1; else str = argv[0]; printf("Command syntax error : %s path1 [path2]...\n", str); return -1; } return 0; } /** * 创建多级目录 * @param path 目录 * @return */ void mkdirs(char* path) { char str[512] = {0}; strcat(str, MKDIR); strcat(str, path); if (OS_TYPE == WINDOWS) strReplace(str, '/', '\\'); system(str); } /** * 替换字符串中的字符 * @param str - 字符串 * @param src - 要被替换的字符 * @param dst - 替换目标字符 * @return */ int strReplace(char* str, char src, char dst) { int count = 0; while (*str != '\0') { if (*str == src) { *str = dst; } str += 1; } return count; }
1.765625
2
packages/std/test/math/math_test.h
highduck/ekx
12
7996395
#ifndef MATH_TEST_H #define MATH_TEST_H #include "math_mat_test.h" #include "math_rect_test.h" #include "math_vec_test.h" #include "math_easing_test.h" #endif // MATH_TEST_H
0.384766
0
System/Library/PrivateFrameworks/Announce.framework/ANSimpleTrackPlayer.h
lechium/tvOS145Headers
5
7996403
/* * This header is generated by classdump-dyld 1.5 * on Wednesday, April 28, 2021 at 9:10:49 PM Mountain Standard Time * Operating System: Version 14.5 (Build 18L204) * Image Source: /System/Library/PrivateFrameworks/Announce.framework/Announce * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by <NAME>. Updated by <NAME>. */ #import <Announce/ANTrackPlayer.h> @interface ANSimpleTrackPlayer : ANTrackPlayer -(BOOL)playInternalSync; -(id)whatIsPlaying; -(void)nextInternalSync; -(void)previousInternalSync; -(void)handleInterruptionDelay:(double)arg1 ; @end
0.46875
0
src/include/ctx_internal.h
readams/throng
1
7996411
/* -*- C++ -*-; c-basic-offset: 4; indent-tabs-mode: nil */ /*! * @file ctx_internal.h * @brief Interface definition file for throng ctx_internal */ /* Copyright (c) 2015 Cisco Systems, 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 #ifndef THRONG_CTX_INTERNAL_H #define THRONG_CTX_INTERNAL_H #include "cluster_config.h" #include "throng/ctx.h" #include <boost/asio/io_service.hpp> namespace throng { namespace internal { class rpc_service; /** * Provides access to library-wide services for internal objects */ class ctx_internal : public ctx { public: virtual ~ctx_internal() {} /** * Get the IO service * * @return the IO service object */ virtual boost::asio::io_service& get_io_service() = 0; /** * Get the RPC service * * @return the RPC service object */ virtual rpc_service& get_rpc_service() = 0; /** * A seed for bootstrapping the cluster */ typedef std::pair<std::string, uint16_t> seed_t; /** * Get the seed information for the local node * * @return the hostname and port number for the local node */ virtual seed_t& get_local_seed() = 0; /** * Return true if the current node is a master node * * @return true if the current node is a master node */ virtual bool is_master() = 0; /** * Get the current cluster configuration * * @return a shared pointer to the current cluster configuration */ virtual cluster_config_p get_cluster_config() = 0; /** * Set a static node configuration for the cluster * * @param config the static configuration to set */ virtual void set_static_config(cluster_config_p config) = 0; }; } /* namespace internal */ } /* namespace throng */ #endif /* THRONG_CTX_INTERNAL_H */
1.046875
1
sockaddr.c
pixeldustproject-o/android_external_strace
0
7996419
/* * Copyright (c) 1991, 1992 <NAME> <<EMAIL>> * Copyright (c) 1993 <NAME> <<EMAIL>> * Copyright (c) 1993, 1994, 1995, 1996 <NAME> <<EMAIL>> * Copyright (c) 1996-2000 <NAME> <<EMAIL>> * Copyright (c) 2005-2016 <NAME> <<EMAIL>> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "defs.h" #include <sys/socket.h> #include <sys/un.h> #include <netinet/in.h> #include <arpa/inet.h> #include <linux/netlink.h> #include <linux/if_packet.h> #include <linux/if_arp.h> #include <linux/if_ether.h> #ifdef HAVE_NETIPX_IPX_H # include <netipx/ipx.h> #else # include <linux/ipx.h> #endif #include "xlat/addrfams.h" #include "xlat/arp_hardware_types.h" #include "xlat/ethernet_protocols.h" #include "xlat/af_packet_types.h" #ifdef HAVE_BLUETOOTH_BLUETOOTH_H # include <bluetooth/bluetooth.h> # include <bluetooth/hci.h> # include <bluetooth/l2cap.h> # include <bluetooth/rfcomm.h> # include <bluetooth/sco.h> # include "xlat/hci_channels.h" #endif #define SIZEOF_SA_FAMILY sizeof(((struct sockaddr *) 0)->sa_family) static void print_sockaddr_data_un(const void *const buf, const int addrlen) { const struct sockaddr_un *const sa_un = buf; const int un_len = addrlen > (int) sizeof(*sa_un) ? (int) sizeof(*sa_un) : addrlen; const int path_len = un_len - SIZEOF_SA_FAMILY; tprints("sun_path="); if (sa_un->sun_path[0]) { print_quoted_string(sa_un->sun_path, path_len + 1, QUOTE_0_TERMINATED); } else { tprints("@"); print_quoted_string(sa_un->sun_path + 1, path_len - 1, 0); } } static void print_sockaddr_data_in(const void *const buf, const int addrlen) { const struct sockaddr_in *const sa_in = buf; tprintf("sin_port=htons(%u), sin_addr=inet_addr(\"%s\")", ntohs(sa_in->sin_port), inet_ntoa(sa_in->sin_addr)); } #define SIN6_MIN_LEN offsetof(struct sockaddr_in6, sin6_scope_id) static void print_sockaddr_data_in6(const void *const buf, const int addrlen) { const struct sockaddr_in6 *const sa_in6 = buf; char string_addr[100]; inet_ntop(AF_INET6, &sa_in6->sin6_addr, string_addr, sizeof(string_addr)); tprintf("sin6_port=htons(%u), inet_pton(AF_INET6" ", \"%s\", &sin6_addr), sin6_flowinfo=htonl(%u)", ntohs(sa_in6->sin6_port), string_addr, ntohl(sa_in6->sin6_flowinfo)); if (addrlen <= (int) SIN6_MIN_LEN) return; tprints(", sin6_scope_id="); #if defined IN6_IS_ADDR_LINKLOCAL && defined IN6_IS_ADDR_MC_LINKLOCAL if (IN6_IS_ADDR_LINKLOCAL(&sa_in6->sin6_addr) || IN6_IS_ADDR_MC_LINKLOCAL(&sa_in6->sin6_addr)) print_ifindex(sa_in6->sin6_scope_id); else #endif tprintf("%u", sa_in6->sin6_scope_id); } static void print_sockaddr_data_ipx(const void *const buf, const int addrlen) { const struct sockaddr_ipx *const sa_ipx = buf; unsigned int i; tprintf("sipx_port=htons(%u)" ", sipx_network=htonl(%#08x)" ", sipx_node=[", ntohs(sa_ipx->sipx_port), ntohl(sa_ipx->sipx_network)); for (i = 0; i < IPX_NODE_LEN; ++i) { tprintf("%s%#02x", i ? ", " : "", sa_ipx->sipx_node[i]); } tprintf("], sipx_type=%#02x", sa_ipx->sipx_type); } static void print_sockaddr_data_nl(const void *const buf, const int addrlen) { const struct sockaddr_nl *const sa_nl = buf; tprintf("nl_pid=%d, nl_groups=%#08x", sa_nl->nl_pid, sa_nl->nl_groups); } static void print_sockaddr_data_ll(const void *const buf, const int addrlen) { const struct sockaddr_ll *const sa_ll = buf; tprints("sll_protocol=htons("); printxval(ethernet_protocols, ntohs(sa_ll->sll_protocol), "ETH_P_???"); tprints("), sll_ifindex="); print_ifindex(sa_ll->sll_ifindex); tprints(", sll_hatype="); printxval(arp_hardware_types, sa_ll->sll_hatype, "ARPHRD_???"); tprints(", sll_pkttype="); printxval(af_packet_types, sa_ll->sll_pkttype, "PACKET_???"); tprintf(", sll_halen=%u", sa_ll->sll_halen); if (sa_ll->sll_halen) { const unsigned int oob_halen = addrlen - offsetof(struct sockaddr_ll, sll_addr); unsigned int i; tprints(", sll_addr=["); for (i = 0; i < sa_ll->sll_halen; ++i) { if (i) tprints(", "); if (i >= oob_halen) { tprints("..."); break; } tprintf("%#02x", sa_ll->sll_addr[i]); } tprints("]"); } } static void print_sockaddr_data_raw(const void *const buf, const int addrlen) { const char *const data = buf + SIZEOF_SA_FAMILY; const int datalen = addrlen - SIZEOF_SA_FAMILY; tprints("sa_data="); print_quoted_string(data, datalen, 0); } #ifdef HAVE_BLUETOOTH_BLUETOOTH_H static void print_sockaddr_data_bt(const void *const buf, const int addrlen) { switch (addrlen) { case sizeof(struct sockaddr_hci): { const struct sockaddr_hci *const hci = buf; tprintf("hci_dev=htobs(%hu), hci_channel=", btohs(hci->hci_dev)); printxval(hci_channels, hci->hci_channel, "HCI_CHANNEL_???"); break; } case sizeof(struct sockaddr_sco): { const struct sockaddr_sco *const sco = buf; tprintf("sco_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x", sco->sco_bdaddr.b[0], sco->sco_bdaddr.b[1], sco->sco_bdaddr.b[2], sco->sco_bdaddr.b[3], sco->sco_bdaddr.b[4], sco->sco_bdaddr.b[5]); break; } case sizeof(struct sockaddr_rc): { const struct sockaddr_rc *const rc = buf; tprintf("rc_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" ", rc_channel=%u", rc->rc_bdaddr.b[0], rc->rc_bdaddr.b[1], rc->rc_bdaddr.b[2], rc->rc_bdaddr.b[3], rc->rc_bdaddr.b[4], rc->rc_bdaddr.b[5], rc->rc_channel); break; } case sizeof(struct sockaddr_l2): { const struct sockaddr_l2 *const l2 = buf; tprintf("l2_psm=htobs(%hu)" ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" ", l2_cid=htobs(%hu), l2_bdaddr_type=%u", btohs(l2->l2_psm), l2->l2_bdaddr.b[0], l2->l2_bdaddr.b[1], l2->l2_bdaddr.b[2], l2->l2_bdaddr.b[3], l2->l2_bdaddr.b[4], l2->l2_bdaddr.b[5], btohs(l2->l2_cid), l2->l2_bdaddr_type); break; } default: print_sockaddr_data_raw(buf, addrlen); break; } } #endif /* HAVE_BLUETOOTH_BLUETOOTH_H */ typedef void (* const sockaddr_printer)(const void *const, const int); static const struct { const sockaddr_printer printer; const int min_len; } sa_printers[] = { [AF_UNIX] = { print_sockaddr_data_un, SIZEOF_SA_FAMILY + 1 }, [AF_INET] = { print_sockaddr_data_in, sizeof(struct sockaddr_in) }, [AF_IPX] = { print_sockaddr_data_ipx, sizeof(struct sockaddr_ipx) }, [AF_INET6] = { print_sockaddr_data_in6, SIN6_MIN_LEN }, [AF_NETLINK] = { print_sockaddr_data_nl, SIZEOF_SA_FAMILY + 1 }, [AF_PACKET] = { print_sockaddr_data_ll, sizeof(struct sockaddr_ll) }, #ifdef HAVE_BLUETOOTH_BLUETOOTH_H [AF_BLUETOOTH] = { print_sockaddr_data_bt, SIZEOF_SA_FAMILY + 1 }, #endif }; void print_sockaddr(struct tcb *tcp, const void *const buf, const int addrlen) { const struct sockaddr *const sa = buf; tprints("{sa_family="); printxval(addrfams, sa->sa_family, "AF_???"); if (addrlen > (int) SIZEOF_SA_FAMILY) { tprints(", "); if (sa->sa_family < ARRAY_SIZE(sa_printers) && sa_printers[sa->sa_family].printer && addrlen >= sa_printers[sa->sa_family].min_len) { sa_printers[sa->sa_family].printer(buf, addrlen); } else { print_sockaddr_data_raw(buf, addrlen); } } tprints("}"); } int decode_sockaddr(struct tcb *const tcp, const kernel_ulong_t addr, int addrlen) { if (addrlen < 2) { printaddr(addr); return -1; } union { struct sockaddr sa; struct sockaddr_storage storage; char pad[sizeof(struct sockaddr_storage) + 1]; } addrbuf; if ((unsigned) addrlen > sizeof(addrbuf.storage)) addrlen = sizeof(addrbuf.storage); if (umoven_or_printaddr(tcp, addr, addrlen, addrbuf.pad)) return -1; memset(&addrbuf.pad[addrlen], 0, sizeof(addrbuf.pad) - addrlen); print_sockaddr(tcp, &addrbuf, addrlen); return addrbuf.sa.sa_family; }
1.195313
1
Experiment/longprint.c
talsperre/OS-Assignment-2
0
7996427
int main () { printf("bhasdjhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhsadaskdbaskjdbahsdbashdsdbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n"); return 0; }
0.296875
0
src/piece/chrfont.c
tehmaze/piece
17
7996435
#include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include "piece/chrfont.h" #include "piece/util.h" static const char chrfont_id[8] = CHRFONT_ID; piece_chrfont * piece_chrfont_read(FILE *fd, const char *filename) { piece_chrfont *font = piece_allocate(sizeof(piece_chrfont)); piece_chrfont_header *header; char *description = NULL, ch; header = font->header = piece_allocate(sizeof(piece_chrfont_header)); header->description = piece_allocate(sizeof(uint8_t) * 128); description = header->description; rewind(fd); fread(&header->id, 8, 1, fd); if (strncmp(header->id, chrfont_id, 8)) { fprintf(stderr, "%s: not a Borland CHR font\n", filename); fprintf(stderr, "%s: header identifier reads \"", filename); for (uint8_t i = 0; i < 8; i++) { fprintf(stderr, "0x%02x ", header->id[i]); } fprintf(stderr, "\"\n"); free(header->description); free(header); return NULL; } for (uint16_t i = 0; i < 128; i++) { ch = fgetc(fd); if (ch == 0x1a) { *description = 0; break; } else { *description++ = ch; } } header->header_size = piece_fget16i(fd); fread(&header->font_name_internal, 4, 1, fd); header->font_file_size = piece_fget16i(fd); fread(&header->font_driver_version, 2, 1, fd); fseek(fd, 0x80, SEEK_SET); header->signature = fgetc(fd); header->characters = piece_fget16i(fd); header->first_char = fgetc(fd); header->stroke_offset = piece_fget16i(fd); header->scan_flag = fgetc(fd); header->top_of_capital_offset = fgetc(fd); header->baseline_offset = fgetc(fd); header->bottom_descender_offset = fgetc(fd); fread(&header->font_name, 4, 1, fd); header->character_offsets = piece_allocate(sizeof(uint16_t) * header->characters); header->character_widths = piece_allocate(sizeof(uint8_t) * header->characters); font->character = piece_allocate(sizeof(piece_chrfont_character) * header->characters); for (uint16_t i = 0; i < header->characters; ++i) { header->character_offsets[i] = piece_fget16i(fd); } for (uint16_t i = 0; i < header->characters; ++i) { header->character_widths[i] = fgetc(fd); } return font; } void piece_chrfont_free(piece_chrfont *font) { if (font->header != NULL) { free(font->header->description); free(font->header); font->header = NULL; } if (font != NULL) { free(font); font = NULL; } }
1.539063
2
QuickLookGenerator/SGFDrawBoard.h
threeve/SGF-Tools
2
7996443
// // SGFDrawBoard.h // SGFTools // // Created by <NAME> on 1/15/10. // This class implements a class that draws a go board. // // The MIT License // // Copyright (c) 2010 SGF Tools Developers // // 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 NON-INFRINGEMENT. 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 <Cocoa/Cocoa.h> #import "SGFGoban.h" #define DEFAULT_BOARD_NSCOLOR [NSColor colorWithDeviceRed:0.968 green:0.704 blue:0.382 alpha:1.000] #define DEFAULT_WHITE_NON_FLAT_STONE_NSCOLOR [NSColor colorWithDeviceRed:0.78 green:0.78 blue:0.78 alpha:1.000] @interface SGFDrawBoard : NSObject { // number of intersections on board in each dimention unsigned size; // bounds within which board will be drawn NSRect bounds; // size of each intersection/location in graphic coords CGFloat locationWidth; BOOL flatStyle; CFBundleRef cfBundle; } @property (assign, nonatomic) unsigned size; @property (assign, nonatomic) BOOL flatStyle; @property (assign, nonatomic) CFBundleRef cfBundle; - (id) initWithBoardSize:(unsigned)newSize; - (void) setBounds:(NSRect)newBounds; // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // The following drawXxxx functions expect the current graphics context to be a // flipped coordinate space! // draw a complete game position (board, grid, stones) // position string must be in the format produced by [SGFGoban getPositionString] - (void) drawPosition:(NSString*)position; - (void) drawBoardColor:(NSColor*)color; - (void) drawGrid; // location is a 2 letter string that describes an intersection on the board in sgf style - (void) drawStoneAtLocation:(NSString*)location color:(NSColor*)color; - (void) drawStoneAtPoint:(NSPoint)point color:(NSColor*)color; // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // location is a 2 letter string that describes an intersection on the board in sgf style // returns graphics coords for upper-left point of board location - (NSPoint) getPointForLocation:(NSString*)location; // here x & y are board intersection coords, not graphics coords // returns graphics coords for upper-left point of board intersection x,y - (NSPoint) getPointForX:(unsigned)x Y:(unsigned)y; // returns graphics coords for center point of board intersection x,y - (NSPoint) getCenterPointForX:(unsigned)x Y:(unsigned)y; @end
1.226563
1
ESOData/include/ESOData/Granny2/ESOGraphicsTypes.h
FloorBelow/ESOData
1
7996451
#ifndef ESODATA_GRANNY2_ESO_GRAPHICS_TYPES_H #define ESODATA_GRANNY2_ESO_GRAPHICS_TYPES_H #include <stdint.h> struct granny_data_type_definition; namespace esodata { #pragma pack(push) #pragma pack(4) struct ESOMeshExtendedData { float BBoxMin[3]; float BBoxMax[3]; float Radius; }; struct ESOMaterial { const char* Diffuse; const char* normal; const char* detail; const char* diffuse2; int ZosSphericalLighting; float ZosFresnel2; float ZosGlow2; float ZosGlossiness2; float AnimateU_Layer1; float AnimateV_Layer1; float AnimateU_Layer2; float AnimateV_Layer2; int alpha; int twoSided; const char* Specular; int materialType; int NoHalo; int ZosExportVersion; float ZosDayGlow; float ZosDuskGlow; float ZosNightGlow; int ZosPlayerLight; float SoftAlphaDepth; const char* tintmaskPath; const char* diffusePath; const char* normalPath; const char* detailPath; const char* diffuse2Path; const char* specularPath; const char* tintmask; float f4DiffuseTintPrimary[4]; float f4SpecularTintPrimary[4]; float f4NormalTintPrimary[4]; float f4DiffuseTintSecondary[4]; float f4SpecularTintSecondary[4]; float f4NormalTintSecondary[4]; float f4DiffuseTintAccent[4]; float f4SpecularTintAccent[4]; float f4NormalTintAccent[4]; int TintPrimaryID; int TintSecondaryID; int TintAccentID; int DrawOrder; int NoShadows; const char* typeName; int ShaderType; int Wire; int TwoSided; int FaceMap; int Faceted; const char* ShaderName; int OpacityType; float Opacity; float FilterColor[3]; int FalloffType; float Falloff; float IndexOfRefraction; float WireSize; int WireUnits; int ApplyReflectionDimming; float DimLevel; float ReflectionLevel; int PixelSampler; float SamplerQuality; int SamplerEnable; float AdaptiveThreshold; int AdaptiveOn; int SubSampleTextures; int AdvancedOptions; const char* SamplerName; float OptionalParam0; float OptionalParam1; int UseGlobalSettings; int32_t MapEnableCount; int* MapEnables; int32_t MapAmountCount; float* MapAmounts; int AmbientDiffuseTextureLock; float BounceCoefficient; float StaticFriction; float SlidingFriction; int bDiffuseEnable; const char* DiffuseTexture; int bSpecularEnable; const char* SpecularTexture; int bNormalEnable; const char* NormalTexture; int bDetailBlendEnable; const char* DetailBlendTexture; int bDiffuseSpecular2Enable; const char* DiffuseSpecular2Texture; int bDiffuse2Enable; const char* Diffuse2Texture; int bSpecular2Enable; const char* Specular2Texture; int bNormal2Enable; const char* Normal2Texture; int bMaskEnable; const char* MaskTexture; float f2UVScrolling[4]; float fGlossiness2; float fFresnel2; float fGlow2; int bEnvironmentEnable; const char* EnvironmentTexture; int bTwoMaterial; int bFresnel; int bFresnelMode; int bGlowEnable; int bOutputGlow; int bGlossinessEnable; int bAlphaMaskEnable; int bAlphaTrasparency; int bGrayDiffuse; int bTwoSided; float fCubeRotation; int bSunEnabled; float f3SunDirection[3]; float f3SunColor[3]; float f3EnvironmentTint[3]; const char* EffectFile; int SoftwareRendering; float ShadedColor[3]; int ForceSoftwareRender; int Technique; int DoubleQuestionMark; float AmbientColor[3]; float DiffuseColor[3]; float SpecularColor[3]; float Shininess; float ShininessStrength; float Transparency; float SelfIllumination; int SelfIlluminationIsOn; float SelfIlluminationColor[3]; }; struct ESOTexture { int fileIndex; }; #pragma pack(pop) extern const granny_data_type_definition ESOMeshExtendedDataType[]; extern const granny_data_type_definition ESOMaterialType[]; extern const granny_data_type_definition ESOTextureType[]; } #endif
1
1
src/Project.h
AlexSoldin/EEE3096S-Project
0
7996459
#ifndef PRAC4_H #define PRAC4_H //Includes #include <wiringPi.h> #include <stdio.h> #include <stdlib.h> #include <wiringPiSPI.h> #include <unistd.h> #include <math.h> #include <pthread.h> #include <signal.h> #include <mcp3004.h> //Function definitions void initGPIO(void); void reset(void); void changeFrequency(void); void dismissAlarm(void); void monitoring(void); //main void *monitorThread(void *threadargs); void checkAlarm(int hour1, int min1, int sec1, int hour2, int min2, int sec2); void setDACOutput(float val); void setup_blynk(void); void printHeading(void); int hFormat(int hours); int mFormat(int mins); void secPWM(int units); int hexCompensation(int units); int decCompensation(int units); void toggleTime(void); void cleanup(int); void setCurrentTime(void); long timeDiff(void); //Define constants const char RTCAddr = 0x6f; const char SEC = 0x00; const char MIN = 0x01; const char HOUR = 0x02; const char TIMEZONE = 2; // +02H00 (RSA) //define SPI parameters const int SPI_CHAN = 0; //wiringPi 10, BCM 8, physical 24 CE0 ADC const int SPI_DAC = 1; const int BASE = 100; //chip base pin const int SPI_CLOCKSPEED = 409600; //Define buttons const int RESET = 26; //wiringPi 25 AND BCM 26 const int FREQUENCY = 12; //wiringPi 26 AND BCM 12 const int ALARM_DISMISS = 6; //wiringPi 22 AND BCM 6 const int START = 5; //wiringPi 21 AND BCM 5 const int BTNS[] = {26, 12, 6, 5}; //Define LEDS const int RESET_LED = 27; //wiringPi 2 AND BCM 27 const int FREQUENCY_LED = 18;//wiringPi 1 AND BCM 18 const int ALARM_DISMISS_LED = 17; //wiringPi 0 AND BCM 17 const int START_LED = 4; //wiringPi 7 AND BCM 4 const int LEDS[] = {27, 18, 17, 4}; const int ALARM_LED = 13; //wiringPi 23 AND BCM 13 #endif
1.414063
1
logging/rtc_event_log/encoder/var_int.h
gaoxiaoyang/webrtc
305
7996467
/* * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef LOGGING_RTC_EVENT_LOG_ENCODER_VAR_INT_H_ #define LOGGING_RTC_EVENT_LOG_ENCODER_VAR_INT_H_ #include <stddef.h> #include <stdint.h> #include <string> #include "absl/strings/string_view.h" #include "rtc_base/bit_buffer.h" namespace webrtc { extern const size_t kMaxVarIntLengthBytes; // Encode a given uint64_t as a varint. From least to most significant, // each batch of seven bits are put into the lower bits of a byte, and the last // remaining bit in that byte (the highest one) marks whether additional bytes // follow (which happens if and only if there are other bits in |input| which // are non-zero). // Notes: If input == 0, one byte is used. If input is uint64_t::max, exactly // kMaxVarIntLengthBytes are used. std::string EncodeVarInt(uint64_t input); // Inverse of EncodeVarInt(). // If decoding is successful, a non-zero number is returned, indicating the // number of bytes read from |input|, and the decoded varint is written // into |output|. // If not successful, 0 is returned, and |output| is not modified. size_t DecodeVarInt(absl::string_view input, uint64_t* output); // Same as other version, but uses a rtc::BitBuffer for input. // Some bits may be consumed even if a varint fails to be read. size_t DecodeVarInt(rtc::BitBuffer* input, uint64_t* output); } // namespace webrtc #endif // LOGGING_RTC_EVENT_LOG_ENCODER_VAR_INT_H_
1.671875
2
REXCompiler/ROSEXOMPReference/rose_firstPrivateArray_2.c
passlab/rexomptest
0
7996475
#include <stdlib.h> #include <assert.h> #include "libxomp.h" struct OUT__1__10881___data { int array[100]; } ; static void OUT__1__10881__(void *__out_argv); int main(argc,argv) int argc; char **argv; { int status = 0; XOMP_init(argc,argv); int array[100]; int i; for (i = 0; i < 100; i++) array[i] = 10; struct OUT__1__10881___data __out_argv1__10881__; int __i1__; for (__i1__ = 0; __i1__ < 100; __i1__++) __out_argv1__10881__ . array[__i1__] = array[__i1__]; XOMP_parallel_start(OUT__1__10881__,&__out_argv1__10881__,1,0,"/home/awang15/Projects/rexdev/rex_src/tests/nonsmoke/functional/CompileTests/OpenMP_tests/firstPrivateArray_2.c",12); XOMP_parallel_end("/home/awang15/Projects/rexdev/rex_src/tests/nonsmoke/functional/CompileTests/OpenMP_tests/firstPrivateArray_2.c",17); for (i = 0; i < 100; i++) { (((void )(sizeof(((array[i] == 10?1 : 0))))) , (( { if (array[i] == 10) ; else __assert_fail("array[i]==10","firstPrivateArray_2.c",22,__PRETTY_FUNCTION__); }))); } XOMP_terminate(status); return 0; } static void OUT__1__10881__(void *__out_argv) { int array[100]; int __i0__; for (__i0__ = 0; __i0__ < 100; __i0__++) array[__i0__] = ((struct OUT__1__10881___data *)__out_argv) -> array[__i0__]; int _p_array[100]; { int *array_ap = (int *)array; int *_p_array_ap = (int *)_p_array; int _p_i; for (_p_i = 0; _p_i < 100; _p_i++) *(_p_array_ap + _p_i) = *(array_ap + _p_i); } int i; for (i = 0; i < 100; i++) _p_array[i] += i; }
1.632813
2
libs/quadwild/libs/quadretopology/patterns/patterns/patchgen/Pattern_6_1.h
Pentacode-IAFA/Quad-Remeshing
0
7996483
#pragma once #include "Pattern.h" #include "ILP.h" #include <kt84/eigen_def.h> #include <kt84/openmesh/edgeloop.h> #include <sstream> /* |0| |1| |0| |0| |0| |1| |2| |1| |1| |0| |0| |l0| |1| |0| |1| |0| |0| |0| |2| |1| |0| |1| |0| |l1| p0|0| + p1|1| + p2|0| + p3|1| + p4|0| + p5|0| + |1| + x|0| + y|0| + z|0| + w|1| = |l2| |0| |0| |1| |0| |1| |0| |1| |0| |1| |0| |0| |l3| |0| |0| |0| |1| |0| |1| |1| |0| |0| |1| |0| |l4| |1| |0| |0| |0| |1| |0| |1| |0| |0| |0| |1| |l5| */ namespace patchgen { template <> struct Pattern<6, 1> { static Eigen::MatrixXd& get_constraint_matrix() { static Eigen::MatrixXd constraint_matrix; if (constraint_matrix.size() == 0) { constraint_matrix.resize(6, 10); constraint_matrix << 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1; } return constraint_matrix; } static Eigen::VectorXd get_constraint_rhs(const Eigen::VectorXi& l) { return kt84::make_Vector6d(l[0] - 2, l[1] - 2, l[2] - 1, l[3] - 1, l[4] - 1, l[5] - 1); } static int& get_variable(PatchParam& param, int index) { if (index < 6) return param.p[index]; if (index == 6) return param.x; if (index == 7) return param.y; if (index == 8) return param.z; return param.w; } static bool get_default_parameter(const Eigen::VectorXi& l, PatchParam& param) { auto& constraint_matrix = get_constraint_matrix(); const int num_variables = constraint_matrix.cols(); ILP ilp(num_variables); ilp.add_constraint(constraint_matrix, EQ, get_constraint_rhs(l)); // arbitrary constraints and objective // xmin ilp.set_objective(kt84::make_Vector10d(0, 0, 0, 0, 0, 0, 1, 0, 0, 0), false); if (!ilp.solve()) return false; int xmin = ilp.get_variables()[6]; // xmax ilp.refresh(); ilp.set_objective(kt84::make_Vector10d(0, 0, 0, 0, 0, 0, 1, 0, 0, 0), true); if (!ilp.solve()) return false; int xmax = ilp.get_variables()[6]; // xmid-1<=x<=xmid+1 ilp.refresh(); int xmid = (xmin + xmax) / 2; ilp.add_constraint(kt84::make_Vector10d(0, 0, 0, 0, 0, 0, 1, 0, 0, 0), LE, xmid + 1); ilp.add_constraint(kt84::make_Vector10d(0, 0, 0, 0, 0, 0, 1, 0, 0, 0), GE, xmid - 1); // maximize p0+p1+p2+p3+p4+p5 ilp.set_objective(kt84::make_Vector10d(1, 1, 1, 1, 1, 1, 0, 0, 0, 0), true); if (!ilp.solve()) return false; auto variables = ilp.get_variables(); for (int i = 0; i < num_variables; ++i) get_variable(param, i) = variables[i]; param.pattern_id = 1; return true; } template <typename PatchT> static void generate_subtopology(const PatchParam& param, PatchT& patch) { /* | v--y | C4--------C3 | / \ \ | z--> / \ \ <--w | / \ \ | C5 V3-------C2 | \ / \ / <--x | w--> \ / V2----V1 | \ / / / <--z | C0---V0---C1 | x--^ ^--y */ patch.clear(); typename PatchT::VHandle C[6]; typename PatchT::VHandle V[4]; for (int i = 0; i < 6; ++i) C[i] = add_tagged_vertex(patch, i, true ); for (int i = 0; i < 4; ++i) V[i] = add_tagged_vertex(patch, i, false); patch.add_face(C[0], V[0], V[2], V[3]); patch.add_face(C[1], V[1], V[2], V[0]); patch.add_face(V[1], C[2], V[3], V[2]); patch.add_face(C[2], C[3], C[4], V[3]); patch.add_face(C[4], C[5], C[0], V[3]); auto h_insert_x = patch.halfedge_handle(V[0]); // corresponds to V0-C0 for (int i = 0; i < param.x; ++i) insert_edgeloop(patch, h_insert_x); auto h_insert_y = patch.halfedge_handle(C[1]); // corresponds to C1-V0 for (int i = 0; i < param.y; ++i) insert_edgeloop(patch, h_insert_y); auto h_insert_z = patch.halfedge_handle(V[1]); // corresponds to V1-C1 for (int i = 0; i < param.z; ++i) insert_edgeloop(patch, h_insert_z); auto h_insert_w = patch.halfedge_handle(C[3]); // corresponds to C3-C2 for (int i = 0; i < param.w; ++i) insert_edgeloop(patch, h_insert_w); } static VariableIndicators& get_variable_indicators() { static VariableIndicators variable_indicators; if (variable_indicators.empty()) { variable_indicators.resize(4); variable_indicators[0].push_back(std::make_pair(PatchVertexTag::C0, PatchVertexTag::V0)); // for x variable_indicators[0].push_back(std::make_pair(PatchVertexTag::V3, PatchVertexTag::V2)); variable_indicators[0].push_back(std::make_pair(PatchVertexTag::C2, PatchVertexTag::V1)); variable_indicators[1].push_back(std::make_pair(PatchVertexTag::C1, PatchVertexTag::V0)); // for y variable_indicators[1].push_back(std::make_pair(PatchVertexTag::V1, PatchVertexTag::V2)); variable_indicators[1].push_back(std::make_pair(PatchVertexTag::C2, PatchVertexTag::V3)); variable_indicators[1].push_back(std::make_pair(PatchVertexTag::C3, PatchVertexTag::C4)); variable_indicators[2].push_back(std::make_pair(PatchVertexTag::C1, PatchVertexTag::V1)); // for z variable_indicators[2].push_back(std::make_pair(PatchVertexTag::V0, PatchVertexTag::V2)); variable_indicators[2].push_back(std::make_pair(PatchVertexTag::C0, PatchVertexTag::V3)); variable_indicators[2].push_back(std::make_pair(PatchVertexTag::C5, PatchVertexTag::C4)); variable_indicators[3].push_back(std::make_pair(PatchVertexTag::C0, PatchVertexTag::C5)); // for w variable_indicators[3].push_back(std::make_pair(PatchVertexTag::V3, PatchVertexTag::C4)); variable_indicators[3].push_back(std::make_pair(PatchVertexTag::C2, PatchVertexTag::C3)); } return variable_indicators; } static std::string get_param_str(const PatchParam& param) { std::stringstream ss; ss << "x=" << param.x << "_y=" << param.y << "_z=" << param.z << "_w=" << param.w; return ss.str(); } }; }
1.484375
1
apps/myApps/idolHackerthon/src/Components/StarDust.h
marble-seijin/idolHackerthon
0
7996491
// // StarDust.h // idolHackerthon // // Created by <NAME> on 2015/09/12. // // #ifndef __idolHackerthon__StarDust__ #define __idolHackerthon__StarDust__ #include "ofMain.h" class StarDust { ofVec2f pos; ofVec2f vel; float alpha; float angle; public: StarDust(ofVec2f pos); static void init(); static ofImage star_image; void update(); void draw(); bool isDead(); }; #endif /* defined(__idolHackerthon__StarDust__) */
0.605469
1
src/rt_stb_image.h
mujpao/Raytracer
0
7996499
#ifndef RTSTBIMAGE_H #define RTSTBIMAGE_H #ifdef _MSC_VER #pragma warning(push, 0) #elif __GNUC__ #pragma GCC system_header #endif #define STB_IMAGE_IMPLEMENTATION #include "thirdparty/stb_image.h" #define STB_IMAGE_WRITE_IMPLEMENTATION #include "thirdparty/stb_image_write.h" #ifdef _MSC_VER #pragma warning(pop) #endif #endif
0.5625
1
PressureEngineCore/Src/Graphics/Water/WaterRenderer.h
Playturbo/PressureEngine
1
7996507
#pragma once #include <vector> #include "../Models/RawModel.h" #include "WaterShader.h" #include "Water.h" #include "../GLObjects/FrameBuffer.h" namespace Pressure { class WaterRenderer { private: WaterShader m_Shader; Window& m_Window; float m_WaveModifier; FrameBuffer m_ReflectionBuffer; FrameBuffer m_RefractionBuffer; FrameBuffer m_ReflectionResultsBuffer; FrameBuffer m_RefractionResultsBuffer; public: WaterRenderer(Window& window); void updateProjectionmatrix(); // Used to time the waves. void tick(); void render(std::vector<Water>& water, std::vector<Light>& lights, Camera& camera); FrameBuffer& getReflectionBuffer(); FrameBuffer& getRefractionBuffer(); private: void prepare(std::vector<Water>& water, std::vector<Light>& lights, Camera& camera); void finish(std::vector<Water>& water); }; }
1.242188
1
rw_rh_engine_lib/data_desc/frame_info.h
petrgeorgievsky/gtaRenderHook
232
7996515
// // Created by peter on 16.02.2021. // #pragma once #include <Engine/Common/ArrayProxy.h> #include <data_desc/imgui_input_state.h> #include <data_desc/light_system/lighting_state.h> #include <data_desc/sky_state.h> #include <data_desc/viewport_state.h> #include <render_client/im2d_state_recorder.h> #include <render_client/im3d_state_recorder.h> #include <render_client/mesh_instance_state_recorder.h> #include <render_client/skin_instance_state_recorder.h> namespace rh::rw::engine { struct FrameState { MainViewportState * Viewport; SkyState * Sky; ImGuiInputState * ImGuiInput; AnalyticLightsState Lights; Im2DRenderState Im2D; Im3DRenderState Im3D; MeshInstanceState MeshInstances; SkinInstanceState SkinInstances; static FrameState Deserialize( MemoryReader &reader ); }; } // namespace rh::rw::engine
1.023438
1
AWSSageMakerRuntime/AWSSageMakerRuntimeModel.h
ulian-onua/aws-sdk-ios
1
7996523
// // Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"). // You may not use this file except in compliance with the License. // A copy of the License is located at // // http://aws.amazon.com/apache2.0 // // or in the "license" file accompanying this file. This file is distributed // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either // express or implied. See the License for the specific language governing // permissions and limitations under the License. // #import <Foundation/Foundation.h> #import <AWSCore/AWSNetworking.h> #import <AWSCore/AWSModel.h> NS_ASSUME_NONNULL_BEGIN FOUNDATION_EXPORT NSString *const AWSSageMakerRuntimeErrorDomain; typedef NS_ENUM(NSInteger, AWSSageMakerRuntimeErrorType) { AWSSageMakerRuntimeErrorUnknown, AWSSageMakerRuntimeErrorInternalFailure, AWSSageMakerRuntimeErrorModel, AWSSageMakerRuntimeErrorServiceUnavailable, AWSSageMakerRuntimeErrorValidation, }; @class AWSSageMakerRuntimeInvokeEndpointInput; @class AWSSageMakerRuntimeInvokeEndpointOutput; /** */ @interface AWSSageMakerRuntimeInvokeEndpointInput : AWSRequest /** <p>The desired MIME type of the inference in the response.</p> */ @property (nonatomic, strong) NSString * _Nullable accept; /** <p>Provides input data, in the format specified in the <code>ContentType</code> request header. Amazon SageMaker passes all of the data in the body to the model. </p><p>For information about the format of the request body, see <a href="http://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html">Common Data Formats—Inference</a>.</p> */ @property (nonatomic, strong) NSData * _Nullable body; /** <p>The MIME type of the input data in the request body.</p> */ @property (nonatomic, strong) NSString * _Nullable contentType; /** <p/> */ @property (nonatomic, strong) NSString * _Nullable customAttributes; /** <p>The name of the endpoint that you specified when you created the endpoint using the <a href="http://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html">CreateEndpoint</a> API. </p> */ @property (nonatomic, strong) NSString * _Nullable endpointName; @end /** */ @interface AWSSageMakerRuntimeInvokeEndpointOutput : AWSModel /** <p>Includes the inference provided by the model.</p><p>For information about the format of the response body, see <a href="http://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html">Common Data Formats—Inference</a>.</p> */ @property (nonatomic, strong) NSData * _Nullable body; /** <p>The MIME type of the inference returned in the response body.</p> */ @property (nonatomic, strong) NSString * _Nullable contentType; /** <p/> */ @property (nonatomic, strong) NSString * _Nullable customAttributes; /** <p>Identifies the production variant that was invoked.</p> */ @property (nonatomic, strong) NSString * _Nullable invokedProductionVariant; @end NS_ASSUME_NONNULL_END
1.03125
1
qwe/navigation/sbpl/src/utils/utils.h
IEEERobotics/high-level
1
7996531
/* * Copyright (c) 2008, <NAME> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the University of Pennsylvania nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef __UTILS_H_ #define __UTILS_H_ class PlannerStats; #ifndef WIN32 #define __max(x,y) (x>y?x:y) #define __min(x,y) (x>y?y:x) #endif #define NORMALIZEDISCTHETA(THETA, THETADIRS) (((THETA>=0)?((THETA)%(THETADIRS)):(((THETA)%(THETADIRS)+THETADIRS)%THETADIRS))) #define CONTXY2DISC(X, CELLSIZE) (((X)>=0)?((int)((X)/(CELLSIZE))):((int)((X)/(CELLSIZE))-1)) #define DISCXY2CONT(X, CELLSIZE) ((X)*(CELLSIZE) + (CELLSIZE)/2.0) #define PI_CONST 3.141592653589793238462643383279502884 #define UNKNOWN_COST 1000000 typedef struct { int X1, Y1; int X2, Y2; int Increment; int UsingYIndex; int DeltaX, DeltaY; int DTerm; int IncrE, IncrNE; int XIndex, YIndex; int Flipped; } bresenham_param_t; class sbpl_2Dcell_t{ public: sbpl_2Dcell_t(){x=0; y=0;} sbpl_2Dcell_t(int x_,int y_){x=x_; y=y_;} bool operator == (const sbpl_2Dcell_t cell) const {return x==cell.x && y==cell.y;} bool operator < (const sbpl_2Dcell_t cell) const {return x<cell.x || (x==cell.x && y<cell.y);} int x; int y; }; class sbpl_2Dpt_t{ public: sbpl_2Dpt_t(){x=0; y=0;} sbpl_2Dpt_t(double x_, double y_){x=x_; y=y_;} bool operator == (const sbpl_2Dpt_t p) const {return x==p.x && y==p.y;} bool operator < (const sbpl_2Dpt_t p) const {return x<p.x || (x==p.x && y<p.y);} double x; double y; }; class sbpl_xy_theta_cell_t{ public: sbpl_xy_theta_cell_t(){x=0; y=0; theta=0;} sbpl_xy_theta_cell_t(int x_, int y_, int theta_){x=x_; y=y_; theta=theta_;} bool operator == (const sbpl_xy_theta_cell_t cell) const {return x==cell.x && y==cell.y && theta==cell.theta;} bool operator < (const sbpl_xy_theta_cell_t cell) const {return x<cell.x || (x==cell.x && (y<cell.y || (y==cell.y && theta<cell.theta)));} int x; int y; int theta; }; class sbpl_xy_theta_pt_t{ public: sbpl_xy_theta_pt_t(){x=0; y=0; theta=0;} sbpl_xy_theta_pt_t(double x_, double y_, double theta_){x=x_; y=y_; theta=theta_;} bool operator == (const sbpl_xy_theta_pt_t p) const {return x==p.x && y==p.y && theta==p.theta;} bool operator < (const sbpl_xy_theta_pt_t p) const {return x<p.x || (x==p.x && (y<p.y || (y==p.y && theta<p.theta)));} double x; double y; double theta; }; typedef struct BINARYHIDDENVARIABLE { int h_ID; //ID of the variable unsigned char Prob; }sbpl_BinaryHiddenVar_t; typedef struct BELIEFSTATEWITHBINARYHVALS { int s_ID; //ID of S part of state-space vector<sbpl_BinaryHiddenVar_t> updatedhvaluesV; //vector of updated h-values, the rest are the same as at the start state }sbpl_BeliefStatewithBinaryh_t; typedef struct POLICYBELIEFSTATEWITHBINARYHVALS { sbpl_BeliefStatewithBinaryh_t BeliefState; //current belief state int nextpolicyactionID; //ID of the next policy action if exists (otherwise -1) vector<int> outcomestateIndexV; //indices of the outcome states of the policy action. If outcome state is not in the policy, then it is -1 }sbpl_PolicyStatewithBinaryh_t; //function prototypes #if MEM_CHECK == 1 void DisableMemCheck(); void EnableMemCheck(); #endif void CheckMDP(CMDP* mdp); void PrintMatrix(int** matrix, int rows, int cols, FILE* fOut); void EvaluatePolicy(CMDP* PolicyMDP, int StartStateID, int GoalStateID, double* PolValue, bool *bFullPolicy, double *Pcgoal, int* nMerges, bool *bCycles); int ComputeNumofStochasticActions(CMDP* pMDP); /** \brief one of the three functions that correspond to bresenham algorithm of path following this function computes bresenham parameters given the start and end points on the line segment */ void get_bresenham_parameters(int p1x, int p1y, int p2x, int p2y, bresenham_param_t *params); /** \brief one of the three functions that correspond to bresenham algorithm of path following returns current cell on the line segment */ void get_current_point(bresenham_param_t *params, int *x, int *y); /** \brief one of the three functions that correspond to bresenham algorithm of path following moves to the next point */ int get_next_point(bresenham_param_t *params); /** \brief converts discretized version of angle into continuous (radians) \note maps 0->0, 1->delta, 2->2*delta, ... */ double DiscTheta2Cont(int nTheta, int NUMOFANGLEVALS); /** \brief converts continuous (radians) version of angle into discrete \note maps 0->0, [delta/2, 3/2*delta)->1, [3/2*delta, 5/2*delta)->2,... */ int ContTheta2Disc(double fTheta, int NUMOFANGLEVALS); /** \note counterclockwise is positive \param angle input angle should be in radians \return output is an angle in the range of from 0 to 2*PI */ double normalizeAngle(double angle); /** \brief computes minimum unsigned difference between two angles in radians */ double computeMinUnsignedAngleDiff(double angle1, double angle2); /** \brief returns true if 2D point is within the specified polygon given by ordered sequence of 2D points (last point is automatically connected to the first) */ bool IsInsideFootprint(sbpl_2Dpt_t pt, vector<sbpl_2Dpt_t>* bounding_polygon); /** \brief computes 8-connected distances - performs distance transform in two linear passes */ void computeDistancestoNonfreeAreas(unsigned char** Grid2D, int width_x, int height_y, unsigned char obsthresh, float** disttoObs_incells, float** disttoNonfree_incells); void get_2d_motion_cells(vector<sbpl_2Dpt_t> polygon, vector<sbpl_xy_theta_pt_t> poses, vector<sbpl_2Dcell_t>* cells, double res); void get_2d_footprint_cells(vector<sbpl_2Dpt_t> polygon, vector<sbpl_2Dcell_t>* cells, sbpl_xy_theta_pt_t pose, double res); void get_2d_footprint_cells(vector<sbpl_2Dpt_t> polygon, set<sbpl_2Dcell_t>* cells, sbpl_xy_theta_pt_t pose, double res); void writePlannerStats(vector<PlannerStats> s, FILE* fout); #if 0 void CheckSearchMDP(CMDP* mdp, int ExcludeSuccStateID = -1); void CheckSearchPredSucc(CMDPSTATE* state, int ExcludeSuccStateID = -1); #endif #endif
1.5
2
src/Keyboard.h
akrinke/scrupp
0
7996539
/* ** $Id$ ** Library to use the keyboard with Scrupp ** See Copyright Notice in COPYRIGHT */ #ifndef __KEYBOARD_H__ #define __KEYBOARD_H__ int luaopen_keyboard(lua_State *L, const char *parent); #endif /* __KEYBOARD_H__ */
0.554688
1
Demo/CPPDemo/TextInjector/FrameParser.h
luoyingwen/CaptureManagerSDK
64
7996547
#pragma once #include "WriteSurface.h" #include "MF.h" #include "../Common/ComPtrCustom.h" #include <atlbase.h> #include <atlstr.h> // // Helper class that processes passed-in uncompressed frames and draws bitmaps on them. // class CFrameParser { public: CFrameParser(void); ~CFrameParser(void); // Set the media type which contains the frame format. HRESULT SetFrameType(IMFMediaType* pMT); // Pass in the sample with the video frame to modify. HRESULT LockFrame(IMFSample* pSmp); HRESULT UnlockFrame(void); // Draw the bitmap on the passed-in frame. HRESULT DrawBitmap(void); void writeText(LPCWSTR aText); private: CComPtrCustom<IMFMediaBuffer> m_pMediaBuffer; CComQIPtr<IMF2DBuffer> m_p2dBuffer; BYTE* m_pScanline0; GUID m_subtype; LONG m_stride; UINT32 m_imageWidthInPixels; UINT32 m_imageHeightInPixels; CWriteSurface* m_pWriteSurface; // The bitmap to inject. HRESULT DrawBitmap_RGB32(CWriteSurface* pBmp); // Draw bitmap on an RGB32 frame };
1.304688
1
framework/drivers/bm_a2b_driver/a2b_topologies/adi_a2b_i2c_commandlist-tdm8-sam-sam-peripheral-init.h
analogdevicesinc/sam-baremetal-sdk
4
7996555
/******************************************************************************* Copyright (c) 2018 - Analog Devices Inc. All Rights Reserved. This software is proprietary to Analog Devices, Inc. and its licensors. ****************************************************************************** * @brief: This file contains I2C command sequence to be followed for discovery * and configuration of A2B nodes for an A2B schematic * @version: $Revision$ * @date: Sunday, March 4, 2018 * I2C Command File Version - 1.0.0 * A2B DLL version- 17.0.0 * A2B Stack DLL version- 17.0.0 * SigmaStudio version- 3.17.001.1753 * Developed by: Automotive Software and Systems team, Bangalore, India * THIS IS A SIGMASTUDIO GENERATED FILE *****************************************************************************/ /*! \addtogroup ADI_A2B_DISCOVERY_CONFIG ADI_A2B_DISCOVERY_CONFIG * @{ */ #ifndef _ADI_A2B_I2C_LIST_H_ #define _ADI_A2B_I2C_LIST_H_ /*! \struct ADI_A2B_DISCOVERY_CONFIG A2B discovery config unit structure */ typedef struct { unsigned char field1; unsigned char field2; unsigned char field3; unsigned int field4; unsigned char field5; unsigned short field6; unsigned char* field7; } ADI_A2B_DISCOVERY_CONFIG; #define WRITE ((unsigned char) 0x00u) #define READ ((unsigned char) 0x01u) #define DELAY ((unsigned char) 0x02u) #define INVALID ((unsigned char) 0xffu) #define CONFIG_LEN (186) static unsigned char gaConfig_aac69007579bc96b496f5df5913633a3[4] = { 0x00u, 0x00u, 0x10u, 0x00u }; static unsigned char gaConfig_2af1312729311565a20cd2d3ae0797f1[1] = { 0x7Fu }; static unsigned char gaConfig_d56a61f7dcf879040114dafdb9a39298[1] = { 0x00u }; static unsigned char gaConfig_a7cd8739cd063acb3b965b2c088b017c[1] = { 0x0Fu }; static unsigned char gaConfig_0b077455ed2c5320cba6b86bd2ff5730[6] = { 0x00u, 0x01u, 0x00u, 0x00u, 0x20u, 0x03u }; static unsigned char gaConfig_07d0a4e2ae863b87d0f7c4076f133def[2] = { 0x00u, 0x64u }; static unsigned char gaConfig_03211db7b78624ed744bcc26ca2712dc[2] = { 0x05u, 0x80u }; static unsigned char gaConfig_2009c65bc3a2d1a8007dd32b2aad03bf[4] = { 0x00u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_45fba1a821dd93e15f865cd70b16ad89[1] = { 0x00u }; static unsigned char gaConfig_2a3401027e79066889c71b8cec30c542[8] = { 0x00u, 0x5Bu, 0x05u, 0x5Bu, 0x05u, 0x40u, 0x40u, 0x00u }; static unsigned char gaConfig_0ed9a6250f52b047f2c8fc5d22a500ec[3] = { 0x13u, 0x00u, 0x00u }; static unsigned char gaConfig_f4071dfb01109d0bfd95d99ad183d2c8[14] = { 0x21u, 0x00u, 0x41u, 0x00u, 0x03u, 0x09u, 0x00u, 0xE6u, 0xE6u, 0xE6u, 0xE6u, 0xE6u, 0x08u, 0x03u }; static unsigned char gaConfig_a2d00b7e6c3e671596b6cca28ec3a759[2] = { 0x00u, 0x00u }; static unsigned char gaConfig_840ebdd3b92bd815fdc44143f5741da7[3] = { 0x03u, 0x00u, 0x00u }; static unsigned char gaConfig_98af8455af6b639c2801b39160c702b0[1] = { 0xFFu }; static unsigned char gaConfig_9bdcd3bd379de07b384b0ecf800a393b[2] = { 0xA0u, 0x00u }; static unsigned char gaConfig_5fc29317ada8c8857183151bcd889e75[1] = { 0x08u }; static unsigned char gaConfig_9e0fb6905db32dd3942fb1af6c682a30[1020] = { 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_7a60ba70ca0fce588d41443c499c7a41[1020] = { 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_fd145b0c5dd18b4d491810b806da1f50[1020] = { 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_1792011182aaaab2ad32767ebf4eb9f8[1020] = { 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_cbe5c7e4199e6cd8873273ccc49876cf[15] = { 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_d56a61f7dcf879040114dafdb9a392982[1] = { 0x01u }; static unsigned char gaConfig_b9651e277a30047bfd768f4a34e1f349[5] = { 0x7Fu, 0x07u, 0x7Fu, 0x78u, 0x01u }; static unsigned char gaConfig_1e326d9b47a9bd4abdc882a97b701902[4] = { 0x00u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_8303d6b3d31f611ebd87cf70d4457be8[2] = { 0x10u, 0x00u }; static unsigned char gaConfig_f66b8735595e286111cac15ed1a7fe2a[5] = { 0x00u, 0x04u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_a2206c5965947eb21a342333851536c1[1] = { 0x7Fu }; static unsigned char gaConfig_3b69615d303d4602b6c71703e59503c7[1] = { 0x00u }; static unsigned char gaConfig_d114c77ba364138f2f51e279ef39d6be[1] = { 0x00u }; static unsigned char gaConfig_2d3eb525a55860be781104e79e118ca3[1] = { 0x00u }; static unsigned char gaConfig_bf12ddce27b680dc1d3f04e79eb15339[1] = { 0x00u }; static unsigned char gaConfig_a36e1b41f2adf43ec11fcc94c2212db3[1] = { 0x00u }; static unsigned char gaConfig_a7cd8739cd063acb3b965b2c088b017c3[2] = { 0x7Fu, 0x03u }; static unsigned char gaConfig_504a5385c6848b23e98fc961950eceff[2050] = { 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFEu, 0xE0u, 0x00u, 0x00u, 0x00u, 0xFFu, 0x34u, 0x00u, 0x00u, 0x00u, 0xFFu, 0x2Cu, 0x00u, 0x00u, 0x00u, 0xFFu, 0x54u, 0x00u, 0x00u, 0x00u, 0xFFu, 0x5Cu, 0x00u, 0x00u, 0x00u, 0xFFu, 0xF5u, 0x08u, 0x20u, 0x00u, 0xFFu, 0x38u, 0x00u, 0x00u, 0x00u, 0xFFu, 0x80u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFEu, 0xE8u, 0x0Cu, 0x00u, 0x00u, 0xFEu, 0x30u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFFu, 0xE8u, 0x07u, 0x20u, 0x08u, 0x00u, 0x00u, 0x06u, 0xA0u, 0x00u, 0xFFu, 0xE0u, 0x00u, 0xC0u, 0x00u, 0xFFu, 0x80u, 0x07u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFFu, 0x00u, 0x00u, 0x00u, 0x00u, 0xFEu, 0xC0u, 0x22u, 0x00u, 0x27u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFEu, 0xE8u, 0x1Eu, 0x00u, 0x00u, 0xFFu, 0xE8u, 0x01u, 0x20u, 0x00u, 0xFFu, 0xD8u, 0x01u, 0x03u, 0x00u, 0x00u, 0x07u, 0xC6u, 0x00u, 0x00u, 0xFFu, 0x08u, 0x00u, 0x00u, 0x00u, 0xFFu, 0xF4u, 0x00u, 0x20u, 0x00u, 0xFFu, 0xD8u, 0x07u, 0x02u, 0x00u, 0xFDu, 0xA5u, 0x08u, 0x20u, 0x00u, 0x00u, 0x00u, 0x00u, 0xE2u, 0x00u, 0xFDu, 0xADu, 0x08u, 0x20u, 0x00u, 0x00u, 0x08u, 0x00u, 0xE2u, 0x00u, 0xFDu, 0x25u, 0x08u, 0x20u, 0x00u, 0x00u, 0x10u, 0x00u, 0xE2u, 0x00u, 0xFDu, 0x35u, 0x08u, 0x20u, 0x00u, 0x00u, 0x18u, 0x00u, 0xE2u, 0x00u, 0xFFu, 0xE8u, 0x08u, 0x20u, 0x00u, 0x00u, 0x20u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x45u, 0x1Fu, 0x20u, 0x00u, 0x00u, 0x35u, 0x08u, 0x22u, 0x00u, 0x00u, 0x00u, 0x0Au, 0xA0u, 0x00u, 0xFFu, 0xE5u, 0x18u, 0x22u, 0x00u, 0x00u, 0x00u, 0x09u, 0xA0u, 0x00u, 0x00u, 0x38u, 0x00u, 0xEAu, 0x00u, 0x00u, 0x48u, 0x00u, 0xF2u, 0x00u, 0x00u, 0x38u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFFu, 0xECu, 0x01u, 0x21u, 0x00u, 0x00u, 0x04u, 0x00u, 0xA1u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFFu, 0xE5u, 0x08u, 0x22u, 0x40u, 0x00u, 0x50u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x48u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x57u, 0xFFu, 0x20u, 0x00u, 0xFFu, 0xE5u, 0x08u, 0x22u, 0x00u, 0x00u, 0x58u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x58u, 0x0Bu, 0x20u, 0x00u, 0x00u, 0x28u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x85u, 0x1Fu, 0x20u, 0x00u, 0x00u, 0x75u, 0x08u, 0x22u, 0x00u, 0x00u, 0x00u, 0x0Du, 0xA0u, 0x00u, 0xFFu, 0xE5u, 0x18u, 0x22u, 0x00u, 0x00u, 0x00u, 0x0Cu, 0xA0u, 0x00u, 0x00u, 0x78u, 0x00u, 0xEAu, 0x00u, 0x00u, 0x88u, 0x00u, 0xF2u, 0x00u, 0x00u, 0x78u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFFu, 0xECu, 0x01u, 0x21u, 0x00u, 0x00u, 0x04u, 0x00u, 0xA1u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFFu, 0xE5u, 0x08u, 0x22u, 0x40u, 0x00u, 0x50u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x88u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x57u, 0xFFu, 0x20u, 0x00u, 0xFFu, 0xE5u, 0x08u, 0x22u, 0x00u, 0x00u, 0x58u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x58u, 0x0Eu, 0x20u, 0x00u, 0x00u, 0x68u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x25u, 0x08u, 0x20u, 0x00u, 0xFFu, 0xD8u, 0x0Fu, 0x02u, 0x00u, 0x00u, 0x90u, 0x00u, 0xE2u, 0x00u, 0xFFu, 0xE8u, 0x10u, 0x20u, 0x00u, 0x00u, 0xE0u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x6Du, 0x08u, 0x20u, 0x00u, 0x00u, 0xA8u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x6Du, 0x08u, 0x20u, 0x00u, 0x00u, 0xC0u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x05u, 0x08u, 0x20u, 0x00u, 0x00u, 0xB0u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x0Du, 0x08u, 0x20u, 0x00u, 0x00u, 0xC8u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x15u, 0x08u, 0x20u, 0x00u, 0x00u, 0xB8u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x1Du, 0x08u, 0x20u, 0x00u, 0x00u, 0xD0u, 0x00u, 0xE2u, 0x00u, 0xFFu, 0xF5u, 0x08u, 0x20u, 0x00u, 0x01u, 0x38u, 0x00u, 0xE2u, 0x00u, 0x00u, 0xDDu, 0x08u, 0x20u, 0x00u, 0x00u, 0xE5u, 0x08u, 0x22u, 0x48u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFFu, 0xEDu, 0x08u, 0x20u, 0x26u, 0x01u, 0x38u, 0x00u, 0xE2u, 0x00u, 0x00u, 0xFDu, 0x08u, 0x20u, 0x00u, 0xFFu, 0xEDu, 0x13u, 0x22u, 0x48u, 0x00u, 0xDDu, 0x08u, 0x20u, 0x00u, 0x01u, 0x1Du, 0x08u, 0x20u, 0x25u, 0x01u, 0x20u, 0x00u, 0xE2u, 0x00u, 0x01u, 0x0Du, 0x08u, 0x20u, 0x00u, 0xFFu, 0xEDu, 0x13u, 0x22u, 0x48u, 0x00u, 0xDDu, 0x08u, 0x20u, 0x00u, 0x01u, 0x2Du, 0x08u, 0x20u, 0x25u, 0x01u, 0x30u, 0x00u, 0xE2u, 0x00u, 0x01u, 0x45u, 0x08u, 0x20u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x01u, 0x50u, 0x00u, 0xF0u, 0x00u, 0x01u, 0x55u, 0x08u, 0x20u, 0x00u, 0xFFu, 0xEDu, 0x13u, 0x22u, 0x48u, 0x01u, 0x3Du, 0x08u, 0x20u, 0x00u, 0xFFu, 0xF5u, 0x08u, 0x20u, 0x25u, 0x01u, 0x38u, 0x00u, 0xE2u, 0x00u, 0x00u, 0xDDu, 0x08u, 0x20u, 0x00u, 0x00u, 0xE0u, 0x00u, 0xE2u, 0x25u, 0x00u, 0xEDu, 0x08u, 0x20u, 0x00u, 0x00u, 0xFDu, 0x08u, 0x22u, 0x40u, 0x01u, 0x48u, 0x00u, 0xE2u, 0x00u, 0x00u, 0xFDu, 0x08u, 0x20u, 0x00u, 0x01u, 0x4Du, 0x14u, 0x22u, 0x00u, 0x01u, 0x00u, 0x00u, 0xE2u, 0x00u, 0x01u, 0x20u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x07u, 0xFFu, 0xA0u, 0x00u, 0x01u, 0x00u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xAFu, 0xFFu, 0x20u, 0x80u, 0x00u, 0x98u, 0x00u, 0xE2u, 0x00u, 0x00u, 0xC7u, 0xFFu, 0x40u, 0x80u, 0x00u, 0xA0u, 0x00u, 0xE4u, 0x00u, 0xFFu, 0xEDu, 0x08u, 0x20u, 0x00u, 0xFFu, 0xEFu, 0xFFu, 0x22u, 0x40u, 0x01u, 0x10u, 0x00u, 0xE2u, 0x00u, 0x01u, 0x30u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x07u, 0xFFu, 0xA0u, 0x00u, 0x01u, 0x10u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xAFu, 0xFFu, 0x20u, 0x80u, 0x00u, 0x9Du, 0x08u, 0x22u, 0x00u, 0x00u, 0x98u, 0x00u, 0xE2u, 0x00u, 0x00u, 0xC7u, 0xFFu, 0x40u, 0x80u, 0x00u, 0xA5u, 0x08u, 0x44u, 0x00u, 0x00u, 0xA0u, 0x00u, 0xE4u, 0x00u, 0x00u, 0xEDu, 0x08u, 0x20u, 0x00u, 0x01u, 0x3Du, 0x08u, 0x22u, 0x40u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xF0u, 0x00u, 0xF0u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x01u, 0x7Du, 0x08u, 0x20u, 0x00u, 0xFFu, 0xE8u, 0x12u, 0x34u, 0x00u, 0x01u, 0x6Du, 0x08u, 0x22u, 0x48u, 0x01u, 0x78u, 0x11u, 0x20u, 0x40u, 0x01u, 0x68u, 0x11u, 0x34u, 0x40u, 0x01u, 0x78u, 0x11u, 0x20u, 0x25u, 0x01u, 0x68u, 0x11u, 0x34u, 0x25u, 0x01u, 0x90u, 0x00u, 0xE2u, 0x00u, 0x01u, 0x88u, 0x00u, 0xF2u, 0x00u, 0x01u, 0x7Du, 0x08u, 0x20u, 0x00u, 0x01u, 0x8Du, 0x08u, 0x22u, 0x00u, 0x01u, 0x6Du, 0x08u, 0x34u, 0x00u, 0x01u, 0x95u, 0x08u, 0x22u, 0x00u, 0x01u, 0x70u, 0x00u, 0xE2u, 0x00u, 0x01u, 0x80u, 0x00u, 0xF2u, 0x00u, 0x01u, 0x75u, 0x08u, 0x20u, 0x08u, 0xFFu, 0xEDu, 0x1Fu, 0x20u, 0x00u, 0x01u, 0x75u, 0x08u, 0x20u, 0x25u, 0x01u, 0x70u, 0x00u, 0xE2u, 0x00u, 0xFFu, 0xEDu, 0x1Fu, 0x22u, 0x40u, 0x01u, 0xA0u, 0x00u, 0xE2u, 0x00u, 0x01u, 0x75u, 0x08u, 0x20u, 0x00u, 0xFFu, 0xE8u, 0x12u, 0x22u, 0x40u, 0x01u, 0x70u, 0x11u, 0x30u, 0x48u, 0x01u, 0xA5u, 0x08u, 0x20u, 0x00u, 0xFFu, 0xE8u, 0x12u, 0x20u, 0x27u, 0x01u, 0xA0u, 0x00u, 0xE2u, 0x00u, 0x01u, 0xA0u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x17u, 0xFFu, 0x20u, 0x00u, 0x01u, 0x58u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x1Fu, 0xFFu, 0x20u, 0x00u, 0x01u, 0x60u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x00u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x07u, 0xFFu, 0x20u, 0x00u, 0x01u, 0xE8u, 0x00u, 0xE2u, 0x00u, 0x01u, 0xF0u, 0x00u, 0xF2u, 0x00u, 0x01u, 0xBDu, 0x08u, 0x20u, 0x00u, 0x01u, 0xB8u, 0x13u, 0x22u, 0x40u, 0x01u, 0xF0u, 0x13u, 0x22u, 0x00u, 0x01u, 0xADu, 0x08u, 0x34u, 0x00u, 0x01u, 0xA8u, 0x13u, 0x22u, 0x40u, 0x01u, 0xE8u, 0x13u, 0x82u, 0x00u, 0x01u, 0xE8u, 0x13u, 0x22u, 0x00u, 0x01u, 0xB0u, 0x00u, 0xE2u, 0x00u, 0x01u, 0xC0u, 0x00u, 0xF2u, 0x00u, 0x01u, 0xF8u, 0x00u, 0xF6u, 0x00u, 0x01u, 0xDDu, 0x08u, 0x20u, 0x08u, 0x01u, 0xE0u, 0x00u, 0xE2u, 0x00u, 0x01u, 0xCDu, 0x08u, 0x20u, 0x00u, 0xFFu, 0xE8u, 0x15u, 0x22u, 0x67u, 0x01u, 0xD0u, 0x00u, 0xE2u, 0x00u, 0x01u, 0xFDu, 0x08u, 0x22u, 0x48u, 0x01u, 0xFDu, 0x08u, 0x20u, 0x00u, 0x01u, 0xD0u, 0x00u, 0xE2u, 0x27u, 0xFFu, 0xE8u, 0x14u, 0x20u, 0x00u, 0x01u, 0xE0u, 0x00u, 0xE2u, 0x27u, 0x01u, 0xE5u, 0x08u, 0x20u, 0x08u, 0xFFu, 0xFDu, 0x08u, 0x22u, 0x40u, 0x01u, 0xE0u, 0x00u, 0xE2u, 0x26u, 0x01u, 0xD5u, 0x08u, 0x20u, 0x00u, 0xFFu, 0xD8u, 0x16u, 0x02u, 0x00u, 0x00u, 0x05u, 0x08u, 0x20u, 0x00u, 0x02u, 0x00u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x08u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x0Fu, 0xFFu, 0x20u, 0x00u, 0x01u, 0xE8u, 0x00u, 0xE2u, 0x00u, 0x01u, 0xF0u, 0x00u, 0xF2u, 0x00u, 0x02u, 0x1Du, 0x08u, 0x20u, 0x00u, 0x02u, 0x18u, 0x17u, 0x22u, 0x40u, 0x01u, 0xF0u, 0x17u, 0x22u, 0x00u, 0x02u, 0x0Du, 0x08u, 0x34u, 0x00u, 0x02u, 0x08u, 0x17u, 0x22u, 0x40u, 0x01u, 0xE8u, 0x17u, 0x82u, 0x00u, 0x01u, 0xE8u, 0x17u, 0x22u, 0x00u, 0x02u, 0x10u, 0x00u, 0xE2u, 0x00u, 0x02u, 0x20u, 0x00u, 0xF2u, 0x00u, 0x01u, 0xF8u, 0x00u, 0xF6u, 0x00u, 0x02u, 0x3Du, 0x08u, 0x20u, 0x08u, 0x02u, 0x40u, 0x00u, 0xE2u, 0x00u, 0x02u, 0x2Du, 0x08u, 0x20u, 0x00u, 0xFFu, 0xE8u, 0x19u, 0x22u, 0x67u, 0x02u, 0x30u, 0x00u, 0xE2u, 0x00u, 0x01u, 0xFDu, 0x08u, 0x22u, 0x48u, 0x01u, 0xFDu, 0x08u, 0x20u, 0x00u, 0x02u, 0x30u, 0x00u, 0xE2u, 0x27u, 0xFFu, 0xE8u, 0x18u, 0x20u, 0x00u, 0x02u, 0x40u, 0x00u, 0xE2u, 0x27u, 0x02u, 0x45u, 0x08u, 0x20u, 0x08u, 0xFFu, 0xFDu, 0x08u, 0x22u, 0x40u, 0x02u, 0x40u, 0x00u, 0xE2u, 0x26u, 0x02u, 0x35u, 0x08u, 0x20u, 0x00u, 0xFFu, 0xD8u, 0x1Au, 0x02u, 0x00u, 0x00u, 0x0Du, 0x08u, 0x20u, 0x00u, 0x02u, 0x48u, 0x00u, 0xE2u, 0x00u, 0xFFu, 0xE8u, 0x1Bu, 0x20u, 0x00u, 0x02u, 0x98u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x05u, 0x08u, 0x20u, 0x00u, 0x02u, 0x60u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x0Du, 0x08u, 0x20u, 0x00u, 0x02u, 0x78u, 0x00u, 0xE2u, 0x00u, 0x01u, 0x5Du, 0x08u, 0x20u, 0x00u, 0x02u, 0x68u, 0x00u, 0xE2u, 0x00u, 0x01u, 0x65u, 0x08u, 0x20u, 0x00u, 0x02u, 0x80u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x2Du, 0x08u, 0x20u, 0x00u, 0x02u, 0x70u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x2Du, 0x08u, 0x20u, 0x00u, 0x02u, 0x88u, 0x00u, 0xE2u, 0x00u, 0xFFu, 0xF5u, 0x08u, 0x20u, 0x00u, 0x02u, 0xF0u, 0x00u, 0xE2u, 0x00u, 0x02u, 0x95u, 0x08u, 0x20u, 0x00u, 0x02u, 0x9Du, 0x08u, 0x22u, 0x48u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFFu, 0xEDu, 0x08u, 0x20u, 0x26u, 0x02u, 0xF0u, 0x00u, 0xE2u, 0x00u, 0x02u, 0xB5u, 0x08u, 0x20u, 0x00u, 0xFFu, 0xEDu, 0x13u, 0x22u, 0x48u, 0x02u, 0x95u, 0x08u, 0x20u, 0x00u, 0x02u, 0xD5u, 0x08u, 0x20u, 0x25u, 0x02u, 0xD8u, 0x00u, 0xE2u, 0x00u, 0x02u, 0xC5u, 0x08u, 0x20u, 0x00u, 0xFFu, 0xEDu, 0x13u, 0x22u, 0x48u, 0x02u, 0x95u, 0x08u, 0x20u, 0x00u, 0x02u, 0xE5u, 0x08u, 0x20u, 0x25u, 0x02u, 0xE8u, 0x00u, 0xE2u, 0x00u, 0x02u, 0xFDu, 0x08u, 0x20u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x03u, 0x08u, 0x00u, 0xF0u, 0x00u, 0x03u, 0x0Du, 0x08u, 0x20u, 0x00u, 0xFFu, 0xEDu, 0x13u, 0x22u, 0x48u, 0x02u, 0xF5u, 0x08u, 0x20u, 0x00u, 0xFFu, 0xF5u, 0x08u, 0x20u, 0x25u, 0x02u, 0xF0u, 0x00u, 0xE2u, 0x00u, 0x02u, 0x95u, 0x08u, 0x20u, 0x00u, 0x02u, 0x98u, 0x00u, 0xE2u, 0x25u, 0x02u, 0xA5u, 0x08u, 0x20u, 0x00u, 0x02u, 0xB5u, 0x08u, 0x22u, 0x40u, 0x03u, 0x00u, 0x00u, 0xE2u, 0x00u, 0x02u, 0xB5u, 0x08u, 0x20u, 0x00u, 0x03u, 0x05u, 0x14u, 0x22u, 0x00u, 0x02u, 0xB8u, 0x00u, 0xE2u, 0x00u, 0x02u, 0xD8u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x07u, 0xFFu, 0xA0u, 0x00u, 0x02u, 0xB8u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x02u, 0x67u, 0xFFu, 0x20u, 0x80u, 0x02u, 0x50u, 0x00u, 0xE2u, 0x00u, 0x02u, 0x7Fu, 0xFFu, 0x40u, 0x80u, 0x02u, 0x58u, 0x00u, 0xE4u, 0x00u, 0xFFu, 0xEDu, 0x08u, 0x20u, 0x00u, 0xFFu, 0xEFu, 0xFFu, 0x22u, 0x40u, 0x02u, 0xC8u, 0x00u, 0xE2u, 0x00u, 0x02u, 0xE8u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x07u, 0xFFu, 0xA0u, 0x00u, 0x02u, 0xC8u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x02u, 0x67u, 0xFFu, 0x20u, 0x80u, 0x02u, 0x55u, 0x08u, 0x22u, 0x00u, 0x02u, 0x50u, 0x00u, 0xE2u, 0x00u, 0x02u, 0x7Fu, 0xFFu, 0x40u, 0x80u, 0x02u, 0x5Du, 0x08u, 0x44u, 0x00u, 0x02u, 0x58u, 0x00u, 0xE4u, 0x00u, 0x02u, 0xA5u, 0x08u, 0x20u, 0x00u, 0x02u, 0xF5u, 0x08u, 0x22u, 0x40u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x02u, 0xA8u, 0x00u, 0xF0u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x03u, 0x35u, 0x08u, 0x20u, 0x00u, 0xFFu, 0xE8u, 0x1Du, 0x34u, 0x00u, 0x03u, 0x25u, 0x08u, 0x22u, 0x48u, 0x03u, 0x30u, 0x1Cu, 0x20u, 0x40u, 0x03u, 0x20u, 0x1Cu, 0x34u, 0x40u, 0x03u, 0x30u, 0x1Cu, 0x20u, 0x25u, 0x03u, 0x20u, 0x1Cu, 0x34u, 0x25u, 0x03u, 0x48u, 0x00u, 0xE2u, 0x00u, 0x03u, 0x40u, 0x00u, 0xF2u, 0x00u, 0x03u, 0x35u, 0x08u, 0x20u, 0x00u, 0x03u, 0x45u, 0x08u, 0x22u, 0x00u, 0x03u, 0x25u, 0x08u, 0x34u, 0x00u, 0x03u, 0x4Du, 0x08u, 0x22u, 0x00u, 0x03u, 0x28u, 0x00u, 0xE2u, 0x00u, 0x03u, 0x38u, 0x00u, 0xF2u, 0x00u, 0x03u, 0x2Du, 0x08u, 0x20u, 0x08u, 0xFFu, 0xEDu, 0x1Fu, 0x20u, 0x00u, 0x03u, 0x2Du, 0x08u, 0x20u, 0x25u, 0x03u, 0x28u, 0x00u, 0xE2u, 0x00u, 0xFFu, 0xEDu, 0x1Fu, 0x22u, 0x40u, 0x03u, 0x58u, 0x00u, 0xE2u, 0x00u, 0x03u, 0x2Du, 0x08u, 0x20u, 0x00u, 0xFFu, 0xE8u, 0x1Du, 0x22u, 0x40u, 0x03u, 0x28u, 0x1Cu, 0x30u, 0x48u, 0x03u, 0x5Du, 0x08u, 0x20u, 0x00u, 0xFFu, 0xE8u, 0x1Du, 0x20u, 0x27u, 0x03u, 0x58u, 0x00u, 0xE2u, 0x00u, 0x03u, 0x58u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x9Fu, 0xFFu, 0x20u, 0x00u, 0x03u, 0x10u, 0x00u, 0xE2u, 0x00u, 0x00u, 0xA7u, 0xFFu, 0x20u, 0x00u, 0x03u, 0x18u, 0x00u, 0xE2u, 0x00u, 0x03u, 0x85u, 0x08u, 0x20u, 0x00u, 0xFFu, 0xE8u, 0x1Fu, 0x34u, 0x00u, 0x03u, 0x75u, 0x08u, 0x22u, 0x48u, 0x03u, 0x80u, 0x1Eu, 0x20u, 0x40u, 0x03u, 0x70u, 0x1Eu, 0x34u, 0x40u, 0x03u, 0x80u, 0x1Eu, 0x20u, 0x25u, 0x03u, 0x70u, 0x1Eu, 0x34u, 0x25u, 0x03u, 0x98u, 0x00u, 0xE2u, 0x00u, 0x03u, 0x90u, 0x00u, 0xF2u, 0x00u, 0x03u, 0x85u, 0x08u, 0x20u, 0x00u, 0x03u, 0x95u, 0x08u, 0x22u, 0x00u, 0x03u, 0x75u, 0x08u, 0x34u, 0x00u, 0x03u, 0x9Du, 0x08u, 0x22u, 0x00u, 0x03u, 0x78u, 0x00u, 0xE2u, 0x00u, 0x03u, 0x88u, 0x00u, 0xF2u, 0x00u, 0x03u, 0x7Du, 0x08u, 0x20u, 0x08u, 0xFFu, 0xEDu, 0x1Fu, 0x20u, 0x00u, 0x03u, 0x7Du, 0x08u, 0x20u, 0x25u, 0x03u, 0x78u, 0x00u, 0xE2u, 0x00u, 0xFFu, 0xEDu, 0x1Fu, 0x22u, 0x40u, 0x03u, 0xA8u, 0x00u, 0xE2u, 0x00u, 0x03u, 0x7Du, 0x08u, 0x20u, 0x00u, 0xFFu, 0xE8u, 0x1Fu, 0x22u, 0x40u, 0x03u, 0x78u, 0x1Eu, 0x30u, 0x48u, 0x03u, 0xADu, 0x08u, 0x20u, 0x00u, 0xFFu, 0xE8u, 0x1Fu, 0x20u, 0x27u, 0x03u, 0xA8u, 0x00u, 0xE2u, 0x00u, 0x03u, 0xA8u, 0x00u, 0xC0u, 0x00u, 0x02u, 0x57u, 0xFFu, 0x20u, 0x00u, 0x03u, 0x60u, 0x00u, 0xE2u, 0x00u, 0x02u, 0x5Fu, 0xFFu, 0x20u, 0x00u, 0x03u, 0x68u, 0x00u, 0xE2u, 0x00u, 0x03u, 0x15u, 0x08u, 0x20u, 0x00u, 0xFDu, 0x60u, 0x00u, 0xE2u, 0x00u, 0x03u, 0x1Du, 0x08u, 0x20u, 0x00u, 0xFDu, 0x70u, 0x00u, 0xE2u, 0x00u, 0x03u, 0x6Du, 0x08u, 0x20u, 0x00u, 0xFDu, 0xB8u, 0x00u, 0xE2u, 0x00u, 0x03u, 0x65u, 0x08u, 0x20u, 0x00u, 0xFDu, 0xB0u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFEu, 0x30u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFEu, 0xC0u, 0x0Fu, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_11dc39db314a8f306f08eaa42b14c9b6[128] = { 0x00u, 0x00u, 0x10u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x01u, 0x80u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFFu, 0x00u, 0x02u, 0x22u, 0x26u, 0x00u, 0x80u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFFu, 0x00u, 0x02u, 0x22u, 0x26u, 0x00u, 0x80u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x01u, 0x00u, 0x00u, 0x10u, 0x00u, 0x00u, 0x80u, 0x00u, 0x00u, 0x00u, 0x00u, 0x4Eu, 0xB0u, 0x00u, 0x00u, 0x01u, 0xE0u, 0x00u, 0x00u, 0x07u, 0x1Cu, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x4Eu, 0xB0u, 0x00u, 0x00u, 0x01u, 0xE0u, 0x00u, 0x00u, 0x07u, 0x1Cu, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x01u, 0x00u, 0x00u, 0x10u, 0x00u, 0x00u, 0x80u, 0x00u, 0x00u, 0x00u, 0x00u, 0x10u, 0x00u, 0x00u, 0x80u, 0x00u, 0x00u }; static unsigned char gaConfig_b10fadc5b1e5007856548f2744175d48[1] = { 0x01u }; static unsigned char gaConfig_7b5b6e396d19555bf15105fb0bd728be[1] = { 0x01u }; static unsigned char gaConfig_9ac93a2ab6554bf0df02d155e7a8f3a5[1] = { 0x00u }; static unsigned char gaConfig_809cd5cd28abd9f49e25e2d850fa88af[1] = { 0x03u }; static unsigned char gaConfig_2e6d745a81d6250e734b8064c689df56[1] = { 0x84u }; static unsigned char gaConfig_35b3645cf21b2f9988ca0c14a06a8f39[1] = { 0x19u }; static unsigned char gaConfig_24388e02c4b6f8f42558a3838b99f7d6[1] = { 0x19u }; static unsigned char gaConfig_83e560ae5cf09fe931ce3857fe5d365b[1] = { 0x77u }; static unsigned char gaConfig_e9afa5b6292e40c2789a3ffe31bdb44a[1] = { 0x78u }; static unsigned char gaConfig_33f8db3963e78dc8ea8c8f4eb317beb9[1] = { 0x0Fu }; static unsigned char gaConfig_8b4d609e13a4a4f49944d613f89cf26c[1] = { 0x7Du }; static unsigned char gaConfig_81170f670dda1d15b751b0dc1ec8c3b1[1] = { 0x01u }; static unsigned char gaConfig_b8f58538c507d43d9a99c6adf6ff2e60[1] = { 0xA2u }; static unsigned char gaConfig_ddb017d8f762017b0b231d015febc745[1] = { 0x01u }; static unsigned char gaConfig_fa053ad4bf70ea7139d62dbf0dd1d8ac[1] = { 0x7Du }; static unsigned char gaConfig_35b3645cf21b2f9988ca0c14a06a8f391[1] = { 0x32u }; static unsigned char gaConfig_5861e3bb7994dc3029d594638f13aa88[1] = { 0x00u }; static unsigned char gaConfig_03587754e11abfbd742e66c3716107da[1] = { 0x01u }; static unsigned char gaConfig_deaff37c812228f2a7724e415c6d7deb[1] = { 0x00u }; static unsigned char gaConfig_0eeaa054db65aad8406e1e4f1bb51986[1] = { 0x00u }; static unsigned char gaConfig_d40e4dda915adaef05789e873609285f[1] = { 0x00u }; static unsigned char gaConfig_9c9e434c50f9f48464ecee46207d893d[1] = { 0x00u }; static unsigned char gaConfig_10a8b2e0283f5e67ac10d80f153d2f65[1] = { 0x21u }; static unsigned char gaConfig_36c0b1fe1d09687e7e92007461ec115d[1] = { 0x00u }; static unsigned char gaConfig_b69fecc95c144d0e9e8b7818cdbba961[1] = { 0x00u }; static unsigned char gaConfig_1e411c008d5224afbe5cb21b34cac58b[1] = { 0x80u }; static unsigned char gaConfig_867d2ec4a617ea15ab79a46ff2497f59[1] = { 0x08u }; static unsigned char gaConfig_6b5d6b0bae23aa9c7f44c1f445f03041[1] = { 0x01u }; static unsigned char gaConfig_99fd160f6a74a8ef5f4a0b994135026d[1] = { 0xA2u }; static unsigned char gaConfig_8694cd4c3df1d8acba2d38ae72cfecc7[1] = { 0x19u }; static unsigned char gaConfig_67efb87bc69f04818cd571e502c0f5d3[1] = { 0x00u }; static unsigned char gaConfig_c1a5cfc1bb7fcc9e38cfcd43d1f4a37d[1] = { 0x00u }; static unsigned char gaConfig_7d04b8d626d2cf80853b3f03120a8b43[1] = { 0x18u }; static unsigned char gaConfig_e4914f4580882e5f5dadc68d04820522[1] = { 0x00u }; static unsigned char gaConfig_71d4377a25df5ec4ae352a890b802f36[1] = { 0x00u }; static unsigned char gaConfig_f8a368d3599fce94a50214620c8baf43[1] = { 0x10u }; static unsigned char gaConfig_4be6f70c8ffd8e15a3d3751ab66c4fdf[1] = { 0x00u }; static unsigned char gaConfig_f5d1a688cef45324bc23fa89264ea0b1[1] = { 0x00u }; static unsigned char gaConfig_57e08af22ca0902cfa0489da6fdfc510[1] = { 0x00u }; static unsigned char gaConfig_a6e91c6206896070d6c029c902f60eef[1] = { 0x00u }; static unsigned char gaConfig_ccdc91e4f6e91ea32cce1aafaee982e0[1] = { 0x00u }; static unsigned char gaConfig_5a8ee9053e87eda47a920685950cc7a1[1] = { 0x00u }; static unsigned char gaConfig_10b0aad7f186547ae64a450dac67467d[1] = { 0x81u }; static unsigned char gaConfig_446bf3482fb10ed9ef1993aa755adc81[1] = { 0x00u }; static unsigned char gaConfig_212e72ba61a2867fc36c08cebfd50d39[1] = { 0x00u }; static unsigned char gaConfig_2304e1ca7e1d5c8bbad6eda920a93bf0[1] = { 0x00u }; static unsigned char gaConfig_86dfeacf54793511e3a6b7b285d6348b[1] = { 0x00u }; static unsigned char gaConfig_3968fc239af43c2a12c6d54cbe61ceca[1] = { 0x00u }; static unsigned char gaConfig_608577276b449c1879940ce70ce32c28[1] = { 0xFFu }; static unsigned char gaConfig_64db1c4a33c8329656d81956af26cefb[1] = { 0x00u }; static unsigned char gaConfig_60c67f225adb2133260c36e8bc5166e5[1] = { 0x00u }; static unsigned char gaConfig_789c0bb6666b0fa99e1f445ce80ae589[1] = { 0x00u }; static unsigned char gaConfig_3d09f95dd990960879a109f282dcc9f9[1] = { 0x00u }; static unsigned char gaConfig_8a64cd9271c6eaa34a6d0f6fe0fb0308[1] = { 0x00u }; static unsigned char gaConfig_d1ea8d7da7c465f389a6798b5edb3d5f[1] = { 0x00u }; static unsigned char gaConfig_8c8c06632ec447007fad6bc068082c63[1] = { 0x00u }; static unsigned char gaConfig_18e231b97058ffd8d0db61b8b32c525b[1] = { 0x00u }; static unsigned char gaConfig_44b5d13165525e30ff193595a448d246[1] = { 0x00u }; static unsigned char gaConfig_facf64b64e99a153037a5bb79eac301f[1] = { 0x00u }; static unsigned char gaConfig_4592360082ff8d985e6e3c92f619d2af[1] = { 0x00u }; static unsigned char gaConfig_e387b1afb6ba245deece1798416839fa[1] = { 0x00u }; static unsigned char gaConfig_2c74c711c3a1e0008741d1b56a0045ef[1] = { 0x00u }; static unsigned char gaConfig_e75a4ce102e7e27fddc0fd8e9df00a94[1] = { 0x00u }; static unsigned char gaConfig_031e4dbe0bb50758d5ccb79b5d77be43[1] = { 0x00u }; static unsigned char gaConfig_718204ffd1c0b8239e519624b26d51fc[1] = { 0x00u }; static unsigned char gaConfig_7f9c30102a65e5a6367498496a4bb2e4[1] = { 0x00u }; static unsigned char gaConfig_704072e7218ae699d3255b6055994f74[1] = { 0x00u }; static unsigned char gaConfig_8bb911eff5231ac231ba60dcf6291d5c[1] = { 0x00u }; static unsigned char gaConfig_5112a95c7273b5618646efd77f3736ee[1] = { 0x77u }; static unsigned char gaConfig_5f5b945ca1b68293784e7fe03ea09773[1] = { 0x7Fu }; static unsigned char gaConfig_64852f2ab0a923ebed65f8fa143c7dd5[1] = { 0xEFu }; static unsigned char gaConfig_82b2fe061f4cd254acb0c25245f569c5[1] = { 0x00u }; static unsigned char gaConfig_f30f3bb7d10c4577078c19677646f65d[1] = { 0x38u }; static unsigned char gaConfig_4900c93f2ba5de005711392480beecab[1] = { 0x20u }; static unsigned char gaConfig_77bfd8e07c3563e7710ea46808103099[4] = { 0x00u, 0x00u, 0x10u, 0x00u }; static unsigned char gaConfig_43b0d9001d589f1023544ef54b8bcb01[1] = { 0x7Fu }; static unsigned char gaConfig_7a70ff129d3b1f51fea1fcae3b43886e[1] = { 0x00u }; static unsigned char gaConfig_05175c4e9fecffdeb9b9f82d12bf363f[1] = { 0x0Fu }; static unsigned char gaConfig_d942ac67561712b8c064aea4f5302d16[6] = { 0x00u, 0x01u, 0x00u, 0x00u, 0x20u, 0x03u }; static unsigned char gaConfig_8b0e1f8af2a65403dd1bad5b40cf814f[2] = { 0x00u, 0x64u }; static unsigned char gaConfig_aa8ead88b776f509288d413821775eae[2] = { 0x04u, 0x80u }; static unsigned char gaConfig_176fd807b0cd7a514579b0402fe2a9f2[4] = { 0x00u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_4f188cd429859efd9f1af62944d8dbc7[1] = { 0x00u }; static unsigned char gaConfig_d015d3189f8d04b36830dae4e3c498e8[8] = { 0x00u, 0x5Bu, 0x05u, 0x5Bu, 0x05u, 0x40u, 0x40u, 0x00u }; static unsigned char gaConfig_c88f858cafff79f947f90feae72962a6[3] = { 0x13u, 0x00u, 0x00u }; static unsigned char gaConfig_0e556e6cd3cc48686745f08e707d9c1f[14] = { 0x21u, 0x00u, 0x41u, 0x00u, 0x03u, 0x09u, 0x00u, 0xE7u, 0xE6u, 0xE6u, 0xE6u, 0xE6u, 0x08u, 0x03u }; static unsigned char gaConfig_243d90e72290e2ef3895f9fb131d13d6[2] = { 0x00u, 0x00u }; static unsigned char gaConfig_243e2819bc981f3d91fc3aead34186dc[3] = { 0x03u, 0x00u, 0x00u }; static unsigned char gaConfig_1fdd58ca6a320e08d3af1493fe2f5400[1] = { 0xFFu }; static unsigned char gaConfig_b7a1113e95e2aa5ad7aac4dcc772fa7d[2] = { 0xA0u, 0x00u }; static unsigned char gaConfig_f224c84018da05ea4b0a908b2f50a9ba[1] = { 0x08u }; static unsigned char gaConfig_e302e432e44d50966065b148d2baf181[1020] = { 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_c129a52444017ab947fb09e961654d63[1020] = { 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_59f4fd4b5b622edcdc03345782d69c9a[1020] = { 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_528ee46a183d7d9323d3320860d28d84[1020] = { 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_12bb1edcb5c5640c4a912a02d6f6b3f0[15] = { 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_7a70ff129d3b1f51fea1fcae3b43886e2[1] = { 0x01u }; static unsigned char gaConfig_27b8a9316058bc551cfab577a1f8e8b4[5] = { 0x45u, 0x77u, 0x7Fu, 0x78u, 0x01u }; static unsigned char gaConfig_adc6af86008485e2c48dcbb012435366[4] = { 0x00u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_713ec80de016635865233e04b256bfb3[2] = { 0x10u, 0x00u }; static unsigned char gaConfig_64f3f55d78769c377c791f41fb720c0d[5] = { 0x00u, 0x04u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_220079da847b59c3013ad7acc8d25e7c[1] = { 0x7Fu }; static unsigned char gaConfig_5bf64b44484c1ce4b0b3f484ac322d70[1] = { 0x00u }; static unsigned char gaConfig_f18008105683ea3dcb6c5cf91ce05145[1] = { 0x00u }; static unsigned char gaConfig_54c3b6360bcc792cd2555254b1079563[1] = { 0x00u }; static unsigned char gaConfig_5136735852eaec8ed1f88eb3c3c6502c[1] = { 0x00u }; static unsigned char gaConfig_abe9567dbe34451e04ac5586470d092c[1] = { 0x00u }; static unsigned char gaConfig_05175c4e9fecffdeb9b9f82d12bf363f3[2] = { 0x7Fu, 0x03u }; static unsigned char gaConfig_c9a1a2e697169909fb1532697ca00f13[750] = { 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFEu, 0xE0u, 0x00u, 0x00u, 0x00u, 0xFFu, 0x34u, 0x00u, 0x00u, 0x00u, 0xFFu, 0x2Cu, 0x00u, 0x00u, 0x00u, 0xFFu, 0x54u, 0x00u, 0x00u, 0x00u, 0xFFu, 0x5Cu, 0x00u, 0x00u, 0x00u, 0xFFu, 0xF5u, 0x08u, 0x20u, 0x00u, 0xFFu, 0x38u, 0x00u, 0x00u, 0x00u, 0xFFu, 0x80u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFEu, 0xE8u, 0x0Cu, 0x00u, 0x00u, 0xFEu, 0x30u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFFu, 0xE8u, 0x07u, 0x20u, 0x08u, 0x00u, 0x00u, 0x06u, 0xA0u, 0x00u, 0xFFu, 0xE0u, 0x00u, 0xC0u, 0x00u, 0xFFu, 0x80u, 0x07u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFFu, 0x00u, 0x00u, 0x00u, 0x00u, 0xFEu, 0xC0u, 0x22u, 0x00u, 0x27u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFEu, 0xE8u, 0x1Eu, 0x00u, 0x00u, 0xFFu, 0xE8u, 0x01u, 0x20u, 0x00u, 0xFFu, 0xD8u, 0x01u, 0x03u, 0x00u, 0x00u, 0x07u, 0xC6u, 0x00u, 0x00u, 0xFFu, 0x08u, 0x00u, 0x00u, 0x00u, 0xFFu, 0xF4u, 0x00u, 0x20u, 0x00u, 0xFFu, 0xD8u, 0x07u, 0x02u, 0x00u, 0xFDu, 0xA5u, 0x08u, 0x20u, 0x00u, 0x00u, 0x00u, 0x00u, 0xE2u, 0x00u, 0xFDu, 0xADu, 0x08u, 0x20u, 0x00u, 0x00u, 0x08u, 0x00u, 0xE2u, 0x00u, 0xFDu, 0x25u, 0x08u, 0x20u, 0x00u, 0x00u, 0x10u, 0x00u, 0xE2u, 0x00u, 0xFDu, 0x2Du, 0x08u, 0x20u, 0x00u, 0x00u, 0x18u, 0x00u, 0xE2u, 0x00u, 0xFDu, 0x35u, 0x08u, 0x20u, 0x00u, 0x00u, 0x20u, 0x00u, 0xE2u, 0x00u, 0xFDu, 0x3Du, 0x08u, 0x20u, 0x00u, 0x00u, 0x28u, 0x00u, 0xE2u, 0x00u, 0xFDu, 0x45u, 0x08u, 0x20u, 0x00u, 0x00u, 0x30u, 0x00u, 0xE2u, 0x00u, 0xFDu, 0x4Du, 0x08u, 0x20u, 0x00u, 0x00u, 0x38u, 0x00u, 0xE2u, 0x00u, 0xFDu, 0x55u, 0x08u, 0x20u, 0x00u, 0x00u, 0x40u, 0x00u, 0xE2u, 0x00u, 0xFDu, 0x5Du, 0x08u, 0x20u, 0x00u, 0x00u, 0x48u, 0x00u, 0xE2u, 0x00u, 0xFFu, 0xE8u, 0x08u, 0x20u, 0x00u, 0x00u, 0x50u, 0x00u, 0xE2u, 0x00u, 0xFFu, 0xE8u, 0x09u, 0x20u, 0x00u, 0x00u, 0x58u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x55u, 0x08u, 0x20u, 0x00u, 0xFFu, 0xD8u, 0x0Au, 0x02u, 0x00u, 0x00u, 0x60u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x5Du, 0x08u, 0x20u, 0x00u, 0xFDu, 0x78u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x5Du, 0x08u, 0x20u, 0x00u, 0xFDu, 0x68u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x5Du, 0x08u, 0x20u, 0x00u, 0xFDu, 0x80u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x5Du, 0x08u, 0x20u, 0x00u, 0xFDu, 0x90u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x5Du, 0x08u, 0x20u, 0x00u, 0xFDu, 0x88u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x5Du, 0x08u, 0x20u, 0x00u, 0xFDu, 0x98u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x15u, 0x08u, 0x20u, 0x00u, 0xFDu, 0xB0u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x25u, 0x08u, 0x20u, 0x00u, 0xFDu, 0xB8u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x05u, 0x08u, 0x20u, 0x00u, 0xFDu, 0x60u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x0Du, 0x08u, 0x20u, 0x00u, 0xFDu, 0x70u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x00u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x07u, 0xFFu, 0x20u, 0x00u, 0x00u, 0xA8u, 0x00u, 0xE2u, 0x00u, 0x00u, 0xB0u, 0x00u, 0xF2u, 0x00u, 0x00u, 0x7Du, 0x08u, 0x20u, 0x00u, 0x00u, 0x78u, 0x0Bu, 0x22u, 0x40u, 0x00u, 0xB0u, 0x0Bu, 0x22u, 0x00u, 0x00u, 0x6Du, 0x08u, 0x34u, 0x00u, 0x00u, 0x68u, 0x0Bu, 0x22u, 0x40u, 0x00u, 0xA8u, 0x0Bu, 0x82u, 0x00u, 0x00u, 0xA8u, 0x0Bu, 0x22u, 0x00u, 0x00u, 0x70u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x80u, 0x00u, 0xF2u, 0x00u, 0x00u, 0xB8u, 0x00u, 0xF6u, 0x00u, 0x00u, 0x9Du, 0x08u, 0x20u, 0x08u, 0x00u, 0xA0u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x8Du, 0x08u, 0x20u, 0x00u, 0xFFu, 0xE8u, 0x0Du, 0x22u, 0x67u, 0x00u, 0x90u, 0x00u, 0xE2u, 0x00u, 0x00u, 0xBDu, 0x08u, 0x22u, 0x48u, 0x00u, 0xBDu, 0x08u, 0x20u, 0x00u, 0x00u, 0x90u, 0x00u, 0xE2u, 0x27u, 0xFFu, 0xE8u, 0x0Cu, 0x20u, 0x00u, 0x00u, 0xA0u, 0x00u, 0xE2u, 0x27u, 0x00u, 0xA5u, 0x08u, 0x20u, 0x08u, 0xFFu, 0xFDu, 0x08u, 0x22u, 0x40u, 0x00u, 0xA0u, 0x00u, 0xE2u, 0x26u, 0x00u, 0x95u, 0x08u, 0x20u, 0x00u, 0xFFu, 0xD8u, 0x0Eu, 0x02u, 0x00u, 0x00u, 0x05u, 0x08u, 0x20u, 0x00u, 0x00u, 0xC0u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x08u, 0x00u, 0xC0u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x0Fu, 0xFFu, 0x20u, 0x00u, 0x00u, 0xA8u, 0x00u, 0xE2u, 0x00u, 0x00u, 0xB0u, 0x00u, 0xF2u, 0x00u, 0x00u, 0xDDu, 0x08u, 0x20u, 0x00u, 0x00u, 0xD8u, 0x0Fu, 0x22u, 0x40u, 0x00u, 0xB0u, 0x0Fu, 0x22u, 0x00u, 0x00u, 0xCDu, 0x08u, 0x34u, 0x00u, 0x00u, 0xC8u, 0x0Fu, 0x22u, 0x40u, 0x00u, 0xA8u, 0x0Fu, 0x82u, 0x00u, 0x00u, 0xA8u, 0x0Fu, 0x22u, 0x00u, 0x00u, 0xD0u, 0x00u, 0xE2u, 0x00u, 0x00u, 0xE0u, 0x00u, 0xF2u, 0x00u, 0x00u, 0xB8u, 0x00u, 0xF6u, 0x00u, 0x00u, 0xFDu, 0x08u, 0x20u, 0x08u, 0x01u, 0x00u, 0x00u, 0xE2u, 0x00u, 0x00u, 0xEDu, 0x08u, 0x20u, 0x00u, 0xFFu, 0xE8u, 0x11u, 0x22u, 0x67u, 0x00u, 0xF0u, 0x00u, 0xE2u, 0x00u, 0x00u, 0xBDu, 0x08u, 0x22u, 0x48u, 0x00u, 0xBDu, 0x08u, 0x20u, 0x00u, 0x00u, 0xF0u, 0x00u, 0xE2u, 0x27u, 0xFFu, 0xE8u, 0x10u, 0x20u, 0x00u, 0x01u, 0x00u, 0x00u, 0xE2u, 0x27u, 0x01u, 0x05u, 0x08u, 0x20u, 0x08u, 0xFFu, 0xFDu, 0x08u, 0x22u, 0x40u, 0x01u, 0x00u, 0x00u, 0xE2u, 0x26u, 0x00u, 0xF5u, 0x08u, 0x20u, 0x00u, 0xFFu, 0xD8u, 0x12u, 0x02u, 0x00u, 0x00u, 0x0Du, 0x08u, 0x20u, 0x00u, 0x01u, 0x08u, 0x00u, 0xE2u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFEu, 0x30u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xFEu, 0xC0u, 0x0Fu, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_b4208250e010f6af326b971b8ac03b01[76] = { 0x00u, 0x00u, 0x10u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x01u, 0x80u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x4Eu, 0xB0u, 0x00u, 0x00u, 0x01u, 0xE0u, 0x00u, 0x00u, 0x07u, 0x1Cu, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x4Eu, 0xB0u, 0x00u, 0x00u, 0x01u, 0xE0u, 0x00u, 0x00u, 0x07u, 0x1Cu, 0x00u, 0x00u, 0x00u, 0x00u }; static unsigned char gaConfig_90186fbbf002cb53fabd5ce94f478ffc[1] = { 0x01u }; static unsigned char gaConfig_135f9bd5f16f61b3588775733c966c6e[1] = { 0x01u }; static unsigned char gaConfig_214c43636f2ba93fa10e329fb85e2997[1] = { 0x00u }; static unsigned char gaConfig_4405e166d4d9ba66340ca58d230a7146[1] = { 0x03u }; static unsigned char gaConfig_a5433bfeb8a6516b1544555566253842[1] = { 0x00u }; static unsigned char gaConfig_d4d609ab6427470d65e8d59168012ed8[1] = { 0x00u }; static unsigned char gaConfig_89873c4f9a6ba61e28299b0c94d769c8[1] = { 0x19u }; static unsigned char gaConfig_d887a2d17482e251b0e97a0cfb47b6b4[1] = { 0x00u }; static unsigned char gaConfig_3c9c986f7d76829f7d943be4a46abd8d[1] = { 0x00u }; static unsigned char gaConfig_0683f71f6301d6ed95d3dc50c08a5435[1] = { 0x00u }; static unsigned char gaConfig_44a139377dd525f642be9cb932c2afb7[1] = { 0x00u }; static unsigned char gaConfig_e066782d1b464f0594e2f8e428e874e5[1] = { 0x00u }; static unsigned char gaConfig_ba60a6fc9f1895807d8e9eadc22fb84a[1] = { 0x00u }; static unsigned char gaConfig_06867424f747b88b9dc14699eda9e788[1] = { 0x00u }; static unsigned char gaConfig_b27a56c4101205239276dfa85c353460[1] = { 0x00u }; static unsigned char gaConfig_fc0fe4e7476afb14184eed0c119af0d5[1] = { 0x00u }; static unsigned char gaConfig_056f690f722bee9930086a25cafb3a5f[1] = { 0x00u }; static unsigned char gaConfig_a5c433fbeb115cb6204ea2c45c8c76e7[1] = { 0x00u }; static unsigned char gaConfig_9aa1f6396529dcf23b51e9b2961f2321[1] = { 0x00u }; static unsigned char gaConfig_764fd7d57e08fa5f00368617ccf1415a[1] = { 0x00u }; static unsigned char gaConfig_04eafa71999a22e775c4907aadfcc53a[1] = { 0x00u }; static unsigned char gaConfig_1943e8929a4f2092ed2ac0529c403ac9[1] = { 0x00u }; static unsigned char gaConfig_a1e695cc98b611144147755f9cc34216[1] = { 0x00u }; static unsigned char gaConfig_4718331eb90537ca94745f83b3c3ee36[1] = { 0x00u }; static unsigned char gaConfig_d25690c9a5bd0d73b3dbf0171d6401e7[1] = { 0x00u }; static unsigned char gaConfig_244f412aafb3bed1af4fa153b10ce452[1] = { 0x00u }; static unsigned char gaConfig_59299dbb42ad242666b752b781954650[1] = { 0x00u }; static unsigned char gaConfig_501ec4d0d8d4ae8d6f1d750aa80e8cf6[1] = { 0x00u }; static unsigned char gaConfig_083d920a57818949f8191b991950bbf4[1] = { 0x00u }; static unsigned char gaConfig_63d66c53ee1cd14cc795eb6f5c13d922[1] = { 0x00u }; static unsigned char gaConfig_bd744b5f15b3bef7588e19a2286a07e7[1] = { 0x00u }; static unsigned char gaConfig_976e7d14a2c694e4da741bf6f56d96df[1] = { 0xEFu }; static unsigned char gaConfig_8d413e20f5e872b851148ade0a00bd5e[1] = { 0x08u }; static unsigned char gaConfig_c92efebece4482defc46928791f9ce2b[1] = { 0x08u }; static unsigned char gaConfig_16df8f451f33f3fdee2f55d435100525[1] = { 0x01u }; static unsigned char gaConfig_b35674da7e72d87fd236f705b621c636[1] = { 0x00u }; static unsigned char gaConfig_fe08b3609f4bc30a60523564e4a2d770[1] = { 0x44u }; static unsigned char gaConfig_a1d0d762605e8ae1c5c82ba90e43763e[1] = { 0x03u }; static unsigned char gaConfig_585253630897cbd37764afc16b5fb8d8[1] = { 0x00u }; static unsigned char gaConfig_317a686e4cafd5a363a88a5a84decee3[1] = { 0x01u }; ADI_A2B_DISCOVERY_CONFIG gaA2BConfig[CONFIG_LEN] = { {0x38u, WRITE, 0x02u, 0x00000000u, 0x01u, 0x0004u, &gaConfig_aac69007579bc96b496f5df5913633a3[0]}, {0x38u, WRITE, 0x02u, 0x000040EBu, 0x01u, 0x0001u, &gaConfig_2af1312729311565a20cd2d3ae0797f1[0]}, {0x38u, WRITE, 0x02u, 0x000040F6u, 0x01u, 0x0001u, &gaConfig_d56a61f7dcf879040114dafdb9a39298[0]}, {0x38u, WRITE, 0x02u, 0x00004000u, 0x01u, 0x0001u, &gaConfig_a7cd8739cd063acb3b965b2c088b017c[0]}, {0x38u, WRITE, 0x02u, 0x00004002u, 0x01u, 0x0006u, &gaConfig_0b077455ed2c5320cba6b86bd2ff5730[0]}, {0x38u, DELAY, 0x02u, 0x00000000u, 0x01u, 0x0002u, &gaConfig_07d0a4e2ae863b87d0f7c4076f133def[0]}, {0x38u, WRITE, 0x02u, 0x00004015u, 0x01u, 0x0002u, &gaConfig_03211db7b78624ed744bcc26ca2712dc[0]}, {0x38u, WRITE, 0x02u, 0x00004011u, 0x01u, 0x0004u, &gaConfig_2009c65bc3a2d1a8007dd32b2aad03bf[0]}, {0x38u, WRITE, 0x02u, 0x00004008u, 0x01u, 0x0001u, &gaConfig_45fba1a821dd93e15f865cd70b16ad89[0]}, {0x38u, WRITE, 0x02u, 0x00004009u, 0x01u, 0x0008u, &gaConfig_2a3401027e79066889c71b8cec30c542[0]}, {0x38u, WRITE, 0x02u, 0x00004019u, 0x01u, 0x0003u, &gaConfig_0ed9a6250f52b047f2c8fc5d22a500ec[0]}, {0x38u, WRITE, 0x02u, 0x0000401Cu, 0x01u, 0x000Eu, &gaConfig_f4071dfb01109d0bfd95d99ad183d2c8[0]}, {0x38u, WRITE, 0x02u, 0x00004017u, 0x01u, 0x0002u, &gaConfig_a2d00b7e6c3e671596b6cca28ec3a759[0]}, {0x38u, WRITE, 0x02u, 0x0000402Au, 0x01u, 0x0003u, &gaConfig_840ebdd3b92bd815fdc44143f5741da7[0]}, {0x38u, WRITE, 0x02u, 0x0000402Du, 0x01u, 0x0001u, &gaConfig_98af8455af6b639c2801b39160c702b0[0]}, {0x38u, WRITE, 0x02u, 0x0000402Fu, 0x01u, 0x0002u, &gaConfig_9bdcd3bd379de07b384b0ecf800a393b[0]}, {0x38u, WRITE, 0x02u, 0x00004031u, 0x01u, 0x0001u, &gaConfig_5fc29317ada8c8857183151bcd889e75[0]}, {0x38u, WRITE, 0x02u, 0x00000800u, 0x01u, 0x03FCu, &gaConfig_9e0fb6905db32dd3942fb1af6c682a30[0]}, {0x38u, WRITE, 0x02u, 0x000008CCu, 0x01u, 0x03FCu, &gaConfig_7a60ba70ca0fce588d41443c499c7a41[0]}, {0x38u, WRITE, 0x02u, 0x00000998u, 0x01u, 0x03FCu, &gaConfig_fd145b0c5dd18b4d491810b806da1f50[0]}, {0x38u, WRITE, 0x02u, 0x00000A64u, 0x01u, 0x03FCu, &gaConfig_1792011182aaaab2ad32767ebf4eb9f8[0]}, {0x38u, WRITE, 0x02u, 0x00000BFCu, 0x01u, 0x000Fu, &gaConfig_cbe5c7e4199e6cd8873273ccc49876cf[0]}, {0x38u, WRITE, 0x02u, 0x000040F5u, 0x01u, 0x0001u, &gaConfig_d56a61f7dcf879040114dafdb9a392982[0]}, {0x38u, WRITE, 0x02u, 0x000040C0u, 0x01u, 0x0005u, &gaConfig_b9651e277a30047bfd768f4a34e1f349[0]}, {0x38u, WRITE, 0x02u, 0x000040C6u, 0x01u, 0x0004u, &gaConfig_1e326d9b47a9bd4abdc882a97b701902[0]}, {0x38u, WRITE, 0x02u, 0x000040E9u, 0x01u, 0x0002u, &gaConfig_8303d6b3d31f611ebd87cf70d4457be8[0]}, {0x38u, WRITE, 0x02u, 0x000040D0u, 0x01u, 0x0005u, &gaConfig_f66b8735595e286111cac15ed1a7fe2a[0]}, {0x38u, WRITE, 0x02u, 0x000040EBu, 0x01u, 0x0001u, &gaConfig_a2206c5965947eb21a342333851536c1[0]}, {0x38u, WRITE, 0x02u, 0x000040F2u, 0x01u, 0x0001u, &gaConfig_3b69615d303d4602b6c71703e59503c7[0]}, {0x38u, WRITE, 0x02u, 0x000040F3u, 0x01u, 0x0001u, &gaConfig_d114c77ba364138f2f51e279ef39d6be[0]}, {0x38u, WRITE, 0x02u, 0x000040F4u, 0x01u, 0x0001u, &gaConfig_2d3eb525a55860be781104e79e118ca3[0]}, {0x38u, WRITE, 0x02u, 0x000040F7u, 0x01u, 0x0001u, &gaConfig_bf12ddce27b680dc1d3f04e79eb15339[0]}, {0x38u, WRITE, 0x02u, 0x000040F8u, 0x01u, 0x0001u, &gaConfig_a36e1b41f2adf43ec11fcc94c2212db3[0]}, {0x38u, WRITE, 0x02u, 0x000040F9u, 0x01u, 0x0002u, &gaConfig_a7cd8739cd063acb3b965b2c088b017c3[0]}, {0x38u, WRITE, 0x02u, 0x00000800u, 0x01u, 0x0802u, &gaConfig_504a5385c6848b23e98fc961950eceff[0]}, {0x38u, WRITE, 0x02u, 0x00000000u, 0x01u, 0x0080u, &gaConfig_11dc39db314a8f306f08eaa42b14c9b6[0]}, {0x38u, WRITE, 0x02u, 0x000040EBu, 0x01u, 0x0001u, &gaConfig_b10fadc5b1e5007856548f2744175d48[0]}, {0x38u, WRITE, 0x02u, 0x000040F6u, 0x01u, 0x0001u, &gaConfig_7b5b6e396d19555bf15105fb0bd728be[0]}, {0x38u, WRITE, 0x02u, 0x00004036u, 0x01u, 0x0001u, &gaConfig_9ac93a2ab6554bf0df02d155e7a8f3a5[0]}, {0x38u, WRITE, 0x02u, 0x00004036u, 0x01u, 0x0001u, &gaConfig_809cd5cd28abd9f49e25e2d850fa88af[0]}, {0x68u, WRITE, 0x01u, 0x00000012u, 0x01u, 0x0001u, &gaConfig_2e6d745a81d6250e734b8064c689df56[0]}, {0x68u, DELAY, 0x01u, 0x00000000u, 0x01u, 0x0001u, &gaConfig_35b3645cf21b2f9988ca0c14a06a8f39[0]}, {0x68u, READ, 0x01u, 0x00000017u, 0x01u, 0x0001u, &gaConfig_24388e02c4b6f8f42558a3838b99f7d6[0]}, {0x68u, WRITE, 0x01u, 0x0000001Bu, 0x01u, 0x0001u, &gaConfig_83e560ae5cf09fe931ce3857fe5d365b[0]}, {0x68u, WRITE, 0x01u, 0x0000001Cu, 0x01u, 0x0001u, &gaConfig_e9afa5b6292e40c2789a3ffe31bdb44a[0]}, {0x68u, WRITE, 0x01u, 0x0000001Du, 0x01u, 0x0001u, &gaConfig_33f8db3963e78dc8ea8c8f4eb317beb9[0]}, {0x68u, WRITE, 0x01u, 0x0000000Fu, 0x01u, 0x0001u, &gaConfig_8b4d609e13a4a4f49944d613f89cf26c[0]}, {0x68u, WRITE, 0x01u, 0x00000012u, 0x01u, 0x0001u, &gaConfig_81170f670dda1d15b751b0dc1ec8c3b1[0]}, {0x68u, WRITE, 0x01u, 0x00000041u, 0x01u, 0x0001u, &gaConfig_b8f58538c507d43d9a99c6adf6ff2e60[0]}, {0x68u, WRITE, 0x01u, 0x00000009u, 0x01u, 0x0001u, &gaConfig_ddb017d8f762017b0b231d015febc745[0]}, {0x68u, WRITE, 0x01u, 0x00000013u, 0x01u, 0x0001u, &gaConfig_fa053ad4bf70ea7139d62dbf0dd1d8ac[0]}, {0x68u, DELAY, 0x01u, 0x00000000u, 0x01u, 0x0001u, &gaConfig_35b3645cf21b2f9988ca0c14a06a8f391[0]}, {0x68u, READ, 0x01u, 0x0000001Au, 0x01u, 0x0001u, &gaConfig_5861e3bb7994dc3029d594638f13aa88[0]}, {0x68u, WRITE, 0x01u, 0x0000001Au, 0x01u, 0x0001u, &gaConfig_03587754e11abfbd742e66c3716107da[0]}, {0x68u, WRITE, 0x01u, 0x00000001u, 0x01u, 0x0001u, &gaConfig_deaff37c812228f2a7724e415c6d7deb[0]}, {0x69u, READ, 0x01u, 0x00000002u, 0x01u, 0x0001u, &gaConfig_0eeaa054db65aad8406e1e4f1bb51986[0]}, {0x69u, READ, 0x01u, 0x00000003u, 0x01u, 0x0001u, &gaConfig_d40e4dda915adaef05789e873609285f[0]}, {0x69u, READ, 0x01u, 0x00000004u, 0x01u, 0x0001u, &gaConfig_9c9e434c50f9f48464ecee46207d893d[0]}, {0x68u, WRITE, 0x01u, 0x00000009u, 0x01u, 0x0001u, &gaConfig_10a8b2e0283f5e67ac10d80f153d2f65[0]}, {0x68u, WRITE, 0x01u, 0x00000001u, 0x01u, 0x0001u, &gaConfig_36c0b1fe1d09687e7e92007461ec115d[0]}, {0x69u, WRITE, 0x01u, 0x0000000Au, 0x01u, 0x0001u, &gaConfig_b69fecc95c144d0e9e8b7818cdbba961[0]}, {0x69u, WRITE, 0x01u, 0x0000000Bu, 0x01u, 0x0001u, &gaConfig_1e411c008d5224afbe5cb21b34cac58b[0]}, {0x69u, WRITE, 0x01u, 0x0000000Cu, 0x01u, 0x0001u, &gaConfig_867d2ec4a617ea15ab79a46ff2497f59[0]}, {0x69u, WRITE, 0x01u, 0x0000003Fu, 0x01u, 0x0001u, &gaConfig_6b5d6b0bae23aa9c7f44c1f445f03041[0]}, {0x69u, WRITE, 0x01u, 0x00000041u, 0x01u, 0x0001u, &gaConfig_99fd160f6a74a8ef5f4a0b994135026d[0]}, {0x69u, WRITE, 0x01u, 0x00000042u, 0x01u, 0x0001u, &gaConfig_8694cd4c3df1d8acba2d38ae72cfecc7[0]}, {0x69u, WRITE, 0x01u, 0x00000043u, 0x01u, 0x0001u, &gaConfig_67efb87bc69f04818cd571e502c0f5d3[0]}, {0x69u, WRITE, 0x01u, 0x00000046u, 0x01u, 0x0001u, &gaConfig_c1a5cfc1bb7fcc9e38cfcd43d1f4a37d[0]}, {0x69u, WRITE, 0x01u, 0x00000047u, 0x01u, 0x0001u, &gaConfig_7d04b8d626d2cf80853b3f03120a8b43[0]}, {0x69u, WRITE, 0x01u, 0x00000048u, 0x01u, 0x0001u, &gaConfig_e4914f4580882e5f5dadc68d04820522[0]}, {0x69u, WRITE, 0x01u, 0x0000004Au, 0x01u, 0x0001u, &gaConfig_71d4377a25df5ec4ae352a890b802f36[0]}, {0x69u, WRITE, 0x01u, 0x0000004Du, 0x01u, 0x0001u, &gaConfig_f8a368d3599fce94a50214620c8baf43[0]}, {0x69u, WRITE, 0x01u, 0x0000004Eu, 0x01u, 0x0001u, &gaConfig_4be6f70c8ffd8e15a3d3751ab66c4fdf[0]}, {0x69u, WRITE, 0x01u, 0x00000050u, 0x01u, 0x0001u, &gaConfig_f5d1a688cef45324bc23fa89264ea0b1[0]}, {0x69u, WRITE, 0x01u, 0x00000051u, 0x01u, 0x0001u, &gaConfig_57e08af22ca0902cfa0489da6fdfc510[0]}, {0x69u, WRITE, 0x01u, 0x00000052u, 0x01u, 0x0001u, &gaConfig_a6e91c6206896070d6c029c902f60eef[0]}, {0x69u, WRITE, 0x01u, 0x00000020u, 0x01u, 0x0001u, &gaConfig_ccdc91e4f6e91ea32cce1aafaee982e0[0]}, {0x69u, WRITE, 0x01u, 0x00000059u, 0x01u, 0x0001u, &gaConfig_5a8ee9053e87eda47a920685950cc7a1[0]}, {0x69u, WRITE, 0x01u, 0x0000005Au, 0x01u, 0x0001u, &gaConfig_10b0aad7f186547ae64a450dac67467d[0]}, {0x69u, WRITE, 0x01u, 0x00000060u, 0x01u, 0x0001u, &gaConfig_446bf3482fb10ed9ef1993aa755adc81[0]}, {0x69u, WRITE, 0x01u, 0x00000061u, 0x01u, 0x0001u, &gaConfig_212e72ba61a2867fc36c08cebfd50d39[0]}, {0x69u, WRITE, 0x01u, 0x00000062u, 0x01u, 0x0001u, &gaConfig_2304e1ca7e1d5c8bbad6eda920a93bf0[0]}, {0x69u, WRITE, 0x01u, 0x00000063u, 0x01u, 0x0001u, &gaConfig_86dfeacf54793511e3a6b7b285d6348b[0]}, {0x69u, WRITE, 0x01u, 0x00000064u, 0x01u, 0x0001u, &gaConfig_3968fc239af43c2a12c6d54cbe61ceca[0]}, {0x69u, WRITE, 0x01u, 0x00000065u, 0x01u, 0x0001u, &gaConfig_608577276b449c1879940ce70ce32c28[0]}, {0x69u, WRITE, 0x01u, 0x00000066u, 0x01u, 0x0001u, &gaConfig_64db1c4a33c8329656d81956af26cefb[0]}, {0x69u, WRITE, 0x01u, 0x00000067u, 0x01u, 0x0001u, &gaConfig_60c67f225adb2133260c36e8bc5166e5[0]}, {0x69u, WRITE, 0x01u, 0x00000068u, 0x01u, 0x0001u, &gaConfig_789c0bb6666b0fa99e1f445ce80ae589[0]}, {0x69u, WRITE, 0x01u, 0x00000069u, 0x01u, 0x0001u, &gaConfig_3d09f95dd990960879a109f282dcc9f9[0]}, {0x69u, WRITE, 0x01u, 0x00000081u, 0x01u, 0x0001u, &gaConfig_8a64cd9271c6eaa34a6d0f6fe0fb0308[0]}, {0x69u, WRITE, 0x01u, 0x00000082u, 0x01u, 0x0001u, &gaConfig_d1ea8d7da7c465f389a6798b5edb3d5f[0]}, {0x69u, WRITE, 0x01u, 0x00000083u, 0x01u, 0x0001u, &gaConfig_8c8c06632ec447007fad6bc068082c63[0]}, {0x69u, WRITE, 0x01u, 0x00000084u, 0x01u, 0x0001u, &gaConfig_18e231b97058ffd8d0db61b8b32c525b[0]}, {0x69u, WRITE, 0x01u, 0x00000085u, 0x01u, 0x0001u, &gaConfig_44b5d13165525e30ff193595a448d246[0]}, {0x69u, WRITE, 0x01u, 0x00000086u, 0x01u, 0x0001u, &gaConfig_facf64b64e99a153037a5bb79eac301f[0]}, {0x69u, WRITE, 0x01u, 0x00000087u, 0x01u, 0x0001u, &gaConfig_4592360082ff8d985e6e3c92f619d2af[0]}, {0x69u, WRITE, 0x01u, 0x00000088u, 0x01u, 0x0001u, &gaConfig_e387b1afb6ba245deece1798416839fa[0]}, {0x69u, WRITE, 0x01u, 0x0000008Au, 0x01u, 0x0001u, &gaConfig_2c74c711c3a1e0008741d1b56a0045ef[0]}, {0x69u, WRITE, 0x01u, 0x00000080u, 0x01u, 0x0001u, &gaConfig_e75a4ce102e7e27fddc0fd8e9df00a94[0]}, {0x69u, WRITE, 0x01u, 0x00000090u, 0x01u, 0x0001u, &gaConfig_031e4dbe0bb50758d5ccb79b5d77be43[0]}, {0x69u, WRITE, 0x01u, 0x00000096u, 0x01u, 0x0001u, &gaConfig_718204ffd1c0b8239e519624b26d51fc[0]}, {0x69u, WRITE, 0x01u, 0x0000005Cu, 0x01u, 0x0001u, &gaConfig_7f9c30102a65e5a6367498496a4bb2e4[0]}, {0x69u, WRITE, 0x01u, 0x00000058u, 0x01u, 0x0001u, &gaConfig_704072e7218ae699d3255b6055994f74[0]}, {0x69u, WRITE, 0x01u, 0x00000057u, 0x01u, 0x0001u, &gaConfig_8bb911eff5231ac231ba60dcf6291d5c[0]}, {0x69u, WRITE, 0x01u, 0x0000001Bu, 0x01u, 0x0001u, &gaConfig_5112a95c7273b5618646efd77f3736ee[0]}, {0x69u, WRITE, 0x01u, 0x0000001Cu, 0x01u, 0x0001u, &gaConfig_5f5b945ca1b68293784e7fe03ea09773[0]}, {0x69u, WRITE, 0x01u, 0x0000001Eu, 0x01u, 0x0001u, &gaConfig_64852f2ab0a923ebed65f8fa143c7dd5[0]}, {0x68u, WRITE, 0x01u, 0x00000001u, 0x01u, 0x0001u, &gaConfig_82b2fe061f4cd254acb0c25245f569c5[0]}, {0x69u, WRITE, 0x01u, 0x00000000u, 0x01u, 0x0001u, &gaConfig_f30f3bb7d10c4577078c19677646f65d[0]}, {0x68u, WRITE, 0x01u, 0x00000001u, 0x01u, 0x0001u, &gaConfig_4900c93f2ba5de005711392480beecab[0]}, {0x69u, WRITE, 0x02u, 0x00000000u, 0x01u, 0x0004u, &gaConfig_77bfd8e07c3563e7710ea46808103099[0]}, {0x69u, WRITE, 0x02u, 0x000040EBu, 0x01u, 0x0001u, &gaConfig_43b0d9001d589f1023544ef54b8bcb01[0]}, {0x69u, WRITE, 0x02u, 0x000040F6u, 0x01u, 0x0001u, &gaConfig_7a70ff129d3b1f51fea1fcae3b43886e[0]}, {0x69u, WRITE, 0x02u, 0x00004000u, 0x01u, 0x0001u, &gaConfig_05175c4e9fecffdeb9b9f82d12bf363f[0]}, {0x69u, WRITE, 0x02u, 0x00004002u, 0x01u, 0x0006u, &gaConfig_d942ac67561712b8c064aea4f5302d16[0]}, {0x69u, DELAY, 0x02u, 0x00000000u, 0x01u, 0x0002u, &gaConfig_8b0e1f8af2a65403dd1bad5b40cf814f[0]}, {0x69u, WRITE, 0x02u, 0x00004015u, 0x01u, 0x0002u, &gaConfig_aa8ead88b776f509288d413821775eae[0]}, {0x69u, WRITE, 0x02u, 0x00004011u, 0x01u, 0x0004u, &gaConfig_176fd807b0cd7a514579b0402fe2a9f2[0]}, {0x69u, WRITE, 0x02u, 0x00004008u, 0x01u, 0x0001u, &gaConfig_4f188cd429859efd9f1af62944d8dbc7[0]}, {0x69u, WRITE, 0x02u, 0x00004009u, 0x01u, 0x0008u, &gaConfig_d015d3189f8d04b36830dae4e3c498e8[0]}, {0x69u, WRITE, 0x02u, 0x00004019u, 0x01u, 0x0003u, &gaConfig_c88f858cafff79f947f90feae72962a6[0]}, {0x69u, WRITE, 0x02u, 0x0000401Cu, 0x01u, 0x000Eu, &gaConfig_0e556e6cd3cc48686745f08e707d9c1f[0]}, {0x69u, WRITE, 0x02u, 0x00004017u, 0x01u, 0x0002u, &gaConfig_243d90e72290e2ef3895f9fb131d13d6[0]}, {0x69u, WRITE, 0x02u, 0x0000402Au, 0x01u, 0x0003u, &gaConfig_243e2819bc981f3d91fc3aead34186dc[0]}, {0x69u, WRITE, 0x02u, 0x0000402Du, 0x01u, 0x0001u, &gaConfig_1fdd58ca6a320e08d3af1493fe2f5400[0]}, {0x69u, WRITE, 0x02u, 0x0000402Fu, 0x01u, 0x0002u, &gaConfig_b7a1113e95e2aa5ad7aac4dcc772fa7d[0]}, {0x69u, WRITE, 0x02u, 0x00004031u, 0x01u, 0x0001u, &gaConfig_f224c84018da05ea4b0a908b2f50a9ba[0]}, {0x69u, WRITE, 0x02u, 0x00000800u, 0x01u, 0x03FCu, &gaConfig_e302e432e44d50966065b148d2baf181[0]}, {0x69u, WRITE, 0x02u, 0x000008CCu, 0x01u, 0x03FCu, &gaConfig_c129a52444017ab947fb09e961654d63[0]}, {0x69u, WRITE, 0x02u, 0x00000998u, 0x01u, 0x03FCu, &gaConfig_59f4fd4b5b622edcdc03345782d69c9a[0]}, {0x69u, WRITE, 0x02u, 0x00000A64u, 0x01u, 0x03FCu, &gaConfig_528ee46a183d7d9323d3320860d28d84[0]}, {0x69u, WRITE, 0x02u, 0x00000BFCu, 0x01u, 0x000Fu, &gaConfig_12bb1edcb5c5640c4a912a02d6f6b3f0[0]}, {0x69u, WRITE, 0x02u, 0x000040F5u, 0x01u, 0x0001u, &gaConfig_7a70ff129d3b1f51fea1fcae3b43886e2[0]}, {0x69u, WRITE, 0x02u, 0x000040C0u, 0x01u, 0x0005u, &gaConfig_27b8a9316058bc551cfab577a1f8e8b4[0]}, {0x69u, WRITE, 0x02u, 0x000040C6u, 0x01u, 0x0004u, &gaConfig_adc6af86008485e2c48dcbb012435366[0]}, {0x69u, WRITE, 0x02u, 0x000040E9u, 0x01u, 0x0002u, &gaConfig_713ec80de016635865233e04b256bfb3[0]}, {0x69u, WRITE, 0x02u, 0x000040D0u, 0x01u, 0x0005u, &gaConfig_64f3f55d78769c377c791f41fb720c0d[0]}, {0x69u, WRITE, 0x02u, 0x000040EBu, 0x01u, 0x0001u, &gaConfig_220079da847b59c3013ad7acc8d25e7c[0]}, {0x69u, WRITE, 0x02u, 0x000040F2u, 0x01u, 0x0001u, &gaConfig_5bf64b44484c1ce4b0b3f484ac322d70[0]}, {0x69u, WRITE, 0x02u, 0x000040F3u, 0x01u, 0x0001u, &gaConfig_f18008105683ea3dcb6c5cf91ce05145[0]}, {0x69u, WRITE, 0x02u, 0x000040F4u, 0x01u, 0x0001u, &gaConfig_54c3b6360bcc792cd2555254b1079563[0]}, {0x69u, WRITE, 0x02u, 0x000040F7u, 0x01u, 0x0001u, &gaConfig_5136735852eaec8ed1f88eb3c3c6502c[0]}, {0x69u, WRITE, 0x02u, 0x000040F8u, 0x01u, 0x0001u, &gaConfig_abe9567dbe34451e04ac5586470d092c[0]}, {0x69u, WRITE, 0x02u, 0x000040F9u, 0x01u, 0x0002u, &gaConfig_05175c4e9fecffdeb9b9f82d12bf363f3[0]}, {0x69u, WRITE, 0x02u, 0x00000800u, 0x01u, 0x02EEu, &gaConfig_c9a1a2e697169909fb1532697ca00f13[0]}, {0x69u, WRITE, 0x02u, 0x00000000u, 0x01u, 0x004Cu, &gaConfig_b4208250e010f6af326b971b8ac03b01[0]}, {0x69u, WRITE, 0x02u, 0x000040EBu, 0x01u, 0x0001u, &gaConfig_90186fbbf002cb53fabd5ce94f478ffc[0]}, {0x69u, WRITE, 0x02u, 0x000040F6u, 0x01u, 0x0001u, &gaConfig_135f9bd5f16f61b3588775733c966c6e[0]}, {0x69u, WRITE, 0x02u, 0x00004036u, 0x01u, 0x0001u, &gaConfig_214c43636f2ba93fa10e329fb85e2997[0]}, {0x69u, WRITE, 0x02u, 0x00004036u, 0x01u, 0x0001u, &gaConfig_4405e166d4d9ba66340ca58d230a7146[0]}, {0x68u, WRITE, 0x01u, 0x00000001u, 0x01u, 0x0001u, &gaConfig_a5433bfeb8a6516b1544555566253842[0]}, {0x68u, WRITE, 0x01u, 0x0000003Fu, 0x01u, 0x0001u, &gaConfig_d4d609ab6427470d65e8d59168012ed8[0]}, {0x68u, WRITE, 0x01u, 0x00000042u, 0x01u, 0x0001u, &gaConfig_89873c4f9a6ba61e28299b0c94d769c8[0]}, {0x68u, WRITE, 0x01u, 0x00000044u, 0x01u, 0x0001u, &gaConfig_d887a2d17482e251b0e97a0cfb47b6b4[0]}, {0x68u, WRITE, 0x01u, 0x00000045u, 0x01u, 0x0001u, &gaConfig_3c9c986f7d76829f7d943be4a46abd8d[0]}, {0x68u, WRITE, 0x01u, 0x00000047u, 0x01u, 0x0001u, &gaConfig_0683f71f6301d6ed95d3dc50c08a5435[0]}, {0x68u, WRITE, 0x01u, 0x00000048u, 0x01u, 0x0001u, &gaConfig_44a139377dd525f642be9cb932c2afb7[0]}, {0x68u, WRITE, 0x01u, 0x0000004Au, 0x01u, 0x0001u, &gaConfig_e066782d1b464f0594e2f8e428e874e5[0]}, {0x68u, WRITE, 0x01u, 0x0000004Du, 0x01u, 0x0001u, &gaConfig_ba60a6fc9f1895807d8e9eadc22fb84a[0]}, {0x68u, WRITE, 0x01u, 0x0000004Eu, 0x01u, 0x0001u, &gaConfig_06867424f747b88b9dc14699eda9e788[0]}, {0x68u, WRITE, 0x01u, 0x00000050u, 0x01u, 0x0001u, &gaConfig_b27a56c4101205239276dfa85c353460[0]}, {0x68u, WRITE, 0x01u, 0x00000051u, 0x01u, 0x0001u, &gaConfig_fc0fe4e7476afb14184eed0c119af0d5[0]}, {0x68u, WRITE, 0x01u, 0x00000052u, 0x01u, 0x0001u, &gaConfig_056f690f722bee9930086a25cafb3a5f[0]}, {0x68u, WRITE, 0x01u, 0x00000020u, 0x01u, 0x0001u, &gaConfig_a5c433fbeb115cb6204ea2c45c8c76e7[0]}, {0x68u, WRITE, 0x01u, 0x00000059u, 0x01u, 0x0001u, &gaConfig_9aa1f6396529dcf23b51e9b2961f2321[0]}, {0x68u, WRITE, 0x01u, 0x0000005Au, 0x01u, 0x0001u, &gaConfig_764fd7d57e08fa5f00368617ccf1415a[0]}, {0x68u, WRITE, 0x01u, 0x00000081u, 0x01u, 0x0001u, &gaConfig_04eafa71999a22e775c4907aadfcc53a[0]}, {0x68u, WRITE, 0x01u, 0x00000082u, 0x01u, 0x0001u, &gaConfig_1943e8929a4f2092ed2ac0529c403ac9[0]}, {0x68u, WRITE, 0x01u, 0x00000083u, 0x01u, 0x0001u, &gaConfig_a1e695cc98b611144147755f9cc34216[0]}, {0x68u, WRITE, 0x01u, 0x00000084u, 0x01u, 0x0001u, &gaConfig_4718331eb90537ca94745f83b3c3ee36[0]}, {0x68u, WRITE, 0x01u, 0x00000085u, 0x01u, 0x0001u, &gaConfig_d25690c9a5bd0d73b3dbf0171d6401e7[0]}, {0x68u, WRITE, 0x01u, 0x00000086u, 0x01u, 0x0001u, &gaConfig_244f412aafb3bed1af4fa153b10ce452[0]}, {0x68u, WRITE, 0x01u, 0x00000087u, 0x01u, 0x0001u, &gaConfig_59299dbb42ad242666b752b781954650[0]}, {0x68u, WRITE, 0x01u, 0x00000088u, 0x01u, 0x0001u, &gaConfig_501ec4d0d8d4ae8d6f1d750aa80e8cf6[0]}, {0x68u, WRITE, 0x01u, 0x0000008Au, 0x01u, 0x0001u, &gaConfig_083d920a57818949f8191b991950bbf4[0]}, {0x68u, WRITE, 0x01u, 0x00000080u, 0x01u, 0x0001u, &gaConfig_63d66c53ee1cd14cc795eb6f5c13d922[0]}, {0x68u, WRITE, 0x01u, 0x00000057u, 0x01u, 0x0001u, &gaConfig_bd744b5f15b3bef7588e19a2286a07e7[0]}, {0x68u, WRITE, 0x01u, 0x0000001Eu, 0x01u, 0x0001u, &gaConfig_976e7d14a2c694e4da741bf6f56d96df[0]}, {0x68u, WRITE, 0x01u, 0x0000000Du, 0x01u, 0x0001u, &gaConfig_8d413e20f5e872b851148ade0a00bd5e[0]}, {0x68u, WRITE, 0x01u, 0x0000000Eu, 0x01u, 0x0001u, &gaConfig_c92efebece4482defc46928791f9ce2b[0]}, {0x68u, WRITE, 0x01u, 0x00000009u, 0x01u, 0x0001u, &gaConfig_16df8f451f33f3fdee2f55d435100525[0]}, {0x68u, WRITE, 0x01u, 0x00000001u, 0x01u, 0x0001u, &gaConfig_b35674da7e72d87fd236f705b621c636[0]}, {0x68u, WRITE, 0x01u, 0x00000010u, 0x01u, 0x0001u, &gaConfig_fe08b3609f4bc30a60523564e4a2d770[0]}, {0x68u, WRITE, 0x01u, 0x00000011u, 0x01u, 0x0001u, &gaConfig_a1d0d762605e8ae1c5c82ba90e43763e[0]}, {0x68u, WRITE, 0x01u, 0x00000056u, 0x01u, 0x0001u, &gaConfig_585253630897cbd37764afc16b5fb8d8[0]}, {0x68u, WRITE, 0x01u, 0x00000012u, 0x01u, 0x0001u, &gaConfig_317a686e4cafd5a363a88a5a84decee3[0]}, }; #endif
1.109375
1
kernel/print.c
ddjohn/mordana
0
7996563
#include "print.h" #include "string.h" void printCharAt(char chr, unsigned int color, unsigned int x, unsigned int y) { unsigned char* videomem_start = (unsigned char*)0xb8000; unsigned int offset = 160 * y + 2 * x; videomem_start[offset] = (unsigned char)chr; videomem_start[offset + 1] = color; } void printChar(char chr) { if(chr == '\n') { cursor.y++; cursor.x = 0; } else { printCharAt(chr, 0x09, cursor.x++, cursor.y); } } void printString(const char* message) { unsigned char* videomem = (unsigned char*)0xb8000; if(cursor.y >= 24) { memmove(videomem, videomem + 160, 160 * 24); } for(unsigned int i = 0; i < strlen((char*)message); i++) { printChar(message[i]); } } void printHex(unsigned int hex) { static int iters = 0; char hex_str[] = "0x00000000"; for (int i = 9; i >= 2; --i) { unsigned char nibble = hex & 0xF; char hex_chr = '0' + nibble; if (nibble > 9) { hex_chr += 7; } hex_str[i] = hex_chr; hex /= 16; } printString(hex_str); iters++; }
1.671875
2
smash/example3.c
phaser/smashing_the_stack
1
7996571
#include <sys/mman.h> /** Binary for what nasm -f elf64 shellcode_nz.nasm spits * Notice the lack of \x00. This can be placed in buffer used by * string handling functions and it should work ok. */ char code[] = "\xeb\x27\x5e\x48\xc7\xc0\xff\xff\xff\xff\x48\x83\xe8\xc4\x48\x89\xf7\x48\x31\xf6\x48\x31\xd2\x0f\x05\x48\x31\xff\x48\xc7\xc0\xff\xff\xff\xff\x48\x83\xe8\xc3\x0f\x05\xe8\xd4\xff\xff\xff\x2f\x62\x69\x6e\x2f\x73\x68\x00"; int main() { // mprotect is needed to make the zone in which code resides executable mprotect((void *)((uint64_t)code & ~4095), 4096, PROT_READ | PROT_EXEC); (*(void (*)())code)(); return 0; }
0.941406
1
production/libs/potrace/potrace-1.11/src/bitops.h
Lewerow/DetailIdentifier
2
7996579
This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ /* bits.h: this file defines some macros for bit manipulations. We provide a generic implementation, as well as machine- and compiler-specific fast implementations */ /* lobit: return the position of the rightmost "1" bit of an int, or 32 if none. hibit: return 1 + the position of the leftmost "1" bit of an int, or 0 if none. Note: these functions work on 32-bit integers. */ #ifndef BITOPS_H #define BITOPS_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* ---------------------------------------------------------------------- */ /* machine specific macros */ #if defined(HAVE_I386) static inline unsigned int lobit(unsigned int x) { unsigned int res; asm ("bsf %1,%0\n\t" "jnz 0f\n\t" "movl $32,%0\n" "0:" : "=r" (res) : "r" (x) : "cc"); return res; } static inline unsigned int hibit(unsigned int x) { unsigned int res; asm ("bsr %1,%0\n\t" "jnz 0f\n\t" "movl $-1,%0\n" "0:" : "=r" (res) : "r" (x) : "cc"); return res+1; } /* ---------------------------------------------------------------------- */ #else /* generic macros */ static inline unsigned int lobit(unsigned int x) { unsigned int res = 32; while (x & 0xffffff) { x <<= 8; res -= 8; } while (x) { x <<= 1; res -= 1; } return res; } static inline unsigned int hibit(unsigned int x) { unsigned int res = 0; while (x > 0xff) { x >>= 8; res += 8; } while (x) { x >>= 1; res += 1; } return res; } #endif #endif /* BITOPS_H */
1.742188
2
src/extmem/memrchr_s.c
hauke/safeclib
0
7996587
/*------------------------------------------------------------------ * memrchr_s.c * * September 2017, <NAME> * * Copyright (c) 2017 by <NAME> * 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, 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. *------------------------------------------------------------------ */ #ifdef FOR_DOXYGEN #include "safe_mem_lib.h" #else #include "safeclib_private.h" #endif #ifdef HAVE_MEMRCHR #ifndef _ISOC11_SOURCE extern void *memrchr(const void *, int, size_t); #endif #endif /** * @def memrchr_s(dest,dmax,ch,result) * @brief * Finds the last occurrence of ch (after conversion to char as if by * (char)ch) in the null-terminated byte string pointed to by dest (each * character interpreted as unsigned char). The terminating null character * is considered to be a part of the string and can be found when searching * for '\0'. * * @remark IMPLEMENTED IN * * @param[in] dest pointer to string buffer to compare against * @param[in] dmax restricted maximum length of dest * @param[in] ch character to search for * @param[out] result pointer to char* in dest * * @pre Neither dest nor result shall be a null pointer. * @pre dmax shall not be 0. * @pre dmax shall not be greater than RSIZE_MAX_MEM and size of dest * @pre ch shall not be greater than 255 * * @retval EOK when successfully character found. * @retval ESNULLP when dest/result is a NULL pointer * @retval ESZEROL when dmax = 0 * @retval ESLEMAX when dmax > RSIZE_MAX_MEM * @retval EOVERFLOW when dmax > size of dest (optionally, when the compiler * knows the object_size statically) * @retval ESLEWRNG when dmax != size of dest and --enable-error-dmax * @retval ESLEMAX when ch > 255 * @retval ESNOTFND when ch not found in dest * * @see * memrchr_s(), strchr_s(), memchr_s(), strspn_s(), strstr_s() * */ EXPORT errno_t _memrchr_s_chk(const void *restrict dest, rsize_t dmax, const int ch, void **result, const size_t destbos) { if (unlikely(result == NULL)) { invoke_safe_str_constraint_handler("memrchr_s: result is null", NULL, ESNULLP); return (ESNULLP); } *result = NULL; CHK_DEST_MEM_NULL("memrchr_s") CHK_DMAX_MEM_ZERO("memrchr_s") if (destbos == BOS_UNKNOWN) { CHK_DMAX_MEM_MAX("memrchr_s", RSIZE_MAX_MEM) BND_CHK_PTR_BOUNDS(dest, dmax); } else { CHK_DEST_MEM_OVR("memrchr_s", destbos) } if (unlikely(ch > 255)) { invoke_safe_str_constraint_handler("memrchr_s: ch exceeds max", NULL, ESLEMAX); return (ESLEMAX); } #ifdef HAVE_MEMRCHR /* compares wordwise */ *result = (void *)memrchr((const void *)dest, ch, (size_t)dmax); if (!*result) return (ESNOTFND); return (EOK); #else { const uint8_t *s = (uint8_t *)dest; uint8_t u8 = (uint8_t)ch; while (dmax--) { if (s[dmax] == u8) { *result = (void *)&s[dmax]; return (EOK); } } } return (ESNOTFND); #endif }
1.125
1
src/ios/Airship/Common/UAActionJSDelegate.h
meetings/phonegap-ua-push
0
7996595
#import <Foundation/Foundation.h> #import "UAJavaScriptDelegate.h" /** * Library-internal implementation of UAJavaScriptDelegate. * * This class exclusively handles UAJavaScriptDelegate calls with the * run-action-cb, run-actions and run-basic-actions commands. */ @interface UAActionJSDelegate : NSObject<UAJavaScriptDelegate> @end
0.53125
1
include/text_metrics.h
knocknote/libhtml5
7
7996603
#pragma once #include "html5.h" NAMESPACE_HTML5_BEGIN; class TextMetrics : public Object { public: HTML5_PROPERTY(TextMetrics, double, actualBoundingBoxAscent); HTML5_PROPERTY(TextMetrics, double, actualBoundingBoxDescent); HTML5_PROPERTY(TextMetrics, double, actualBoundingBoxLeft); HTML5_PROPERTY(TextMetrics, double, actualBoundingBoxRight); HTML5_PROPERTY(TextMetrics, double, alphabeticBaseline); HTML5_PROPERTY(TextMetrics, double, emHeightAscent); HTML5_PROPERTY(TextMetrics, double, emHeightDescent); HTML5_PROPERTY(TextMetrics, double, fontBoundingBoxAscent); HTML5_PROPERTY(TextMetrics, double, fontBoundingBoxDescent); HTML5_PROPERTY(TextMetrics, double, hangingBaseline); HTML5_PROPERTY(TextMetrics, double, ideographicBaseline); HTML5_PROPERTY(TextMetrics, double, width); TextMetrics(emscripten::val v); virtual ~TextMetrics(); static TextMetrics *create(emscripten::val v); }; NAMESPACE_HTML5_END;
0.640625
1
bst.h
sosoxu/datastructure
0
7996611
#ifndef BST_H #define BST_H typedef int Type; typedef struct BSTreeNode{ Type key; BSTreeNode* left; BSTreeNode* right; BSTreeNode* parent; } Node, *BSTree; Node* create_bstree_node(Type key, Node* parent, Node* left, Node* right) { Node* p = (Node*)malloc(sizeof(Node)); if (!p) return NULL; p->key = key; p->parent = parent; p->left = left; p->right = right; return p; } //前序遍历 void preorder_bstree(BSTree tree) { if (tree) { printf("%d", tree->key); preorder_bstree(tree->left); preorder_bstree(tree->right); } } void inorder_bstree(BSTree tree) { if (tree) { inorder_bstree(tree->left); printf("%d", tree->key); inorder_bstree(tree->right); } } void postorder_bstree(BSTree tree) { if (tree) { postorder_bstree(tree->left); postorder_bstree(tree->right); printf("%d", tree->key); } } Node* bstree_search(BSTree tree, Type key) { if (!tree || key == tree->key) return tree; if (key < tree->left) return bstree_search(tree->left, key); else return bstree_search(tree->right, key); } Node* iterative_bstree_search(BSTree tree, Type key) { while (tree && tree->key != key) { if (key < tree->key) tree = tree->left; else tree = tree->right; } return tree; } Node* bstree_maximnum(BSTree tree) { if (!tree) return tree; while (tree->right) tree = tree->right; return tree; } Node* bstree_minimun(BSTree tree) { if (!tree) return tree; while (tree->left) tree = tree->left; return tree; } Node* bstree_insert(BSTree tree, Node *z) { Node* x = tree; Node* y = NULL; while(!x) { y = x; if (z->key < x->key) x = x->left; else x = x->right; } z->parent = y; if (!y) tree = z; else if (z->key < y->key) y->left = z; else y->right = z; return tree; } Node* insert_bstree(BSTree tree, Type key) { Node* z = NULL; if (z = create_bstree_node(key, NULL, NULL, NULL)) return bstree_insert(tree, z); return tree; } #endif // BST_H
2.34375
2
libsel4vm/src/arch/arm/guest_arm_context.c
zsipos/seL4_projects_libs
0
7996619
/* * Copyright 2019, Data61 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) * ABN 41 687 119 230. * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(DATA61_BSD) */ #include <sel4/sel4.h> #include <sel4vm/guest_vm.h> #include <sel4vm/guest_vm_util.h> #include <sel4vm/arch/guest_arm_context.h> #include "fault.h" int vm_set_thread_context(vm_vcpu_t *vcpu, seL4_UserContext context) { if (!fault_handled(vcpu->vcpu_arch.fault)) { /* If we are in a fault set its context directly as this will be * later synced */ fault_set_ctx(vcpu->vcpu_arch.fault, &context); } else { /* Otherwise write to the TCB directly */ seL4_CPtr tcb = vm_get_vcpu_tcb(vcpu); int err = seL4_TCB_WriteRegisters(tcb, false, 0, sizeof(context) / sizeof(context.pc), &context); if (err) { ZF_LOGE("Failed to set thread context: Unable to write TCB registers"); return -1; } } return 0; } int vm_set_thread_context_reg(vm_vcpu_t *vcpu, unsigned int reg, uintptr_t value) { seL4_CPtr tcb = vm_get_vcpu_tcb(vcpu); if (!fault_handled(vcpu->vcpu_arch.fault)) { /* If we are in a fault use and modify its cached context */ seL4_UserContext *regs; regs = fault_get_ctx(vcpu->vcpu_arch.fault); (&regs->pc)[reg] = value; } else { /* Otherwise write to the TCB directly */ seL4_UserContext regs; int err = seL4_TCB_ReadRegisters(tcb, false, 0, sizeof(regs) / sizeof(regs.pc), &regs); if (err) { ZF_LOGE("Failed to set thread context reg: Unable to read TCB registers"); return -1; } (&regs.pc)[reg] = value; err = seL4_TCB_WriteRegisters(tcb, false, 0, sizeof(regs) / sizeof(regs.pc), &regs); if (err) { ZF_LOGE("Failed to set thread context register: Unable to write new register to TCB"); return -1; } } return 0; } int vm_get_thread_context(vm_vcpu_t *vcpu, seL4_UserContext *context) { if (!fault_handled(vcpu->vcpu_arch.fault)) { /* If we are in a fault use its cached context */ seL4_UserContext *regs; regs = fault_get_ctx(vcpu->vcpu_arch.fault); *context = *regs; } else { /* Otherwise read the TCB directly */ seL4_UserContext regs; seL4_CPtr tcb = vm_get_vcpu_tcb(vcpu); int err = seL4_TCB_ReadRegisters(tcb, false, 0, sizeof(regs) / sizeof(regs.pc), &regs); if (err) { ZF_LOGE("Failed to get thread context: Unable to read TCB registers"); return -1; } *context = regs; } return 0; } int vm_get_thread_context_reg(vm_vcpu_t *vcpu, unsigned int reg, uintptr_t *value) { if (!fault_handled(vcpu->vcpu_arch.fault)) { /* If we are in a fault use its cached context */ seL4_UserContext *regs; regs = fault_get_ctx(vcpu->vcpu_arch.fault); *value = (&regs->pc)[reg]; } else { /* Otherwise read it from the TCB directly */ seL4_UserContext regs; seL4_CPtr tcb = vm_get_vcpu_tcb(vcpu); int err = seL4_TCB_ReadRegisters(tcb, false, 0, sizeof(regs) / sizeof(regs.pc), &regs); if (err) { ZF_LOGE("Failed to get thread context register: Unable to read TCB registers"); return -1; } *value = (&regs.pc)[reg]; } return 0; } int vm_set_arm_vcpu_reg(vm_vcpu_t *vcpu, seL4_Word reg, uintptr_t value) { int err = seL4_ARM_VCPU_WriteRegs(vcpu->vcpu.cptr, reg, value); if (err) { ZF_LOGE("Failed to set VCPU register: Write registers failed"); return -1; } return 0; } int vm_get_arm_vcpu_reg(vm_vcpu_t *vcpu, seL4_Word reg, uintptr_t *value) { seL4_ARM_VCPU_ReadRegs_t res = seL4_ARM_VCPU_ReadRegs(vcpu->vcpu.cptr, reg); if (res.error) { ZF_LOGF("Read registers failed"); return -1; } *value = res.value; return 0; }
1.546875
2
src/game/server/NextBot/Path/NextBotRetreatPath.h
LavKazan/ThePassTimeProject
4
7996627
// NextBotRetreatPath.h // Maintain and follow a path that leads safely away from the given Actor // Author: <NAME>, February 2007 //========= Copyright Valve Corporation, All rights reserved. ============// #ifndef _NEXT_BOT_RETREAT_PATH_ #define _NEXT_BOT_RETREAT_PATH_ #include "nav.h" #include "NextBotInterface.h" #include "NextBotLocomotionInterface.h" #include "NextBotRetreatPath.h" #include "NextBotUtil.h" #include "NextBotPathFollow.h" #include "tier0/vprof.h" //---------------------------------------------------------------------------------------------- /** * A RetreatPath extends a PathFollower to periodically recompute a path * away from a threat, and to move along the path away from that threat. */ class RetreatPath : public PathFollower { public: RetreatPath( void ); virtual ~RetreatPath() { } void Update( INextBot *bot, CBaseEntity *threat ); // update path away from threat and move bot along path virtual float GetMaxPathLength( void ) const; // return maximum path length virtual void Invalidate( void ); // (EXTEND) cause the path to become invalid private: void RefreshPath( INextBot *bot, CBaseEntity *threat ); CountdownTimer m_throttleTimer; // require a minimum time between re-paths EHANDLE m_pathThreat; // the threat of our existing path Vector m_pathThreatPos; // where the threat was when the path was built }; inline RetreatPath::RetreatPath( void ) { m_throttleTimer.Invalidate(); m_pathThreat = NULL; } inline float RetreatPath::GetMaxPathLength( void ) const { return 1000.0f; } inline void RetreatPath::Invalidate( void ) { // path is gone, repath at earliest opportunity m_throttleTimer.Invalidate(); m_pathThreat = NULL; // extend PathFollower::Invalidate(); } //---------------------------------------------------------------------------------------------- /** * Maintain a path to our chase threat and move along that path */ inline void RetreatPath::Update( INextBot *bot, CBaseEntity *threat ) { VPROF_BUDGET( "RetreatPath::Update", "NextBot" ); if ( threat == NULL ) { return; } // if our path threat changed, repath immediately if ( threat != m_pathThreat ) { if ( bot->IsDebugging( INextBot::PATH ) ) { DevMsg( "%3.2f: bot(#%d) Chase path threat changed (from %X to %X).\n", gpGlobals->curtime, bot->GetEntity()->entindex(), m_pathThreat.Get(), threat ); } Invalidate(); } // maintain the path away from the threat RefreshPath( bot, threat ); // move along the path towards the threat PathFollower::Update( bot ); } //-------------------------------------------------------------------------------------------------------------- /** * Build a path away from retreatFromArea up to retreatRange in length. */ class RetreatPathBuilder { public: RetreatPathBuilder( INextBot *me, CBaseEntity *threat, float retreatRange = 500.0f ) { m_me = me; m_mover = me->GetLocomotionInterface(); m_threat = threat; m_retreatRange = retreatRange; } CNavArea *ComputePath( void ) { VPROF_BUDGET( "NavAreaBuildRetreatPath", "NextBot" ); if ( m_mover == NULL ) return NULL; CNavArea *startArea = m_me->GetEntity()->GetLastKnownArea(); if ( startArea == NULL ) return NULL; CNavArea *retreatFromArea = TheNavMesh->GetNearestNavArea( m_threat->GetAbsOrigin() ); if ( retreatFromArea == NULL ) return NULL; startArea->SetParent( NULL ); // start search CNavArea::ClearSearchLists(); float initCost = Cost( startArea, NULL, NULL ); if ( initCost < 0.0f ) return NULL; int teamID = m_me->GetEntity()->GetTeamNumber(); startArea->SetTotalCost( initCost ); startArea->AddToOpenList(); // keep track of the area farthest away from the threat CNavArea *farthestArea = NULL; float farthestRange = 0.0f; // // Dijkstra's algorithm (since we don't know our goal). // Build a path as far away from the retreat area as possible. // Minimize total path length and danger. // Maximize distance to threat of end of path. // while( !CNavArea::IsOpenListEmpty() ) { // get next area to check CNavArea *area = CNavArea::PopOpenList(); area->AddToClosedList(); // don't consider blocked areas if ( area->IsBlocked( teamID ) ) continue; // build adjacent area array CollectAdjacentAreas( area ); // search adjacent areas for( int i=0; i<m_adjAreaIndex; ++i ) { CNavArea *newArea = m_adjAreaVector[ i ].area; // only visit each area once if ( newArea->IsClosed() ) continue; // don't consider blocked areas if ( newArea->IsBlocked( teamID ) ) continue; // don't use this area if it is out of range if ( ( newArea->GetCenter() - m_me->GetEntity()->GetAbsOrigin() ).IsLengthGreaterThan( m_retreatRange ) ) continue; // determine cost of traversing this area float newCost = Cost( newArea, area, m_adjAreaVector[ i ].ladder ); // don't use adjacent area if cost functor says it is a dead-end if ( newCost < 0.0f ) continue; if ( newArea->IsOpen() && newArea->GetTotalCost() <= newCost ) { // we have already visited this area, and it has a better path continue; } else { // whether this area has been visited or not, we now have a better path newArea->SetParent( area, m_adjAreaVector[ i ].how ); newArea->SetTotalCost( newCost ); // use 'cost so far' to hold cumulative cost newArea->SetCostSoFar( newCost ); // tricky bit here - relying on OpenList being sorted by cost if ( newArea->IsOpen() ) { // area already on open list, update the list order to keep costs sorted newArea->UpdateOnOpenList(); } else { newArea->AddToOpenList(); } // keep track of area farthest from threat float threatRange = ( newArea->GetCenter() - m_threat->GetAbsOrigin() ).Length(); if ( threatRange > farthestRange ) { farthestArea = newArea; farthestRange = threatRange; } } } } return farthestArea; } /** * Build a vector of adjacent areas reachable from the given area */ void CollectAdjacentAreas( CNavArea *area ) { m_adjAreaIndex = 0; const NavConnectVector &adjNorth = *area->GetAdjacentAreas( NORTH ); FOR_EACH_VEC( adjNorth, it ) { if ( m_adjAreaIndex >= MAX_ADJ_AREAS ) break; m_adjAreaVector[ m_adjAreaIndex ].area = adjNorth[ it ].area; m_adjAreaVector[ m_adjAreaIndex ].how = GO_NORTH; m_adjAreaVector[ m_adjAreaIndex ].ladder = NULL; ++m_adjAreaIndex; } const NavConnectVector &adjSouth = *area->GetAdjacentAreas( SOUTH ); FOR_EACH_VEC( adjSouth, it ) { if ( m_adjAreaIndex >= MAX_ADJ_AREAS ) break; m_adjAreaVector[ m_adjAreaIndex ].area = adjSouth[ it ].area; m_adjAreaVector[ m_adjAreaIndex ].how = GO_SOUTH; m_adjAreaVector[ m_adjAreaIndex ].ladder = NULL; ++m_adjAreaIndex; } const NavConnectVector &adjWest = *area->GetAdjacentAreas( WEST ); FOR_EACH_VEC( adjWest, it ) { if ( m_adjAreaIndex >= MAX_ADJ_AREAS ) break; m_adjAreaVector[ m_adjAreaIndex ].area = adjWest[ it ].area; m_adjAreaVector[ m_adjAreaIndex ].how = GO_WEST; m_adjAreaVector[ m_adjAreaIndex ].ladder = NULL; ++m_adjAreaIndex; } const NavConnectVector &adjEast = *area->GetAdjacentAreas( EAST ); FOR_EACH_VEC( adjEast, it ) { if ( m_adjAreaIndex >= MAX_ADJ_AREAS ) break; m_adjAreaVector[ m_adjAreaIndex ].area = adjEast[ it ].area; m_adjAreaVector[ m_adjAreaIndex ].how = GO_EAST; m_adjAreaVector[ m_adjAreaIndex ].ladder = NULL; ++m_adjAreaIndex; } const NavLadderConnectVector &adjUpLadder = *area->GetLadders( CNavLadder::LADDER_UP ); FOR_EACH_VEC( adjUpLadder, it ) { CNavLadder *ladder = adjUpLadder[ it ].ladder; if ( ladder->m_topForwardArea && m_adjAreaIndex < MAX_ADJ_AREAS ) { m_adjAreaVector[ m_adjAreaIndex ].area = ladder->m_topForwardArea; m_adjAreaVector[ m_adjAreaIndex ].how = GO_LADDER_UP; m_adjAreaVector[ m_adjAreaIndex ].ladder = ladder; ++m_adjAreaIndex; } if ( ladder->m_topLeftArea && m_adjAreaIndex < MAX_ADJ_AREAS ) { m_adjAreaVector[ m_adjAreaIndex ].area = ladder->m_topLeftArea; m_adjAreaVector[ m_adjAreaIndex ].how = GO_LADDER_UP; m_adjAreaVector[ m_adjAreaIndex ].ladder = ladder; ++m_adjAreaIndex; } if ( ladder->m_topRightArea && m_adjAreaIndex < MAX_ADJ_AREAS ) { m_adjAreaVector[ m_adjAreaIndex ].area = ladder->m_topRightArea; m_adjAreaVector[ m_adjAreaIndex ].how = GO_LADDER_UP; m_adjAreaVector[ m_adjAreaIndex ].ladder = ladder; ++m_adjAreaIndex; } } const NavLadderConnectVector &adjDownLadder = *area->GetLadders( CNavLadder::LADDER_DOWN ); FOR_EACH_VEC( adjDownLadder, it ) { CNavLadder *ladder = adjDownLadder[ it ].ladder; if ( m_adjAreaIndex >= MAX_ADJ_AREAS ) break; if ( ladder->m_bottomArea ) { m_adjAreaVector[ m_adjAreaIndex ].area = ladder->m_bottomArea; m_adjAreaVector[ m_adjAreaIndex ].how = GO_LADDER_DOWN; m_adjAreaVector[ m_adjAreaIndex ].ladder = ladder; ++m_adjAreaIndex; } } } /** * Cost minimizes path length traveled thus far and "danger" (proximity to threat(s)) */ float Cost( CNavArea *area, CNavArea *fromArea, const CNavLadder *ladder ) { // check if we can use this area if ( !m_mover->IsAreaTraversable( area ) ) { return -1.0f; } int teamID = m_me->GetEntity()->GetTeamNumber(); if ( area->IsBlocked( teamID ) ) { return -1.0f; } const float debugDeltaT = 3.0f; float cost; const float maxThreatRange = 500.0f; const float dangerDensity = 1000.0f; if ( fromArea == NULL ) { cost = 0.0f; if ( area->Contains( m_threat->GetAbsOrigin() ) ) { // maximum danger - threat is in the area with us cost += 10.0f * dangerDensity; if ( m_me->IsDebugging( INextBot::PATH ) ) { area->DrawFilled( 255, 0, 0, 128 ); } } else { // danger proportional to range to us float rangeToThreat = ( m_threat->GetAbsOrigin() - m_me->GetEntity()->GetAbsOrigin() ).Length(); if ( rangeToThreat < maxThreatRange ) { cost += dangerDensity * ( 1.0f - ( rangeToThreat / maxThreatRange ) ); if ( m_me->IsDebugging( INextBot::PATH ) ) { NDebugOverlay::Line( m_me->GetEntity()->GetAbsOrigin(), m_threat->GetAbsOrigin(), 255, 0, 0, true, debugDeltaT ); } } } } else { // compute distance traveled along path so far float dist; if ( ladder ) { const float ladderCostFactor = 100.0f; dist = ladderCostFactor * ladder->m_length; } else { Vector to = area->GetCenter() - fromArea->GetCenter(); dist = to.Length(); // check for vertical discontinuities Vector closeFrom, closeTo; area->GetClosestPointOnArea( fromArea->GetCenter(), &closeTo ); fromArea->GetClosestPointOnArea( area->GetCenter(), &closeFrom ); float deltaZ = closeTo.z - closeFrom.z; if ( deltaZ > m_mover->GetMaxJumpHeight() ) { // too high to jump return -1.0f; } else if ( -deltaZ > m_mover->GetDeathDropHeight() ) { // too far down to drop return -1.0f; } // prefer to maintain our level const float climbCost = 10.0f; dist += climbCost * fabs( deltaZ ); } cost = dist + fromArea->GetTotalCost(); // Add in danger cost due to threat // Assume straight line between areas and find closest point // to the threat along that line segment. The distance between // the threat and closest point on the line is the danger cost. // path danger is CUMULATIVE float dangerCost = fromArea->GetCostSoFar(); Vector close; float t; CalcClosestPointOnLineSegment( m_threat->GetAbsOrigin(), area->GetCenter(), fromArea->GetCenter(), close, &t ); if ( t < 0.0f ) { close = area->GetCenter(); } else if ( t > 1.0f ) { close = fromArea->GetCenter(); } float rangeToThreat = ( m_threat->GetAbsOrigin() - close ).Length(); if ( rangeToThreat < maxThreatRange ) { float dangerFactor = 1.0f - ( rangeToThreat / maxThreatRange ); dangerCost = dangerDensity * dangerFactor; if ( m_me->IsDebugging( INextBot::PATH ) ) { NDebugOverlay::HorzArrow( fromArea->GetCenter(), area->GetCenter(), 5, 255 * dangerFactor, 0, 0, 255, true, debugDeltaT ); Vector to = close - m_threat->GetAbsOrigin(); to.NormalizeInPlace(); NDebugOverlay::Line( close, close - 50.0f * to, 255, 0, 0, true, debugDeltaT ); } } cost += dangerCost; } return cost; } private: INextBot *m_me; ILocomotion *m_mover; CBaseEntity *m_threat; float m_retreatRange; enum { MAX_ADJ_AREAS = 64 }; struct AdjInfo { CNavArea *area; CNavLadder *ladder; NavTraverseType how; }; AdjInfo m_adjAreaVector[ MAX_ADJ_AREAS ]; int m_adjAreaIndex; }; //---------------------------------------------------------------------------------------------- /** * Periodically rebuild the path away from our threat */ inline void RetreatPath::RefreshPath( INextBot *bot, CBaseEntity *threat ) { VPROF_BUDGET( "RetreatPath::RefreshPath", "NextBot" ); if ( threat == NULL ) { if ( bot->IsDebugging( INextBot::PATH ) ) { DevMsg( "%3.2f: bot(#%d) CasePath::RefreshPath failed. No threat.\n", gpGlobals->curtime, bot->GetEntity()->entindex() ); } return; } // don't change our path if we're on a ladder ILocomotion *mover = bot->GetLocomotionInterface(); if ( IsValid() && mover && mover->IsUsingLadder() ) { if ( bot->IsDebugging( INextBot::PATH ) ) { DevMsg( "%3.2f: bot(#%d) RetreatPath::RefreshPath failed. Bot is on a ladder.\n", gpGlobals->curtime, bot->GetEntity()->entindex() ); } return; } // the closer we get, the more accurate our path needs to be Vector to = threat->GetAbsOrigin() - bot->GetPosition(); const float minTolerance = 0.0f; const float toleranceRate = 0.33f; float tolerance = minTolerance + toleranceRate * to.Length(); if ( !IsValid() || ( threat->GetAbsOrigin() - m_pathThreatPos ).IsLengthGreaterThan( tolerance ) ) { if ( !m_throttleTimer.IsElapsed() ) { // require a minimum time between repaths, as long as we have a path to follow if ( bot->IsDebugging( INextBot::PATH ) ) { DevMsg( "%3.2f: bot(#%d) RetreatPath::RefreshPath failed. Rate throttled.\n", gpGlobals->curtime, bot->GetEntity()->entindex() ); } return; } // remember our path threat m_pathThreat = threat; m_pathThreatPos = threat->GetAbsOrigin(); RetreatPathBuilder retreat( bot, threat, GetMaxPathLength() ); CNavArea *goalArea = retreat.ComputePath(); if ( goalArea ) { AssemblePrecomputedPath( bot, goalArea->GetCenter(), goalArea ); } else { // all adjacent areas are too far away - just move directly away from threat Vector to = threat->GetAbsOrigin() - bot->GetPosition(); BuildTrivialPath( bot, bot->GetPosition() - to ); } const float minRepathInterval = 0.5f; m_throttleTimer.Start( minRepathInterval ); } } #endif // _NEXT_BOT_RETREAT_PATH_
1.664063
2
PrivateFrameworks/CoreThemeDefinition.framework/TDMicaRenditionSpec.h
shaojiankui/iOS10-Runtime-Headers
36
7996635
/* Generated by RuntimeBrowser Image: /System/Library/PrivateFrameworks/CoreThemeDefinition.framework/CoreThemeDefinition */ @interface TDMicaRenditionSpec : TDRenditionSpec @property (nonatomic, copy) NSString *layerPath; - (void)_logError:(id)arg1; - (void)_logExtra:(id)arg1; - (void)_logWarning:(id)arg1; - (void)copyAttributesInto:(id)arg1; - (id)copyDataFromAttributes; - (id)createCSIRepresentationWithCompression:(bool)arg1 colorSpaceID:(unsigned long long)arg2 document:(id)arg3; - (id)debugDescription; - (void)setAttributesFromCopyData:(id)arg1; @end
0.554688
1
src/wrapped/wrappedpng12_private.h
Icenowy/box86
1
7996643
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) #error meh! #endif GO(png_create_write_struct, pFpppp) GO(png_destroy_write_struct, vFpp) GO(png_write_row, vFpp) GO(png_set_compression_level, vFpi) GO(png_set_tIME, vFppp) GO(png_set_IHDR, vFppuuiiiii) GO(png_write_end, vFpp) GO(png_write_chunk, vFpppu) GO(png_convert_from_time_t, vFpu) GO(png_create_info_struct, pFp) GO(png_init_io, vFpp) GO(png_set_PLTE, vFpppi) GO(png_write_info, vFpp) GO(png_destroy_read_struct, vFppp) GO(png_get_IHDR, vFppppppppp) GO(png_free, vFpp) GO(png_malloc, pFpp) GO(png_read_end, vFpp) GO(png_read_image, vFpp) GO(png_create_read_struct, pFpppp) GO(png_read_info, vFpp) GO(png_get_rowbytes, uFpp) GO(png_set_rows, vFppp) GO(png_write_png, vFppip) GO(png_get_io_ptr, pFp) GOM(png_set_write_fn, vFEpppp) GO(png_set_packing, vFp) GO(png_set_gray_to_rgb, vFp) GO(png_set_palette_to_rgb, vFp) GO(png_set_expand_gray_1_2_4_to_8, vFp) GO(png_set_add_alpha, vFpui) GO(png_set_tRNS_to_alpha, vFp) GO(png_set_strip_16, vFp) GO(png_get_valid, uFppu) GO(png_get_sRGB, uFppp) GO(png_set_interlace_handling, iFp) GO(png_error, vFpp) GO(png_set_gamma, vFpdd) GO(png_sig_cmp, iFpuu) GO(png_get_tRNS, uFppppp) GO(png_get_gAMA, uFppp) GO(png_read_update_info, vFpp) GO(png_set_expand, vFp) GO(png_read_row, vFppp) GO(png_set_sig_bytes, vFpi) GO(png_get_PLTE, uFpppp) GO(png_get_error_ptr, pFp) GOM(png_set_error_fn, vFEpppp) GOM(png_set_read_fn, vFEppp) GO(png_set_bgr, vFp) GO(png_get_channels, CFpp) GO(png_set_iCCP, vFpppipu) GO(png_set_sRGB, vFppi) GO(png_set_compression_mem_level, vFpi) GO(png_set_text, vFpppi) GO(png_get_cHRM, uFpppppppppp) GO(png_set_compression_strategy, vFpi) GO(png_set_gAMA, vFppd) GOM(png_create_read_struct_2, pFEppppppp) GO(png_get_header_ver, pFp) GO(png_get_pHYs, uFppppp) GO(png_set_pHYs, vFppuui) GO(png_set_compression_buffer_size, vFpu) GOM(png_create_write_struct_2, pFEppppppp) GO(png_set_filter, vFpii) GO(png_set_cHRM, vFppdddddddd) GO(png_get_iCCP, uFpppppp) GO(png_permit_mng_features, uFpu) GO(png_set_keep_unknown_chunks, vFpipi) GO(png_set_oFFs, vFppiii) GO(png_get_libpng_ver, pFp) GO(png_get_text, uFpppp) GO(png_set_sBIT, vFppp) GO(png_set_tRNS, vFpppip) GO(png_warning, vFpp) GO(png_set_bKGD, vFppp) GO(png_get_x_offset_pixels, iFpp) GO(png_get_y_offset_pixels, iFpp) GO(png_write_image, vFpp) GO(png_get_color_type, CFpp) GO(png_check_sig, iFpi) GO(png_set_gray_1_2_4_to_8, vFp) GO(png_set_swap, vFp) GO(png_process_data, vFpppL) GO(png_get_image_height, uFpp) GO(png_get_image_width, uFpp) GO(png_progressive_combine_row, vFppp) GO(png_get_progressive_ptr, pFp) GO(png_get_interlace_type, CFpp) GOM(png_set_progressive_read_fn, vFEppppp) GO(png_get_bit_depth, CFpp) GO(png_set_bgr, vFp)
0.652344
1
resources/usr/lib/root/etc/dictpch/hist/histpainter/inc/LinkDef.h
edawson/parliament2
0
7996651
/* @(#)root/histpainter:$Id$ */ /************************************************************************* * Copyright (C) 1995-2000, <NAME> and <NAME>. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class TPainter3dAlgorithms; #pragma link C++ class TGraph2DPainter; #pragma link C++ class TGraphPainter; #pragma link C++ class THistPainter; #pragma link C++ class TPaletteAxis+; // needed since new class definition of TGraph2DPainter #pragma extra_include "TGraph2D.h"; #pragma extra_include "TGraphDelaunay.h"; #pragma extra_include "TGraphDelaunay2D.h"; #endif
1.109375
1
modules/userinterfacegl/glui/widgets/rangeslider.h
leaveitout/inviwo
1
7996659
/********************************************************************************* * * Inviwo - Interactive Visualization Workshop * * Copyright (c) 2017-2018 Inviwo Foundation * 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 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 IVW_RANGESLIDER_H #define IVW_RANGESLIDER_H #include <modules/userinterfacegl/userinterfaceglmoduledefine.h> #include <inviwo/core/common/inviwo.h> #include <modules/userinterfacegl/glui/element.h> #include <array> namespace inviwo { class Texture2DArray; namespace glui { class Renderer; /** * \class RangeSlider * \brief glui::element representing a range slider, the label is positioned to the right */ class IVW_MODULE_USERINTERFACEGL_API RangeSlider : public Element { public: RangeSlider(const std::string &label, const ivec2 &value, int minValue, int maxValue, int minSeparation, Processor &processor, Renderer &uiRenderer, const ivec2 &extent = ivec2(100, 24), UIOrientation orientation = UIOrientation::Horizontal); virtual ~RangeSlider() = default; void set(const ivec2 &value); void set(const ivec2 &value, int minValue, int maxValue, int minSeparation); const ivec2 &get() const; void setStart(int start); void setEnd(int stop); int getMinValue() const; int getMaxValue() const; void setMinSeparation(int sep); int getMinSeparation() const; protected: virtual void renderWidget(const ivec2 &origin, const size2_t &canvasDim) override; const ivec2 &getPreviousValue() const; /** * \brief transform mouse movements from pixel to normalized slider range while also * considering the slider orientation * * @param delta (in screen coords, i.e. pixel) * @return delta movement normalized to slider range */ double convertDeltaToSlider(const dvec2 &delta) const; private: virtual ivec2 computeLabelPos(int descent) const override; virtual UIState uiState() const override; virtual vec2 marginScale() const override; virtual void pushStateChanged() override; double getHandleWidth() const; vec2 getSliderPos() const; Texture2DArray *uiTextures_; Texture2DArray *centerTextures_; Texture2DArray *grooveTextures_; std::array<int, 9> uiTextureMap_; ivec2 value_; int min_; int max_; int minSeparation_; ivec2 prevValue_; }; } // namespace glui } // namespace inviwo #endif // IVW_RANGESLIDER_H
1.28125
1
dash/libs/inemo/iNemoEngineAPI.h
Zuli/device_sony_lt28
0
7996667
#ifndef INEMO_ENGINE_API_H_ #define INEMO_ENGINE_API_H_ typedef struct RawCounts { float mag[3]; float acc[3]; float gyro[3]; } RawCounts; int iNemoEngineAPI_Initialization(char LocalEarthMagField, int MagFullScale, int formFactorNumber); void iNemoEngineAPI_Run(int delta_time, struct RawCounts * RawCnts); void iNemoEngineAPI_Return_Quaternion(float *quaternion); void iNemoEngineAPI_Return_Rotation(float *rotation); void iNemoEngineAPI_Return_Gravity(float *gravity); void iNemoEngineAPI_Return_Linear_acceleration(float *linear_accel); int iNemoEngineAPI_Return_NewFullScale(void); void iNemoEngineAPI_ForceReCalibration(void); void iNemoEngineAPI_ChangeFormFactor(int formFactorNumber); void iNemoEngineAPI_getCalibrationData(CalibFactor *CalibrationData); #endif
1
1
source/example/template/project/vc/lib/npcap/Include/pcap/bpf.h
xsjames/vsf
170
7996675
/*- * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * This code is derived from the Stanford/CMU enet packet filter, * (net/enet.c) distributed as part of 4.3BSD, and code contributed * to Berkeley by <NAME> and <NAME> both of Lawrence * Berkeley Laboratory. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of 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. * * @(#)bpf.h 7.1 (Berkeley) 5/7/91 */ /* * This is libpcap's cut-down version of bpf.h; it includes only * the stuff needed for the code generator and the userland BPF * interpreter, and the libpcap APIs for setting filters, etc.. * * "pcap-bpf.c" will include the native OS version, as it deals with * the OS's BPF implementation. * * At least two programs found by Google Code Search explicitly includes * <pcap/bpf.h> (even though <pcap.h>/<pcap/pcap.h> includes it for you), * so moving that stuff to <pcap/pcap.h> would break the build for some * programs. */ /* * If we've already included <net/bpf.h>, don't re-define this stuff. * We assume BSD-style multiple-include protection in <net/bpf.h>, * which is true of all but the oldest versions of FreeBSD and NetBSD, * or Tru64 UNIX-style multiple-include protection (or, at least, * Tru64 UNIX 5.x-style; I don't have earlier versions available to check), * or AIX-style multiple-include protection (or, at least, AIX 5.x-style; * I don't have earlier versions available to check), or QNX-style * multiple-include protection (as per GitHub pull request #394). * * We do not check for BPF_MAJOR_VERSION, as that's defined by * <linux/filter.h>, which is directly or indirectly included in some * programs that also include pcap.h, and <linux/filter.h> doesn't * define stuff we need. * * This also provides our own multiple-include protection. */ #if !defined(_NET_BPF_H_) && !defined(_NET_BPF_H_INCLUDED) && !defined(_BPF_H_) && !defined(_H_BPF) && !defined(lib_pcap_bpf_h) #define lib_pcap_bpf_h #include <pcap/funcattrs.h> #ifdef __cplusplus extern "C" { #endif /* BSD style release date */ #define BPF_RELEASE 199606 #ifdef MSDOS /* must be 32-bit */ typedef long bpf_int32; typedef unsigned long bpf_u_int32; #else typedef int bpf_int32; typedef u_int bpf_u_int32; #endif /* * Alignment macros. BPF_WORDALIGN rounds up to the next * even multiple of BPF_ALIGNMENT. * * Tcpdump's print-pflog.c uses this, so we define it here. */ #ifndef __NetBSD__ #define BPF_ALIGNMENT sizeof(bpf_int32) #else #define BPF_ALIGNMENT sizeof(long) #endif #define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1)) /* * Structure for "pcap_compile()", "pcap_setfilter()", etc.. */ struct bpf_program { u_int bf_len; struct bpf_insn *bf_insns; }; #include <pcap/dlt.h> /* * The instruction encodings. * * Please inform <EMAIL> if you use any * of the reserved values, so that we can note that they're used * (and perhaps implement it in the reference BPF implementation * and encourage its implementation elsewhere). */ /* * The upper 8 bits of the opcode aren't used. BSD/OS used 0x8000. */ /* instruction classes */ #define BPF_CLASS(code) ((code) & 0x07) #define BPF_LD 0x00 #define BPF_LDX 0x01 #define BPF_ST 0x02 #define BPF_STX 0x03 #define BPF_ALU 0x04 #define BPF_JMP 0x05 #define BPF_RET 0x06 #define BPF_MISC 0x07 /* ld/ldx fields */ #define BPF_SIZE(code) ((code) & 0x18) #define BPF_W 0x00 #define BPF_H 0x08 #define BPF_B 0x10 /* 0x18 reserved; used by BSD/OS */ #define BPF_MODE(code) ((code) & 0xe0) #define BPF_IMM 0x00 #define BPF_ABS 0x20 #define BPF_IND 0x40 #define BPF_MEM 0x60 #define BPF_LEN 0x80 #define BPF_MSH 0xa0 /* 0xc0 reserved; used by BSD/OS */ /* 0xe0 reserved; used by BSD/OS */ /* alu/jmp fields */ #define BPF_OP(code) ((code) & 0xf0) #define BPF_ADD 0x00 #define BPF_SUB 0x10 #define BPF_MUL 0x20 #define BPF_DIV 0x30 #define BPF_OR 0x40 #define BPF_AND 0x50 #define BPF_LSH 0x60 #define BPF_RSH 0x70 #define BPF_NEG 0x80 #define BPF_MOD 0x90 #define BPF_XOR 0xa0 /* 0xb0 reserved */ /* 0xc0 reserved */ /* 0xd0 reserved */ /* 0xe0 reserved */ /* 0xf0 reserved */ #define BPF_JA 0x00 #define BPF_JEQ 0x10 #define BPF_JGT 0x20 #define BPF_JGE 0x30 #define BPF_JSET 0x40 /* 0x50 reserved; used on BSD/OS */ /* 0x60 reserved */ /* 0x70 reserved */ /* 0x80 reserved */ /* 0x90 reserved */ /* 0xa0 reserved */ /* 0xb0 reserved */ /* 0xc0 reserved */ /* 0xd0 reserved */ /* 0xe0 reserved */ /* 0xf0 reserved */ #define BPF_SRC(code) ((code) & 0x08) #define BPF_K 0x00 #define BPF_X 0x08 /* ret - BPF_K and BPF_X also apply */ #define BPF_RVAL(code) ((code) & 0x18) #define BPF_A 0x10 /* 0x18 reserved */ /* misc */ #define BPF_MISCOP(code) ((code) & 0xf8) #define BPF_TAX 0x00 /* 0x08 reserved */ /* 0x10 reserved */ /* 0x18 reserved */ /* #define BPF_COP 0x20 NetBSD "coprocessor" extensions */ /* 0x28 reserved */ /* 0x30 reserved */ /* 0x38 reserved */ /* #define BPF_COPX 0x40 NetBSD "coprocessor" extensions */ /* also used on BSD/OS */ /* 0x48 reserved */ /* 0x50 reserved */ /* 0x58 reserved */ /* 0x60 reserved */ /* 0x68 reserved */ /* 0x70 reserved */ /* 0x78 reserved */ #define BPF_TXA 0x80 /* 0x88 reserved */ /* 0x90 reserved */ /* 0x98 reserved */ /* 0xa0 reserved */ /* 0xa8 reserved */ /* 0xb0 reserved */ /* 0xb8 reserved */ /* 0xc0 reserved; used on BSD/OS */ /* 0xc8 reserved */ /* 0xd0 reserved */ /* 0xd8 reserved */ /* 0xe0 reserved */ /* 0xe8 reserved */ /* 0xf0 reserved */ /* 0xf8 reserved */ /* * The instruction data structure. */ struct bpf_insn { u_short code; u_char jt; u_char jf; bpf_u_int32 k; }; /* * Macros for insn array initializers. */ #define BPF_STMT(code, k) { (u_short)(code), 0, 0, k } #define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k } PCAP_API int bpf_validate(const struct bpf_insn *, int); PCAP_API u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int); /* * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST). */ #define BPF_MEMWORDS 16 #ifdef __cplusplus } #endif #endif /* !defined(_NET_BPF_H_) && !defined(_BPF_H_) && !defined(_H_BPF) && !defined(lib_pcap_bpf_h) */
1.179688
1
Sylio/setPlayer.h
sylwow/Sylio
0
7996683
#pragma once #include <SFML/Graphics.hpp> #include <SFML/Audio.hpp> #include "inputText.h" #include <algorithm> #include "CheckBox.h" class setPlayer { private: static std::vector<sf::Keyboard::Key> forbidden; sf::Keyboard::Key leftKey; sf::Keyboard::Key rightKey; sf::RenderWindow& window; inputText nickname; inputText left; inputText right; CheckBox checkBox; //sf::Sprite selected; int activated; std::string translate(sf::Keyboard::Key key); sf::Color playerColor; static bool focused; public: setPlayer(sf::RenderWindow& win, sf::Texture& boxOn_, sf::Texture& boxOff, sf::Texture& controls, sf::Texture& controlsOff, sf::Texture& checkOn, sf::Texture& checkOff, sf::SoundBuffer& click, sf::Font& font, std::string string); bool function(); void setColor(sf::Color x) { playerColor = x; } sf::Color getColor() { return playerColor; } bool setChar(sf::Keyboard::Key key); void checkState(); void draw() { right.draw(); left.draw(); nickname.draw(); checkBox.draw(); } void setPosition(int x, int y); static bool getFocus() { return focused; } void setSoundVolume(double vol) { nickname.setSoundVolume(vol); right.setSoundVolume(vol); left.setSoundVolume(vol); checkBox.setSoundVolume(vol); } static void clearForbidden() { forbidden.clear(); } std::string getNickname(); sf::Keyboard::Key getLeftKey(); sf::Keyboard::Key getRightKey(); bool getActive() { return checkBox.getActivate(); } ~setPlayer(); };
1.65625
2
Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeGopPolicyInit.c
hwu25/edk2-platforms
0
7996691
/** @file This file initialises and Installs GopPolicy Protocol. Copyright (c) 2017, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License that accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #include "DxeGopPolicyInit.h" #include <Protocol/GopPolicy.h> GLOBAL_REMOVE_IF_UNREFERENCED GOP_POLICY_PROTOCOL mGOPPolicy; GLOBAL_REMOVE_IF_UNREFERENCED UINT32 mVbtSize = 0; GLOBAL_REMOVE_IF_UNREFERENCED EFI_PHYSICAL_ADDRESS mVbtAddress = 0; // // Function implementations // /** @param[out] CurrentLidStatus @retval EFI_SUCCESS @retval EFI_UNSUPPORTED **/ EFI_STATUS EFIAPI GetPlatformLidStatus ( OUT LID_STATUS *CurrentLidStatus ) { return EFI_UNSUPPORTED; } /** @param[out] CurrentDockStatus @retval EFI_SUCCESS @retval EFI_UNSUPPORTED **/ EFI_STATUS EFIAPI GetPlatformDockStatus ( OUT DOCK_STATUS CurrentDockStatus ) { return EFI_UNSUPPORTED; } /** @param[out] VbtAddress @param[out] VbtSize @retval EFI_SUCCESS @retval EFI_NOT_FOUND **/ EFI_STATUS EFIAPI GetVbtData ( OUT EFI_PHYSICAL_ADDRESS *VbtAddress, OUT UINT32 *VbtSize ) { EFI_STATUS Status; UINTN FvProtocolCount; EFI_HANDLE *FvHandles; EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv; UINTN Index; UINT32 AuthenticationStatus; UINT8 *Buffer; UINTN VbtBufferSize; Status = EFI_NOT_FOUND; if ( mVbtAddress == 0) { Fv = NULL; Buffer = 0; FvHandles = NULL; Status = gBS->LocateHandleBuffer ( ByProtocol, &gEfiFirmwareVolume2ProtocolGuid, NULL, &FvProtocolCount, &FvHandles ); if (!EFI_ERROR (Status)) { for (Index = 0; Index < FvProtocolCount; Index++) { Status = gBS->HandleProtocol ( FvHandles[Index], &gEfiFirmwareVolume2ProtocolGuid, (VOID **) &Fv ); VbtBufferSize = 0; Status = Fv->ReadSection ( Fv, PcdGetPtr (PcdGraphicsVbtGuid), EFI_SECTION_RAW, 0, (VOID **) &Buffer, &VbtBufferSize, &AuthenticationStatus ); if (!EFI_ERROR (Status)) { *VbtAddress = (EFI_PHYSICAL_ADDRESS)Buffer; *VbtSize = (UINT32)VbtBufferSize; mVbtAddress = *VbtAddress; mVbtSize = *VbtSize; Status = EFI_SUCCESS; break; } } } else { Status = EFI_NOT_FOUND; } if (FvHandles != NULL) { FreePool (FvHandles); FvHandles = NULL; } } else { *VbtAddress = mVbtAddress; *VbtSize = mVbtSize; Status = EFI_SUCCESS; } return Status; } /** Initialize GOP DXE Policy @param[in] ImageHandle Image handle of this driver. @retval EFI_SUCCESS Initialization complete. @retval EFI_UNSUPPORTED The chipset is unsupported by this driver. @retval EFI_OUT_OF_RESOURCES Do not have enough resources to initialize the driver. @retval EFI_DEVICE_ERROR Device error, driver exits abnormally. **/ EFI_STATUS EFIAPI GopPolicyInitDxe ( IN EFI_HANDLE ImageHandle ) { EFI_STATUS Status; // // Initialize the EFI Driver Library // SetMem (&mGOPPolicy, sizeof (GOP_POLICY_PROTOCOL), 0); mGOPPolicy.Revision = GOP_POLICY_PROTOCOL_REVISION_03; mGOPPolicy.GetPlatformLidStatus = GetPlatformLidStatus; mGOPPolicy.GetVbtData = GetVbtData; mGOPPolicy.GetPlatformDockStatus = GetPlatformDockStatus; // // Install protocol to allow access to this Policy. // Status = gBS->InstallMultipleProtocolInterfaces ( &ImageHandle, &gGopPolicyProtocolGuid, &mGOPPolicy, NULL ); return Status; }
1.046875
1
StRoot/StJetMaker/towers/StjBEMC.h
xiaohaijin/RHIC-STAR
2
7996699
// -*- mode: c++;-*- // $Id: StjBEMC.h,v 1.1 2008/11/27 07:35:21 tai Exp $ // Copyright (C) 2008 <NAME> <<EMAIL>> #ifndef STJBEMC_H #define STJBEMC_H #include <TObject.h> #include "StjTowerEnergyList.h" class StjBEMC : public TObject { public: StjBEMC() { } virtual ~StjBEMC() { } virtual void Init() { } virtual StjTowerEnergyList getEnergyList() = 0; ClassDef(StjBEMC, 1) }; #endif // STJBEMC_H
1.023438
1
src/hw1/numerical/p2.c
rahlk/Parallel-Programming
0
7996707
/****************************************************************************** * FILE: hw1.c * DESCRIPTION: * * Users will supply the functions * i.) fn(x) - the function to be analyized * ii.) dfn(x) - the true derivative of the function * iii.) ifn(x) - the true integral of the function * * The function fn(x) should be smooth and continuous, and * the derivative and integral should have analyitic expressions * on the entire domain. * * AUTHOR: <NAME> * LAST REVISED: 08/18/12 ******************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <math.h> #include "mpi.h" /* The number of grid points */ #define NGRID 10000 /* first grid point */ #define XI 1.0 /* last grid point */ #define XF 100.0 /* floating point precision type definitions */ typedef double FP_PREC; /* function declarations */ FP_PREC fn(FP_PREC); FP_PREC dfn(FP_PREC); FP_PREC ifn(FP_PREC, FP_PREC); void print_function_data(int, FP_PREC*, FP_PREC*, FP_PREC*); void print_error_data(int np, FP_PREC, FP_PREC, FP_PREC*, FP_PREC*, FP_PREC); int main(int, char**); int main (int argc, char *argv[]) { <<<<<<< HEAD int numproc, rank, len,i; char hostname[MPI_MAX_PROCESSOR_NAME]; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &numproc); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Get_processor_name(hostname, &len); FP_PREC *yc, *dyc; FP_PREC *xc, dx, intg; //"real" grid indices int imin, imax; imin = 1 + (rank * (NGRID/numproc)); if(rank == numproc - 1) imax = XF; else imax = (rank+1) * (NGRID/numproc); printf("min: %d, max: %d\n",imin,imax); int range = imax - imin + 1; xc = (FP_PREC*) malloc((range + 2) * sizeof(FP_PREC)); yc = (FP_PREC*) malloc((range + 2) * sizeof(FP_PREC)); dyc = (FP_PREC*) malloc((range + 2) * sizeof(FP_PREC)); for (i = 1; i <= range ; i++) { xc[i] = imin + (XF - XI) * (FP_PREC)(i - 1)/(FP_PREC)(NGRID - 1); } dx = xc[2] - xc[1]; xc[0] = xc[1] - dx; xc[range + 1] = xc[range] + dx; for( i = 1; i <= range; i++ ) { yc[i] = fn(xc[i]); } yc[0] = fn(xc[0]); yc[range + 1] = fn(xc[range + 1]); for (i = 1; i <= range; i++) { dyc[i] = (yc[i + 1] - yc[i - 1])/(2.0 * dx); } intg = 0.0; for (i = 1; i <= range; i++) { //there are NGRID points, so there are NGRID-1 integration zones. if((rank == numproc - 1) && (i == range)) break; intg += 0.5 * (xc[i + 1] - xc[i]) * (yc[i + 1] + yc[i]); } //if(rank == 0) { for(i=0; i<=range+1; i++) printf("%lf: %lf: %lf\n",xc[i],yc[i],dyc[i]); printf("Integration: %lf\n",intg); } MPI_Finalize(); ======= int numproc, rank, len,i; char hostname[MPI_MAX_PROCESSOR_NAME]; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &numproc); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Get_processor_name(hostname, &len); FP_PREC *yc, *dyc, *derr, *fullerr; FP_PREC *xc, dx, intg, davg_err, dstd_dev, intg_err; FP_PREC globalSum = 0.0; MPI_Request *request; //"real" grid indices int imin, imax; imin = 1 + (rank * (NGRID/numproc)); if(rank == numproc - 1) imax = NGRID; else imax = (rank+1) * (NGRID/numproc); int range = imax - imin + 1; xc = (FP_PREC*) malloc((range + 2) * sizeof(FP_PREC)); yc = (FP_PREC*) malloc((range + 2) * sizeof(FP_PREC)); dyc = (FP_PREC*) malloc((range + 2) * sizeof(FP_PREC)); dx = (XF - XI)/(double)NGRID; for (i = 1; i <= range ; i++) { //xc[i] = imin + (XF - XI) * (FP_PREC)(i - 1)/(FP_PREC)(NGRID - 1); xc[i] = XI + dx * (imin + i - 2); } xc[0] = xc[1] - dx; xc[range + 1] = xc[range] + dx; for( i = 1; i <= range; i++ ) { yc[i] = fn(xc[i]); } yc[0] = fn(xc[0]); yc[range + 1] = fn(xc[range + 1]); for (i = 1; i <= range; i++) { dyc[i] = (yc[i + 1] - yc[i - 1])/(2.0 * dx); } intg = 0.0; for (i = 1; i <= range; i++) { intg += 0.5 * (xc[i + 1] - xc[i]) * (yc[i + 1] + yc[i]); } MPI_Reduce(&intg, &globalSum, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); //compute the error, average error of the derivatives derr = (FP_PREC*)malloc((range + 2) * sizeof(FP_PREC)); //compute the errors for(i = 1; i <= range; i++) { derr[i] = fabs((dyc[i] - dfn(xc[i]))/dfn(xc[i])); } derr[0] = derr[range + 1] = 0.0; if(rank == 0) { fullerr = (FP_PREC *)malloc(sizeof(FP_PREC)*NGRID); for(i = 0;i<range;i++) { fullerr[i] = derr[i+1]; } for(i = 1; i<numproc; i++) { int rmin, rmax; rmin = 1 + (i * (NGRID/numproc)); if(i == numproc - 1) rmax = NGRID; else rmax = (i+1) * (NGRID/numproc); MPI_Recv(fullerr+rmin-1, rmax-rmin+1, MPI_DOUBLE, i, i, MPI_COMM_WORLD, MPI_STATUS_IGNORE); } double sum = 0.0; for(i=0; i<NGRID; i++) { sum+=fullerr[i]; } davg_err = sum/(FP_PREC)NGRID; dstd_dev = 0.0; for(i = 0; i< NGRID; i++) { dstd_dev += pow(derr[i] - davg_err, 2); } dstd_dev = sqrt(dstd_dev/(FP_PREC)NGRID); intg_err = fabs((ifn(XI, XF) - globalSum)/ifn(XI, XF)); printf("%0.4e: %0.4e: %0.4e\n", davg_err, dstd_dev, intg_err); } else { MPI_Send(derr+1, imax-imin+1, MPI_DOUBLE, 0, rank, MPI_COMM_WORLD); fflush(stdout); } MPI_Finalize(); >>>>>>> 5875ebd784803c689b768a62fa8338886e177277 }
1.953125
2
chrome/browser/chromeos/cros/network_library.h
SlimKatLegacy/android_external_chromium
2
7996715
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ #define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ #pragma once #include <string> #include <vector> #include "base/gtest_prod_util.h" #include "base/memory/scoped_vector.h" #include "base/memory/singleton.h" #include "base/observer_list.h" #include "base/string16.h" #include "base/timer.h" #include "third_party/cros/chromeos_network.h" class DictionaryValue; class Value; namespace chromeos { // Connection enums (see flimflam/include/service.h) enum ConnectionType { TYPE_UNKNOWN = 0, TYPE_ETHERNET = 1, TYPE_WIFI = 2, TYPE_WIMAX = 3, TYPE_BLUETOOTH = 4, TYPE_CELLULAR = 5, TYPE_VPN = 6, }; enum ConnectionMode { MODE_UNKNOWN = 0, MODE_MANAGED = 1, MODE_ADHOC = 2, }; enum ConnectionSecurity { SECURITY_UNKNOWN = 0, SECURITY_NONE = 1, SECURITY_WEP = 2, SECURITY_WPA = 3, SECURITY_RSN = 4, SECURITY_8021X = 5, SECURITY_PSK = 6, }; enum ConnectionState { STATE_UNKNOWN = 0, STATE_IDLE = 1, STATE_CARRIER = 2, STATE_ASSOCIATION = 3, STATE_CONFIGURATION = 4, STATE_READY = 5, STATE_DISCONNECT = 6, STATE_FAILURE = 7, STATE_ACTIVATION_FAILURE = 8 }; enum ConnectivityState { CONN_STATE_UNKNOWN = 0, CONN_STATE_UNRESTRICTED = 1, CONN_STATE_RESTRICTED = 2, CONN_STATE_NONE = 3 }; // Network enums (see flimflam/include/network.h) enum NetworkTechnology { NETWORK_TECHNOLOGY_UNKNOWN = 0, NETWORK_TECHNOLOGY_1XRTT = 1, NETWORK_TECHNOLOGY_EVDO = 2, NETWORK_TECHNOLOGY_GPRS = 3, NETWORK_TECHNOLOGY_EDGE = 4, NETWORK_TECHNOLOGY_UMTS = 5, NETWORK_TECHNOLOGY_HSPA = 6, NETWORK_TECHNOLOGY_HSPA_PLUS = 7, NETWORK_TECHNOLOGY_LTE = 8, NETWORK_TECHNOLOGY_LTE_ADVANCED = 9, }; enum ActivationState { ACTIVATION_STATE_UNKNOWN = 0, ACTIVATION_STATE_ACTIVATED = 1, ACTIVATION_STATE_ACTIVATING = 2, ACTIVATION_STATE_NOT_ACTIVATED = 3, ACTIVATION_STATE_PARTIALLY_ACTIVATED = 4, }; enum NetworkRoamingState { ROAMING_STATE_UNKNOWN = 0, ROAMING_STATE_HOME = 1, ROAMING_STATE_ROAMING = 2, }; // SIMLock states (see gobi-cromo-plugin/gobi_gsm_modem.cc) enum SIMLockState { SIM_UNKNOWN = 0, SIM_UNLOCKED = 1, SIM_LOCKED_PIN = 2, SIM_LOCKED_PUK = 3, // also when SIM is blocked, then retries = 0. }; // SIM PinRequire states. Since PinRequire current state is not exposed as a // cellular property, we initialize it's value based on the SIMLockState // initial value. // SIM_PIN_REQUIRE_UNKNOWN - SIM card is absent or SIMLockState initial value // hasn't been received yet. // SIM_PIN_REQUIRED - SIM card is locked when booted/wake from sleep and // requires user to enter PIN. // SIM_PIN_NOT_REQUIRED - SIM card is unlocked all the time and requires PIN // only on certain operations, such as ChangeRequirePin, ChangePin, EnterPin. enum SIMPinRequire { SIM_PIN_REQUIRE_UNKNOWN = 0, SIM_PIN_NOT_REQUIRED = 1, SIM_PIN_REQUIRED = 2, }; // Any PIN operation result (EnterPin, UnblockPin etc.). enum PinOperationError { PIN_ERROR_NONE = 0, PIN_ERROR_UNKNOWN = 1, PIN_ERROR_INCORRECT_CODE = 2, // Either PIN/PUK specified is incorrect. PIN_ERROR_BLOCKED = 3, // No more PIN retries left, SIM is blocked. }; // connection errors (see flimflam/include/service.h) enum ConnectionError { ERROR_NO_ERROR = 0, ERROR_OUT_OF_RANGE = 1, ERROR_PIN_MISSING = 2, ERROR_DHCP_FAILED = 3, ERROR_CONNECT_FAILED = 4, ERROR_BAD_PASSPHRASE = 5, ERROR_BAD_WEPKEY = 6, ERROR_ACTIVATION_FAILED = 7, ERROR_NEED_EVDO = 8, ERROR_NEED_HOME_NETWORK = 9, ERROR_OTASP_FAILED = 10, ERROR_AAA_FAILED = 11, }; // We are currently only supporting setting a single EAP Method. enum EAPMethod { EAP_METHOD_UNKNOWN = 0, EAP_METHOD_PEAP = 1, EAP_METHOD_TLS = 2, EAP_METHOD_TTLS = 3, EAP_METHOD_LEAP = 4 }; // We are currently only supporting setting a single EAP phase 2 authentication. enum EAPPhase2Auth { EAP_PHASE_2_AUTH_AUTO = 0, EAP_PHASE_2_AUTH_MD5 = 1, EAP_PHASE_2_AUTH_MSCHAPV2 = 2, EAP_PHASE_2_AUTH_MSCHAP = 3, EAP_PHASE_2_AUTH_PAP = 4, EAP_PHASE_2_AUTH_CHAP = 5 }; // Simple wrapper for property Cellular.FoundNetworks. struct FoundCellularNetwork { std::string status; std::string network_id; std::string short_name; std::string long_name; std::string technology; }; typedef std::vector<FoundCellularNetwork> CellularNetworkList; // Cellular network is considered low data when less than 60 minues. static const int kCellularDataLowSecs = 60 * 60; // Cellular network is considered low data when less than 30 minues. static const int kCellularDataVeryLowSecs = 30 * 60; // Cellular network is considered low data when less than 100MB. static const int kCellularDataLowBytes = 100 * 1024 * 1024; // Cellular network is considered very low data when less than 50MB. static const int kCellularDataVeryLowBytes = 50 * 1024 * 1024; // Contains data related to the flimflam.Device interface, // e.g. ethernet, wifi, cellular. // TODO(dpolukhin): refactor to make base class and device specific derivatives. class NetworkDevice { public: explicit NetworkDevice(const std::string& device_path); // Device info. const std::string& device_path() const { return device_path_; } const std::string& name() const { return name_; } ConnectionType type() const { return type_; } bool scanning() const { return scanning_; } const std::string& meid() const { return MEID_; } const std::string& imei() const { return IMEI_; } const std::string& imsi() const { return IMSI_; } const std::string& esn() const { return ESN_; } const std::string& mdn() const { return MDN_; } const std::string& min() const { return MIN_; } const std::string& model_id() const { return model_id_; } const std::string& manufacturer() const { return manufacturer_; } SIMLockState sim_lock_state() const { return sim_lock_state_; } bool is_sim_locked() const { return sim_lock_state_ == SIM_LOCKED_PIN || sim_lock_state_ == SIM_LOCKED_PUK; } const int sim_retries_left() const { return sim_retries_left_; } SIMPinRequire sim_pin_required() const { return sim_pin_required_; } const std::string& firmware_revision() const { return firmware_revision_; } const std::string& hardware_revision() const { return hardware_revision_; } const unsigned int prl_version() const { return PRL_version_; } const std::string& home_provider() const { return home_provider_; } const std::string& home_provider_code() const { return home_provider_code_; } const std::string& home_provider_country() const { return home_provider_country_; } const std::string& home_provider_id() const { return home_provider_id_; } const std::string& home_provider_name() const { return home_provider_name_; } const std::string& selected_cellular_network() const { return selected_cellular_network_; } const CellularNetworkList& found_cellular_networks() const { return found_cellular_networks_; } bool data_roaming_allowed() const { return data_roaming_allowed_; } bool support_network_scan() const { return support_network_scan_; } private: bool ParseValue(int index, const Value* value); void ParseInfo(const DictionaryValue* info); // General device info. std::string device_path_; std::string name_; ConnectionType type_; bool scanning_; // Cellular specific device info. std::string carrier_; std::string home_provider_; std::string home_provider_code_; std::string home_provider_country_; std::string home_provider_id_; std::string home_provider_name_; std::string MEID_; std::string IMEI_; std::string IMSI_; std::string ESN_; std::string MDN_; std::string MIN_; std::string model_id_; std::string manufacturer_; SIMLockState sim_lock_state_; int sim_retries_left_; SIMPinRequire sim_pin_required_; std::string firmware_revision_; std::string hardware_revision_; int PRL_version_; std::string selected_cellular_network_; CellularNetworkList found_cellular_networks_; bool data_roaming_allowed_; bool support_network_scan_; friend class NetworkLibraryImpl; DISALLOW_COPY_AND_ASSIGN(NetworkDevice); }; // Contains data common to all network service types. class Network { public: virtual ~Network() {} const std::string& service_path() const { return service_path_; } const std::string& name() const { return name_; } const std::string& device_path() const { return device_path_; } const std::string& ip_address() const { return ip_address_; } ConnectionType type() const { return type_; } ConnectionMode mode() const { return mode_; } ConnectionState connection_state() const { return state_; } bool connecting() const { return IsConnectingState(state_); } bool configuring() const { return state_ == STATE_CONFIGURATION; } bool connected() const { return state_ == STATE_READY; } bool connecting_or_connected() const { return connecting() || connected(); } bool failed() const { return state_ == STATE_FAILURE; } bool failed_or_disconnected() const { return failed() || state_ == STATE_IDLE; } ConnectionError error() const { return error_; } ConnectionState state() const { return state_; } // Is this network connectable. Currently, this is mainly used by 802.1x // networks to specify that the network is not configured yet. bool connectable() const { return connectable_; } // Is this the active network, i.e, the one through which // network traffic is being routed? A network can be connected, // but not be carrying traffic. bool is_active() const { return is_active_; } bool favorite() const { return favorite_; } bool auto_connect() const { return auto_connect_; } ConnectivityState connectivity_state() const { return connectivity_state_; } bool added() const { return added_; } const std::string& unique_id() const { return unique_id_; } // We don't have a setter for |favorite_| because to unfavorite a network is // equivalent to forget a network, so we call forget network on cros for // that. See ForgetWifiNetwork(). void SetAutoConnect(bool auto_connect); // Sets network name. void SetName(const std::string& name); // Return a string representation of the state code. std::string GetStateString() const; // Return a string representation of the error code. std::string GetErrorString() const; static bool IsConnectingState(ConnectionState state) { return (state == STATE_ASSOCIATION || state == STATE_CONFIGURATION || state == STATE_CARRIER); } protected: Network(const std::string& service_path, ConnectionType type) : state_(STATE_UNKNOWN), error_(ERROR_NO_ERROR), connectable_(true), is_active_(false), favorite_(false), auto_connect_(false), connectivity_state_(CONN_STATE_UNKNOWN), priority_order_(0), added_(false), service_path_(service_path), type_(type) {} // Parse name/value pairs from libcros. virtual bool ParseValue(int index, const Value* value); virtual void ParseInfo(const DictionaryValue* info); // Methods to asynchronously set network service properties virtual void SetStringProperty(const char* prop, const std::string& str, std::string* dest); virtual void SetBooleanProperty(const char* prop, bool b, bool* dest); virtual void SetIntegerProperty(const char* prop, int i, int* dest); virtual void SetValueProperty(const char* prop, Value* val); virtual void ClearProperty(const char* prop); // This will clear the property if string is empty. Otherwise, it will set it. virtual void SetOrClearStringProperty(const char* prop, const std::string& str, std::string* dest); std::string device_path_; std::string name_; std::string ip_address_; ConnectionMode mode_; ConnectionState state_; ConnectionError error_; bool connectable_; bool is_active_; bool favorite_; bool auto_connect_; ConnectivityState connectivity_state_; // Unique identifier, set the first time the network is parsed. std::string unique_id_; private: void set_name(const std::string& name) { name_ = name; } void set_connecting(bool connecting) { state_ = (connecting ? STATE_ASSOCIATION : STATE_IDLE); } void set_connected(bool connected) { state_ = (connected ? STATE_READY : STATE_IDLE); } void set_state(ConnectionState state) { state_ = state; } void set_connectable(bool connectable) { connectable_ = connectable; } void set_active(bool is_active) { is_active_ = is_active; } void set_error(ConnectionError error) { error_ = error; } void set_connectivity_state(ConnectivityState connectivity_state) { connectivity_state_ = connectivity_state; } void set_added(bool added) { added_ = added; } // Initialize the IP address field void InitIPAddress(); // Priority value, corresponds to index in list from flimflam (0 = first) int priority_order_; // Set to true if the UI requested this as a new network. bool added_; // These must not be modified after construction. std::string service_path_; ConnectionType type_; friend class NetworkLibraryImpl; friend class NetworkLibraryStubImpl; DISALLOW_COPY_AND_ASSIGN(Network); // ChangeAutoConnectSaveTest accesses |favorite_|. FRIEND_TEST_ALL_PREFIXES(WifiConfigViewTest, ChangeAutoConnectSaveTest); }; // Class for networks of TYPE_ETHERNET. class EthernetNetwork : public Network { public: explicit EthernetNetwork(const std::string& service_path) : Network(service_path, TYPE_ETHERNET) { } private: friend class NetworkLibraryImpl; DISALLOW_COPY_AND_ASSIGN(EthernetNetwork); }; // Class for networks of TYPE_VPN. class VirtualNetwork : public Network { public: enum ProviderType { PROVIDER_TYPE_L2TP_IPSEC_PSK, PROVIDER_TYPE_L2TP_IPSEC_USER_CERT, PROVIDER_TYPE_OPEN_VPN, // Add new provider types before PROVIDER_TYPE_MAX. PROVIDER_TYPE_MAX, }; explicit VirtualNetwork(const std::string& service_path) : Network(service_path, TYPE_VPN), provider_type_(PROVIDER_TYPE_L2TP_IPSEC_PSK) { } const std::string& server_hostname() const { return server_hostname_; } ProviderType provider_type() const { return provider_type_; } const std::string& ca_cert() const { return ca_cert_; } const std::string& psk_passphrase() const { return psk_passphrase_; } const std::string& user_cert() const { return user_cert_; } const std::string& user_cert_key() const { return user_cert_key_; } const std::string& username() const { return username_; } const std::string& user_passphrase() const { return user_passphrase_; } bool NeedMoreInfoToConnect() const; // Public setters. void SetCACert(const std::string& ca_cert); void SetPSKPassphrase(const std::string& psk_passphrase); void SetUserCert(const std::string& user_cert); void SetUserCertKey(const std::string& key); void SetUsername(const std::string& username); void SetUserPassphrase(const std::string& user_passphrase); std::string GetProviderTypeString() const; private: // Network overrides. virtual bool ParseValue(int index, const Value* value); virtual void ParseInfo(const DictionaryValue* info); // VirtualNetwork private methods. bool ParseProviderValue(int index, const Value* value); void set_server_hostname(const std::string& server_hostname) { server_hostname_ = server_hostname; } void set_provider_type(ProviderType provider_type) { provider_type_ = provider_type; } void set_ca_cert(const std::string& ca_cert) { ca_cert_ = ca_cert; } void set_psk_passphrase(const std::string& psk_passphrase) { psk_passphrase_ = psk_passphrase; } void set_user_cert(const std::string& user_cert) { user_cert_ = user_cert; } void set_user_cert_key(const std::string& key) { user_cert_key_ = key; } void set_username(const std::string& username) { username_ = username; } void set_user_passphrase(const std::string& user_passphrase) { user_passphrase_ = user_passphrase; } std::string server_hostname_; ProviderType provider_type_; std::string ca_cert_; std::string psk_passphrase_; std::string user_cert_; std::string user_cert_key_; std::string username_; std::string user_passphrase_; friend class NetworkLibraryImpl; DISALLOW_COPY_AND_ASSIGN(VirtualNetwork); }; typedef std::vector<VirtualNetwork*> VirtualNetworkVector; // Base class for networks of TYPE_WIFI or TYPE_CELLULAR. class WirelessNetwork : public Network { public: int strength() const { return strength_; } protected: WirelessNetwork(const std::string& service_path, ConnectionType type) : Network(service_path, type), strength_(0) {} int strength_; // Network overrides. virtual bool ParseValue(int index, const Value* value); private: void set_strength(int strength) { strength_ = strength; } friend class NetworkLibraryImpl; friend class NetworkLibraryStubImpl; DISALLOW_COPY_AND_ASSIGN(WirelessNetwork); }; // Class for networks of TYPE_CELLULAR. class CellularDataPlan; class CellularNetwork : public WirelessNetwork { public: enum DataLeft { DATA_UNKNOWN, DATA_NORMAL, DATA_LOW, DATA_VERY_LOW, DATA_NONE }; struct Apn { std::string apn; std::string network_id; std::string username; std::string password; Apn() {} Apn(const std::string& apn, const std::string& network_id, const std::string& username, const std::string& password) : apn(apn), network_id(network_id), username(username), password(password) { } void Set(const DictionaryValue& dict); }; virtual ~CellularNetwork(); explicit CellularNetwork(const std::string& service_path) : WirelessNetwork(service_path, TYPE_CELLULAR), activation_state_(ACTIVATION_STATE_UNKNOWN), network_technology_(NETWORK_TECHNOLOGY_UNKNOWN), roaming_state_(ROAMING_STATE_UNKNOWN), data_left_(DATA_UNKNOWN) { } // Starts device activation process. Returns false if the device state does // not permit activation. bool StartActivation() const; // Requests data plans if the network is conencted and activated. // Plan data will be passed through Network::Observer::CellularDataPlanChanged // callback. void RefreshDataPlansIfNeeded() const; const ActivationState activation_state() const { return activation_state_; } bool activated() const { return activation_state() == ACTIVATION_STATE_ACTIVATED; } const NetworkTechnology network_technology() const { return network_technology_; } const NetworkRoamingState roaming_state() const { return roaming_state_; } bool restricted_pool() const { return connectivity_state() == CONN_STATE_RESTRICTED; } bool needs_new_plan() const { return restricted_pool() && connected() && activated(); } const std::string& operator_name() const { return operator_name_; } const std::string& operator_code() const { return operator_code_; } const std::string& operator_country() const { return operator_country_; } const std::string& payment_url() const { return payment_url_; } const std::string& usage_url() const { return usage_url_; } DataLeft data_left() const { return data_left_; } const Apn& apn() const { return apn_; } const Apn& last_good_apn() const { return last_good_apn_; } void SetApn(const Apn& apn); bool SupportsDataPlan() const; // Misc. bool is_gsm() const { return network_technology_ != NETWORK_TECHNOLOGY_EVDO && network_technology_ != NETWORK_TECHNOLOGY_1XRTT && network_technology_ != NETWORK_TECHNOLOGY_UNKNOWN; } // Return a string representation of network technology. std::string GetNetworkTechnologyString() const; // Return a string representation of connectivity state. std::string GetConnectivityStateString() const; // Return a string representation of activation state. std::string GetActivationStateString() const; // Return a string representation of roaming state. std::string GetRoamingStateString() const; // Return a string representation of |activation_state|. static std::string ActivationStateToString(ActivationState activation_state); protected: // WirelessNetwork overrides. virtual bool ParseValue(int index, const Value* value); ActivationState activation_state_; NetworkTechnology network_technology_; NetworkRoamingState roaming_state_; // Carrier Info std::string operator_name_; std::string operator_code_; std::string operator_country_; std::string payment_url_; std::string usage_url_; // Cached values DataLeft data_left_; // Updated when data plans are updated. Apn apn_; Apn last_good_apn_; private: void set_activation_state(ActivationState state) { activation_state_ = state; } void set_payment_url(const std::string& url) { payment_url_ = url; } void set_usage_url(const std::string& url) { usage_url_ = url; } void set_network_technology(NetworkTechnology technology) { network_technology_ = technology; } void set_roaming_state(NetworkRoamingState state) { roaming_state_ = state; } void set_data_left(DataLeft data_left) { data_left_ = data_left; } void set_apn(const Apn& apn) { apn_ = apn; } void set_last_good_apn(const Apn& apn) { last_good_apn_ = apn; } friend class NetworkLibraryImpl; friend class NetworkLibraryStubImpl; DISALLOW_COPY_AND_ASSIGN(CellularNetwork); }; typedef std::vector<CellularNetwork*> CellularNetworkVector; // Class for networks of TYPE_WIFI. class WifiNetwork : public WirelessNetwork { public: explicit WifiNetwork(const std::string& service_path) : WirelessNetwork(service_path, TYPE_WIFI), encryption_(SECURITY_NONE), passphrase_required_(false), eap_method_(EAP_METHOD_UNKNOWN), eap_phase_2_auth_(EAP_PHASE_2_AUTH_AUTO), eap_use_system_cas_(true), save_credentials_(false) { } bool encrypted() const { return encryption_ != SECURITY_NONE; } ConnectionSecurity encryption() const { return encryption_; } const std::string& passphrase() const { return passphrase_; } const std::string& identity() const { return identity_; } const std::string& cert_path() const { return cert_path_; } bool passphrase_required() const { return passphrase_required_; } EAPMethod eap_method() const { return eap_method_; } EAPPhase2Auth eap_phase_2_auth() const { return eap_phase_2_auth_; } const std::string& eap_server_ca_cert_nss_nickname() const { return eap_server_ca_cert_nss_nickname_; } const std::string& eap_client_cert_pkcs11_id() const { return eap_client_cert_pkcs11_id_; } const bool eap_use_system_cas() const { return eap_use_system_cas_; } const std::string& eap_identity() const { return eap_identity_; } const std::string& eap_anonymous_identity() const { return eap_anonymous_identity_; } const std::string& eap_passphrase() const { return eap_passphrase_; } bool save_credentials() const { return save_credentials_; } const std::string& GetPassphrase() const; bool SetSsid(const std::string& ssid); bool SetHexSsid(const std::string& ssid_hex); void SetPassphrase(const std::string& passphrase); void SetIdentity(const std::string& identity); void SetCertPath(const std::string& cert_path); // 802.1x properties void SetEAPMethod(EAPMethod method); void SetEAPPhase2Auth(EAPPhase2Auth auth); void SetEAPServerCaCertNssNickname(const std::string& nss_nickname); void SetEAPClientCertPkcs11Id(const std::string& pkcs11_id); void SetEAPUseSystemCAs(bool use_system_cas); void SetEAPIdentity(const std::string& identity); void SetEAPAnonymousIdentity(const std::string& identity); void SetEAPPassphrase(const std::string& passphrase); void SetSaveCredentials(bool save_credentials); // Erase cached credentials, used when "Save password" is unchecked. void EraseCredentials(); // Return a string representation of the encryption code. // This not translated and should be only used for debugging purposes. std::string GetEncryptionString() const; // Return true if a passphrase or other input is required to connect. bool IsPassphraseRequired() const; // Return true if cert_path_ indicates that we have loaded the certificate. bool IsCertificateLoaded() const; private: // WirelessNetwork overrides. virtual bool ParseValue(int index, const Value* value); virtual void ParseInfo(const DictionaryValue* info); void CalculateUniqueId(); void set_encryption(ConnectionSecurity encryption) { encryption_ = encryption; } void set_passphrase(const std::string& passphrase) { passphrase_ = passphrase; } void set_passphrase_required(bool passphrase_required) { passphrase_required_ = passphrase_required; } void set_identity(const std::string& identity) { identity_ = identity; } void set_cert_path(const std::string& cert_path) { cert_path_ = cert_path; } ConnectionSecurity encryption_; std::string passphrase_; bool passphrase_required_; std::string identity_; std::string cert_path_; EAPMethod eap_method_; EAPPhase2Auth eap_phase_2_auth_; std::string eap_server_ca_cert_nss_nickname_; std::string eap_client_cert_pkcs11_id_; bool eap_use_system_cas_; std::string eap_identity_; std::string eap_anonymous_identity_; std::string eap_passphrase_; // Tells flimflam to save passphrase and EAP credentials to disk. bool save_credentials_; // Internal state (not stored in flimflam). // Passphrase set by user (stored for UI). std::string user_passphrase_; friend class NetworkLibraryImpl; DISALLOW_COPY_AND_ASSIGN(WifiNetwork); }; typedef std::vector<WifiNetwork*> WifiNetworkVector; // Cellular Data Plan management. class CellularDataPlan { public: CellularDataPlan() : plan_name("Unknown"), plan_type(CELLULAR_DATA_PLAN_UNLIMITED), plan_data_bytes(0), data_bytes_used(0) { } explicit CellularDataPlan(const CellularDataPlanInfo &plan) : plan_name(plan.plan_name ? plan.plan_name : ""), plan_type(plan.plan_type), update_time(base::Time::FromInternalValue(plan.update_time)), plan_start_time(base::Time::FromInternalValue(plan.plan_start_time)), plan_end_time(base::Time::FromInternalValue(plan.plan_end_time)), plan_data_bytes(plan.plan_data_bytes), data_bytes_used(plan.data_bytes_used) { } // Formats cellular plan description. string16 GetPlanDesciption() const; // Evaluates cellular plans status and returns warning string if it is near // expiration. string16 GetRemainingWarning() const; // Formats remaining plan data description. string16 GetDataRemainingDesciption() const; // Formats plan expiration description. string16 GetPlanExpiration() const; // Formats plan usage info. string16 GetUsageInfo() const; // Returns a unique string for this plan that can be used for comparisons. std::string GetUniqueIdentifier() const; base::TimeDelta remaining_time() const; int64 remaining_minutes() const; // Returns plan data remaining in bytes. int64 remaining_data() const; // TODO(stevenjb): Make these private with accessors and properly named. std::string plan_name; CellularDataPlanType plan_type; base::Time update_time; base::Time plan_start_time; base::Time plan_end_time; int64 plan_data_bytes; int64 data_bytes_used; }; typedef ScopedVector<CellularDataPlan> CellularDataPlanVector; // Geolocation data. struct CellTower { enum RadioType { RADIOTYPE_GSM, RADIOTYPE_CDMA, RADIOTYPE_WCDMA, } radio_type; // GSM/WCDMA CDMA int mobile_country_code; // MCC MCC int mobile_network_code; // MNC SID int location_area_code; // LAC NID int cell_id; // CID BID base::Time timestamp; // Timestamp when this cell was primary int signal_strength; // Radio signal strength measured in dBm. int timing_advance; // Represents the distance from the cell tower. // Each unit is roughly 550 meters. }; struct WifiAccessPoint { std::string mac_address; // The mac address of the WiFi node. std::string name; // The SSID of the WiFi node. base::Time timestamp; // Timestamp when this AP was detected. int signal_strength; // Radio signal strength measured in dBm. int signal_to_noise; // Current signal to noise ratio measured in dB. int channel; // Wifi channel number. }; typedef std::vector<CellTower> CellTowerVector; typedef std::vector<WifiAccessPoint> WifiAccessPointVector; // IP Configuration. struct NetworkIPConfig { NetworkIPConfig(const std::string& device_path, IPConfigType type, const std::string& address, const std::string& netmask, const std::string& gateway, const std::string& name_servers) : device_path(device_path), type(type), address(address), netmask(netmask), gateway(gateway), name_servers(name_servers) {} // NetworkIPConfigs are sorted by tyoe. bool operator< (const NetworkIPConfig& other) const { return type < other.type; } std::string device_path; IPConfigType type; std::string address; // This looks like "/device/0011aa22bb33" std::string netmask; std::string gateway; std::string name_servers; }; typedef std::vector<NetworkIPConfig> NetworkIPConfigVector; // This class handles the interaction with the ChromeOS network library APIs. // Classes can add themselves as observers. Users can get an instance of the // library like this: chromeos::CrosLibrary::Get()->GetNetworkLibrary() class NetworkLibrary { public: enum HardwareAddressFormat { FORMAT_RAW_HEX, FORMAT_COLON_SEPARATED_HEX }; class NetworkManagerObserver { public: // Called when the state of the network manager has changed, // for example, networks have appeared or disappeared. virtual void OnNetworkManagerChanged(NetworkLibrary* obj) = 0; }; class NetworkObserver { public: // Called when the state of a single network has changed, // for example signal strength or connection state. virtual void OnNetworkChanged(NetworkLibrary* cros, const Network* network) = 0; }; class NetworkDeviceObserver { public: // Called when the state of a single device has changed, // for example SIMLock state for cellular. virtual void OnNetworkDeviceChanged(NetworkLibrary* cros, const NetworkDevice* device) = 0; }; class CellularDataPlanObserver { public: // Called when the cellular data plan has changed. virtual void OnCellularDataPlanChanged(NetworkLibrary* obj) = 0; }; class PinOperationObserver { public: // Called when pin async operation has completed. // Network is NULL when we don't have an associated Network object. virtual void OnPinOperationCompleted(NetworkLibrary* cros, PinOperationError error) = 0; }; class UserActionObserver { public: // Called when user initiates a new connection. // Network is NULL when we don't have an associated Network object. virtual void OnConnectionInitiated(NetworkLibrary* cros, const Network* network) = 0; }; virtual ~NetworkLibrary() {} virtual void AddNetworkManagerObserver(NetworkManagerObserver* observer) = 0; virtual void RemoveNetworkManagerObserver( NetworkManagerObserver* observer) = 0; // An attempt to add an observer that has already been added for a // give service path will be ignored. virtual void AddNetworkObserver(const std::string& service_path, NetworkObserver* observer) = 0; // Remove an observer of a single network virtual void RemoveNetworkObserver(const std::string& service_path, NetworkObserver* observer) = 0; // Stop |observer| from observing any networks virtual void RemoveObserverForAllNetworks(NetworkObserver* observer) = 0; // Add an observer for a single network device. virtual void AddNetworkDeviceObserver(const std::string& device_path, NetworkDeviceObserver* observer) = 0; // Remove an observer for a single network device. virtual void RemoveNetworkDeviceObserver(const std::string& device_path, NetworkDeviceObserver* observer) = 0; // Temporarily locks down certain functionality in network library to prevent // unplanned side effects. During the lock down, Enable*Device() calls cannot // be made. virtual void Lock() = 0; // Removes temporarily lock of network library. virtual void Unlock() = 0; // Checks if access to network library is locked. virtual bool IsLocked() = 0; virtual void AddCellularDataPlanObserver( CellularDataPlanObserver* observer) = 0; virtual void RemoveCellularDataPlanObserver( CellularDataPlanObserver* observer) = 0; virtual void AddPinOperationObserver(PinOperationObserver* observer) = 0; virtual void RemovePinOperationObserver(PinOperationObserver* observer) = 0; virtual void AddUserActionObserver(UserActionObserver* observer) = 0; virtual void RemoveUserActionObserver(UserActionObserver* observer) = 0; // Return the active or default Ethernet network (or NULL if none). virtual const EthernetNetwork* ethernet_network() const = 0; virtual bool ethernet_connecting() const = 0; virtual bool ethernet_connected() const = 0; // Return the active Wifi network (or NULL if none active). virtual const WifiNetwork* wifi_network() const = 0; virtual bool wifi_connecting() const = 0; virtual bool wifi_connected() const = 0; // Return the active Cellular network (or NULL if none active). virtual const CellularNetwork* cellular_network() const = 0; virtual bool cellular_connecting() const = 0; virtual bool cellular_connected() const = 0; // Return the active virtual network (or NULL if none active). virtual const VirtualNetwork* virtual_network() const = 0; virtual bool virtual_network_connecting() const = 0; virtual bool virtual_network_connected() const = 0; // Return true if any network is currently connected. virtual bool Connected() const = 0; // Return true if any network is currently connecting. virtual bool Connecting() const = 0; // Returns the current IP address if connected. If not, returns empty string. virtual const std::string& IPAddress() const = 0; // Returns the current list of wifi networks. virtual const WifiNetworkVector& wifi_networks() const = 0; // Returns the list of remembered wifi networks. virtual const WifiNetworkVector& remembered_wifi_networks() const = 0; // Returns the current list of cellular networks. virtual const CellularNetworkVector& cellular_networks() const = 0; // Returns the current list of virtual networks. virtual const VirtualNetworkVector& virtual_networks() const = 0; // Return a pointer to the device, if it exists, or NULL. virtual const NetworkDevice* FindNetworkDeviceByPath( const std::string& path) const = 0; // Returns device with TYPE_CELLULAR. Returns NULL if none exists. virtual const NetworkDevice* FindCellularDevice() const = 0; // Returns device with TYPE_ETHERNET. Returns NULL if none exists. virtual const NetworkDevice* FindEthernetDevice() const = 0; // Returns device with TYPE_WIFI. Returns NULL if none exists. virtual const NetworkDevice* FindWifiDevice() const = 0; // Return a pointer to the network, if it exists, or NULL. // NOTE: Never store these results, store service paths instead. // The pattern for doing an operation on a Network is: // Network* network = cros->FindNetworkByPath(service_path); // network->SetFoo(); // network->Connect(); // As long as this is done in sequence on the UI thread it will be safe; // the network list only gets updated on the UI thread. virtual Network* FindNetworkByPath(const std::string& path) const = 0; virtual WifiNetwork* FindWifiNetworkByPath(const std::string& path) const = 0; virtual CellularNetwork* FindCellularNetworkByPath( const std::string& path) const = 0; virtual VirtualNetwork* FindVirtualNetworkByPath( const std::string& path) const = 0; // Returns the visible wifi network corresponding to the remembered // wifi network, or NULL if the remembered network is not visible. virtual Network* FindNetworkFromRemembered( const Network* remembered) const = 0; // Retrieves the data plans associated with |path|, NULL if there are no // associated plans. virtual const CellularDataPlanVector* GetDataPlans( const std::string& path) const = 0; // This returns the significant data plan. If the user only has the // base data plan, then return that. If there is a base and a paid data plan, // then the significant one is the paid one. So return the paid plan. // If there are no data plans, then this method returns NULL. // This returns a pointer to a member of data_plans_, so if SetDataPlans() // gets called, the result becomes invalid. virtual const CellularDataPlan* GetSignificantDataPlan( const std::string& path) const = 0; // Passes |old_pin|, |new_pin| to change SIM card PIM. virtual void ChangePin(const std::string& old_pin, const std::string& new_pin) = 0; // Passes |pin|, |require_pin| value to change SIM card RequirePin setting. virtual void ChangeRequirePin(bool require_pin, const std::string& pin) = 0; // Passes |pin| to unlock SIM card. virtual void EnterPin(const std::string& pin) = 0; // Passes |puk|, |new_pin| to unblock SIM card. virtual void UnblockPin(const std::string& puk, const std::string& new_pin) = 0; // Request a scan for available cellular networks. virtual void RequestCellularScan() = 0; // Request a register in cellular network with |network_id|. virtual void RequestCellularRegister(const std::string& network_id) = 0; // Change data roaming restriction for current cellular device. virtual void SetCellularDataRoamingAllowed(bool new_value) = 0; // Request a scan for new wifi networks. virtual void RequestNetworkScan() = 0; // Reads out the results of the last wifi scan. These results are not // pre-cached in the library, so the call may block whilst the results are // read over IPC. // Returns false if an error occurred in reading the results. Note that // a true return code only indicates the result set was successfully read, // it does not imply a scan has successfully completed yet. virtual bool GetWifiAccessPoints(WifiAccessPointVector* result) = 0; // TODO(joth): Add GetCellTowers to retrieve a CellTowerVector. // Connect to the specified wireless network. virtual void ConnectToWifiNetwork(WifiNetwork* network) = 0; // Same as above but searches for an existing network by name. virtual void ConnectToWifiNetwork(const std::string& service_path) = 0; // Connect to the specified network with security, ssid, passphrase, identity, // and (optionally) certpath. virtual void ConnectToWifiNetwork(ConnectionSecurity security, const std::string& ssid, const std::string& passphrase, const std::string& identity, const std::string& certpath) = 0; // Connect to the specified cellular network. virtual void ConnectToCellularNetwork(CellularNetwork* network) = 0; // Records information that cellular play payment had happened. virtual void SignalCellularPlanPayment() = 0; // Returns true if cellular plan payment had been recorded recently. virtual bool HasRecentCellularPlanPayment() = 0; // Connect to the specified virtual network. virtual void ConnectToVirtualNetwork(VirtualNetwork* network) = 0; // Connect to the specified virtual network with service name, // server hostname, provider_type, PSK passphrase, username and passphrase. virtual void ConnectToVirtualNetworkPSK( const std::string& service_name, const std::string& server_hostname, const std::string& psk, const std::string& username, const std::string& user_passphrase) = 0; // Disconnect from the specified network. virtual void DisconnectFromNetwork(const Network* network) = 0; // Forget the wifi network corresponding to service_path. virtual void ForgetWifiNetwork(const std::string& service_path) = 0; // Returns home carrier ID if available, otherwise empty string is returned. // Carrier ID format: <carrier name> (country). Ex.: "Verizon (us)". virtual std::string GetCellularHomeCarrierId() const = 0; virtual bool ethernet_available() const = 0; virtual bool wifi_available() const = 0; virtual bool cellular_available() const = 0; virtual bool ethernet_enabled() const = 0; virtual bool wifi_enabled() const = 0; virtual bool cellular_enabled() const = 0; virtual bool wifi_scanning() const = 0; virtual const Network* active_network() const = 0; virtual const Network* connected_network() const = 0; virtual bool offline_mode() const = 0; // Enables/disables the ethernet network device. virtual void EnableEthernetNetworkDevice(bool enable) = 0; // Enables/disables the wifi network device. virtual void EnableWifiNetworkDevice(bool enable) = 0; // Enables/disables the cellular network device. virtual void EnableCellularNetworkDevice(bool enable) = 0; // Enables/disables offline mode. virtual void EnableOfflineMode(bool enable) = 0; // Fetches IP configs and hardware address for a given device_path. // The hardware address is usually a MAC address like "0011AA22BB33". // |hardware_address| will be an empty string, if no hardware address is // found. virtual NetworkIPConfigVector GetIPConfigs( const std::string& device_path, std::string* hardware_address, HardwareAddressFormat) = 0; // Factory function, creates a new instance and returns ownership. // For normal usage, access the singleton via CrosLibrary::Get(). static NetworkLibrary* GetImpl(bool stub); }; } // namespace chromeos #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_
1.125
1
MitnalPkg/OAuth.c
CyberFlameGO/mitnal
461
7996723
#include "Common.h" #include "hmac/hmac.h" #include <Library/BaseLib.h> #include <Library/PrintLib.h> #include <Protocol/Timestamp.h> #include <Uefi.h> #include "Secrets" // fake value static const CHAR8 *gNonce = "JtB6znKJNVo"; static const UINT64 gTimestamp = 1643528823; EFI_STATUS HmacSha1(IN CHAR8 *Key, IN CHAR8 *Data, OUT CHAR8 *Result, OUT UINTN *ResultSize) { UINTN DigestSize; CHAR8 ResultRaw[256]; hmac_sha1((UINT8 *)Key, AsciiStrLen(Key), (UINT8 *)Data, AsciiStrLen(Data), (UINT8 *)ResultRaw, (size_t *)&DigestSize); Base64Encode((UINT8 *)ResultRaw, DigestSize, Result, ResultSize); return EFI_SUCCESS; } EFI_STATUS GenerateSignature(IN CHAR8 *Method, IN CHAR8 *Url, IN CHAR8 *Query, OUT CHAR8 *Signature, IN UINTN SignatureSize) { CHAR8 Key[256]; CHAR8 Base[1024]; CHAR8 UrlEnc[256]; CHAR8 Param[1024]; CHAR8 ParamEnc[1024]; AsciiSPrint(Key, sizeof(Key), "%a&%a", gConsumerSecret, gAccessTokenSecret); if (Query == NULL) { AsciiSPrint( Param, sizeof(Param), "oauth_consumer_key=%a&oauth_nonce=%a&oauth_signature_method=HMAC-SHA1&oauth_timestamp=%d&oauth_token=%a&oauth_version=1.0", gConsumerKey, gNonce, gTimestamp, gAccessToken); } else { AsciiSPrint( Param, sizeof(Param), "oauth_consumer_key=%a&oauth_nonce=%a&oauth_signature_method=HMAC-SHA1&oauth_timestamp=%d&oauth_token=%a&oauth_version=1.0&%a", gConsumerKey, gNonce, gTimestamp, gAccessToken, Query); } UrlEncode(Url, UrlEnc); UrlEncode(Param, ParamEnc); AsciiSPrint(Base, sizeof(Base), "%a&%a&%a", Method, UrlEnc, ParamEnc); HmacSha1(Key, Base, Signature, &SignatureSize); return EFI_SUCCESS; } EFI_STATUS GenerateOAuthHeader(IN CHAR8 *Method, IN CHAR8 *Url, IN CHAR8 *Query, OUT CHAR8 *Buffer, IN UINTN BufferSize) { EFI_STATUS Status; CHAR8 Signature[256]; CHAR8 SignatureEnc[256]; Status = GenerateSignature(Method, Url, Query, Signature, sizeof(Signature)); HANDLE_ERROR(Status) UrlEncode(Signature, SignatureEnc); AsciiSPrint( Buffer, BufferSize, "OAuth oauth_consumer_key=\"%a\", oauth_nonce=\"%a\", oauth_signature=\"%a\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"%d\", oauth_token=\"%a\", oauth_version=\"1.0\"", gConsumerKey, gNonce, SignatureEnc, gTimestamp, gAccessToken); return EFI_SUCCESS; }
1.460938
1
components/exo/display.h
Ron423c/chromium
575
7996731
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_EXO_DISPLAY_H_ #define COMPONENTS_EXO_DISPLAY_H_ #include <stddef.h> #include <memory> #include <string> #include "base/macros.h" #include "base/memory/unsafe_shared_memory_region.h" #include "build/chromeos_buildflags.h" #include "components/exo/seat.h" #if defined(USE_OZONE) #include "base/files/scoped_file.h" #include "ui/gfx/buffer_types.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/native_pixmap_handle.h" #endif namespace gfx { class ClientNativePixmapFactory; } namespace exo { class ClientControlledShellSurface; class DataDevice; class DataDeviceDelegate; class DataExchangeDelegate; class InputMethodSurfaceManager; class NotificationSurface; class NotificationSurfaceManager; class SharedMemory; class SubSurface; class Surface; #if BUILDFLAG(IS_CHROMEOS_ASH) class InputMethodSurface; class ShellSurface; class ToastSurface; class ToastSurfaceManager; class XdgShellSurface; #endif #if defined(USE_OZONE) class Buffer; #endif // The core display class. This class provides functions for creating surfaces // and is in charge of combining the contents of multiple surfaces into one // displayable output. class Display { public: Display(); #if BUILDFLAG(IS_CHROMEOS_ASH) Display( std::unique_ptr<NotificationSurfaceManager> notification_surface_manager, std::unique_ptr<InputMethodSurfaceManager> input_method_surface_manager, std::unique_ptr<ToastSurfaceManager> toast_surface_manager, std::unique_ptr<DataExchangeDelegate> data_exchange_delegate); #endif // BUILDFLAG(IS_CHROMEOS_ASH) ~Display(); void Shutdown(); // Creates a new surface. std::unique_ptr<Surface> CreateSurface(); // Creates a shared memory segment from |shared_memory_region|. This function // takes ownership of the region. std::unique_ptr<SharedMemory> CreateSharedMemory( base::UnsafeSharedMemoryRegion shared_memory_region); #if defined(USE_OZONE) // Creates a buffer for a Linux DMA-buf file descriptor. std::unique_ptr<Buffer> CreateLinuxDMABufBuffer( const gfx::Size& size, gfx::BufferFormat format, gfx::NativePixmapHandle handle, bool y_invert); #endif // defined(USE_OZONE) #if BUILDFLAG(IS_CHROMEOS_ASH) // Creates a shell surface for an existing surface. std::unique_ptr<ShellSurface> CreateShellSurface(Surface* surface); // Creates a xdg shell surface for an existing surface. std::unique_ptr<XdgShellSurface> CreateXdgShellSurface(Surface* surface); // Creates a remote shell surface for an existing surface using |container|. std::unique_ptr<ClientControlledShellSurface> CreateClientControlledShellSurface(Surface* surface, int container, double default_device_scale_factor, bool default_scale_cancellation); // Creates a notification surface for a surface and notification id. std::unique_ptr<NotificationSurface> CreateNotificationSurface( Surface* surface, const std::string& notification_key); // Creates a input method surface for a surface. std::unique_ptr<InputMethodSurface> CreateInputMethodSurface( Surface* surface, double default_device_scale_factor, bool default_scale_cancellation); // Creates a toast surface for a surface. std::unique_ptr<ToastSurface> CreateToastSurface( Surface* surface, double default_device_scale_factor, bool default_scale_cancellation); #endif // BUILDFLAG(IS_CHROMEOS_ASH) // Creates a sub-surface for an existing surface. The sub-surface will be // a child of |parent|. std::unique_ptr<SubSurface> CreateSubSurface(Surface* surface, Surface* parent); // Creates a data device for a |delegate|. std::unique_ptr<DataDevice> CreateDataDevice(DataDeviceDelegate* delegate); // Obtains seat instance. Seat* seat() { return &seat_; } #if BUILDFLAG(IS_CHROMEOS_ASH) InputMethodSurfaceManager* input_method_surface_manager() { return input_method_surface_manager_.get(); } #endif private: #if BUILDFLAG(IS_CHROMEOS_ASH) std::unique_ptr<NotificationSurfaceManager> notification_surface_manager_; std::unique_ptr<InputMethodSurfaceManager> input_method_surface_manager_; std::unique_ptr<ToastSurfaceManager> toast_surface_manager_; #endif // BUILDFLAG(IS_CHROMEOS_ASH) Seat seat_; bool shutdown_ = false; #if defined(USE_OZONE) std::unique_ptr<gfx::ClientNativePixmapFactory> client_native_pixmap_factory_; #endif // defined(USE_OZONE) DISALLOW_COPY_AND_ASSIGN(Display); }; } // namespace exo #endif // COMPONENTS_EXO_DISPLAY_H_
1.242188
1
linux/drivers/staging/ft1000/ft1000-pcmcia/boot.h
bradchesney79/illacceptanything
3
7996739
/*--------------------------------------------------------------------------- FT1000 driver for Flarion Flash OFDM NIC Device Copyright (C) 2002 Flarion Technologies, All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --------------------------------------------------------------------------- File: boot.h Description: boatloader History: 1/11/05 Whc Ported to Linux. ---------------------------------------------------------------------------*/ #ifndef _BOOTH_ #define _BOOTH_ /* Official bootloader */ static unsigned char bootimage[] = { 0x00, 0x00, 0x01, 0x5E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xD7, 0x00, 0x00, 0x01, 0x5E, 0x46, 0xB3, 0xE6, 0x02, 0x00, 0x98, 0xE6, 0x8C, 0x00, 0x98, 0xFB, 0x92, 0xFF, 0xFF, 0x98, 0xFB, 0x94, 0xFF, 0xFF, 0x98, 0xFB, 0x06, 0x08, 0x00, 0x98, 0xFB, 0x96, 0x84, 0x00, 0x98, 0xFB, 0x08, 0x1C, 0x00, 0x98, 0xFB, 0x51, 0x25, 0x10, 0x1C, 0x00, 0xE6, 0x51, 0x01, 0x07, 0xFD, 0x4C, 0xFF, 0x20, 0xF5, 0x51, 0x02, 0x20, 0x08, 0x00, 0x4C, 0xFF, 0x20, 0x3C, 0x00, 0xC0, 0x64, 0x98, 0xC0, 0x66, 0x98, 0xC0, 0x68, 0x98, 0xC0, 0x6A, 0x98, 0xC0, 0x6C, 0x98, 0x90, 0x08, 0x90, 0x09, 0x90, 0x0A, 0x90, 0x0B, 0x90, 0x0C, 0x90, 0x0D, 0x90, 0x0E, 0x90, 0x0F, 0x90, 0x04, 0x90, 0x06, 0xFB, 0x51, 0x22, 0x16, 0x08, 0x03, 0xFB, 0x51, 0x52, 0x16, 0x08, 0x04, 0xFB, 0x51, 0x24, 0x2B, 0x08, 0x06, 0xFB, 0x51, 0x54, 0x2B, 0x08, 0x07, 0xFB, 0x51, 0x24, 0x2B, 0x08, 0x09, 0xFB, 0x51, 0x54, 0x2B, 0x08, 0x0A, 0xFB, 0x51, 0x12, 0x16, 0x08, 0x0C, 0xFB, 0x51, 0x52, 0x16, 0x08, 0x0D, 0x78, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0xEC, 0x31, 0xAE, 0x00, 0x00, 0x81, 0x4C, 0x0F, 0xE6, 0x43, 0xFF, 0xEC, 0x31, 0x4E, 0x00, 0x00, 0x91, 0xEC, 0x31, 0xAE, 0x00, 0x00, 0x91, 0x4C, 0x0F, 0xE6, 0x43, 0xFF, 0xEC, 0x31, 0x5E, 0x00, 0x00, 0xA1, 0xEB, 0x31, 0x08, 0x00, 0x00, 0xA6, 0xEB, 0x31, 0x08, 0x00, 0x00, 0xAC, 0x3C, 0x00, 0xEB, 0x31, 0x08, 0x00, 0x00, 0xA8, 0x76, 0xFE, 0xFE, 0x08, 0xEB, 0x31, 0x08, 0x20, 0x00, 0x00, 0x76, 0xFF, 0xFF, 0x18, 0xED, 0x31, 0x08, 0x20, 0x00, 0x00, 0x26, 0x10, 0x04, 0x10, 0xF5, 0x3C, 0x01, 0x3C, 0x00, 0x08, 0x01, 0x12, 0x3C, 0x11, 0x3C, 0x00, 0x08, 0x01, 0x0B, 0x08, 0x00, 0x6D, 0xEC, 0x31, 0xAE, 0x20, 0x00, 0x06, 0xED, 0x4D, 0x08, 0x00, 0x00, 0x67, 0x80, 0x6F, 0x00, 0x01, 0x0B, 0x6F, 0x00, 0x02, 0x2E, 0x76, 0xEE, 0x01, 0x48, 0x06, 0x01, 0x39, 0xED, 0x4D, 0x18, 0x00, 0x02, 0xED, 0x4D, 0x08, 0x00, 0x04, 0x14, 0x06, 0xA4, 0xED, 0x31, 0x22, 0x00, 0x00, 0xAC, 0x76, 0xEE, 0x07, 0x48, 0x6D, 0x22, 0x01, 0x1E, 0x08, 0x01, 0x58, 0xEB, 0x31, 0x08, 0x00, 0x00, 0xAC, 0x06, 0xFF, 0xBA, 0x3C, 0x00, 0xEB, 0x31, 0x08, 0x20, 0x00, 0x04, 0x3C, 0x30, 0xEB, 0x31, 0x08, 0x20, 0x00, 0x02, 0x3C, 0x10, 0xEB, 0x31, 0x08, 0x20, 0x00, 0x00, 0xED, 0x31, 0x08, 0x20, 0x00, 0x00, 0x04, 0x10, 0xF7, 0xED, 0x31, 0x08, 0x00, 0x00, 0xA2, 0x91, 0x00, 0x9C, 0x3C, 0x80, 0xEB, 0x31, 0x08, 0x20, 0x00, 0x04, 0x3C, 0x20, 0xEB, 0x31, 0x08, 0x20, 0x00, 0x02, 0x3C, 0x10, 0xEB, 0x31, 0x08, 0x20, 0x00, 0x00, 0xED, 0x31, 0x08, 0x20, 0x00, 0x00, 0x04, 0x10, 0xF7, 0xED, 0x31, 0x08, 0x20, 0x00, 0x04, 0x42, 0x10, 0x90, 0x08, 0xEC, 0x31, 0xAE, 0x20, 0x00, 0x06, 0xA4, 0x41, 0x08, 0x00, 0xB6, 0xED, 0x41, 0x28, 0x7D, 0xFF, 0xFF, 0x22, 0xB3, 0x40, 0x98, 0x2A, 0x32, 0xEB, 0x41, 0x28, 0xB4, 0x43, 0xFC, 0x05, 0xFF, 0xE6, 0xA0, 0x31, 0x20, 0x00, 0x06, 0xEB, 0x31, 0x08, 0x20, 0x00, 0x04, 0x3C, 0x20, 0xEB, 0x31, 0x08, 0x20, 0x00, 0x02, 0x3C, 0x10, 0xEB, 0x31, 0x08, 0x20, 0x00, 0x00, 0xED, 0x31, 0x08, 0x20, 0x00, 0x00, 0x04, 0x10, 0xF7, 0xED, 0x31, 0x08, 0x20, 0x00, 0x04, 0x42, 0x10, 0x90, 0x08, 0xEC, 0x31, 0xAE, 0x20, 0x00, 0x06, 0xA4, 0x41, 0x08, 0x00, 0x68, 0xED, 0x41, 0x28, 0x7D, 0xFF, 0xFF, 0x22, 0xB3, 0x40, 0x98, 0x2A, 0x32, 0xEB, 0x41, 0x28, 0xB4, 0x43, 0xFC, 0x05, 0xFF, 0xE6, 0x48, 0x04, 0xEB, 0x31, 0x08, 0x20, 0x00, 0x04, 0xEB, 0x31, 0x18, 0x20, 0x00, 0x02, 0x3C, 0x11, 0xEB, 0x31, 0x18, 0x20, 0x00, 0x00, 0xED, 0x31, 0x08, 0x20, 0x00, 0x00, 0x04, 0x10, 0xF7, 0xED, 0x31, 0x08, 0x20, 0x00, 0x02, 0x66, 0x00, 0x6F, 0x00, 0x01, 0x16, 0x76, 0xEE, 0x06, 0x48, 0x4A, 0x1E, 0x48, 0x04, 0xED, 0x31, 0x08, 0x20, 0x00, 0x04, 0xEB, 0x31, 0x08, 0x00, 0x00, 0xA4, 0x48, 0x04, 0xED, 0x31, 0x08, 0x20, 0x00, 0x04, 0xEB, 0x31, 0x08, 0x00, 0x00, 0xA2, 0x48, 0x04, 0x20, 0x20, 0x4A, 0x7C, 0x46, 0x82, 0x50, 0x05, 0x50, 0x15, 0xB5, 0x1E, 0x98, 0xED, 0x31, 0x08, 0x00, 0x00, 0xA8, 0x10, 0x47, 0x3B, 0x2C, 0x01, 0xDB, 0x40, 0x11, 0x98, 0xC1, 0x1E, 0x98, 0x10, 0x07, 0x30, 0xF9, 0x40, 0x07, 0x18, 0x98, 0x2A, 0x10, 0xEB, 0x31, 0x08, 0x00, 0x00, 0xA8, 0xA4, 0x1E, 0x98, 0xBB, 0x1E, 0x98, 0x50, 0x14, 0x50, 0x04, 0x46, 0x83, 0x48, 0x04, 0x02, 0x01, 0x00, 0x50, 0x05, 0x50, 0x15, 0x10, 0x87, 0x3F, 0x90, 0x2B, 0x18, 0x01, 0x00, 0xC0, 0x31, 0x00, 0x00, 0xAE, 0xDF, 0x41, 0x00, 0x08, 0x00, 0x1A, 0x42, 0x11, 0x67, 0x01, 0xDF, 0x41, 0x02, 0x08, 0x00, 0x10, 0x42, 0x11, 0x62, 0x01, 0xB4, 0x43, 0x4A, 0x68, 0x50, 0x14, 0x50, 0x04, 0x24, 0x10, 0x48, 0x04, 0xF2, 0x31, 0x00, 0x01, 0x00, 0x00, 0xAE, 0xF6, 0x31, 0x00, 0x01, 0x00, 0x00, 0xAE, 0x62, 0xE4, 0xE5, 0x61, 0x04, 0x48, 0x04, 0xE5, 0x63, 0x05, 0x48, 0x04, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00 }; #endif
1.203125
1
src/flame/linear.h
PierreSchnizer/FLAME
0
7996747
#ifndef FLAME_LINEAR_H #define FLAME_LINEAR_H #include <ostream> #include <math.h> #include <boost/numeric/ublas/vector.hpp> #include <boost/numeric/ublas/matrix.hpp> #include <boost/numeric/ublas/io.hpp> #include "base.h" /** @brief An Element based on a simple Transfer matrix * * @f$ state = transfer * state @f$ * @tparam one of VectorState or MatrixState */ template<typename State> struct LinearElementBase : public ElementVoid { typedef State state_t; LinearElementBase(const Config& c) :ElementVoid(c) ,transfer(boost::numeric::ublas::identity_matrix<double>(state_t::maxsize)) {} virtual ~LinearElementBase() {} virtual void advance(StateBase& s) override { State& ST = static_cast<State&>(s); advanceT(ST); } virtual void show(std::ostream& strm, int level) const override { ElementVoid::show(strm, level); strm<<"Transfer: "<<transfer<<"\n"; } typedef boost::numeric::ublas::matrix<double> value_t; value_t transfer; //!< The transfer matrix virtual void assign(const ElementVoid *other) override { const LinearElementBase *O = static_cast<const LinearElementBase*>(other); transfer = O->transfer; ElementVoid::assign(other); } private: void advanceT(State& s) { using boost::numeric::ublas::prod; s.pos += length; s.state = prod(transfer, s.state); } }; #endif // FLAME_LINEAR_H
2.03125
2
GameCenterExploit/Headers/CKXPCShareDaemon.h
eblair2/ios0day-poc
2
7996755
@protocol CKXPCShareDaemon <NSObject> @required - (void)handleCloudKitShareMetadata:(CKShareMetadata *)arg1 completionHandler:(void (^)(NSError *))arg2; @optional - (oneway void)willAcceptShareAtURL:(NSURL *)arg1; @end
0.298828
0
src/charset/encodings/utf8impl.h
zaucy/libparserutils
665
7996763
/* * This file is part of LibParserUtils. * Licensed under the MIT License, * http://www.opensource.org/licenses/mit-license.php * Copyright 2007 <NAME> <<EMAIL>> */ #ifndef parserutils_charset_encodings_utf8impl_h_ #define parserutils_charset_encodings_utf8impl_h_ /** \file * UTF-8 manipulation macros (implementation). */ #include <stdbool.h> #include <stdlib.h> #include <string.h> /** Number of continuation bytes for a given start byte */ extern const uint8_t numContinuations[256]; /** * Convert a UTF-8 multibyte sequence into a single UCS-4 character * * Encoding of UCS values outside the UTF-16 plane has been removed from * RFC3629. This macro conforms to RFC2279, however. * * \param s The sequence to process * \param len Length of sequence * \param ucs4 Pointer to location to receive UCS-4 character (host endian) * \param clen Pointer to location to receive byte length of UTF-8 sequence * \param error Location to receive error code */ #define UTF8_TO_UCS4(s, len, ucs4, clen, error) \ do { \ uint32_t c, min; \ uint8_t n; \ uint8_t i; \ \ error = PARSERUTILS_OK; \ \ if (s == NULL || ucs4 == NULL || clen == NULL) { \ error = PARSERUTILS_BADPARM; \ break; \ } \ \ if (len == 0) { \ error = PARSERUTILS_NEEDDATA; \ break; \ } \ \ c = s[0]; \ \ if (c < 0x80) { \ n = 1; \ min = 0; \ } else if ((c & 0xE0) == 0xC0) { \ c &= 0x1F; \ n = 2; \ min = 0x80; \ } else if ((c & 0xF0) == 0xE0) { \ c &= 0x0F; \ n = 3; \ min = 0x800; \ } else if ((c & 0xF8) == 0xF0) { \ c &= 0x07; \ n = 4; \ min = 0x10000; \ } else if ((c & 0xFC) == 0xF8) { \ c &= 0x03; \ n = 5; \ min = 0x200000; \ } else if ((c & 0xFE) == 0xFC) { \ c &= 0x01; \ n = 6; \ min = 0x4000000; \ } else { \ error = PARSERUTILS_INVALID; \ break; \ } \ \ if (len < n) { \ error = PARSERUTILS_NEEDDATA; \ break; \ } \ \ for (i = 1; i < n; i++) { \ uint32_t t = s[i]; \ \ if ((t & 0xC0) != 0x80) { \ error = PARSERUTILS_INVALID; \ break; \ } \ \ c <<= 6; \ c |= t & 0x3F; \ } \ \ if (error == PARSERUTILS_OK) { \ /* Detect overlong sequences, surrogates and fffe/ffff */ \ if (c < min || (c >= 0xD800 && c <= 0xDFFF) || \ c == 0xFFFE || c == 0xFFFF) { \ error = PARSERUTILS_INVALID; \ break; \ } \ \ *ucs4 = c; \ *clen = n; \ } \ } while(0) /** * Convert a single UCS-4 character into a UTF-8 multibyte sequence * * Encoding of UCS values outside the UTF-16 plane has been removed from * RFC3629. This macro conforms to RFC2279, however. * * \param ucs4 The character to process (0 <= c <= 0x7FFFFFFF) (host endian) * \param s Pointer to pointer to output buffer, updated on exit * \param len Pointer to length, in bytes, of output buffer, updated on exit * \param error Location to receive error code */ #define UTF8_FROM_UCS4(ucs4, s, len, error) \ do { \ uint8_t *buf; \ uint8_t l = 0; \ \ error = PARSERUTILS_OK; \ \ if (s == NULL || *s == NULL || len == NULL) { \ error = PARSERUTILS_BADPARM; \ break; \ } \ \ if (ucs4 < 0x80) { \ l = 1; \ } else if (ucs4 < 0x800) { \ l = 2; \ } else if (ucs4 < 0x10000) { \ l = 3; \ } else if (ucs4 < 0x200000) { \ l = 4; \ } else if (ucs4 < 0x4000000) { \ l = 5; \ } else if (ucs4 <= 0x7FFFFFFF) { \ l = 6; \ } else { \ error = PARSERUTILS_INVALID; \ break; \ } \ \ if (l > *len) { \ error = PARSERUTILS_NOMEM; \ break; \ } \ \ buf = *s; \ \ if (l == 1) { \ buf[0] = (uint8_t) ucs4; \ } else { \ uint8_t i; \ for (i = l; i > 1; i--) { \ buf[i - 1] = 0x80 | (ucs4 & 0x3F); \ ucs4 >>= 6; \ } \ buf[0] = ~((1 << (8 - l)) - 1) | ucs4; \ } \ \ *s += l; \ *len -= l; \ } while(0) /** * Calculate the length (in characters) of a bounded UTF-8 string * * \param s The string * \param max Maximum length * \param len Pointer to location to receive length of string * \param error Location to receive error code */ #define UTF8_LENGTH(s, max, len, error) \ do { \ const uint8_t *end = s + max; \ int l = 0; \ \ error = PARSERUTILS_OK; \ \ if (s == NULL || len == NULL) { \ error = PARSERUTILS_BADPARM; \ break; \ } \ \ while (s < end) { \ uint32_t c = s[0]; \ \ if ((c & 0x80) == 0x00) \ s += 1; \ else if ((c & 0xE0) == 0xC0) \ s += 2; \ else if ((c & 0xF0) == 0xE0) \ s += 3; \ else if ((c & 0xF8) == 0xF0) \ s += 4; \ else if ((c & 0xFC) == 0xF8) \ s += 5; \ else if ((c & 0xFE) == 0xFC) \ s += 6; \ else { \ error = PARSERUTILS_INVALID; \ break; \ } \ \ l++; \ } \ \ if (error == PARSERUTILS_OK) \ *len = l; \ } while(0) /** * Calculate the length (in bytes) of a UTF-8 character * * \param s Pointer to start of character * \param len Pointer to location to receive length * \param error Location to receive error code */ #define UTF8_CHAR_BYTE_LENGTH(s, len, error) \ do { \ if (s == NULL || len == NULL) { \ error = PARSERUTILS_BADPARM; \ break; \ } \ \ *len = numContinuations[s[0]] + 1 /* Start byte */; \ \ error = PARSERUTILS_OK; \ } while(0) /** * Find previous legal UTF-8 char in string * * \param s The string * \param off Offset in the string to start at * \param prevoff Pointer to location to receive offset of first byte of * previous legal character * \param error Location to receive error code */ #define UTF8_PREV(s, off, prevoff, error) \ do { \ if (s == NULL || prevoff == NULL) { \ error = PARSERUTILS_BADPARM; \ break; \ } \ \ while (off != 0 && (s[--off] & 0xC0) == 0x80) \ /* do nothing */; \ \ *prevoff = off; \ \ error = PARSERUTILS_OK; \ } while(0) /** * Find next legal UTF-8 char in string * * \param s The string (assumed valid) * \param len Maximum offset in string * \param off Offset in the string to start at * \param nextoff Pointer to location to receive offset of first byte of * next legal character * \param error Location to receive error code */ #define UTF8_NEXT(s, len, off, nextoff, error) \ do { \ if (s == NULL || off >= len || nextoff == NULL) { \ error = PARSERUTILS_BADPARM; \ break; \ } \ \ /* Skip current start byte (if present - may be mid-sequence) */\ if (s[off] < 0x80 || (s[off] & 0xC0) == 0xC0) \ off++; \ \ while (off < len && (s[off] & 0xC0) == 0x80) \ off++; \ \ *nextoff = off; \ \ error = PARSERUTILS_OK; \ } while(0) /** * Skip to start of next sequence in UTF-8 input * * \param s The string (assumed to be of dubious validity) * \param len Maximum offset in string * \param off Offset in the string to start at * \param nextoff Pointer to location to receive offset of first byte of * next legal character * \param error Location to receive error code */ #define UTF8_NEXT_PARANOID(s, len, off, nextoff, error) \ do { \ uint8_t c; \ \ error = PARSERUTILS_OK; \ \ if (s == NULL || off >= len || nextoff == NULL) { \ error = PARSERUTILS_BADPARM; \ break; \ } \ \ c = s[off]; \ \ /* If we're mid-sequence, simply advance to next byte */ \ if (!(c < 0x80 || (c & 0xC0) == 0xC0)) { \ off++; \ } else { \ uint32_t nCont = numContinuations[c]; \ uint32_t nToSkip; \ \ if (off + nCont + 1 >= len) { \ error = PARSERUTILS_NEEDDATA; \ break; \ } \ \ /* Verify continuation bytes */ \ for (nToSkip = 1; nToSkip <= nCont; nToSkip++) { \ if ((s[off + nToSkip] & 0xC0) != 0x80) \ break; \ } \ \ /* Skip over the valid bytes */ \ off += nToSkip; \ } \ \ *nextoff = off; \ } while(0) #endif
1.851563
2
rtos/mbed-os/features/nanostack/sal-stack-nanostack/nanostack/ws_management_api.h
knmcguire/gap_sdk
3
7996771
/* * Copyright (c) 2018-2019, Arm Limited and affiliates. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * \file ws_management_if.h * \brief Wi-SUN management interface. * * This interface is used for configuring Wi-SUN devices. * After creating the Wi-SUN interface, you can use this interface to configure the Wi-SUN device * behaviour. When you are done with the configurations, you need to call interface up to enable a Wi-SUN node. * */ #ifndef WS_MANAGEMENT_API_H_ #define WS_MANAGEMENT_API_H_ #include "ns_types.h" #include "net_interface.h" /* Declaration for channel_list_s. */ #ifdef __cplusplus extern "C" { #endif /* Regulatory domain values*/ #define REG_DOMAIN_WW 0x00 // World wide #define REG_DOMAIN_NA 0x01 // North America #define REG_DOMAIN_JP 0x02 // Japan #define REG_DOMAIN_EU 0x03 // European Union #define REG_DOMAIN_CH 0x04 // China #define REG_DOMAIN_IN 0x05 // India #define REG_DOMAIN_MX 0x06 // #define REG_DOMAIN_BZ 0x07 // Brazil #define REG_DOMAIN_AZ 0x08 // Australia #define REG_DOMAIN_NZ 0x08 // New zealand #define REG_DOMAIN_KR 0x09 // Korea #define REG_DOMAIN_PH 0x0A // #define REG_DOMAIN_MY 0x0B // #define REG_DOMAIN_HK 0x0C // #define REG_DOMAIN_SG 0x0D // band 866-869 #define REG_DOMAIN_TH 0x0E // #define REG_DOMAIN_VN 0x0F // #define REG_DOMAIN_SG_H 0x10 // band 920-925 #define OPERATING_MODE_1a 0x1a #define OPERATING_MODE_1b 0x1b #define OPERATING_MODE_2a 0x2a #define OPERATING_MODE_2b 0x2b #define OPERATING_MODE_3 0x03 #define OPERATING_MODE_4a 0x4a #define OPERATING_MODE_4b 0x4b #define OPERATING_MODE_5 0x05 #define CHANNEL_FUNCTION_FIXED 0x00 // Fixed channel #define CHANNEL_FUNCTION_TR51CF 0x01 // TR51CF #define CHANNEL_FUNCTION_DH1CF 0x02 // Direct Hash #define CHANNEL_FUNCTION_VENDOR_DEFINED 0x03 // vendor given channel hop schedule #define CHANNEL_SPACING_200 0x00 // 200 khz #define CHANNEL_SPACING_400 0x01 // 400 khz #define CHANNEL_SPACING_600 0x02 // 600 khz #define CHANNEL_SPACING_100 0x03 // 100 khz #define CHANNEL_SPACING_250 0x04 // 250 khz #define NETWORK_SIZE_AUTOMATIC 0x00 #define NETWORK_SIZE_SMALL 0x01 #define NETWORK_SIZE_LARGE 0x10 /** Temporary API change flag. this will be removed when new version of API is implemented on applications * */ #define WS_MANAGEMENT_API_VER_2 /** * Initialize Wi-SUN stack. * * Generates the default configuration for Wi-SUN operation * * \param interface_id Network interface ID. * \param regulatory_domain Mandatory regulatory domain value of the device. * \param network_name_ptr Network name where to join if no configuration found from storage. * \param fhss_timer_ptr FHSS functions for timer adaptation to platform. * * \return 0, Init OK. * \return <0 Init fail. */ int ws_management_node_init( int8_t interface_id, uint8_t regulatory_domain, char *network_name_ptr, fhss_timer_t *fhss_timer_ptr); /** * Configure regulatory domain of Wi-SUN stack. * * Change the default configuration for Wi-SUN PHY operation. * * Supported values: * Domain: "NA"(0x01), "KR"(0x09) * Operating class: (1), (2) * operation mode: "1b" (symbol rate 50, modulation index 1) * * if value of 255 is given then previous value is used. * * \param interface_id Network interface ID. * \param regulatory_domain FHSS regulatory domain default to "KR" 0x09. * \param operating_class FHSS operating class default to 1. * \param operating_mode FHSS phy operating mode default to "1b". * * \return 0, Init OK. * \return <0 Init fail. */ int ws_management_regulatory_domain_set( int8_t interface_id, uint8_t regulatory_domain, uint8_t operating_class, uint8_t operating_mode); /** * Set timing parameters related to network size. * * timing parameters follows the specification example from Wi-SUN specification * * Default value: automatic * small network size: hundreds of devices * Large network size: thousands of devices * automatic: when discovering the network network size is learned * from advertisements and timings adjusted accordingly * * \param interface_id Network interface ID. * \param network_size define from NETWORK_SIZE_*. * * \return 0, Init OK. * \return <0 Init fail. */ int ws_management_network_size_set( int8_t interface_id, uint8_t network_size); /** * Set channel mask for FHSS operation. * * Default value: all channels are allowed. * * \param interface_id Network interface ID. * \param channel_mask set bits matching the channel 1 to allow channel 0 to disallow. * * \return 0, Init OK. * \return <0 Init fail. */ int ws_management_channel_mask_set( int8_t interface_id, uint32_t channel_mask[8]); /** * Configure Application defined channel plan. * * Change the application defined channel plan. * This changes our channel plan that is reported to our children. * PHY driver must be configured to follow these settings to make the configuration active. * * * \param interface_id Network interface ID. * \param channel_plan Channel plan must be 1 application defined if deviating from regulatory domain (0). * \param uc_channel_function 0: Fixed channel, 1:TR51CF, 2: Direct Hash, 3: Vendor defined. * \param bc_channel_function 0: Fixed channel, 1:TR51CF, 2: Direct Hash, 3: Vendor defined. * \param ch0_freq ch0 center frequency. * \param channel_spacing Channel spacing value 0:200k, 1:400k, 2:600k, 3:100k. * \param number_of_channels FHSS phy operating mode default to "1b". * * \return 0, Init OK. * \return <0 Init fail. */ int ws_management_channel_plan_set( int8_t interface_id, uint8_t channel_plan, uint8_t uc_channel_function, uint8_t bc_channel_function, uint32_t ch0_freq, // Stack can not modify this uint8_t channel_spacing,// Stack can not modify this uint8_t number_of_channels);// Stack can not modify this /** * Configure timing values for FHSS. * * Change the default configuration for Wi-SUN FHSS operation. * * \param interface_id Network interface ID. * \param fhss_uc_dwell_interval default to 250 ms. * \param fhss_broadcast_interval default to 800 ms. * \param fhss_bc_dwell_interval default to 200 ms. * * \return 0, Init OK. * \return <0 Init fail. */ int ws_management_fhss_timing_configure( int8_t interface_id, uint8_t fhss_uc_dwell_interval, uint32_t fhss_broadcast_interval, uint8_t fhss_bc_dwell_interval); /** * Configure unicast channel function. * * Change the default configuration for Wi-SUN FHSS operation. * if application defined is used the behaviour is undefined * * \param interface_id Network interface ID. * \param channel_function Unicast channel function. * \param fixed_channel Used channel when channel function is fixed channel. If 0xFFFF, randomly chosen channel is used. * \param dwell_interval Used dwell interval when channel function is TR51 or DH1. * * \return 0, Init OK. * \return <0 Init fail. */ int ws_management_fhss_unicast_channel_function_configure( int8_t interface_id, uint8_t channel_function, uint16_t fixed_channel, uint8_t dwell_interval); /** * Configure broadcast channel function. * * Change the default configuration for Wi-SUN FHSS operation. * if application defined is used the behaviour is undefined * * \param interface_id Network interface ID. * \param channel_function Broadcast channel function. * \param fixed_channel Used channel when channel function is fixed channel. If 0xFFFF, randomly chosen channel is used. * \param dwell_interval Broadcast channel dwell interval. * \param broadcast_interval Broadcast interval. * * \return 0, Init OK. * \return <0 Init fail. */ int ws_management_fhss_broadcast_channel_function_configure( int8_t interface_id, uint8_t channel_function, uint16_t fixed_channel, uint8_t dwell_interval, uint32_t broadcast_interval); #ifdef __cplusplus } #endif #endif /* WS_MANAGEMENT_API_H_ */
0.894531
1
tmc/ic/TMC5041/TMC5041_Register.h
FutureInLogistics/TMC-API
94
7996779
#ifndef TMC5041_REGISTER_H #define TMC5041_REGISTER_H // ===== TMC5041 register set ===== #define MOTOR_ADDR(m) (0x20 << m) #define MOTOR_ADDR_DRV(m) (m << 4) #define MOTOR_ADDR_PWM(m) (m << 3) #define TMC5041_GCONF 0x00 #define TMC5041_GSTAT 0x01 #define TMC5041_IFCNT 0x02 #define TMC5041_SLAVECONF 0x03 #define TMC5041_INPUT 0x04 #define TMC5041_X_COMPARE 0x05 // motor = 0 motor = 1 #define TMC5041_PWMCONF(motor) (0x10|MOTOR_ADDR_PWM(motor)) // 0x10 0x18 #define TMC5041_PWM_STATUS(motor) (0x11|MOTOR_ADDR_PWM(motor)) // 0x11 0x19 // motor = 0 motor = 1 #define TMC5041_RAMPMODE(motor) (0x00|MOTOR_ADDR(motor)) // 0x20 0x40 #define TMC5041_XACTUAL(motor) (0x01|MOTOR_ADDR(motor)) // 0x21 0x41 #define TMC5041_VACTUAL(motor) (0x02|MOTOR_ADDR(motor)) // 0x22 0x42 #define TMC5041_VSTART(motor) (0x03|MOTOR_ADDR(motor)) // 0x23 0x43 #define TMC5041_A1(motor) (0x04|MOTOR_ADDR(motor)) // 0x24 0x44 #define TMC5041_V1(motor) (0x05|MOTOR_ADDR(motor)) // 0x25 0x45 #define TMC5041_AMAX(motor) (0x06|MOTOR_ADDR(motor)) // 0x26 0x46 #define TMC5041_VMAX(motor) (0x07|MOTOR_ADDR(motor)) // 0x27 0x47 #define TMC5041_DMAX(motor) (0x08|MOTOR_ADDR(motor)) // 0x28 0x48 #define TMC5041_D1(motor) (0x0A|MOTOR_ADDR(motor)) // 0x2A 0x4A #define TMC5041_VSTOP(motor) (0x0B|MOTOR_ADDR(motor)) // 0x2B 0x4B #define TMC5041_TZEROWAIT(motor) (0x0C|MOTOR_ADDR(motor)) // 0x2C 0x4C #define TMC5041_XTARGET(motor) (0x0D|MOTOR_ADDR(motor)) // 0x2D 0x4D #define TMC5041_IHOLD_IRUN(motor) (0x10|MOTOR_ADDR(motor)) // 0x30 0x50 #define TMC5041_VCOOLTHRS(motor) (0x11|MOTOR_ADDR(motor)) // 0x31 0x51 #define TMC5041_VHIGH(motor) (0x12|MOTOR_ADDR(motor)) // 0x32 0x52 #define TMC5041_VDCMIN(motor) (0x13|MOTOR_ADDR(motor)) // 0x33 0x53 #define TMC5041_SWMODE(motor) (0x14|MOTOR_ADDR(motor)) // 0x34 0x54 #define TMC5041_RAMPSTAT(motor) (0x15|MOTOR_ADDR(motor)) // 0x35 0x55 #define TMC5041_XLATCH(motor) (0x16|MOTOR_ADDR(motor)) // 0x36 0x56 #define TMC5041_ENC_CONST(motor) (0x1A|MOTOR_ADDR(motor)) // 0x3A 0x5A // todo CHECK REM 3: should be removable, TMC5041 doesn't have encoder features. Still used though (LH) // motor = 0 motor = 1 #define TMC5041_MSLUT0(motor) (0x60|MOTOR_ADDR_DRV(motor)) // 0x60 0x70 #define TMC5041_MSLUT1(motor) (0x61|MOTOR_ADDR_DRV(motor)) // 0x61 0x71 #define TMC5041_MSLUT2(motor) (0x62|MOTOR_ADDR_DRV(motor)) // 0x62 0x72 #define TMC5041_MSLUT3(motor) (0x63|MOTOR_ADDR_DRV(motor)) // 0x63 0x73 #define TMC5041_MSLUT4(motor) (0x64|MOTOR_ADDR_DRV(motor)) // 0x64 0x74 #define TMC5041_MSLUT5(motor) (0x65|MOTOR_ADDR_DRV(motor)) // 0x65 0x75 #define TMC5041_MSLUT6(motor) (0x66|MOTOR_ADDR_DRV(motor)) // 0x66 0x76 #define TMC5041_MSLUT7(motor) (0x67|MOTOR_ADDR_DRV(motor)) // 0x67 0x77 #define TMC5041_MSLUTSEL(motor) (0x68|MOTOR_ADDR_DRV(motor)) // 0x68 0x78 #define TMC5041_MSLUTSTART(motor) (0x69|MOTOR_ADDR_DRV(motor)) // 0x69 0x79 #define TMC5041_MSCNT(motor) (0x6A|MOTOR_ADDR_DRV(motor)) // 0x6A 0x7A #define TMC5041_MSCURACT(motor) (0x6B|MOTOR_ADDR_DRV(motor)) // 0x6B 0x7B #define TMC5041_CHOPCONF(motor) (0x6C|MOTOR_ADDR_DRV(motor)) // 0x6C 0x7C #define TMC5041_COOLCONF(motor) (0x6D|MOTOR_ADDR_DRV(motor)) // 0x6D 0x7D #define TMC5041_DRVSTATUS(motor) (0x6F|MOTOR_ADDR_DRV(motor)) // 0x6F 0x7F #endif /* TMC5041_REGISTER_H */
0.78125
1
public/platform/modules/presentation/WebPresentationController.h
igordmn/blink-typo
0
7996787
// Copyright 2015 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 WebPresentationController_h #define WebPresentationController_h #include "public/platform/WebCommon.h" namespace blink { class WebPresentationSessionClient; class WebString; enum class WebPresentationSessionState; // The delegate Blink provides to WebPresentationClient in order to get updates. class BLINK_PLATFORM_EXPORT WebPresentationController { public: virtual ~WebPresentationController() { } // Called when the presentation screen availability changes. // May not be called if there's no registered listener for the event. virtual void didChangeAvailability(bool available) = 0; // Indicates if the frame has listeners to the |availablechange| event. virtual bool isAvailableChangeWatched() const = 0; // Called when the presentation session is started by the embedder using // the default presentation URL and id. virtual void didStartDefaultSession(WebPresentationSessionClient*) = 0; // Called when the state of a session changes. virtual void didChangeSessionState(WebPresentationSessionClient*, WebPresentationSessionState) = 0; // Called when a text message of a session is received. virtual void didReceiveSessionTextMessage(WebPresentationSessionClient*, const WebString& message) = 0; }; } // namespace blink #endif // WebPresentationController_h
0.890625
1
MyTinySTL/stack.h
wangzhen0518/MyTinySTL
0
7996795
#ifndef MYTINYSTL_STACK_H_ #define MYTINYSTL_STACK_H_ // 这个头文件包含了一个模板类 stack // stack : 栈 #include "deque.h" namespace mystl { // 模板类 stack // 参数一代表数据类型,参数二代表底层容器类型,缺省使用 mystl::deque // 作为底层容器 template <class T, class Container = mystl::deque<T>> class stack { public: typedef Container container_type; // 使用底层容器的型别 typedef typename Container::value_type value_type; typedef typename Container::size_type size_type; typedef typename Container::reference reference; typedef typename Container::const_reference const_reference; static_assert(std::is_same<T, value_type>::value, "the value_type of Container should be same with T"); private: container_type c_; // 用底层容器表现 stack public: // 构造、复制、移动函数 stack() = default; explicit stack(size_type n) : c_(n) {} stack(size_type n, const value_type& value) : c_(n, value) {} template <class IIter> stack(IIter first, IIter last) : c_(first, last) {} stack(std::initializer_list<T> ilist) : c_(ilist.begin(), ilist.end()) {} stack(const Container& c) : c_(c) {} stack(Container&& c) noexcept( std::is_nothrow_move_constructible<Container>::value) : c_(mystl::move(c)) {} stack(const stack& rhs) : c_(rhs.c_) {} stack(stack&& rhs) noexcept( std::is_nothrow_move_constructible<Container>::value) : c_(mystl::move(rhs.c_)) {} stack& operator=(const stack& rhs) { c_ = rhs.c_; return *this; } stack& operator=(stack&& rhs) noexcept( std::is_nothrow_move_assignable<Container>::value) { c_ = mystl::move(rhs.c_); return *this; } stack& operator=(std::initializer_list<T> ilist) { c_ = ilist; return *this; } ~stack() = default; // 访问元素相关操作 reference top() { return c_.back(); } const_reference top() const { return c_.back(); } // 容量相关操作 bool empty() const noexcept { return c_.empty(); } size_type size() const noexcept { return c_.size(); } // 修改容器相关操作 template <class... Args> void emplace(Args&&... args) { c_.emplace_back(mystl::forward<Args>(args)...); } void push(const value_type& value) { c_.push_back(value); } void push(value_type&& value) { c_.push_back(mystl::move(value)); } void pop() { c_.pop_back(); } void clear() { while (!empty()) pop(); } void swap(stack& rhs) noexcept(noexcept(mystl::swap(c_, rhs.c_))) { mystl::swap(c_, rhs.c_); } public: friend bool operator==(const stack& lhs, const stack& rhs) { return lhs.c_ == rhs.c_; } friend bool operator<(const stack& lhs, const stack& rhs) { return lhs.c_ < rhs.c_; } }; // 重载比较操作符 template <class T, class Container> bool operator==(const stack<T, Container>& lhs, const stack<T, Container>& rhs) { return lhs == rhs; } template <class T, class Container> bool operator<(const stack<T, Container>& lhs, const stack<T, Container>& rhs) { return lhs < rhs; } template <class T, class Container> bool operator!=(const stack<T, Container>& lhs, const stack<T, Container>& rhs) { return !(lhs == rhs); } template <class T, class Container> bool operator>(const stack<T, Container>& lhs, const stack<T, Container>& rhs) { return rhs < lhs; } template <class T, class Container> bool operator<=(const stack<T, Container>& lhs, const stack<T, Container>& rhs) { return !(rhs < lhs); } template <class T, class Container> bool operator>=(const stack<T, Container>& lhs, const stack<T, Container>& rhs) { return !(lhs < rhs); } // 重载 mystl 的 swap template <class T, class Container> void swap(stack<T, Container>& lhs, stack<T, Container>& rhs) noexcept(noexcept(lhs.swap(rhs))) { lhs.swap(rhs); } } // namespace mystl #endif // !MYTINYSTL_STACK_H_
1.726563
2
fetchIso/turblib.c
KTHVisualization/percMPI
2
7996803
// Copyright 2011 Johns Hopkins University // // 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. /* $Id: turblib.c,v 1.13 2009-10-23 17:58:57 eric Exp $ */ #include <stdio.h> #include <math.h> #ifdef CUTOUT_SUPPORT #include "hdf5.h" #endif//CUTOUT_SUPPORT #include "soapH.h" #include "TurbulenceServiceSoap.nsmap" #include "turblib.h" /* global gSOAP runtime environment * Temporary until we can figure out how to pass a pointer * to and from a function correctly in Fortran. */ struct soap __jhuturbsoap; /* Error reporting - C */ char __turblib_err[TURB_ERROR_LENGTH]; int __turblib_errno = 0; int __turblib_exit_on_error = 1; int __turblib_prefetching = 0; #ifdef CUTOUT_SUPPORT //Linked list of all added cutout files cutoutFile* __turblib_cutouts = NULL; set_info DataSets[9] = { { 0, 0, 0 }, { 2.0f * 3.14159265358979f / 1024.0f, .002f, 1024 }, //isotropic1024old { 2.0f * 3.14159265358979f / 1024.0f, .0002f, 1024 }, //isotropicfine_old { 2.0f * 3.14159265358979f / 1024.0f, .0025f, 1024 }, //mhd1024 { 2.0f * 3.14159265358979f / 1024.0f, .002f, 1024 }, //isotropic1024coarse { 2.0f * 3.14159265358979f / 1024.0f, .0002f, 1024 }, //isotropic1024fine { 0, 0, 0 }, { 2.0f * 3.14159265358979f / 1024.0f, .0025f, 1024 }, //custom_dataset { 2.0f * 3.14159265358979f / 1024.0f, .04f, 1024 } //mixing_dataset }; turb_fn TurbFields[5] = { { 'u', 3}, //velocity { 'p', 1}, //pressure { 'b', 3}, //magnetic { 'a', 3}, //vector potential { 'd', 1} //density }; #endif//CUTOUT_SUPPORT char * turblibGetErrorString() { return __turblib_err; } int turblibGetErrorNumber() { return __turblib_errno; } void turblibPrintError() { fprintf(stderr, "%d: %s\n", turblibGetErrorNumber(), turblibGetErrorString()); } void turblibSetExitOnError(int v) { __turblib_exit_on_error = v; } /* Error reporting - Fortran */ void turblibgeterrorstring_ (char *dest, int len) { strncpy(dest, __turblib_err, len); } int turblibgeterrornumber_() { return turblibGetErrorNumber(); } void turblibprinterror_() { turblibPrintError(); } void turblibsetexitonerror_(int *v) { turblibSetExitOnError(*v); } /* Determine appropriate error behavior */ void turblibHandleError() { if (__turblib_exit_on_error) { turblibPrintError(); exit(1); } } /* Return the enum relating to the Fortran constant */ enum turb1__SpatialInterpolation SpatialIntToEnum(enum SpatialInterpolation spatial) { switch (spatial) { case 0: return turb1__SpatialInterpolation__None; case 4: return turb1__SpatialInterpolation__Lag4; case 6: return turb1__SpatialInterpolation__Lag6; case 8: return turb1__SpatialInterpolation__Lag8; case 40: return turb1__SpatialInterpolation__None_USCOREFd4; case 44: return turb1__SpatialInterpolation__Fd4Lag4; case 60: return turb1__SpatialInterpolation__None_USCOREFd6; case 80: return turb1__SpatialInterpolation__None_USCOREFd8; case 104: return turb1__SpatialInterpolation__M1Q4; case 106: return turb1__SpatialInterpolation__M1Q6; case 108: return turb1__SpatialInterpolation__M1Q8; case 110: return turb1__SpatialInterpolation__M1Q10; case 112: return turb1__SpatialInterpolation__M1Q12; case 114: return turb1__SpatialInterpolation__M1Q14; case 204: return turb1__SpatialInterpolation__M2Q4; case 206: return turb1__SpatialInterpolation__M2Q6; case 208: return turb1__SpatialInterpolation__M2Q8; case 210: return turb1__SpatialInterpolation__M2Q10; case 212: return turb1__SpatialInterpolation__M2Q12; case 214: return turb1__SpatialInterpolation__M2Q14; case 304: return turb1__SpatialInterpolation__M3Q4; case 306: return turb1__SpatialInterpolation__M3Q6; case 308: return turb1__SpatialInterpolation__M3Q8; case 310: return turb1__SpatialInterpolation__M3Q10; case 312: return turb1__SpatialInterpolation__M3Q12; case 314: return turb1__SpatialInterpolation__M3Q14; case 404: return turb1__SpatialInterpolation__M4Q4; case 406: return turb1__SpatialInterpolation__M4Q6; case 408: return turb1__SpatialInterpolation__M4Q8; case 410: return turb1__SpatialInterpolation__M4Q10; case 412: return turb1__SpatialInterpolation__M4Q12; case 414: return turb1__SpatialInterpolation__M4Q14; default: return -1; } return -1; } /* Return the enum relating to the Fortran constant */ enum turb1__TemporalInterpolation TemporalIntToEnum(enum TemporalInterpolation temporal) { switch (temporal) { case 0: return turb1__TemporalInterpolation__None; case 1: return turb1__TemporalInterpolation__PCHIP; } return -1; } /* Intialize the gSOAP runtime environment */ void soapinit_() { soapinit(); } void soapinit() { soap_init(&__jhuturbsoap); } /* Destroy the gSOAP environment */ void soapdestroy_ () { soap_destroy(&__jhuturbsoap); } void soapdestroy () { soap_destroy(&__jhuturbsoap); } int getVelocity (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_velocity, count, datain, time, spatial, temporal)) return getValueLocal(dataset_, turb_velocity, spatial, temporal, time, count, datain, &dataout[0][0]); else #endif//CUTOUT_SUPPORT return getVelocitySoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getVelocityAndPressure (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][4]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_vp, count, datain, time, spatial, temporal)) return getVelocityAndPressureLocal(dataset_, time, spatial, temporal, count, datain, dataout); else #endif//CUTOUT_SUPPORT return getVelocityAndPressureSoap(authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getPressure (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_pressure, count, datain, time, spatial, temporal)) return getValueLocal(dataset_, turb_pressure, spatial, temporal, time, count, datain, &dataout[0]); else #endif//CUTOUT_SUPPORT return getPressureSoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getPressureHessian(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][6]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_pressure, count, datain, time, spatial, temporal)) return getPressureHessianLocal(dataset_, time, spatial, temporal, count, datain, dataout); else #endif//CUTOUT_SUPPORT return getPressureHessianSoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getVelocityGradient(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][9]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_velocity, count, datain, time, spatial, temporal)) return getVelocityGradientLocal(dataset_, time, spatial, temporal, count, datain, dataout); else #endif//CUTOUT_SUPPORT return getVelocityGradientSoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getVelocityHessian(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][18]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_velocity, count, datain, time, spatial, temporal)) return getVelocityHessianLocal(dataset_, time, spatial, temporal, count, datain, dataout); else #endif//CUTOUT_SUPPORT return getVelocityHessianSoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getVelocityLaplacian (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_velocity, count, datain, time, spatial, temporal)) return getVelocityLaplacianLocal (dataset_, time, spatial, temporal, count, datain, dataout); else #endif//CUTOUT_SUPPORT return getVelocityLaplacianSoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getPressureGradient(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_pressure, count, datain, time, spatial, temporal)) return getPressureGradientLocal(dataset_, time, spatial, temporal, count, datain, dataout); else #endif//CUTOUT_SUPPORT return getPressureGradientSoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getMagneticFieldGradient(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][9]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_magnetic, count, datain, time, spatial, temporal)) return getMagneticFieldGradientLocal(dataset_, time, spatial, temporal, count, datain, dataout); else #endif//CUTOUT_SUPPORT return getMagneticFieldGradientSoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getVectorPotentialGradient(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][9]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_potential, count, datain, time, spatial, temporal)) return getVectorPotentialGradientLocal(dataset_, time, spatial, temporal, count, datain, dataout); else #endif//CUTOUT_SUPPORT return getVectorPotentialGradientSoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getMagneticFieldHessian(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][18]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_magnetic, count, datain, time, spatial, temporal)) return getMagneticFieldHessianLocal(dataset_, time, spatial, temporal, count, datain, dataout); else #endif//CUTOUT_SUPPORT return getMagneticFieldHessianSoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getMagneticFieldLaplacian (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_magnetic, count, datain, time, spatial, temporal)) return getMagneticFieldLaplacianLocal (dataset_, time, spatial, temporal, count, datain, dataout); else #endif//CUTOUT_SUPPORT return getMagneticFieldLaplacianSoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getMagneticField (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_magnetic, count, datain, time, spatial, temporal)) return getValueLocal(dataset_, turb_magnetic, spatial, temporal, time, count, datain, &dataout[0][0]); else #endif//CUTOUT_SUPPORT return getMagneticFieldSoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getVectorPotentialHessian(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][18]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_potential, count, datain, time, spatial, temporal)) return getVectorPotentialHessianLocal(dataset_, time, spatial, temporal, count, datain, dataout); else #endif//CUTOUT_SUPPORT return getVectorPotentialHessianSoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getVectorPotentialLaplacian (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_potential, count, datain, time, spatial, temporal)) return getVectorPotentialLaplacianLocal (dataset_, time, spatial, temporal, count, datain, dataout); else #endif//CUTOUT_SUPPORT return getVectorPotentialLaplacianSoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getVectorPotential (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_potential, count, datain, time, spatial, temporal)) return getValueLocal(dataset_, turb_potential, spatial, temporal, time, count, datain, &dataout[0][0]); else #endif//CUTOUT_SUPPORT return getVectorPotentialSoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getDensity (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_density, count, datain, time, spatial, temporal)) return getValueLocal(dataset_, turb_density, spatial, temporal, time, count, datain, &dataout[0]); else #endif//CUTOUT_SUPPORT return getDensitySoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getDensityGradient(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_density, count, datain, time, spatial, temporal)) return getDensityGradientLocal(dataset_, time, spatial, temporal, count, datain, dataout); else #endif//CUTOUT_SUPPORT return getDensityGradientSoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getDensityHessian(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][6]) { #ifdef CUTOUT_SUPPORT TurbDataset dataset_ = getDataSet(dataset); if (isDataAvailable(dataset_, turb_density, count, datain, time, spatial, temporal)) return getDensityHessianLocal(dataset_, time, spatial, temporal, count, datain, dataout); else #endif//CUTOUT_SUPPORT return getDensityHessianSoap (authToken, dataset, time, spatial, temporal, count, datain, dataout); } int getVelocitySoap (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { int rc; struct _turb1__GetVelocity input; struct _turb1__GetVelocityResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetVelocity(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetVelocityResult->Vector3, output.GetVelocityResult->__sizeVector3 * sizeof(float) * 3); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getthreshold_ (char *authToken, char *dataset, char *field, float *time, float *threshold, int *spatial, int *X, int *Y, int *Z, int *Xwidth, int *Ywidth, int *Zwidth, ThresholdInfo** dataout, int *result_size) { return getThreshold(authToken, dataset, field, *time, *threshold, *spatial, *X, *Y, *Z, *Xwidth, *Ywidth, *Zwidth, dataout, result_size); } void deallocate_array_ (ThresholdInfo **threshold_array) { free(*threshold_array); } int getThreshold (char *authToken, char *dataset, char *field, float time, float threshold, enum SpatialInterpolation spatial, int X, int Y, int Z, int Xwidth, int Ywidth, int Zwidth, ThresholdInfo **dataout, int *result_size) { int rc; struct _turb1__GetThreshold input; struct _turb1__GetThresholdResponse output; input.authToken = authToken; input.dataset = dataset; input.field = field; input.time = time; input.threshold = threshold; input.spatialInterpolation = SpatialIntToEnum(spatial); input.X = X; input.Y = Y; input.Z = Z; input.Xwidth = Xwidth; input.Ywidth = Ywidth; input.Zwidth = Zwidth; rc = soap_call___turb2__GetThreshold(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { *result_size = output.GetThresholdResult->__sizeThresholdInfo; *dataout = (ThresholdInfo *) malloc(sizeof(ThresholdInfo) * (*result_size)); memcpy(*dataout, output.GetThresholdResult->ThresholdInfo, output.GetThresholdResult->__sizeThresholdInfo * sizeof(ThresholdInfo)); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); // remove deserialized data and clean up soap_done(&__jhuturbsoap); // detach the gSOAP environment __turblib_errno = rc; return rc; } int getboxfilter_ (char *authToken, char *dataset, char *field, float *time, float *filterwidth, int *count, float datain[][3], float dataout[][3], int len_a, int len_d) { return getBoxFilter (authToken, dataset, field, *time, *filterwidth, *count, datain, dataout); } int getBoxFilter (char *authToken, char *dataset, char *field, float time, float filterwidth, int count, float datain[][3], float dataout[][3]) { int rc; struct _turb1__GetBoxFilter input; struct _turb1__GetBoxFilterResponse output; input.authToken = authToken; input.dataset = dataset; input.field = field; input.time = time; input.filterwidth = filterwidth; struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetBoxFilter(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetBoxFilterResult->Vector3, output.GetBoxFilterResult->__sizeVector3 * sizeof(float) * 3); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getboxfiltersgs_ (char *authToken, char *dataset, char *field, float *time, float *filterwidth, int *count, float datain[][3], float dataout[][6], int len_a, int len_d) { return getBoxFilterSGS (authToken, dataset, field, *time, *filterwidth, *count, datain, dataout); } int getBoxFilterSGS (char *authToken, char *dataset, char *field, float time, float filterwidth, int count, float datain[][3], float dataout[][6]) { int rc; struct _turb1__GetBoxFilterSGS input; struct _turb1__GetBoxFilterSGSResponse output; input.authToken = authToken; input.dataset = dataset; input.field = field; input.time = time; input.filterwidth = filterwidth; struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetBoxFilterSGS(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetBoxFilterSGSResult->SGSTensor, output.GetBoxFilterSGSResult->__sizeSGSTensor * sizeof(float) * 6); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getboxfiltersgsscalar_ (char *authToken, char *dataset, char *field, float *time, float *filterwidth, int *count, float datain[][3], float dataout[], int len_a, int len_d) { return getBoxFilterSGSscalar (authToken, dataset, field, *time, *filterwidth, *count, datain, dataout); } int getBoxFilterSGSscalar (char *authToken, char *dataset, char *field, float time, float filterwidth, int count, float datain[][3], float dataout[]) { int rc; struct _turb1__GetBoxFilterSGSscalar input; struct _turb1__GetBoxFilterSGSscalarResponse output; input.authToken = authToken; input.dataset = dataset; input.field = field; input.time = time; input.filterwidth = filterwidth; struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetBoxFilterSGSscalar(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetBoxFilterSGSscalarResult->float_, output.GetBoxFilterSGSscalarResult->__sizefloat_ * sizeof(float)); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getboxfiltersgsvector_ (char *authToken, char *dataset, char *field, float *time, float *filterwidth, int *count, float datain[][3], float dataout[][3], int len_a, int len_d) { return getBoxFilterSGSvector (authToken, dataset, field, *time, *filterwidth, *count, datain, dataout); } int getBoxFilterSGSvector (char *authToken, char *dataset, char *field, float time, float filterwidth, int count, float datain[][3], float dataout[][3]) { int rc; struct _turb1__GetBoxFilterSGSvector input; struct _turb1__GetBoxFilterSGSvectorResponse output; input.authToken = authToken; input.dataset = dataset; input.field = field; input.time = time; input.filterwidth = filterwidth; struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetBoxFilterSGSvector(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetBoxFilterSGSvectorResult->Vector3, output.GetBoxFilterSGSvectorResult->__sizeVector3 * sizeof(float) * 3); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getboxfiltersgssymtensor_ (char *authToken, char *dataset, char *field, float *time, float *filterwidth, int *count, float datain[][3], float dataout[][6], int len_a, int len_d) { return getBoxFilterSGSsymtensor (authToken, dataset, field, *time, *filterwidth, *count, datain, dataout); } int getBoxFilterSGSsymtensor (char *authToken, char *dataset, char *field, float time, float filterwidth, int count, float datain[][3], float dataout[][6]) { int rc; struct _turb1__GetBoxFilterSGSsymtensor input; struct _turb1__GetBoxFilterSGSsymtensorResponse output; input.authToken = authToken; input.dataset = dataset; input.field = field; input.time = time; input.filterwidth = filterwidth; struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetBoxFilterSGSsymtensor(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetBoxFilterSGSsymtensorResult->SGSTensor, output.GetBoxFilterSGSsymtensorResult->__sizeSGSTensor * sizeof(float) * 6); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getboxfiltersgstensor_ (char *authToken, char *dataset, char *field, float *time, float *filterwidth, int *count, float datain[][3], float dataout[][9], int len_a, int len_d) { return getBoxFilterSGStensor (authToken, dataset, field, *time, *filterwidth, *count, datain, dataout); } int getBoxFilterSGStensor (char *authToken, char *dataset, char *field, float time, float filterwidth, int count, float datain[][3], float dataout[][9]) { int rc; struct _turb1__GetBoxFilterSGStensor input; struct _turb1__GetBoxFilterSGStensorResponse output; input.authToken = authToken; input.dataset = dataset; input.field = field; input.time = time; input.filterwidth = filterwidth; struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetBoxFilterSGStensor(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetBoxFilterSGStensorResult->VelocityGradient, output.GetBoxFilterSGStensorResult->__sizeVelocityGradient * sizeof(float) * 9); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getboxfiltergradient_(char *authToken, char *dataset, char* field, float *time, float *filterwidth, float *spacing, int *count, float datain[][3], float dataout[][9], int len_a, int len_d) { return getBoxFilterGradient(authToken, dataset, field, *time, *filterwidth, *spacing, *count, datain, dataout); } int getBoxFilterGradient(char *authToken, char *dataset, char *field, float time, float filterwidth, float spacing, int count, float datain[][3], float dataout[][9]) { int rc; struct _turb1__GetBoxFilterGradient input; struct _turb1__GetBoxFilterGradientResponse output; input.authToken = authToken; input.dataset = dataset; input.field = field; input.time = time; input.filterwidth = filterwidth; input.spacing = spacing; struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetBoxFilterGradient (&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetBoxFilterGradientResult->VelocityGradient, output.GetBoxFilterGradientResult->__sizeVelocityGradient * sizeof(float) * 9); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getVelocityAndPressureSoap (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][4]) { int rc; struct _turb1__GetVelocityAndPressure input; struct _turb1__GetVelocityAndPressureResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetVelocityAndPressure (&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetVelocityAndPressureResult->Vector3P, output.GetVelocityAndPressureResult->__sizeVector3P * sizeof(float) * 4); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getPressureHessianSoap(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][6]) { int rc; struct _turb1__GetPressureHessian input; struct _turb1__GetPressureHessianResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetPressureHessian (&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetPressureHessianResult->PressureHessian, output.GetPressureHessianResult->__sizePressureHessian * sizeof(float) * 6); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getVelocityGradientSoap(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][9]) { int rc; struct _turb1__GetVelocityGradient input; struct _turb1__GetVelocityGradientResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetVelocityGradient (&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetVelocityGradientResult->VelocityGradient, output.GetVelocityGradientResult->__sizeVelocityGradient * sizeof(float) * 9); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getMagneticFieldGradientSoap(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][9]) { int rc; struct _turb1__GetMagneticFieldGradient input; struct _turb1__GetMagneticFieldGradientResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetMagneticFieldGradient (&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetMagneticFieldGradientResult->VelocityGradient, output.GetMagneticFieldGradientResult->__sizeVelocityGradient * sizeof(float) * 9); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getVectorPotentialGradientSoap(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][9]) { int rc; struct _turb1__GetVectorPotentialGradient input; struct _turb1__GetVectorPotentialGradientResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetVectorPotentialGradient (&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetVectorPotentialGradientResult->VelocityGradient, output.GetVectorPotentialGradientResult->__sizeVelocityGradient * sizeof(float) * 9); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getPressureGradientSoap(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { int rc; struct _turb1__GetPressureGradient input; struct _turb1__GetPressureGradientResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetPressureGradient (&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetPressureGradientResult->Vector3, output.GetPressureGradientResult->__sizeVector3 * sizeof(float) * 3); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getVelocityHessianSoap(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][18]) { int rc; struct _turb1__GetVelocityHessian input; struct _turb1__GetVelocityHessianResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetVelocityHessian (&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetVelocityHessianResult->VelocityHessian, output.GetVelocityHessianResult->__sizeVelocityHessian * sizeof(float) * 18); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getVelocityLaplacianSoap (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { int rc; struct _turb1__GetVelocityLaplacian input; struct _turb1__GetVelocityLaplacianResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetVelocityLaplacian(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetVelocityLaplacianResult->Vector3, output.GetVelocityLaplacianResult->__sizeVector3 * sizeof(float) * 3); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getMagneticFieldHessianSoap(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][18]) { int rc; struct _turb1__GetMagneticHessian input; struct _turb1__GetMagneticHessianResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetMagneticHessian (&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetMagneticHessianResult->VelocityHessian, output.GetMagneticHessianResult->__sizeVelocityHessian * sizeof(float) * 18); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getMagneticFieldLaplacianSoap (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { int rc; struct _turb1__GetMagneticFieldLaplacian input; struct _turb1__GetMagneticFieldLaplacianResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetMagneticFieldLaplacian(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetMagneticFieldLaplacianResult->Vector3, output.GetMagneticFieldLaplacianResult->__sizeVector3 * sizeof(float) * 3); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getVectorPotentialHessianSoap(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][18]) { int rc; struct _turb1__GetVectorPotentialHessian input; struct _turb1__GetVectorPotentialHessianResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetVectorPotentialHessian (&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetVectorPotentialHessianResult->VelocityHessian, output.GetVectorPotentialHessianResult->__sizeVelocityHessian * sizeof(float) * 18); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getVectorPotentialLaplacianSoap (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { int rc; struct _turb1__GetVectorPotentialLaplacian input; struct _turb1__GetVectorPotentialLaplacianResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetVectorPotentialLaplacian(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetVectorPotentialLaplacianResult->Vector3, output.GetVectorPotentialLaplacianResult->__sizeVector3 * sizeof(float) * 3); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int nullop_ (char *authToken, int *count, float datain[][3], float dataout[][3], int len_a, int len_d) { return nullOp (authToken, *count, datain, dataout); } int nullOp (char *authToken, int count, float datain[][3], float dataout[][3]) { int rc; struct _turb1__NullOp input; struct _turb1__NullOpResponse output; input.authToken = authToken; struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__NullOp(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.NullOpResult->Vector3, output.NullOpResult->__sizeVector3 * sizeof(float) * 3); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getForce(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { int rc; struct _turb1__GetForce input; struct _turb1__GetForceResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetForce(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetForceResult->Vector3, output.GetForceResult->__sizeVector3 * sizeof(float) * 3); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getforce_(char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][3], int len_a, int len_d) { return getForce (authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getPosition(char *authToken, char *dataset, float startTime, float endTime, float dt, enum SpatialInterpolation spatial, int count, float datain[][3], float dataout[][3]) { int rc; struct _turb1__GetPosition input; struct _turb1__GetPositionResponse output; input.authToken = authToken; input.dataset = dataset; input.StartTime = startTime; input.EndTime = endTime; input.dt = dt; input.spatialInterpolation = SpatialIntToEnum(spatial); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetPosition(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetPositionResult->Point3, output.GetPositionResult->__sizePoint3 * sizeof(float) * 3); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getposition_(char *authToken, char *dataset, float *startTime, float *endTime, float *dt, int *spatial, int *count, float datain[][3], float dataout[][3], int len_a, int len_d) { return getPosition (authToken, dataset, *startTime, *endTime, *dt, *spatial, *count, datain, dataout); } int getrawvelocity_(char *authToken, char *dataset, float *time, int *X, int *Y, int *Z, int *Xwidth, int *Ywidth, int *Zwidth, float dataout[]) { return getRawVelocity(authToken, dataset, *time, *X, *Y, *Z, *Xwidth, *Ywidth, *Zwidth, (char*)dataout); } int getRawVelocity (char *authToken, char *dataset, float time, int X, int Y, int Z, int Xwidth, int Ywidth, int Zwidth, char dataout[]) { int rc; struct _turb1__GetRawVelocity input; struct _turb1__GetRawVelocityResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.X = X; input.Y = Y; input.Z = Z; input.Xwidth = Xwidth; input.Ywidth = Ywidth; input.Zwidth = Zwidth; rc = soap_call___turb2__GetRawVelocity(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetRawVelocityResult->__ptr, output.GetRawVelocityResult->__size ); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); // remove deserialized data and clean up soap_done(&__jhuturbsoap); // detach the gSOAP environment __turblib_errno = rc; return rc; } int getMagneticFieldSoap (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { int rc; struct _turb1__GetMagneticField input; struct _turb1__GetMagneticFieldResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetMagneticField(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetMagneticFieldResult->Vector3, output.GetMagneticFieldResult->__sizeVector3 * sizeof(float) * 3); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); //remove deserialized data and clean up soap_done(&__jhuturbsoap); //detach the gSOAP environment __turblib_errno = rc; return rc; } int getrawmagneticfield_ (char *authToken, char *dataset, float *time, int *X, int *Y, int *Z, int *Xwidth, int *Ywidth, int *Zwidth, float dataout[]) { return getRawMagneticField (authToken, dataset, *time, *X, *Y, *Z, *Xwidth, *Ywidth, *Zwidth, (char*) dataout); } int getRawMagneticField (char *authToken, char *dataset, float time, int X, int Y, int Z, int Xwidth, int Ywidth, int Zwidth, char dataout[]) { int rc; struct _turb1__GetRawMagneticField input; struct _turb1__GetRawMagneticFieldResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.X = X; input.Y = Y; input.Z = Z; input.Xwidth = Xwidth; input.Ywidth = Ywidth; input.Zwidth = Zwidth; rc = soap_call___turb2__GetRawMagneticField(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetRawMagneticFieldResult->__ptr, output.GetRawMagneticFieldResult->__size ); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); // remove deserialized data and clean up soap_done(&__jhuturbsoap); // detach the gSOAP environment __turblib_errno = rc; return rc; } int getVectorPotentialSoap (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { int rc; struct _turb1__GetVectorPotential input; struct _turb1__GetVectorPotentialResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetVectorPotential(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetVectorPotentialResult->Vector3, output.GetVectorPotentialResult->__sizeVector3 * sizeof(float) * 3); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); // remove deserialized data and clean up soap_done(&__jhuturbsoap); // detach the gSOAP environment __turblib_errno = rc; return rc; } int getrawvectorpotential_ (char *authToken, char *dataset, float *time, int *X, int *Y, int *Z, int *Xwidth, int *Ywidth, int *Zwidth, float dataout[]) { return getRawVectorPotential (authToken, dataset, *time, *X, *Y, *Z, *Xwidth, *Ywidth, *Zwidth, (char*) dataout); } int getRawVectorPotential (char *authToken, char *dataset, float time, int X, int Y, int Z, int Xwidth, int Ywidth, int Zwidth, char dataout[]) { int rc; struct _turb1__GetRawVectorPotential input; struct _turb1__GetRawVectorPotentialResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.X = X; input.Y = Y; input.Z = Z; input.Xwidth = Xwidth; input.Ywidth = Ywidth; input.Zwidth = Zwidth; rc = soap_call___turb2__GetRawVectorPotential(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetRawVectorPotentialResult->__ptr, output.GetRawVectorPotentialResult->__size ); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); // remove deserialized data and clean up soap_done(&__jhuturbsoap); // detach the gSOAP environment __turblib_errno = rc; return rc; } int getPressureSoap (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[]) { int rc; struct _turb1__GetPressure input; struct _turb1__GetPressureResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetPressure(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetPressureResult->Pressure, output.GetPressureResult->__sizePressure * sizeof(float)); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); // remove deserialized data and clean up soap_done(&__jhuturbsoap); // detach the gSOAP environment __turblib_errno = rc; return rc; } int getrawpressure_ (char *authToken, char *dataset, float *time, int *X, int *Y, int *Z, int *Xwidth, int *Ywidth, int *Zwidth, float dataout[]) { return getRawPressure(authToken, dataset, *time, *X, *Y, *Z, *Xwidth, *Ywidth, *Zwidth,(char*)dataout); } int getRawPressure (char *authToken, char *dataset, float time, int X, int Y, int Z, int Xwidth, int Ywidth, int Zwidth, char dataout[]) { int rc; struct _turb1__GetRawPressure input; struct _turb1__GetRawPressureResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.X = X; input.Y = Y; input.Z = Z; input.Xwidth = Xwidth; input.Ywidth = Ywidth; input.Zwidth = Zwidth; rc = soap_call___turb2__GetRawPressure(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetRawPressureResult->__ptr, output.GetRawPressureResult->__size ); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); // remove deserialized data and clean up soap_done(&__jhuturbsoap); // detach the gSOAP environment __turblib_errno = rc; return rc; } int getDensitySoap (char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[]) { int rc; struct _turb1__GetDensity input; struct _turb1__GetDensityResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetDensity(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetDensityResult->Pressure, output.GetDensityResult->__sizePressure * sizeof(float)); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); // remove deserialized data and clean up soap_done(&__jhuturbsoap); // detach the gSOAP environment __turblib_errno = rc; return rc; } int getDensityGradientSoap(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { int rc; struct _turb1__GetDensityGradient input; struct _turb1__GetDensityGradientResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetDensityGradient (&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetDensityGradientResult->Vector3, output.GetDensityGradientResult->__sizeVector3 * sizeof(float) * 3); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getDensityHessianSoap(char *authToken, char *dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][6]) { int rc; struct _turb1__GetDensityHessian input; struct _turb1__GetDensityHessianResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.spatialInterpolation = SpatialIntToEnum(spatial); input.temporalInterpolation = TemporalIntToEnum(temporal); struct turb1__ArrayOfPoint3 pointArray; pointArray.__sizePoint3 = count; pointArray.Point3 = (void *)datain; input.points = &pointArray; rc = soap_call___turb2__GetDensityHessian (&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetDensityHessianResult->PressureHessian, output.GetDensityHessianResult->__sizePressureHessian * sizeof(float) * 6); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); /* remove deserialized data and clean up */ soap_done(&__jhuturbsoap); /* detach the gSOAP environment */ __turblib_errno = rc; return rc; } int getrawdensity_ (char *authToken, char *dataset, float *time, int *X, int *Y, int *Z, int *Xwidth, int *Ywidth, int *Zwidth, float dataout[]) { return getRawDensity(authToken, dataset, *time, *X, *Y, *Z, *Xwidth, *Ywidth, *Zwidth,(char*)dataout); } int getRawDensity (char *authToken, char *dataset, float time, int X, int Y, int Z, int Xwidth, int Ywidth, int Zwidth, char dataout[]) { int rc; struct _turb1__GetRawDensity input; struct _turb1__GetRawDensityResponse output; input.authToken = authToken; input.dataset = dataset; input.time = time; input.X = X; input.Y = Y; input.Z = Z; input.Xwidth = Xwidth; input.Ywidth = Ywidth; input.Zwidth = Zwidth; rc = soap_call___turb2__GetRawDensity(&__jhuturbsoap, NULL, NULL, &input, &output); if (rc == SOAP_OK) { memcpy(dataout, output.GetRawDensityResult->__ptr, output.GetRawDensityResult->__size ); bzero(__turblib_err, TURB_ERROR_LENGTH); } else { soap_sprint_fault(&__jhuturbsoap, __turblib_err, TURB_ERROR_LENGTH); turblibHandleError(); } soap_end(&__jhuturbsoap); // remove deserialized data and clean up soap_done(&__jhuturbsoap); // detach the gSOAP environment __turblib_errno = rc; return rc; } //////////////////////////////// /* Local Functions */ #ifdef CUTOUT_SUPPORT int getValueLocal(TurbDataset dataset, TurbField func, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, float time, int count, float position[][3], float *result) { if(!validateParams(spatial, dataset, 0)) return -1; loadNeededData(dataset, func, count, position, time, spatial, temporal); int comps = TurbFields[func].comps; float dt = DataSets[dataset].dt; int timestep = (int)ceil(time/DataSets[dataset].dt - .5f); if(temporal == PCHIPInt) { float temp[4][3]; int i, j; for (i=0; i < count; i++) { for(j = 0; j < 4; j++) { getSingleValue(dataset, func, position[i], timestep+(j-1), spatial, temp[j]); } pchipInterp(3, temp, time, timestep, dt, result + i*comps); } } else { int i; for (i = 0; i < count; i++) { getSingleValue(dataset, func, position[i], timestep, spatial, result + i*comps); } } freeLoadedMemory(); return 0; } int getVelocityAndPressureLocal (TurbDataset dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][4]) { if(!validateParams(spatial, dataset, 0)) return -1; float dt = DataSets[dataset].dt; int timestep = (int)ceil(time/DataSets[dataset].dt - .5f); if(temporal == PCHIPInt) { float temp[4][3]; int i, j; for (i=0; i < count; i++) { for(j = 0; j < 4; j++) { getSingleValue(dataset, turb_vp, datain[i], timestep+(j-1), spatial, temp[j]); } pchipInterp(4, temp, time, timestep, dt, dataout[i]); } } else { float temp[4]; int i; for (i = 0; i < count; i++) { getSingleValue(dataset, turb_vp, datain[i], timestep, spatial, temp); dataout[i][0] = temp[0]; dataout[i][1] = temp[1]; dataout[i][2] = temp[2]; dataout[i][3] = temp[3]; } } return 0; } int getPressureHessianLocal (TurbDataset dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float input[count][3], float output[count][6]) { if(!validateParams(spatial, dataset, 1)) return -1; return getHessian(dataset, turb_pressure, time, spatial, temporal, count, input, &output[0][0]); } int getVelocityGradientLocal (TurbDataset dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float input[count][3], float output[count][9]) { if(!validateParams(spatial, dataset, 1)) return -1; return getGradient(dataset, turb_velocity, time, spatial, temporal, count, input, &output[0][0]); } int getMagneticFieldGradientLocal (TurbDataset dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float input[count][3], float output[count][9]) { if(!validateParams(spatial, dataset, 1)) return -1; return getGradient(dataset, turb_magnetic, time, spatial, temporal, count, input, &output[0][0]); } int getVectorPotentialGradientLocal (TurbDataset dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float input[count][3], float output[count][9]) { if(!validateParams(spatial, dataset, 1)) return -1; return getGradient(dataset, turb_potential, time, spatial, temporal, count, input, &output[0][0]); } int getPressureGradientLocal (TurbDataset dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float input[count][3], float output[count][3]) { if(!validateParams(spatial, dataset, 1)) return -1; return getGradient(dataset, turb_pressure, time, spatial, temporal, count, input, &output[0][0]); } int getVelocityHessianLocal (TurbDataset dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float input[count][3], float output[count][18]) { if(!validateParams(spatial, dataset, 1)) return -1; return getHessian(dataset, turb_velocity, time, spatial, temporal, count, input, &output[0][0]); } int getVelocityLaplacianLocal (TurbDataset dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float input[][3], float output[][3]) { if(!validateParams(spatial, dataset, 1)) return -1; return getLaplacian (dataset, turb_velocity, time, spatial, temporal, count, input, output); } int getMagneticFieldHessianLocal (TurbDataset dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float input[count][3], float output[count][18]) { if(!validateParams(spatial, dataset, 1)) return -1; return getHessian(dataset, turb_magnetic, time, spatial, temporal, count, input, &output[0][0]); } int getMagneticFieldLaplacianLocal(TurbDataset dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float input[][3], float output[][3]) { if(!validateParams(spatial, dataset, 1)) return -1; return getLaplacian(dataset, turb_magnetic, time, spatial, temporal, count, input, output); } int getVectorPotentialHessianLocal (TurbDataset dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float input[count][3], float output[count][18]) { if(!validateParams(spatial, dataset, 1)) return -1; return getHessian(dataset, turb_potential, time, spatial, temporal, count, input, &output[0][0]); } int getVectorPotentialLaplacianLocal (TurbDataset dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float datain[][3], float dataout[][3]) { if(!validateParams(spatial, dataset, 1)) return -1; return getLaplacian(dataset, turb_potential, time, spatial, temporal, count, datain, dataout); } int getDensityGradientLocal (TurbDataset dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float input[count][3], float output[count][3]) { if(!validateParams(spatial, dataset, 1)) return -1; return getGradient(dataset, turb_density, time, spatial, temporal, count, input, &output[0][0]); } int getDensityHessianLocal (TurbDataset dataset, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float input[count][3], float output[count][6]) { if(!validateParams(spatial, dataset, 1)) return -1; return getHessian(dataset, turb_density, time, spatial, temporal, count, input, &output[0][0]); } /* HDF5 file utility functions */ int turblibaddlocalsource_ (char *fname) { return turblibAddLocalSource (fname); } int turblibAddLocalSource(char *fname) { fprintf(stderr, "opening %s\n", fname); hid_t file = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT); if (file < 0) return -1; cutoutFile *src = malloc(sizeof(cutoutFile)); src->next = NULL; src->file = file; //Determine which set int dataset; hid_t set_name = H5Dopen1(file, "_dataset"); H5Dread(set_name, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &dataset); src->dataset = dataset; //Determine bounds int start[4]; hid_t set_start = H5Dopen1(file, "_start"); H5Dread(set_start, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, start); src->start[0] = start[0]; src->start[1] = start[1]; src->start[2] = start[2]; src->start[3] = start[3]; //Determine size int size[4]; hid_t set_size = H5Dopen1(file, "_size"); H5Dread(set_size, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, size); src->size[0] = size[0]; src->size[1] = size[1]; src->size[2] = size[2]; src->size[3] = size[3]; //Determine contents int contents; hid_t set_contents = H5Dopen1(file, "_contents"); H5Dread(set_contents, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &contents); src->contents[turb_velocity] = (contents & 0x01 ? 1 : 0); src->contents[turb_pressure] = (contents & 0x02 ? 1 : 0); src->contents[turb_magnetic] = (contents & 0x04 ? 1 : 0); src->contents[turb_potential] = (contents & 0x08 ? 1 : 0); src->contents[turb_density] = (contents & 0x16 ? 1 : 0); memset(src->data, 0, sizeof(float *) * 4096); /* int f; for (f = 0; f < 4; f++) { int t; for (t = src->start[0]; t < src->size[0]; t++) { if(src->contents[f] == 0) continue; src->data[f][t] = malloc(sizeof(float) * TurbFields[f].comps * src->size[1] * src->size[2] * src->size[3]); char setname[16]; sprintf(setname, "%c%.5d", TurbFields[f].prefix, t); hid_t datachunk = H5Dopen1(file, setname); H5Dread(datachunk, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, src->data[f][t]); H5Dclose(datachunk); } } */ H5Dclose(set_name); H5Dclose(set_start); H5Dclose(set_size); H5Dclose(set_contents); if (__turblib_cutouts == NULL) { __turblib_cutouts = src; } else { cutoutFile* last = __turblib_cutouts; while(last->next != NULL) last = last->next; last->next = src; } return 0; } //Turn prefetching on or off int turblibSetPrefetching(int prefetch) { return (__turblib_prefetching = prefetch); } //Caches a portion of the specified file in memory int loadDataToMemory(cutoutFile *src, TurbField function, int timestep, int xl, int yl, int zl, int xh, int yh, int zh) { if(src->data[function][timestep] != NULL) return 0; hsize_t buff_size[] = { zh - zl + 1, yh - yl + 1, xh - xl + 1, TurbFields[function].comps }; hid_t mspace = H5Screate_simple(4, buff_size, NULL); float* buff = malloc(sizeof(float) * TurbFields[function].comps * buff_size[0] * buff_size[1] * buff_size[2]); if(!buff) return -1; char setname[16]; sprintf(setname, "%c%.5d", TurbFields[function].prefix, timestep*10); hsize_t start[4] = { zl - src->start[3], yl - src->start[2], xl - src->start[1], 0 }, scount[4] = { zh - zl + 1, yh - yl + 1, xh - xl + 1, TurbFields[function].comps }; hid_t dataset = H5Dopen1(src->file, setname); hid_t filespace = H5Dget_space(dataset); H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, scount, NULL); H5Dread(dataset, H5T_NATIVE_FLOAT, mspace, filespace, H5P_DEFAULT, buff); H5Dclose(dataset); H5Sclose(filespace); dataBlock *cache = malloc(sizeof(dataBlock)); cache->data = buff; cache->xl = xl; cache->yl = yl; cache->zl = zl; cache->hx = scount[2]; cache->hy = scount[1]; cache->hz = scount[0]; src->data[function][timestep] = cache; return 0; } int freeLoadedMemory(void) { cutoutFile * file; if(!__turblib_prefetching) return 0; int j, k; for (file = __turblib_cutouts; file != NULL; file = file->next) { for(j = 0; j < 4; j++) { for(k = 0; k < 1024; k++) { if(file->data[j][k] != NULL) { free(file->data[j][k]->data); free(file->data[j][k]); file->data[j][k] = NULL; } } } } return 0; } int loadNeededData(TurbDataset set, TurbField function, int count, float position[][3], float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal) { if(!__turblib_prefetching) return 0; float dx = DataSets[set].dx, dt = DataSets[set].dt; //Determine availability of data locally int nOrderLag = spatial % 10; int nOrderFD = (int) (spatial / 10); int size = (spatial == NoSInt ? 1 : nOrderLag) + nOrderFD; int timestep = (int)ceil(time/dt - .5f); int timesteps = 1; if (temporal == PCHIPInt) { timestep -= 1; timesteps = 4; } int t; for (t = 0; t < timesteps; t++) { cutoutFile *file; for (file = __turblib_cutouts; file != NULL; file = file->next) { int fileUsed = 0; int lowestx = file->start[1] + file->size[1] - 1, lowesty = file->start[2] + file->size[2] - 1, lowestz = file->start[3] + file->size[3] - 1, highestx = file->start[1], highesty = file->start[2], highestz = file->start[3]; int i; int x, y, z, endx, endy, endz; for (i = 0; i < count; i++) { if (spatial==NoSInt) { x = (int) (round(position[i][0]/dx)) - nOrderFD/2; y = (int) (round(position[i][1]/dx)) - nOrderFD/2; z = (int) (round(position[i][2]/dx)) - nOrderFD/2; } else { x = (int) (floor(position[i][0]/dx)) - (nOrderLag + nOrderFD) / 2 + 1; y = (int) (floor(position[i][1]/dx)) - (nOrderLag + nOrderFD) / 2 + 1; z = (int) (floor(position[i][2]/dx)) - (nOrderLag + nOrderFD) / 2 + 1; } endx = x + size - 1; endy = y + size - 1; endz = z + size - 1; x = (x % 1024 + 1024) % 1024; y = (y % 1024 + 1024) % 1024; z = (z % 1024 + 1024) % 1024; endx = (endx % 1024 + 1024) % 1024; endy = (endy % 1024 + 1024) % 1024; endz = (endz % 1024 + 1024) % 1024; //if(!isWithinFile(set, function, x, y, z, size, size, size, timestep, file)) continue; //fileUsed = 1; //if(x < lowestx) lowestx = x; //if(y < lowesty) lowesty = y; //if(z < lowestz) lowestz = z; //if(x > highestx) highestx = x; //if(y > highesty) highesty = y; //if(z > highestz) highestz = z; if (file->dataset == set && (function == turb_vp ? file->contents[turb_pressure] && file->contents[turb_velocity] : file->contents[function]) && timestep >= file->start[0] && timestep <= (file->start[0] + file->size[0]-1)) { if ((file->start[1] <= x && x < (file->start[1] + file->size[1])) || (file->start[1] <= endx && endx < (file->start[1] + file->size[1])) || (x < file->start[1] && (file->start[1] + file->size[1]) <= endx) || (x < file->start[1] && endx < x) || ((file->start[1] + file->size[1]) <= endx && endx < x)) if ((file->start[2] <= y && y < (file->start[2] + file->size[2])) || (file->start[2] <= endy && endy < (file->start[2] + file->size[2])) || (y < file->start[2] && (file->start[2] + file->size[2]) <= endy) || (y < file->start[2] && endy < y) || ((file->start[2] + file->size[2]) <= endy && endy < y)) if ((file->start[3] <= z && z < (file->start[3] + file->size[3])) || (file->start[3] <= endz && endz < (file->start[3] + file->size[3])) || (z < file->start[3] && (file->start[3] + file->size[3]) <= endz) || (z < file->start[3] && endz < z) || ((file->start[3] + file->size[3]) <= endz && endz < z)) { if (lowestx > x) if (x >= file->start[1]) lowestx = x; else lowestx = file->start[1]; else if (x >= file->start[1] + file->size[1] && x > endx) lowestx = file->start[1]; if (lowesty > y) if (y >= file->start[2]) lowesty = y; else lowesty = file->start[2]; else if (y >= file->start[2] + file->size[2] && y > endy) lowesty = file->start[2]; if (lowestz > z) if (z >= file->start[3]) lowestz = z; else lowestz = file->start[3]; else if (z >= file->start[3] + file->size[3] && z > endz) lowestz = file->start[3]; if (highestx < endx) if (endx < file->start[1] + file->size[1]) highestx = endx; else highestx = file->start[1] + file->size[1] - 1; else if (endx < file->start[1] && x > endx) highestx = file->start[1] + file->size[1] - 1; if (highesty < endy) if (endy < file->start[2] + file->size[2]) highesty = endy; else highesty = file->start[2] + file->size[2] - 1; else if (endy < file->start[2] && y > endy) highesty = file->start[2] + file->size[2] - 1; if (highestz < endz) if (endz < file->start[3] + file->size[3]) highestz = endz; else highestz = file->start[3] + file->size[3] - 1; else if (endz < file->start[3] && z > endz) highestz = file->start[3] + file->size[3] - 1; } } } if(!fileUsed) continue; //highestx = highestx + size - 1; //highesty = highesty + size - 1; //highestz = highestz + size - 1; loadDataToMemory(file, function, timestep, lowestx, lowesty, lowestz, highestx, highesty, highestz); } } return 1; } TurbDataset getDataSet(char *name) { if (strcmp("isotropic1024coarse", name) == 0) return isotropic1024coarse; if (strcmp("isotropic1024", name) == 0) return isotropic1024coarse; if (strcmp("isotropic1024fine", name) == 0) return isotropic1024fine; if (strcmp("mhd1024", name) == 0) return mhd1024; if (strcmp("channel", name) == 0) return channel; if (strcmp("mixing", name) == 0) return mixing; if (strcmp("custom", name) == 0) return custom_dataset; return -1; } int isDataAvailable(TurbDataset set, TurbField function, int count, float position[][3], float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal) { if (set == channel) { printf("The client library does not currently provide local implementations " "of the server-side functions for the channel flow dataset. " "Redirecting to the server...\n"); return 0; } float dx = DataSets[set].dx, dt = DataSets[set].dt; //Determine availability of data locally int nOrderLag = spatial % 10; int nOrderFD = (int) (spatial / 10); int size = (spatial == NoSInt ? 1 : nOrderLag) + nOrderFD; int xc, yc, zc; int i; for (i = 0; i < count; i++) { int x = (int) (floor(position[i][0]/dx)), y = (int) (floor(position[i][1]/dx)), z = (int) (floor(position[i][2]/dx)); if (spatial==NoSInt) { xc = (int) (round(position[i][0]/dx)) - nOrderFD/2; yc = (int) (round(position[i][1]/dx)) - nOrderFD/2; zc = (int) (round(position[i][2]/dx)) - nOrderFD/2; } else { xc = x - (nOrderLag + nOrderFD) / 2 + 1; yc = y - (nOrderLag + nOrderFD) / 2 + 1; zc = z - (nOrderLag + nOrderFD) / 2 + 1; } int timestep = (int)ceil(time/dt - .5f); if (temporal == PCHIPInt) { int t; for(t = 0; t < 4; t++) { if(!isDataComplete(set, function, xc, yc, zc, size, size, size, timestep-1+t)) { return 0; } } } else { if(!isDataComplete(set, function, xc, yc, zc, size, size, size, timestep)) { return 0; } } } return 1; } //Determines if the given data cube can be completely assembled from all cutout files //In the case where data may span more than 2 files we call on the function recursively int isDataComplete(TurbDataset dataset, TurbField function, int x, int y, int z, int xw, int yw, int zw, int timestep) { // Wrap the coordinates into the grid space x = (x % 1024 + 1024) % 1024; y = (y % 1024 + 1024) % 1024; z = (z % 1024 + 1024) % 1024; //Is the data available as a contiguous block? if(findDataBlock(dataset, function, x, y, z, xw, yw, zw, timestep) != NULL) return 1; //Is the data available in pieces across different files? (Individual HDF5 files are restricted to units of 16x16x16) cutoutFile* corner = findDataBlock(dataset, function, x, y, z, 1, 1, 1, timestep); if (corner == NULL) return 0; int sx = ((corner->start[1] + corner->size[1]) - x), sy = ((corner->start[2] + corner->size[2]) - y), sz = ((corner->start[3] + corner->size[3]) - z); int dx = xw - sx, dy = yw - sy, dz = zw - sz; if(findDataBlock(dataset, function, x, y, z, sx, sy, sz, timestep) == NULL) return 0; //NOTE: In the case of wrap-around corner->start + corner->size will be wrapped to 0 below //Ensure presence of other pieces if(dz > 0) { // if(findDataBlock(dataset, function, x, y, corner->start[3] + corner->size[3], // (dx > 0 ? size - dx : size), (dy > 0 ? size - dy : size), dz, timestep) == NULL) return 0; if(!isDataComplete(dataset, function, x, y, corner->start[3] + corner->size[3], (dx > 0 ? xw - dx : xw), (dy > 0 ? yw - dy : yw), dz, timestep)) return 0; if (dy > 0) { // if(findDataBlock(dataset, function, // x, corner->start[2] + corner->size[2], corner->start[3] + corner->size[3], // (dx > 0 ? size - dx : size), dy, dz, timestep) == NULL) return 0; if(!isDataComplete(dataset, function, x, corner->start[2] + corner->size[2], corner->start[3] + corner->size[3], (dx > 0 ? xw - dx : xw), dy, dz, timestep)) return 0; if (dx > 0) { // if(findDataBlock(dataset, function, // corner->start[1] + corner->size[1], corner->start[2] + corner->size[2], corner->start[3] + corner->size[3], // dx, dy, dz, timestep) == NULL) return 0; if(!isDataComplete(dataset, function, corner->start[1] + corner->size[1], corner->start[2] + corner->size[2], corner->start[3] + corner->size[3], dx, dy, dz, timestep)) return 0; } } if (dx > 0) { // if(findDataBlock(dataset, function, // corner->start[1] + corner->size[1], y, corner->start[3] + corner->size[3], // dx, (dy > 0 ? size - dy : size), dz, timestep) == NULL) return 0; if(!isDataComplete(dataset, function, corner->start[1] + corner->size[1], y, corner->start[3] + corner->size[3], dx, (dy > 0 ? yw - dy : yw), dz, timestep)) return 0; } } if (dy > 0) { // if(findDataBlock(dataset, function, // x, corner->start[2] + corner->size[2], z, // (dx > 0 ? size - dx : size), dy, (dz > 0 ? size - dz : size), timestep) == NULL) return 0; if(!isDataComplete(dataset, function, x, corner->start[2] + corner->size[2], z, (dx > 0 ? xw - dx : xw), dy, (dz > 0 ? zw - dz : zw), timestep)) return 0; if (dx > 0) { // if(findDataBlock(dataset, function, // corner->start[1] + corner->size[1], corner->start[2] + corner->size[2], z, // dx, dy, (dz > 0 ? size - dz : size), timestep) == NULL) return 0; if(!isDataComplete(dataset, function, x, corner->start[2] + corner->size[2], z, (dx > 0 ? xw - dx : xw), dy, (dz > 0 ? zw - dz : zw), timestep)) return 0; } } if (dx > 0) { // if(findDataBlock(dataset, function, // corner->start[1] + corner->size[1], y, z, // dx, (dy > 0 ? size - dy : size), (dz > 0 ? size - dz : size), timestep) == NULL) return 0; if(!isDataComplete(dataset, function, corner->start[1] + corner->size[1], y, z, dx, (dy > 0 ? yw - dy : yw), (dz > 0 ? zw - dz : zw), timestep)) return 0; } return 1; } //XYZ cutoutFile* findDataBlock(TurbDataset dataset, TurbField function, int x, int y, int z, int xw, int yw, int zw, int timestep) { x = (x % 1024 + 1024) % 1024; y = (y % 1024 + 1024) % 1024; z = (z % 1024 + 1024) % 1024; //xw = (xw % 1024 + 1024) % 1024; //yw = (yw % 1024 + 1024) % 1024; //zw = (zw % 1024 + 1024) % 1024; cutoutFile *file; for (file = __turblib_cutouts; file != NULL; file = file->next) { if (isWithinFile(dataset, function, x, y, z, xw, yw, zw, timestep, file)) return file; } return NULL; } int isWithinFile(TurbDataset dataset, TurbField function, int x, int y, int z, int xw, int yw, int zw, int timestep, cutoutFile* file) { //int result; //result = (file->dataset == dataset); ////fprintf(stderr, "\nisWithinFile, %s\n", result ? "true" : "false"); //result = result && // (function == turb_vp ? file->contents[turb_pressure] && file->contents[turb_velocity] : file->contents[function]); ////fprintf(stderr, "isWithinFile, %s\n", result ? "true" : "false"); //result = result && // timestep >= file->start[0] && timestep <= (file->start[0] + file->size[0]-1); ////fprintf(stderr, "isWithinFile, %s\n", result ? "true" : "false"); //result = result && // x >= file->start[1] && (x + xw) <= (file->start[1] + file->size[1]); ////fprintf(stderr, "isWithinFile, %s\n", result ? "true" : "false"); //result = result && // y >= file->start[2] && (y + yw) <= (file->start[2] + file->size[2]); ////fprintf(stderr, "isWithinFile, %s\n", result ? "true" : "false"); //result = result && // z >= file->start[3] && (z + zw) <= (file->start[3] + file->size[3]); ////fprintf(stderr, "isWithinFile, %s\n", result ? "true" : "false"); ////fprintf(stderr, "isWithinFile, %d %d %d %d\n", z, zw, file->start[3], file->size[3]); //if (result) if ((file->dataset == dataset) && (function == turb_vp ? file->contents[turb_pressure] && file->contents[turb_velocity] : file->contents[function]) && timestep >= file->start[0] && timestep <= (file->start[0] + file->size[0]-1) && x >= file->start[1] && (x + xw) <= (file->start[1] + file->size[1]) && y >= file->start[2] && (y + yw) <= (file->start[2] + file->size[2]) && z >= file->start[3] && (z + zw) <= (file->start[3] + file->size[3])) return 1; return 0; } /* zyx order */ dataKernel* getDataCube(TurbDataset dataset, TurbField function, int x, int y, int z, int timestep, int size) { dataKernel* cube = malloc(sizeof(dataKernel)); cutoutFile *loc = findDataBlock(dataset, function, x, y, z, size, size, size, timestep); if(loc != 0 && loc->data[function][timestep] != NULL) { dataBlock *cache = loc->data[function][timestep]; cube->data = cache->data; cube->x = x - cache->xl; cube->y = y - cache->yl; cube->z = z - cache->zl; cube->hx = cache->hx; cube->hy = cache->hy; cube->hz = cache->hz; cube->comps = TurbFields[function].comps; cube->persist = 1; } else { // printf("Cache miss!\n"); float* buff = malloc(sizeof(float) * TurbFields[function].comps * size * size * size); loadDataCube(dataset, function, x, y, z, timestep, size, buff); cube->data = buff; cube->x = 0; cube->y = 0; cube->z = 0; cube->hx = size; cube->hy = size; cube->hz = size; cube->comps = TurbFields[function].comps; cube->persist = 0; } return cube; } int getSinglePoint(TurbDataset dataset, TurbField function, int x, int y, int z, int timestep, float *out) { int comps = TurbFields[function].comps; cutoutFile *loc = findDataBlock(dataset, function, x, y, z, 1, 1, 1, timestep); if(loc != NULL && loc->data[function][timestep] != NULL) { dataBlock *cache = loc->data[function][timestep]; int c = 0, index = x*comps + y*comps*cache->hx + z*comps*cache->hx*cache->hy; for (c = 0; c < comps; c++) out[c] = cache->data[c + index]; } else { loadDataCube(dataset, function, x, y, z, timestep, 1, out); } return 0; } void freeDataCube(dataKernel* cube) { if(cube->persist == 0) free(cube->data); // free cube; } /* zyx order */ //Loads a given block of data into memory, assembled possibly from multiple files //TODO: The function doesn't handle the situation where the data cube requested // spans more than 2 files in each dimension int loadDataCube(TurbDataset dataset, TurbField function, int x, int y, int z, int timestep, int size, float *buff) { int comps = TurbFields[function].comps; hsize_t dim_mem[] = { size, size, size, comps }; hid_t mspace = H5Screate_simple(4, dim_mem, NULL); //Wrap the coordinates into the grid space: x = (x % 1024 + 1024) % 1024; y = (y % 1024 + 1024) % 1024; z = (z % 1024 + 1024) % 1024; //Is the data available as a contiguous block? cutoutFile* src = findDataBlock(dataset, function, x, y, z, size, size, size, timestep); if(src != NULL) { char setname[16]; sprintf(setname, "%c%.5d", TurbFields[function].prefix, timestep*10); hid_t dataset = H5Dopen1(src->file, setname); hid_t filespace = H5Dget_space(dataset); //Data selection of the file hsize_t start[4] = { z - src->start[3], y - src->start[2], x - src->start[1], 0 }, scount[4] = { size, size, size, comps }; H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, scount, NULL); H5Dread(dataset, H5T_NATIVE_FLOAT, mspace, filespace, H5P_DEFAULT, (float*)buff); H5Dclose(dataset); H5Sclose(mspace); H5Sclose(filespace); return 0; } //Load the data piece by piece: cutoutFile *corner = findDataBlock(dataset, function, x, y, z, 1, 1, 1, timestep); int sx = ((corner->start[1] + corner->size[1]) - x), sy = ((corner->start[2] + corner->size[2]) - y), sz = ((corner->start[3] + corner->size[3]) - z); int dx = size - sx, dy = size - sy, dz = size - sz; sx = sx > size ? size : sx; sy = sy > size ? size : sy; sz = sz > size ? size : sz; //First load corner loadSubBlock(dataset, function, timestep, mspace, buff, x, y, z, sx, sy, sz, 0, 0, 0); //Then load other pieces if(dz > 0) { loadSubBlock(dataset, function, timestep, mspace, buff, x, y, corner->start[3] + corner->size[3], (dx > 0 ? size - dx : size), (dy > 0 ? size - dy : size), dz, 0, 0, sz); if (dy > 0) { loadSubBlock(dataset, function, timestep, mspace, buff, x, corner->start[2] + corner->size[2], corner->start[3] + corner->size[3], (dx > 0 ? size - dx : size), dy, dz, 0, sy, sz); if (dx > 0) { loadSubBlock(dataset, function, timestep, mspace, buff, corner->start[1] + corner->size[1], corner->start[2] + corner->size[2], corner->start[3] + corner->size[3], dx, dy, dz, sx, sy, sz); } } if (dx > 0) { loadSubBlock(dataset, function, timestep, mspace, buff, corner->start[1] + corner->size[1], y, corner->start[3] + corner->size[3], dx, (dy > 0 ? size - dy : size), dz, sx, 0, sz); } } if (dy > 0) { loadSubBlock(dataset, function, timestep, mspace, buff, x, corner->start[2] + corner->size[2], z, (dx > 0 ? size - dx : size), dy, (dz > 0 ? size - dz : size), 0, sy, 0); if (dx > 0) { loadSubBlock(dataset, function, timestep, mspace, buff, corner->start[1] + corner->size[1], corner->start[2] + corner->size[2], z, dx, dy, (dz > 0 ? size - dz : size), sx, sy, 0); } } if (dx > 0) { loadSubBlock(dataset, function, timestep, mspace, buff, corner->start[1] + corner->size[1], y, z, dx, (dy > 0 ? size - dy : size), (dz > 0 ? size - dz : size), sx, 0, 0); } H5Sclose(mspace); return 1; } /* xyz order */ int loadSubBlock(TurbDataset dataset, TurbField function, int timestep, hid_t mspace, float *buff, int x, int y, int z, int wx, int wy, int wz, int dest_x, int dest_y, int dest_z) { x = (x % 1024 + 1024) % 1024; y = (y % 1024 + 1024) % 1024; z = (z % 1024 + 1024) % 1024; char setname[16]; int comps = TurbFields[function].comps; sprintf(setname, "%c%.5d", TurbFields[function].prefix, timestep*10); cutoutFile *src = findDataBlock(dataset, function, x, y, z, wx, wy, wz, timestep); hid_t dataset_ = H5Dopen1(src->file, setname); hid_t filespace = H5Dget_space(dataset_); //Data selection of the file hsize_t start[4] = { z - src->start[3], y - src->start[2], x - src->start[1], 0 }, scount[4] = { wz, wy, wx, comps }; //Data selection of memory hsize_t mstart[4] = { dest_z, dest_y, dest_x, 0 }; H5Sselect_hyperslab(mspace, H5S_SELECT_SET, mstart, NULL, scount, NULL); H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, scount, NULL); H5Dread(dataset_, H5T_NATIVE_FLOAT, mspace, filespace, H5P_DEFAULT, buff); H5Sclose(filespace); H5Dclose(dataset_); return 0; } /* Local computation functions */ int validateParams(enum SpatialInterpolation spatial, TurbDataset set, int useFD) { int nOrderFD = (int) spatial / 10; int nOrderLag = (int) spatial % 10; if( (useFD && nOrderFD != 4 && nOrderFD != 6 && nOrderFD != 8) || (!useFD && nOrderFD != 0) || (nOrderLag != 0 && nOrderLag != 4 && nOrderLag != 6 && nOrderLag != 8) || (set < 0) ) { fprintf(stderr, "Error: Invalid interpolation parameter specified\n"); return 0; } return 1; } //Gets the value of a function at the point, with or without interpolation int getSingleValue(TurbDataset dataset, TurbField func, float position[3], int timestep, enum SpatialInterpolation spatial, float *output) { if (func == turb_vp) { getSingleValue(dataset, turb_velocity, position, timestep, spatial, output); getSingleValue(dataset, turb_pressure, position, timestep, spatial, &output[3]); return 0; } float dx = DataSets[dataset].dx; int nOrder = (int) spatial; int comps = TurbFields[func].comps; //If no spatial int, just return the closest points and finish if (nOrder == 0) { int x = (int) (round(position[0]/dx)), y = (int) (round(position[1]/dx)), z = (int) (round(position[2]/dx)); getSinglePoint(dataset, func, x, y, z, timestep, output); } else { int x = (int) (floor(position[0]/dx)) - (nOrder/2) + 1, y = (int) (floor(position[1]/dx)) - (nOrder/2) + 1, z = (int) (floor(position[2]/dx)) - (nOrder/2) + 1; dataKernel* cube = getDataCube(dataset, func, x, y, z, timestep, nOrder); lagrangianInterp2(comps, cube, position, nOrder, dx, output); freeDataCube(cube); } return 0; } int getGradient (TurbDataset dataset, TurbField function, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float input[count][3], float *output) { loadNeededData(dataset, function, count, input, time, spatial, temporal); float dt = DataSets[dataset].dt; int timestep = (int)ceil(time/DataSets[dataset].dt - .5f); int comps = TurbFields[function].comps; int nOrderLag = spatial % 10, nOrderFD = spatial / 10; int gradientSize = (nOrderLag == 0? 1 : nOrderLag); int kernelsize = gradientSize + nOrderFD; int x, y, z; float dx = DataSets[dataset].dx; dataKernel* fdkernel; //Diff, Lagint, pchipInt if(temporal == PCHIPInt) { float temp[4][comps*3]; int i, j; if (nOrderLag > 0) { float *lagkernel; lagkernel = malloc(sizeof(float) * comps * 3 * gradientSize * gradientSize * gradientSize); for (i = 0; i < count; i++) { x = (int) (input[i][0]/dx) - (kernelsize/2) + 1; y = (int) (input[i][1]/dx) - (kernelsize/2) + 1; z = (int) (input[i][2]/dx) - (kernelsize/2) + 1; for (j = 0; j < 4; j++) { fdkernel = getDataCube(dataset, function, x, y, z, timestep+j-1, kernelsize); computeGradient(fdkernel, comps, dx, gradientSize, nOrderFD, lagkernel); lagrangianInterp(comps * 3, lagkernel, input[i], nOrderLag, dx, temp[j]); freeDataCube(fdkernel); } pchipInterp(comps * 3, temp, time, timestep, dt, output+i*comps*3); } free(lagkernel); } else { for (i = 0; i < count; i++) { x = (int) (input[i][0]/dx + 0.5f) - nOrderFD/2; y = (int) (input[i][1]/dx + 0.5f) - nOrderFD/2; z = (int) (input[i][2]/dx + 0.5f) - nOrderFD/2; for (j = 0; j < 4; j++) { fdkernel = getDataCube(dataset, function, x, y, z, timestep+j-1, kernelsize); computeGradient(fdkernel, comps, dx, gradientSize, nOrderFD, temp[j]); freeDataCube(fdkernel); } pchipInterp(comps * 3, temp, time, timestep, dt, output+i*comps*3); } } } //No temporal int else { int i; if (nOrderLag > 0) { float *lagkernel; lagkernel = malloc(sizeof(float) * comps * 3 * gradientSize * gradientSize * gradientSize); for (i = 0; i < count; i++) { x = (int) (input[i][0]/dx) - (kernelsize/2) + 1; y = (int) (input[i][1]/dx) - (kernelsize/2) + 1; z = (int) (input[i][2]/dx) - (kernelsize/2) + 1; fdkernel = getDataCube(dataset, function, x, y, z, timestep, kernelsize); computeGradient(fdkernel, comps, dx, gradientSize, nOrderFD, lagkernel); lagrangianInterp(comps * 3, lagkernel, input[i], nOrderLag, dx, output+i*comps*3); freeDataCube(fdkernel); } free(lagkernel); } else { for (i = 0; i < count; i++) { x = (int) (input[i][0]/dx + 0.5f) - nOrderFD/2; y = (int) (input[i][1]/dx + 0.5f) - nOrderFD/2; z = (int) (input[i][2]/dx + 0.5f) - nOrderFD/2; fdkernel = getDataCube(dataset, function, x, y, z, timestep, kernelsize); computeGradient(fdkernel, comps, dx, gradientSize, nOrderFD, output+i*comps*3); freeDataCube(fdkernel); } } } freeLoadedMemory(); return 0; } int getLaplacian (TurbDataset dataset, TurbField function, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float input[][3], float output[][3]) { loadNeededData(dataset, function, count, input, time, spatial, temporal); float dt = DataSets[dataset].dt; int timestep = (int)ceil(time/DataSets[dataset].dt - .5f); int comps = TurbFields[function].comps; int nOrderLag = spatial % 10, nOrderFD = spatial / 10; int gradientSize = (nOrderLag == 0? 1 : nOrderLag); int kernelsize = gradientSize + nOrderFD; int x, y, z; float dx = DataSets[dataset].dx; dataKernel* fdkernel; //Diff, Lagint, pchipInt if(temporal == PCHIPInt) { float temp[4][3]; int i, j; if (nOrderLag > 0) { float *lagkernel; lagkernel = malloc(sizeof(float) * comps * gradientSize * gradientSize * gradientSize); for (i = 0; i < count; i++) { x = (int) (input[i][0]/dx) - (kernelsize/2) + 1; y = (int) (input[i][1]/dx) - (kernelsize/2) + 1; z = (int) (input[i][2]/dx) - (kernelsize/2) + 1; for (j = 0; j < 4; j++) { fdkernel = getDataCube(dataset, function, x, y, z, timestep+j-1, kernelsize); computeLaplacian(fdkernel, comps, dx, gradientSize, nOrderFD, lagkernel); lagrangianInterp(comps, lagkernel, input[i], nOrderLag, dx, temp[j]); freeDataCube(fdkernel); } pchipInterp(comps, temp, time, timestep, dt, output[i]); } } else { for (i = 0; i < count; i++) { x = (int) (input[i][0]/dx + 0.5f) - nOrderFD/2; y = (int) (input[i][1]/dx + 0.5f) - nOrderFD/2; z = (int) (input[i][2]/dx + 0.5f) - nOrderFD/2; for (j = 0; j < 4; j++) { fdkernel = getDataCube(dataset, function, x, y, z, timestep+j-1, kernelsize); computeLaplacian(fdkernel, comps, dx, gradientSize, nOrderFD, temp[j]); freeDataCube(fdkernel); } pchipInterp(comps, temp, time, timestep, dt, output[i]); } } } //No temporal int else { int i; if (nOrderLag > 0) { float *lagkernel; lagkernel = malloc(sizeof(float) * comps * gradientSize * gradientSize * gradientSize); for (i = 0; i < count; i++) { x = (int) (input[i][0]/dx) - (kernelsize / 2) + 1; y = (int) (input[i][1]/dx) - (kernelsize / 2) + 1; z = (int) (input[i][2]/dx) - (kernelsize / 2) + 1; fdkernel = getDataCube(dataset, function, x, y, z, timestep, kernelsize); computeLaplacian(fdkernel, comps, dx, gradientSize, nOrderFD, lagkernel); lagrangianInterp(comps, lagkernel, input[i], nOrderLag, dx, output[i]); freeDataCube(fdkernel); } } else { for (i = 0; i < count; i++) { x = (int) (input[i][0]/dx + 0.5f) - nOrderFD/2; y = (int) (input[i][1]/dx + 0.5f) - nOrderFD/2; z = (int) (input[i][2]/dx + 0.5f) - nOrderFD/2; fdkernel = getDataCube(dataset, function, x, y, z, timestep, kernelsize); computeLaplacian(fdkernel, comps, dx, gradientSize, nOrderFD, output[i]); freeDataCube(fdkernel); } } } freeLoadedMemory(); return 0; } int getHessian (TurbDataset dataset, TurbField function, float time, enum SpatialInterpolation spatial, enum TemporalInterpolation temporal, int count, float input[count][3], float* output) { loadNeededData(dataset, function, count, input, time, spatial, temporal); float dt = DataSets[dataset].dt; int timestep = (int)ceil(time/DataSets[dataset].dt - .5f); int nOrderLag = spatial % 10, nOrderFD = spatial / 10; int gradientSize = (nOrderLag == 0? 1 : nOrderLag); int comps = TurbFields[function].comps; int kernelsize = gradientSize + nOrderFD; int x, y, z; float dx = DataSets[dataset].dx; dataKernel* fdkernel; //Diff, Lagint, pchipInt if(temporal == PCHIPInt) { float temp[4][18]; int i, j; if (nOrderLag > 0) { float *lagkernel; lagkernel = malloc(sizeof(float) * comps * 6 * gradientSize * gradientSize * gradientSize); for (i = 0; i < count; i++) { x = (int) (input[i][0]/dx) - (kernelsize/2) + 1; y = (int) (input[i][1]/dx) - (kernelsize/2) + 1; z = (int) (input[i][2]/dx) - (kernelsize/2) + 1; for (j = 0; j < 4; j++) { fdkernel = getDataCube(dataset, function, x, y, z, timestep+j-1, kernelsize); computeHessian(fdkernel, comps, dx, gradientSize, nOrderFD, lagkernel); lagrangianInterp(comps * 6, lagkernel, input[i], nOrderLag, dx, temp[j]); freeDataCube(fdkernel); } pchipInterp(comps * 6, temp, time, timestep, dt, output+i*6*comps); } } else { for (i = 0; i < count; i++) { x = (int) (input[i][0]/dx + 0.5f) - nOrderFD/2; y = (int) (input[i][1]/dx + 0.5f) - nOrderFD/2; z = (int) (input[i][2]/dx + 0.5f) - nOrderFD/2; for (j = 0; j < 4; j++) { fdkernel = getDataCube(dataset, function, x, y, z, timestep+j-1, kernelsize); computeHessian(fdkernel, comps, dx, gradientSize, nOrderFD, temp[j]); freeDataCube(fdkernel); } pchipInterp(comps * 6, temp, time, timestep, dt, output+i*6*comps); } } } //No temporal int else { int i; if (nOrderLag > 0) { float *lagkernel; lagkernel = malloc(sizeof(float) * comps * 6 * gradientSize * gradientSize * gradientSize); for (i = 0; i < count; i++) { x = (int) (input[i][0]/dx) - (kernelsize / 2) + 1; y = (int) (input[i][1]/dx) - (kernelsize / 2) + 1; z = (int) (input[i][2]/dx) - (kernelsize / 2) + 1; fdkernel = getDataCube(dataset, function, x, y, z, timestep, kernelsize); computeHessian(fdkernel, comps, dx, gradientSize, nOrderFD, lagkernel); lagrangianInterp(comps * 6, lagkernel, input[i], nOrderLag, dx, output+i*6*comps); freeDataCube(fdkernel); } } else { for (i = 0; i < count; i++) { x = (int) (input[i][0]/dx + 0.5f) - nOrderFD/2; y = (int) (input[i][1]/dx + 0.5f) - nOrderFD/2; z = (int) (input[i][2]/dx + 0.5f) - nOrderFD/2; fdkernel = getDataCube(dataset, function, x, y, z, timestep, kernelsize); computeHessian(fdkernel, comps, dx, gradientSize, nOrderFD, output+i*6*comps); freeDataCube(fdkernel); } } } freeLoadedMemory(); return 0; } /* Interpolation Functions */ int lagrangianInterp(int comps, float *kernel, float position[3], int nOrder, float dx, float result[comps]) { int node[3]; node[0] = (int) (floor(position[0]/dx)); node[1] = (int) (floor(position[1]/dx)); node[2] = (int) (floor(position[2]/dx)); int x, y, z; float lagInt[3][8]; for (x = 0; x < 3; x++) { float z1 = position[x] / dx - (float) node[x] ; float z2 = z1 * z1; float z3 = z2 * z1; switch(nOrder) { case 4: { lagInt[x][0] = (-2 * z1 + 3 * z2 - z3) / 6; lagInt[x][1] = (2 - z1 - 2 * z2 + z3) / 2; lagInt[x][2] = (2 * z1 + z2 - z3) / 2; lagInt[x][3] = (-z1 + z3) / 6; break; } case 6: { float z4 = z2 * z2; float z5 = z3 * z2; lagInt[x][0] = (6 * z1 - 5 * z2 - 5 * z3 + 5 * z4 - z5) / 120; lagInt[x][1] = (-12 * z1 + 16 * z2 - z3 - 4 * z4 + z5) / 24; lagInt[x][2] = (12 - 4 * z1 - 15 * z2 + 5 * z3 + 3 * z4 - z5) / 12; lagInt[x][3] = (12 * z1 + 8 * z2 - 7 * z3 - 2 * z4 + z5) / 12; lagInt[x][4] = (-6 * z1 - z2 + 7 * z3 + z4 - z5) / 24; lagInt[x][5] = (4 * z1 - 5 * z3 + z5) / 120; break; } case 8: { float z4 = z3 * z1; float z5 = z4 * z1; float z6 = z5 * z1; float z7 = z6 * z1; lagInt[x][0] = -z1 * (z6 - 7 * z5 + 7 * z4 + 35 * z3 - 56 * z2 - 28 * z1 + 48) / 5040; lagInt[x][1] = z1 * (z6 - 6 * z5 - 2 * z4 + 60 * z3 - 71 * z2 - 54 * z1 + 72) / 720; lagInt[x][2] = -z1 * (z6 - 5 * z5 - 9 * z4 + 65 * z3 - 16 * z2 - 180 * z1 + 144) / 240; lagInt[x][3] = (z7 - 4 * z6 - 14 * z5 + 56 * z4 + 49 * z3 - 196 * z2 - 36 * z1 + 144) / 144; lagInt[x][4] = -z1 * (z6 - 3 * z5 - 17 * z4 + 39 * z3 + 88 * z2 - 108 * z1 - 144) / 144; lagInt[x][5] = z1 * (z6 - 2 * z5 - 18 * z4 + 20 * z3 + 89 * z2 - 18 * z1 - 72) / 240; lagInt[x][6] = -z1 * (z6 - z5 - 17 * z4 + 5 * z3 + 64 * z2 - 4 * z1 - 48) / 720; lagInt[x][7] = z1 * (z6 - 14 * z4 + 49 * z2 - 36) / 5040; break; } } } int comp; for (comp = 0; comp < comps; comp++) result[comp] = 0; int index = 0; for (z = 0; z < nOrder; z++) { for (y = 0; y < nOrder; y++) { for (x = 0; x < nOrder; x++) { for (comp = 0; comp < comps; comp++) { result[comp] += kernel[index++] * lagInt[0][x] * lagInt[1][y] * lagInt[2][z]; } } } } return 0; } int lagrangianInterp2(int comps, dataKernel* kernel, float position[3], int nOrder, float dx, float result[comps]) { int node[3]; node[0] = (int) (floor(position[0]/dx)); node[1] = (int) (floor(position[1]/dx)); node[2] = (int) (floor(position[2]/dx)); int x, y, z; float lagInt[3][8]; float* data = kernel->data; for (x = 0; x < 3; x++) { float z1 = position[x] / dx - (float) node[x] ; float z2 = z1 * z1; float z3 = z2 * z1; switch(nOrder) { case 4: { lagInt[x][0] = (-2 * z1 + 3 * z2 - z3) / 6; lagInt[x][1] = (2 - z1 - 2 * z2 + z3) / 2; lagInt[x][2] = (2 * z1 + z2 - z3) / 2; lagInt[x][3] = (-z1 + z3) / 6; break; } case 6: { float z4 = z2 * z2; float z5 = z3 * z2; lagInt[x][0] = (6 * z1 - 5 * z2 - 5 * z3 + 5 * z4 - z5) / 120; lagInt[x][1] = (-12 * z1 + 16 * z2 - z3 - 4 * z4 + z5) / 24; lagInt[x][2] = (12 - 4 * z1 - 15 * z2 + 5 * z3 + 3 * z4 - z5) / 12; lagInt[x][3] = (12 * z1 + 8 * z2 - 7 * z3 - 2 * z4 + z5) / 12; lagInt[x][4] = (-6 * z1 - z2 + 7 * z3 + z4 - z5) / 24; lagInt[x][5] = (4 * z1 - 5 * z3 + z5) / 120; break; } case 8: { float z4 = z3 * z1; float z5 = z4 * z1; float z6 = z5 * z1; float z7 = z6 * z1; lagInt[x][0] = -z1 * (z6 - 7 * z5 + 7 * z4 + 35 * z3 - 56 * z2 - 28 * z1 + 48) / 5040; lagInt[x][1] = z1 * (z6 - 6 * z5 - 2 * z4 + 60 * z3 - 71 * z2 - 54 * z1 + 72) / 720; lagInt[x][2] = -z1 * (z6 - 5 * z5 - 9 * z4 + 65 * z3 - 16 * z2 - 180 * z1 + 144) / 240; lagInt[x][3] = (z7 - 4 * z6 - 14 * z5 + 56 * z4 + 49 * z3 - 196 * z2 - 36 * z1 + 144) / 144; lagInt[x][4] = -z1 * (z6 - 3 * z5 - 17 * z4 + 39 * z3 + 88 * z2 - 108 * z1 - 144) / 144; lagInt[x][5] = z1 * (z6 - 2 * z5 - 18 * z4 + 20 * z3 + 89 * z2 - 18 * z1 - 72) / 240; lagInt[x][6] = -z1 * (z6 - z5 - 17 * z4 + 5 * z3 + 64 * z2 - 4 * z1 - 48) / 720; lagInt[x][7] = z1 * (z6 - 14 * z4 + 49 * z2 - 36) / 5040; break; } } } int comp; for (comp = 0; comp < comps; comp++) result[comp] = 0; int index = 0; for (z = 0; z < nOrder; z++) { for (y = 0; y < nOrder; y++) { index = (kernel->x)*comps + (y+kernel->y)*kernel->hx*comps + (z+kernel->z)*kernel->hx*kernel->hy*comps; for (x = 0; x < nOrder; x++) { for (comp = 0; comp < comps; comp++) { result[comp] += data[index++] * lagInt[0][x] * lagInt[1][y] * lagInt[2][z]; } } } } return 0; } int pchipInterp(int comps, float data[4][comps], float time, int timestep, float dt, float result[comps]) { float times[4] = { (timestep - 1) * dt, (timestep) * dt, (timestep + 1) * dt, (timestep + 2) * dt }; int j; for(j = 0; j < comps; j++) { float a, b, c, d; float delta = times[2] - times[1]; float drv1 = ((data[2][j] - data[1][j]) / (times[2] - times[1]) + (data[1][j] - data[0][j]) / (times[1] - times[0] )) / 2; float drv2 = ((data[3][j] - data[2][j]) / (times[3] - times[2]) + (data[2][j] - data[1][j]) / (times[2] - times[1] )) / 2; a = data[1][j]; b = drv1; c = ((data[2][j] - data[1][j]) / delta - drv1) / delta; d = 2 / delta / delta * ((drv1 + drv2) / 2 - (data[2][j] - data[1][j]) / (times[2] - times[1])); result[j] = a + b * (time - times[1]) + c * (time - times[1]) * (time - times[1]) + d * (time - times[1]) * (time - times[1]) * (time - times[2]); } return 0; } /* Differentiation Functions */ int computeGradient(dataKernel* kernel, int comps, float dx, int size, int nOrder, float *output) { int x, y, z, w; //Differentiate each point int hx = comps, hy = comps*kernel->hx, hz=comps*kernel->hx*kernel->hy; float* data = kernel->data; for (z = 0; z < size; z++) { for (y = 0; y < size; y++) { for (x = 0; x < size; x++) { //Each component for (w = 0; w < comps; w++) { int x_ = nOrder/2+x+kernel->x, y_ = nOrder/2+y+kernel->y, z_ = nOrder/2+z+kernel->z; int index = z*size*size*comps*3 + y*size*comps*3 + x*comps*3 + w*3; int center = z_*hz+ y_*hy + x_*hx + w; switch(nOrder) { case 4: { // dfw/dx output[index] = 2.0f / 3.0f / dx * (data[center + hx] - data[center - hx]) - 1.0f / 12.0f / dx * (data[center + 2*hx] - data[center - 2*hx]); // dfw/dy output[index+1] = 2.0f / 3.0f / dx * (data[center + hy] - data[center - hy]) - 1.0f / 12.0f / dx * (data[center + 2*hy] - data[center - 2*hy]); // dfw/dz output[index+2] = 2.0f / 3.0f / dx * (data[center + hz] - data[center - hz]) - 1.0f / 12.0f / dx * (data[center + 2*hz] - data[center - 2*hz]); break; } case 6: { // dfw/dx output[index] = 3.0f / 4.0f / dx * (data[center + hx] - data[center - hx]) - 3.0f / 20.0f / dx * (data[center + 2*hx] - data[center - 2*hx]) + 1.0f / 60.0f / dx * (data[center + 3*hx] - data[center - 3*hx]); // dfw/dy output[index+1] = 3.0f / 4.0f / dx * (data[center + hy] - data[center - hy]) - 3.0f / 20.0f / dx * (data[center + 2*hy] - data[center - 2*hy]) + 1.0f / 60.0f / dx * (data[center + 3*hy] - data[center - 3*hy]); // dfw/dz output[index+2] = 3.0f / 4.0f / dx * (data[center + hz] - data[center - hz]) - 3.0f / 20.0f / dx * (data[center + 2*hz] - data[center - 2*hz]) + 1.0f / 60.0f / dx * (data[center + 3*hz] - data[center - 3*hz]); break; } case 8: { // dfw/dx output[index] = 4.0f / 5.0f / dx * (data[center + hx] - data[center - hx]) - 1.0f / 5.0f / dx * (data[center + 2*hx] - data[center - 2*hx]) + 4.0f / 105.0f/ dx * (data[center + 3*hx] - data[center - 3*hx]) - 1.0f / 280.0f/ dx * (data[center + 4*hx] - data[center - 4*hx]); // dfw/dy output[index+1] = 4.0f / 5.0f / dx * (data[center + hy] - data[center - hy]) - 1.0f / 5.0f / dx * (data[center + 2*hy] - data[center - 2*hy]) + 4.0f / 105.0f/ dx * (data[center + 3*hy] - data[center - 3*hy]) - 1.0f / 280.0f/ dx * (data[center + 4*hy] - data[center - 4*hy]); // dfw/dz output[index+2] = 4.0f / 5.0f / dx * (data[center + hz] - data[center - hz]) - 1.0f / 5.0f / dx * (data[center + 2*hz] - data[center - 2*hz]) + 4.0f / 105.0f/ dx * (data[center + 3*hz] - data[center - 3*hz]) - 1.0f / 280.0f/ dx * (data[center + 4*hz] - data[center - 4*hz]); break; } } } } } } return 0; } int computeLaplacian(dataKernel* kernel, int comps, float dx, int size, int nOrder, float *output) { int x, y, z, w; float* data = kernel->data; int hz = kernel->hy*kernel->hx*comps, hy = kernel->hx*comps, hx = comps; for (x = 0; x < size; x++) { for (y = 0; y < size; y++) { for (z = 0; z < size; z++) { //Each component for (w = 0; w < 3; w++) { int z_ = nOrder/2+z + kernel->z, y_ = nOrder/2+y + kernel->y, x_ = nOrder/2+x + kernel->x; int index = z*size*size*comps + y*size*comps + x*comps + w; int center = z_*hz + y_*hy + x_*hx + w; switch(nOrder) { case 4: { // du2w/dxdx output[index] = SecFiniteDiff4(dx, data[center - 2*hx], data[center - hx], data[center], data[center + hx], data[center + 2*hx]) + SecFiniteDiff4(dx, data[center - 2*hy], data[center - hy], data[center], data[center + hy], data[center + 2*hy]) + SecFiniteDiff4(dx, data[center - 2*hz], data[center - hz], data[center], data[center + hz], data[center + 2*hz]); break; } case 6: { // du2w/dxdx output[index + 0] = SecFiniteDiff6(dx, data[center - 3*hx], data[center - 2*hx], data[center - hx], data[center], data[center + hx], data[center + 2*hx], data[center + 3*hx])+ SecFiniteDiff6(dx, data[center - 3*hy], data[center - 2*hy], data[center - hy], data[center], data[center + hy], data[center + 2*hy], data[center + 3*hy])+ SecFiniteDiff6(dx, data[center - 3*hz], data[center - 2*hz], data[center - hz], data[center], data[center + hz], data[center + 2*hz], data[center + 3*hz]); break; } case 8: { // du2w/dxdx output[index + 0] = SecFiniteDiff8(dx, data[center - 4*hx], data[center - 3*hx], data[center - 2*hx], data[center - hx], data[center], data[center + hx], data[center + 2*hx], data[center + 3*hx], data[center + 4*hx]) + SecFiniteDiff8(dx, data[center - 4*hy], data[center - 3*hy], data[center - 2*hy], data[center - hy], data[center], data[center + hy], data[center + 2*hy], data[center + 3*hy], data[center + 4*hy]) + SecFiniteDiff8(dx, data[center - 4*hz], data[center - 3*hz], data[center - 2*hz], data[center - hz], data[center], data[center + hz], data[center + 2*hz], data[center + 3*hz], data[center + 4*hz]); break; } } } } } } return 0; } int computeHessian(dataKernel* kernel, int comps, float dx, int size, int nOrder, float *output) { int x, y, z, w; float* data = kernel->data; int hz = kernel->hy*kernel->hx*comps, hy = kernel->hx*comps, hx = comps; for (x = 0; x < size; x++) { for (y = 0; y < size; y++) { for (z = 0; z < size; z++) { //Each component for (w = 0; w < comps; w++) { int z_ = nOrder/2+z+kernel->z, y_ = nOrder/2+y+kernel->y, x_ = nOrder/2+x+kernel->x; int index = z*size*size*comps*6 + y*size*comps*6 + x*comps*6 + w*6; int center = z_*hz + y_*hy + x_*hx + w; switch(nOrder) { case 4: { // du2w/dxdx output[index + 0] = SecFiniteDiff4(dx, data[center - 2*hx], data[center - hx], data[center], data[center + hx], data[center + 2*hx]); // du2w/dxdy output[index + 1] = CrossFiniteDiff4(dx, data[center + 2*hy + 2*hx], data[center + 2*hy - 2*hx], data[center - 2*hy - 2*hx], data[center - 2*hy + 2*hx], data[center + hy + hx], data[center + hy - hx], data[center - hy - hx], data[center - hy + hx]); // du2w/dxdz output[index + 2] = CrossFiniteDiff4(dx, data[center + 2*hz + 2*hx], data[center + 2*hz - 2*hx], data[center - 2*hz - 2*hx], data[center - 2*hz + 2*hx], data[center + hz + hx], data[center + hz - hx], data[center - hz - hx], data[center - hz + hx]); // du2w/dydy output[index +3] = SecFiniteDiff4(dx, data[center - 2*hy], data[center - hy], data[center], data[center + hy], data[center + 2*hy]); // du2w/dydz output[index +4] = CrossFiniteDiff4(dx, data[center + 2*hz + 2*hy], data[center + 2*hz - 2*hy], data[center - 2*hz - 2*hy], data[center - 2*hz + 2*hy], data[center + hz + hy], data[center + hz - hy], data[center - hz - hy], data[center - hz + hy]); // du2w/dzdz output[index +5] = SecFiniteDiff4(dx, data[center - 2*hz], data[center - hz], data[center], data[center + hz], data[center + 2*hz]); break; } case 6: { // du2w/dxdx output[index + 0] = SecFiniteDiff6(dx, data[center - 3*hx], data[center - 2*hx], data[center - hx], data[center], data[center + hx], data[center + 2*hx], data[center + 3*hx]); // du2w/dxdy output[index + 1] = CrossFiniteDiff6(dx, data[center + 3*hy + 3*hx], data[center + 3*hy - 3*hx], data[center - 3*hy - 3*hx], data[center - 3*hy + 3*hx], data[center + 2*hy + 2*hx], data[center + 2*hy - 2*hx], data[center - 2*hy - 2*hx], data[center - 2*hy + 2*hx], data[center + hy + hx], data[center + hy - hx], data[center - hy - hx], data[center - hy + hx]); // du2w/dxdz output[index + 2] = CrossFiniteDiff6(dx, data[center + 3*hz + 3*hx], data[center + 3*hz - 3*hx], data[center - 3*hz - 3*hx], data[center - 3*hz + 3*hx], data[center + 2*hz + 2*hx], data[center + 2*hz - 2*hx], data[center - 2*hz - 2*hx], data[center - 2*hz + 2*hx], data[center + hz + hx], data[center + hz - hx], data[center - hz - hx], data[center - hz + hx]); // du2w/dydy output[index +3] = SecFiniteDiff6(dx, data[center - 3*hy], data[center - 2*hy], data[center - hy], data[center], data[center + hy], data[center + 2*hy], data[center + 3*hy]); // du2w/dydz output[index +4] = CrossFiniteDiff6(dx, data[center + 3*hz + 3*hy], data[center + 3*hz - 3*hy], data[center - 3*hz - 3*hy], data[center - 3*hz + 3*hy], data[center + 2*hz + 2*hy], data[center + 2*hz - 2*hy], data[center - 2*hz - 2*hy], data[center - 2*hz + 2*hy], data[center + hz + hy], data[center + hz - hy], data[center - hz - hy], data[center - hz + hy]); // du2w/dzdz output[index +5] = SecFiniteDiff6(dx, data[center - 3*hz], data[center - 2*hz], data[center - hz], data[center], data[center + hz], data[center + 2*hz], data[center + 3*hz]); break; } case 8: { // du2w/dxdx output[index + 0] = SecFiniteDiff8(dx, data[center - 4*hx], data[center - 3*hx], data[center - 2*hx], data[center - hx], data[center], data[center + hx], data[center + 2*hx], data[center + 3*hx], data[center + 4*hx]); // du2w/dxdy output[index + 1] = CrossFiniteDiff8(dx, data[center + 4*hy + 4*hx], data[center + 4*hy - 4*hx], data[center - 4*hy - 4*hx], data[center - 4*hy + 4*hx], data[center + 3*hy + 3*hx], data[center + 3*hy - 3*hx], data[center - 3*hy - 3*hx], data[center - 3*hy + 3*hx], data[center + 2*hy + 2*hx], data[center + 2*hy - 2*hx], data[center - 2*hy - 2*hx], data[center - 2*hy + 2*hx], data[center + hy + hx], data[center + hy - hx], data[center - hy - hx], data[center - hy + hx]); // du2w/dxdz output[index + 2] = CrossFiniteDiff8(dx, data[center + 4*hz + 4*hx], data[center + 4*hz - 4*hx], data[center - 4*hz - 4*hx], data[center - 4*hz + 4*hx], data[center + 3*hz + 3*hx], data[center + 3*hz - 3*hx], data[center - 3*hz - 3*hx], data[center - 3*hz + 3*hx], data[center + 2*hz + 2*hx], data[center + 2*hz - 2*hx], data[center - 2*hz - 2*hx], data[center - 2*hz + 2*hx], data[center + hz + hx], data[center + hz - hx], data[center - hz - hx], data[center - hz + hx]); // du2w/dydy output[index +3] = SecFiniteDiff8(dx, data[center - 4*hy], data[center - 3*hy], data[center - 2*hy], data[center - hy], data[center], data[center + hy], data[center + 2*hy], data[center + 3*hy], data[center + 4*hy]); // du2w/dydz output[index +4] = CrossFiniteDiff8(dx, data[center + 4*hz + 4*hy], data[center + 4*hz - 4*hy], data[center - 4*hz - 4*hy], data[center - 4*hz + 4*hy], data[center + 3*hz + 3*hy], data[center + 3*hz - 3*hy], data[center - 3*hz - 3*hy], data[center - 3*hz + 3*hy], data[center + 2*hz + 2*hy], data[center + 2*hz - 2*hy], data[center - 2*hz - 2*hy], data[center - 2*hz + 2*hy], data[center + hz + hy], data[center + hz - hy], data[center - hz - hy], data[center - hz + hy]); // du2w/dzdz output[index +5] = SecFiniteDiff8(dx, data[center - 4*hz], data[center - 3*hz], data[center - 2*hz], data[center - hz], data[center], data[center + hz], data[center + 2*hz], data[center + 3*hz], data[center + 4*hz]); break; } } } } } } return 0; } #endif//CUTOUT_SUPPORT int getvelocity_ (char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][3], int len_a, int len_d) { return getVelocity (authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getvelocitygradient_(char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][9], int len_a, int len_d) { return getVelocityGradient(authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getvelocityhessian_(char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][18], int len_a, int len_d) { return getVelocityHessian(authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getvelocitylaplacian_ (char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][3], int len_a, int len_d) { return getVelocityLaplacian (authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getmagneticfield_ (char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][3], int len_a, int len_d) { return getMagneticField (authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getvectorpotential_ (char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][3], int len_a, int len_d) { return getVectorPotential (authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getvelocityandpressure_ (char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][4], int len_a, int len_d) { return getVelocityAndPressure (authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getpressurehessian_(char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][6], int len_a, int len_d) { return getPressureHessian(authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getmagneticfieldlaplacian_ (char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][3], int len_a, int len_d) { return getMagneticFieldLaplacian (authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getvectorpotentiallaplacian_ (char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][3], int len_a, int len_d) { return getVectorPotentialLaplacian (authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getdensityhessian_(char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][6], int len_a, int len_d) { return getDensityHessian(authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getdensitygradient_(char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][3], int len_a, int len_d) { return getDensityGradient(authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getdensity_ (char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[], int len_a, int len_d) { return getDensity (authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getpressure_ (char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[], int len_a, int len_d) { return getPressure (authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getvectorpotentialhessian_(char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][18], int len_a, int len_d) { return getVectorPotentialHessian(authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getpressuregradient_(char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][3], int len_a, int len_d) { return getPressureGradient(authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getmagneticfieldgradient_(char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][9], int len_a, int len_d) { return getMagneticFieldGradient(authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getvectorpotentialgradient_(char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][9], int len_a, int len_d) { return getVectorPotentialGradient(authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); } int getmagneticfieldhessian_(char *authToken, char *dataset, float *time, int *spatial, int *temporal, int *count, float datain[][3], float dataout[][18], int len_a, int len_d) { return getMagneticFieldHessian(authToken, dataset, *time, *spatial, *temporal, *count, datain, dataout); }
1.242188
1
m3conf/m3conf_parser.h
m3lawren/libm3conf
1
7996811
#ifndef _PARSER_H_ #define _PARSER_H_ #ifdef __cplusplus extern "C" { #endif struct m3conf_token; struct m3config; struct m3config* m3conf_parse(struct m3conf_token*); #ifdef __cplusplus } #endif #endif
0.104492
0
src/unabto/unabto_query_rw.h
nabtodaemon/unabto
0
7996819
/* * Copyright (C) 2008-2013 Nabto - All Rights Reserved. */ #ifndef _UNABTO_QUERY_BUFFER_H_ #define _UNABTO_QUERY_BUFFER_H_ #include <unabto/unabto_env_base.h> #include "unabto/unabto_buffers.h" #ifdef __cplusplus extern "C" { #endif /** * the query buffers */ typedef unabto_abuffer unabto_query_request; typedef unabto_abuffer unabto_query_response; //#define unabto_query_response unabto_abuffer #ifndef PLATFORM_MEMCPY #define PLATFORM_MEMCPY memcpy #endif /**************************************************/ /* Prototypes for query request parameter reading */ /**************************************************/ /** * read an uint32_t from the query request buffer * @param queryRequest the query request buffer to read from * @param resultValue the resulting uint32_t * @return true on successreadabl */ bool unabto_query_read_uint32(unabto_query_request* queryRequest, uint32_t *resultValue); /** * read an uint16_t from the query request buffer * @param queryRequest the query request buffer to read from * @param resultValue the resulting uint16_t * @return true on success */ bool unabto_query_read_uint16(unabto_query_request* queryRequest, uint16_t *resultValue); /** * read an uint8_t from the query request buffer * @param queryRequest the query request buffer to read from * @param resultValue the resulting uint8_t * @return true on success */ bool unabto_query_read_uint8(unabto_query_request* queryRequest, uint8_t *resultValue); /** * read an int32_t from the query request buffer * @param queryRequest the query request buffer to read from * @param resultValue the resulting uint32_t * @return true on success */ bool unabto_query_read_int32(unabto_query_request* queryRequest, int32_t *resultValue); /** * read an int16_t from the query request buffer * @param queryRequest the query request buffer to read from * @param resultValue the resulting uint16_t * @return true on success */ bool unabto_query_read_int16(unabto_query_request* queryRequest, int16_t *resultValue); /** * read an int8_t from the query request buffer * @param queryRequest the query request buffer to read from * @param resultValue the resulting uint8_t * @return true on success */ bool unabto_query_read_int8(unabto_query_request* queryRequest, int8_t *resultValue); /** * read a list of uint8 from the query request buffer * @param queryRequest the query request buffer to read from * @param list will be set to the start of the first byte of the byte array * @param listLength set to length of the uint8 sequence * @return true if success */ bool unabto_query_read_uint8_list(unabto_query_request* queryRequest, uint8_t **list, uint16_t *listLength); /** * read uint8 list into unabto_buffer without copying the data */ bool unabto_query_read_uint8_list_to_buffer_nc(unabto_query_request* queryRequest, unabto_buffer* buffer); /** * read the number of list elements * @param queryRequest the query request buffer to read from * @param elementCount set to number of elements in the list * @return true if success */ bool unabto_query_read_list_length(unabto_query_request* queryRequest, uint16_t *elementCount); /** * get the size of the request */ uint16_t unabto_query_request_size(unabto_query_request* queryRequest); /** * reset the request query read state to the start again */ void unabto_query_request_reset(unabto_query_request* queryRequest); /***************************************************/ /* Prototypes for query response parameter writing */ /***************************************************/ /** * Append an uint8_t to the query response buffer * @param queryResponse the query response buffer * @param value the uint8_t * @return false if the operation would have resulted in a buffer overflow. */ bool unabto_query_write_uint8(unabto_query_response *queryResponse, uint8_t value); /** * Append an uint16_t to the query response buffer * @param queryResponse the query response buffer * @param value the uint16_t * @return false if the operation would have resulted in a buffer overflow. */ bool unabto_query_write_uint16(unabto_query_response *queryResponse, uint16_t value); /** * Append an uint32_t to the query response buffer * @param queryResponse the query response buffer * @param value the uint32_t * @return false if the operation would have resulted in a buffer overflow. */ bool unabto_query_write_uint32(unabto_query_response *queryResponse, uint32_t value); /** * Append an int8_t to the query response buffer * @param queryResponse the query response buffer * @param value the int8_t * @return false if the operation would have resulted in a buffer overflow. */ bool unabto_query_write_int8(unabto_query_response *queryResponse, int8_t value); /** * Append an int16_t to the query response buffer * @param queryResponse the query response buffer * @param value the int16_t * @return false if the operation would have resulted in a buffer overflow. */ bool unabto_query_write_int16(unabto_query_response *queryResponse, int16_t value); /** * Append an int32_t to the query response buffer * @param queryResponse the query response buffer * @param value the int32_t * @return false if the operation would have resulted in a buffer overflow. */ bool unabto_query_write_int32(unabto_query_response *queryResponse, int32_t value); /** * Append a byte array to the query response buffer * This is a short cut for creating a list only consisting of uint8 elements. * @param queryResponse the query response buffer * @param list pointer to a byte array * @param listLength number of bytes in the byte array * @return true on success */ bool unabto_query_write_uint8_list(unabto_query_response * queryResponse, uint8_t *list, uint16_t listLength); /** * return the number of bytes still available for writing in the buffer * @param queryResponse the query response buffer * @return the number of bytes available for writing 0 if the buffer is full */ size_t unabto_query_write_free_bytes(unabto_query_response * queryResponse); typedef void *unabto_list_ctx; /* ... */ /** * Initializes a list * @param queryResponse the query response buffer * @param listCtx on return initialized to with the internal list context * @return true on success */ bool unabto_query_write_list_start(unabto_query_response* queryResponse, unabto_list_ctx *listCtx); /** * Finalizes a list * @param queryResponse the query response buffer * @param listCtx the list context returned from the write list start function. * @param elementCount number of elements written in the list. * @return true on success */ bool unabto_query_write_list_end(unabto_query_response* queryResponse, unabto_list_ctx *listCtx, uint16_t elementCount); /******************************************************************************** ******** The following functions are primarily for internal usage - TBM ******** ********************************************************************************/ #define unabto_query_read_init(queryRequest, buffer) unabto_abuffer_init(queryRequest, buffer) #define unabto_query_write_init(queryResponse, buffer) unabto_abuffer_init(queryResponse, buffer) /** * Initialize a query request */ void unabto_query_request_init(unabto_query_request* queryRequest, unabto_buffer* buffer); /** * Initialize a query response */ void unabto_query_response_init(unabto_query_response* queryResponse, unabto_buffer* buffer); /** * Ask how many bytes have been used in the response */ uint16_t unabto_query_response_used(unabto_query_response* queryResponse); /* hackers entry */ #define unabto_query_get_read_head(queryResponse) unabto_abuffer_get_head(queryResponse) #define unabto_query_get_write_head(queryResponse) unabto_abuffer_get_head(queryResponse) #define unabto_query_get_write_initial_head(queryResponse) UNABTO_ABUFFER_GET_INITIAL_HEAD(queryResponse) #define unabto_query_get_write_used(queryResponse) unabto_abuffer_get_used(queryResponse) #define unabto_query_get_write_unused(queryResponse) unabto_abuffer_get_unused(queryResponse) #define unabto_query_advance_write_head(queryResponse, offset) unabto_abuffer_advance(queryResponse, offset) #ifdef __cplusplus } //extern "C" #endif #endif
0.785156
1
src/common/util.h
DrMcCoy/darkseed2-tools
1
7996827
/* darkseed2-tools - Tools to inspect Dark Seed II resources * * Copyright (c) 2014, <NAME> (DrMcCoy) <<EMAIL>> * 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Dark Seed is a registered trademark of Cyberdreams, Inc. All rights reserved. */ /** @file common/util.h * Common utility functions and macros. */ #ifndef COMMON_UTIL_H #define COMMON_UTIL_H #include "common/types.h" #include <string> #include <istream> #ifdef MAX #undef MAX #endif #ifdef MIN #undef MIN #endif template <typename T> T ABS (T x) { return (x >= 0) ? x : -x; } template <typename T> T MAX (T a, T b) { return (a > b) ? a : b; } template <typename T> T MIN (T a, T b) { return (a < b) ? a : b; } template <typename T> void SWAP(T &a, T &b) { T tmp = a; a = b; b = tmp; } #define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0]))) namespace Common { uint32 getSize(std::istream &stream); uint8 readUint8 (std::istream &stream); uint16 readUint16BE(std::istream &stream); uint16 readUint16LE(std::istream &stream); uint32 readUint32BE(std::istream &stream); uint32 readUint32LE(std::istream &stream); uint16 readUint16BE(const byte *data); uint16 readUint16LE(const byte *data); uint32 readUint32BE(const byte *data); uint32 readUint32LE(const byte *data); void readFixedString(std::istream &stream, char *str, int n); bool dumpToFile(std::istream &input, uint32 offset, uint32 size, const std::string &output); } // End of namespace Common #endif // COMMON_UTIL_H
1.023438
1
test_harmless.c
davea42/libdwarf-regressiontests
0
7996835
This code is hereby placed into the public domain. */ /* Test code to verify the correct functioning of the dwarf 'harmless error' interfaces in libdwarf. On an irregular basis it is wise to run this under valgrind (or the like) to verify there is no space leakage. */ #include <stdio.h> #include <dwarf.h> #include <libdwarf.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> typedef int (*tfunc)(unsigned int, const char **out); static char *harmless[] = { "test 0", "test 1", "test 2", "test 3", "test 4", "test 5", "test 6", "test 7", "test 8", "test 9", "test 10", 0 }; static const char *hbuf[40]; static Dwarf_Debug dbg = 0; static void refill_hbuff() { unsigned bytecount = sizeof(hbuf); memset(hbuf,1,bytecount); } static int run_test0() { unsigned totalct = 0; int res = DW_DLV_ERROR; res = dwarf_get_harmless_error_list(dbg,4,&hbuf[0],&totalct); if(res != DW_DLV_NO_ENTRY) { printf("Failure, line %d\n",__LINE__); return 1; } return 0; } static int run_test1() { unsigned totalct = 0; int res = DW_DLV_ERROR; dwarf_insert_harmless_error(dbg,harmless[0]); res = dwarf_get_harmless_error_list(dbg,4,&hbuf[0],&totalct); if(res != DW_DLV_OK) { printf("Failure, expected OK result line %d\n",__LINE__); return 1; } if(totalct != 1) { printf("Failure, 1 error totalct result line %d\n",__LINE__); return 1; } if(strcmp(harmless[0],hbuf[0]) ) { printf("Failure, \"%s\" vs \"%s\" 1 error wrong string line %d\n", harmless[0],hbuf[0],__LINE__); return 1; } if(hbuf[1] != 0) { printf("Failure, 1 error bad terminator line %d\n",__LINE__); return 1; } return 0; } static int run_test2() { unsigned totalct = 0; int res = DW_DLV_ERROR; dwarf_insert_harmless_error(dbg,harmless[0]); dwarf_insert_harmless_error(dbg,harmless[1]); dwarf_insert_harmless_error(dbg,harmless[2]); dwarf_insert_harmless_error(dbg,harmless[3]); dwarf_insert_harmless_error(dbg,harmless[4]); res = dwarf_get_harmless_error_list(dbg,3,&hbuf[0],&totalct); if(res != DW_DLV_OK) { printf("Failure, expected OK result line %d\n",__LINE__); return 1; } if(strcmp(harmless[1],hbuf[0]) ) { printf("Failure, \"%s\" vs \"%s\" 1 error wrong " "string line %d\n", harmless[1],hbuf[0],__LINE__); return 1; } if(strcmp(harmless[2],hbuf[1]) ) { printf("Failure, \"%s\" vs \"%s\" 1 error wrong " "string line %d\n", harmless[2],hbuf[1],__LINE__); return 1; } if(hbuf[2] != 0) { printf("Failure, 1 error bad terminator line %d\n",__LINE__); return 1; } if(totalct != 5) { printf("Failure, totalct %d expected 5 %d\n",totalct,__LINE__); return 1; } res = dwarf_get_harmless_error_list(dbg,2,&hbuf[0],&totalct); if(res != DW_DLV_NO_ENTRY) { printf("Failure, 1 error expected no new entry " "line %d\n",__LINE__); return 1; } return 0; } static int run_test3() { unsigned totalct = 0; int res = DW_DLV_ERROR; dwarf_insert_harmless_error(dbg,harmless[0]); dwarf_insert_harmless_error(dbg,harmless[1]); dwarf_insert_harmless_error(dbg,harmless[2]); dwarf_insert_harmless_error(dbg,harmless[3]); dwarf_insert_harmless_error(dbg,harmless[4]); res = dwarf_get_harmless_error_list(dbg,8,&hbuf[0],&totalct); if(res != DW_DLV_OK) { printf("Failure, expected OK result line %d\n",__LINE__); return 1; } if(totalct != 5) { printf("Failure, totalct %d expected 5 %d\n",totalct,__LINE__); return 1; } if(strcmp(harmless[1],hbuf[0]) ) { printf("Failure, \"%s\" vs \"%s\" 1 error wrong string line %d\n", harmless[1],hbuf[0],__LINE__); return 1; } if(strcmp(harmless[2],hbuf[1]) ) { printf("Failure, \"%s\" vs \"%s\" 1 error wrong string line %d\n", harmless[2],hbuf[1],__LINE__); return 1; } if(strcmp(harmless[3],hbuf[2]) ) { printf("Failure, \"%s\" vs \"%s\" 1 error wrong string line %d\n", harmless[3],hbuf[2],__LINE__); return 1; } if(strcmp(harmless[4],hbuf[3]) ) { printf("Failure, \"%s\" vs \"%s\" 1 error wrong string line %d\n", harmless[4],hbuf[3],__LINE__); return 1; } if(hbuf[4] != 0) { printf("Failure, 1 error bad terminator line %d\n",__LINE__); return 1; } res = dwarf_get_harmless_error_list(dbg,2,&hbuf[0],&totalct); if(res != DW_DLV_NO_ENTRY) { printf("Failure, 1 error expected no new entry line %d\n",__LINE__); return 1; } return 0; } static int run_test4() { unsigned totalct = 0; int res = DW_DLV_ERROR; int oldsize = 0; dwarf_insert_harmless_error(dbg,harmless[0]); dwarf_insert_harmless_error(dbg,harmless[1]); dwarf_insert_harmless_error(dbg,harmless[2]); dwarf_insert_harmless_error(dbg,harmless[3]); dwarf_insert_harmless_error(dbg,harmless[4]); oldsize = dwarf_set_harmless_error_list_size(dbg,2); if(oldsize != DW_HARMLESS_ERROR_CIRCULAR_LIST_DEFAULT_SIZE) { printf("Failure, expected old size as default line %d vs %d %d\n", oldsize,DW_HARMLESS_ERROR_CIRCULAR_LIST_DEFAULT_SIZE,__LINE__); return 1; } res = dwarf_get_harmless_error_list(dbg,8,&hbuf[0],&totalct); if(res != DW_DLV_OK) { printf("Failure, expected OK result line %d\n",__LINE__); return 1; } if(totalct != 5) { printf("Failure, totalct %d expected 5 %d\n",totalct,__LINE__); return 1; } if(strcmp(harmless[3],hbuf[0]) ) { printf("Failure, \"%s\" vs \"%s\" 1 error wrong string line %d\n", harmless[3],hbuf[0],__LINE__); return 1; } if(strcmp(harmless[4],hbuf[1]) ) { printf("Failure, \"%s\" vs \"%s\" 1 error wrong string line %d\n", harmless[4],hbuf[1],__LINE__); return 1; } if(hbuf[2] != 0) { printf("Failure, 1 error bad terminator line %d\n",__LINE__); return 1; } res = dwarf_get_harmless_error_list(dbg,2,&hbuf[0],&totalct); if(res != DW_DLV_NO_ENTRY) { printf("Failure, 1 error expected no new entry line %d\n", __LINE__); return 1; } return 0; } int main() { int errcount = 0; int res = DW_DLV_ERROR; Dwarf_Handler errhand = 0; Dwarf_Ptr errarg = 0; Dwarf_Error error = 0; const char *filepath= "./test_harmless"; char truepath[3000]; unsigned truepathsize = sizeof(truepath); res = dwarf_init_path(filepath, truepath,truepathsize, DW_GROUPNUMBER_ANY,errhand,errarg, &dbg, &error); if(res != DW_DLV_OK) { printf("test_harmless cannot do DWARF processing " "dwarf_init failed.\n"); if (res == DW_DLV_ERROR) { printf("test_harmless: dwarf_init returned ERROR." " Err %s \n",dwarf_errmsg(error)); } else { printf("test_harmless: dwarf_init returned NO_ENTRY!\n"); } exit(1); } refill_hbuff(); errcount += run_test0(); refill_hbuff(); errcount += run_test1(); refill_hbuff(); errcount += run_test2(); refill_hbuff(); errcount += run_test3(); refill_hbuff(); errcount += run_test4(); refill_hbuff(); res = dwarf_finish(dbg); if(res != DW_DLV_OK) { printf("dwarf_finish failed!\n"); } if(errcount > 0) { printf("FAIL harmless test, %d errors\n",errcount); } else { printf("PASS harmless test\n"); } exit(errcount> 0 ? 3:0); }
1.460938
1
WickedEngine/Game.h
TacticalDan/WickedEngine
5
7996843
#pragma once #include <sstream> #include <string> #include <ranges> #include "WickedEngine.h" #include "utils.h" #include "OctopusComponent.h" #include "ParticleLocomotion.h" class Game { public: OctopusComponent octopusComponent; ParticleLocomotion particle { .radius = 0.01f, .position = { 0, 0, 5, 1 } }; Entity testTarget; float time = 0.0f; Game() { // 📷 Update the camera transform to have a nice top-down (orthographic-like) view { TransformComponent transform; XMStoreFloat4(&transform.rotation_local, XMQuaternionRotationRollPitchYaw(3.14 * .25, 0, 0)); XMStoreFloat3(&transform.translation_local, { 0, 10, 0 }); transform.UpdateTransform(); wiScene::GetCamera().TransformCamera(transform); } const auto octopusScene = LoadModel("../CustomContent/Game.wiscene", XMMatrixTranslation(0, 0, 10), true); testTarget = GetScene().Entity_CreateObject("Tentacle Target"); const auto transform = Utils::GetMutableForEntity<TransformComponent>(testTarget); transform->translation_local = { 0, 0, 15 }; transform->UpdateTransform(); const auto getOctopus = [](const vector<Entity>& entities) { for (const auto entity : entities) if (Utils::GetForEntity<NameComponent>(entity)->name == "OctopusRiggedTopo.glb") return entity; return INVALID_ENTITY; }; const auto octopusEntity = getOctopus(Utils::Children<NameComponent>(octopusScene)); octopusComponent = OctopusComponent(octopusEntity); } void Update(float dt); };
1.734375
2
src/vulkan/functions/function_loader.h
jammymalina/vkpixelcollision
1
7996851
#ifndef VULKAN_FUNCTION_LOADER_H #define VULKAN_FUNCTION_LOADER_H #include <vulkan/vulkan.h> void load_external_function(PFN_vkGetInstanceProcAddr vk_get_proc); void load_global_functions(); void load_instance_vulkan_functions(VkInstance instance); void load_device_level_functions(VkDevice device); #endif
0.667969
1
include/prism/optionhandler.h
CaptainDreamcast/prism
7
7996859
#pragma once #include "geometry.h" #include "actorhandler.h" typedef void (*OptionCB)(void* caller); void setupOptionHandler(); void shutdownOptionHandler(); void disableOptionHandler(); int addOption(Position tPosition, char* tText, OptionCB tCB, void* tCaller); void removeOption(int tID); void setOptionTextSize(int tSize); void setOptionTextBreakSize(int tBreakSize); void setOptionButtonA(); void setOptionButtonStart(); void updateOptionHandler(); void drawOptionHandler(); ActorBlueprint getOptionHandlerBlueprint();
0.792969
1
weather-console/dht22.h
wasmup/stm32
769
7996867
/* Port and pin with DHT22 sensor*/ #define DHT22_GPIO_PORT GPIOB #define DHT22_GPIO_CLOCK RCC_APB2Periph_GPIOB #define DHT22_GPIO_PIN GPIO_Pin_0 /* DHT22_GetReadings response codes */ #define DHT22_RCV_OK 0 // Return with no error #define DHT22_RCV_NO_RESPONSE 1 // No response from sensor #define DHT22_RCV_BAD_ACK1 2 // Bad first half length of ACK impulse #define DHT22_RCV_BAD_ACK2 3 // Bad second half length of ACK impulse #define DHT22_RCV_RCV_TIMEOUT 4 // It was timeout while receiving bits void DHT22_Init(void); uint32_t DHT22_GetReadings(void); uint16_t DHT22_DecodeReadings(void); uint16_t DHT22_GetHumidity(void); uint16_t DHT22_GetTemperature(void);
0.921875
1
sdk-6.5.20/src/examples/xgs/maverick2/bcm_rx/bcm_rx.c
copslock/broadcom_cpri
0
7996875
/* * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. * * Copyright 2007-2020 Broadcom Inc. All rights reserved. */ /* Feature : BCM RX * * Usage : BCM.0> cint bcm_rx.c * * config : bcm_rx_config.bcm * * Log file : bcm_rx_log.txt * * Test Topology : * * +------------------------------+ * | | * | | * | | * ingress_port | | cpu_port * +----------------+ SWITCH +-----------------+ * | | * | | * | | * | | * | | * +------------------------------+ * * * Summary: * ======== * This CINT script registers RX callback using BCM APIs. * This exampls hsows how application can register RX callback function * and process the packets received by CPU port. * * Detailed steps done in the CINT script: * ======================================= * 1) Step1 - Test Setup (Done in test_setup()): * ============================================= * a) Select one ingress port and configure it in loopback mode. * b) Add static L2 entry on cpu port with mac=00:00:00:00:00:03 and vlan=1 * * 2) Step2 - Configuration (Done in rx_setup()) * =================================================== * a) Check if RX is active, if not then Init RX and start RX thread * b) Register RX callback function which will print the received packet along * with the metadata of the packet. * * 3) Step3 - Verification (Done in verify()) * ========================================== * a) Transmit multiple packets with different vlan_prio and mac=00:00:00:00:00:03 * b) Expected Result: * ================ * The packets are looped back on ingress port and received by CPU port * The RX callback registered in step#4 will dump the packet along with metadata * on console */ cint_reset(); bcm_port_t ingress_port; /* * packet_info() * * This routine prints of some key bits of information from a bcm_pkt_t structure. */ void packet_info(bcm_pkt_t * pkt) { /* * Define a mapping from reason code to its corresponding text string. All * reasons may not be used by some devices. */ const char *reason_strings[] = { "Invalid", "Arp", "Bpdu", "Broadcast", "ClassBasedMove", "ClassTagPackets", "Control", "CpuLearn", "DestLookupFail", "Dhcp", "DosAttack", "E2eHolIbp", "EncapHigigError", "FilterMatch", "GreChecksum", "GreSourceRoute", "HigigControl", "HigigHdrError", "IcmpRedirect", "Igmp", "IngressFilter", "Ip", "IpfixRateViolation", "IpMcastMiss", "IpmcReserved", "IpOptionVersion", "Ipmc", "L2Cpu", "L2DestMiss", "L2LearnLimit", "L2Move", "L2MtuFail", "L2NonUnicastMiss", "L2SourceMiss", "L3AddrBindFail", "L3DestMiss", "L3HeaderError", "L3MtuFail", "L3Slowpath", "L3SourceMiss", "L3SourceMove", "MartianAddr", "McastIdxError", "McastMiss", "MimServiceError", "MplsCtrlWordError", "MplsError", "MplsInvalidAction", "MplsInvalidPayload", "MplsLabelMiss", "MplsSequenceNumber", "MplsTtl", "Multicast", "Nhop", "OAMError", "OAMSlowpath", "OAMLMDM", "ParityError", "Protocol", "SampleDest", "SampleSource", "SharedVlanMismatch", "SourceRoute", "TimeStamp", "Ttl", "Ttl1", "TunnelError", "UdpChecksum", "UnknownVlan", "UrpfFail", "VcLabelMiss", "VlanFilterMatch", "WlanClientError", "WlanSlowpath", "WlanDot1xDrop", "ExceptionFlood", "TimeSync", "EAVData", "SamePortBridge", "SplitHorizon", "L4Error", "Stp", "EgressFilterRedirect", "FilterRedirect", "Loopback", "VlanTranslate", "Mmrp", "Srp", "TunnelControl", "L2Marked", "WlanSlowpathKeepalive", "Station", "Niv", "NivPrioDrop", "NivInterfaceMiss", "NivRpfFail", "NivTagInvalid", "NivTagDrop", "NivUntagDrop", "Trill", "TrillInvalid", "TrillMiss", "TrillRpfFail", "TrillSlowpath", "TrillCoreIsIs", "TrillTtl", "TrillName", "BfdSlowpath", "Bfd", "Mirror", "RegexAction", "RegexMatch", "FailoverDrop", "WlanTunnelError", "CongestionCnmProxy", "CongestionCnmProxyError", "CongestionCnm", "MplsUnknownAch", "MplsLookupsExceeded", "MplsReservedEntropyLabel", "MplsIllegalReservedLabel", "MplsRouterAlertLabel", "NivPrune", "VirtualPortPrune", "NonUnicastDrop", "TrillPacketPortMismatch", "WlanClientMove", "WlanSourcePortMiss", "WlanClientSourceMiss", "WlanClientDestMiss", "WlanMtu", "L2GreSipMiss", "L2GreVpnIdMiss", "TimesyncUnknownVersion", "BfdUnknownVersion", "BfdInvalidVersion", "BfdLookupFailure", "BfdInvalidPacket", "VxlanSipMiss", "VxlanVpnIdMiss", "FcoeZoneCheckFail", "IpmcInterfaceMismatch", "Nat", "TcpUdpNatMiss", "IcmpNatMiss", "NatFragment", "NatMiss", "OAMCCMSlowpath", "BHHOAM", "UnknownSubtendingPort", "Reserved0", "OAMMplsLmDm", "Sat", "SampleSourceFlex" }; bcm_rx_reason_t reason; int i; int reason_count; /* Print basic packet information first */ printf (" length %4d; rx-port %2d; COS %2d; prio_int %2d; VLAN %4d; DMA chan: %d; %s;\n", pkt->pkt_len, pkt->rx_port, pkt->cos, pkt->prio_int, pkt->vlan, pkt->dma_channel, (pkt->rx_untagged & BCM_PKT_OUTER_UNTAGGED) ? ((pkt->rx_untagged & BCM_PKT_INNER_UNTAGGED) ? "Untagged" : "Inner tagged") : ((pkt->rx_untagged & BCM_PKT_INNER_UNTAGGED) ? "Outer tagged" : "Double tagged")); /* Print additional packet information */ if ((pkt->flags & BCM_PKT_STK_F_SRC_PORT) && (pkt->flags & BCM_PKT_STK_F_DST_PORT)) { /* Both destination and source GPORTs available */ printf (" dest-gport %d; src-gport %d; opcode %d;%s matched %d; classification-tag %d;\n", pkt->dst_gport, pkt->src_gport, pkt->opcode, (pkt->flags & BCM_RX_TRUNCATED) ? " Truncated;" : "", pkt->rx_matched, pkt->rx_classification_tag); } else if ((pkt->flags & BCM_PKT_STK_F_SRC_PORT)) { /* Source GPORT available */ printf (" dest-port %d; dest-mod %d; src-gport %d; opcode %d;%s matched %d; classification-tag %d;\n", pkt->dest_port, pkt->dest_mod, pkt->src_gport, pkt->opcode, (pkt->flags & BCM_RX_TRUNCATED) ? " Truncated;" : "", pkt->rx_matched, pkt->rx_classification_tag); } else if ((pkt->flags & BCM_PKT_STK_F_DST_PORT)) { /* Destination GPORT available */ printf (" dest-gport %d; %s %d; src-mod %d; opcode %d;%s matched %d; classification-tag %d;\n", pkt->dst_gport, (pkt->flags & BCM_PKT_F_TRUNK) ? "src-trunk" : "src-port", (pkt->flags & BCM_PKT_F_TRUNK) ? pkt->src_trunk : pkt->src_port, pkt->src_mod, pkt->opcode, (pkt->flags & BCM_RX_TRUNCATED) ? " Truncated;" : "", pkt->rx_matched, pkt->rx_classification_tag); } else { /* No GPORTs */ printf (" dest-port %d; dest-mod %d;%s %d; src-mod %d; opcode %d;%s matched %d; classification-tag %d;\n", pkt->dest_port, pkt->dest_mod, (pkt->flags & BCM_PKT_F_TRUNK) ? "src-trunk" : "src-port", (pkt->flags & BCM_PKT_F_TRUNK) ? pkt->src_trunk : pkt->src_port, pkt->src_mod, pkt->opcode, (pkt->flags & BCM_RX_TRUNCATED) ? " Truncated;" : "", pkt->rx_matched, pkt->rx_classification_tag); } /* * Print out reasons (if any) by iterating through the entire reasons * mask and printing the reason string associated with each reason. */ reason_count = 0; BCM_RX_REASON_ITER(pkt->rx_reasons, reason) { reason_count++; printf(" %s", reason_strings[reason]); } if (reason_count) { printf("\nPacket sent for %d reason(s)\n", reason_count); } else { /* Assume that if there were no reasons, must be switched */ printf("Packet switched to CPU\n"); } } /* A little routine to print a MAC address */ void mac_print(unsigned char *macAddr) { printf("%02x:%02x:%02x:%02x:%02x:%02x\n", (macAddr[0] & 0xFF), (macAddr[1] & 0xFF), (macAddr[2] & 0xFF), (macAddr[3] & 0xFF), (macAddr[4] & 0xFF), (macAddr[5] & 0xFF)); } /* Receive Task Callback * * This is called for every packet received. It prints the packet metadata * along with the entire packet. * * Param "cookie" is a pointer to current received packet count. */ bcm_rx_t packetWatcher(int unit, bcm_pkt_t * pkt, void *cookie) { int BCM_RX_HANDLED=2; int *packet_count = (auto) cookie; int i; /* Increment packet count */ (*packet_count)++; printf("Received Packet: %2d\n", *packet_count); for (i = 0; i < pkt->tot_len; i++) { uint32 print_byte = pkt->pkt_data->data[i] & 0xFF; if ((i & 0xf) == 0) { printf("\n%03X:", i); } printf(" %02X", print_byte); } if (((i & 0xf) != 1)) { printf("\n"); } printf(" DM="); mac_print(&pkt->pkt_data->data[0]); printf(" SM="); mac_print(&pkt->pkt_data->data[6]); /* print packet metadata */ packet_info(pkt); printf("\n"); return BCM_RX_HANDLED; } /* * rx_setup() * * Start Rx task (if necessary) and install a single Rx callback routine. */ int rx_count; /* Global received packet count */ int rx_setup(int unit) { int rv; /* * Use a priority above 100 to be able to co-exist with diagnostic * shell packetWatcher. */ const int priority = 101; /* Receive packets from all CPU queues. */ const int flags = BCM_RCO_F_ALL_COS; if (!bcm_rx_active(unit)) { /* * If necessary, initialize and start the receive task. */ rv = bcm_rx_init(unit); if(BCM_FAILURE(rv)) { printf("\nError in bcm_rx_init(): %s.\n",bcm_errmsg(rv)); return rv; } rv = bcm_rx_start(unit, NULL); if(BCM_FAILURE(rv)) { printf("\nError in bcm_rx_start(): %s.\n",bcm_errmsg(rv)); return rv; } printf("Started the Rx task\n"); } /* * Register Packet Watcher Rx Callback. */ rv = bcm_rx_register(unit, "Rx PacketWatch", packetWatcher, \ priority, &rx_count,flags); if(BCM_FAILURE(rv)) { printf("\nError in bcm_rx_init(): %s.\n",bcm_errmsg(rv)); return rv; } printf("Registered CINT Packet Watcher callback\n"); return BCM_E_NONE; } /* * Configures the port in loopback mode and * add L2 entry with mac-03 for CPU port. */ bcm_error_t ingress_port_setup(int unit, bcm_port_t port) { const char *mac = "00:00:00:00:00:03"; const int max_vlan_pri = 8; char command[128]; /* Buffer for diagnostic shell commands */ int vlan_pri; /* Put test port into loopback mode */ BCM_IF_ERROR_RETURN(bcm_port_loopback_set(unit, port, BCM_PORT_LOOPBACK_PHY)); /* Configure "tx" utility to send IEEE packets (not HiGig) */ bshell(unit, "hm ieee"); /* Set up L2 map to direct packets to CPU */ sprintf(command, "l2 add PortBitMap=cpu0 vlan=1 mac=%s rp=0 st=1", mac); bshell(unit, command); return BCM_E_NONE; } /* This function is written so that hardcoding of port numbers in Cint scripts is removed. This function gives required number of ports */ bcm_error_t portNumbersGet(int unit, int *port_list, int num_ports) { int i=0,port=0,rv=0; bcm_port_config_t configP; bcm_pbmp_t ports_pbmp; rv = bcm_port_config_get(unit,&configP); if(BCM_FAILURE(rv)) { printf("\nError in retrieving port configuration: %s.\n",bcm_errmsg(rv)); return rv; } ports_pbmp = configP.e; for (i= 1; i < BCM_PBMP_PORT_MAX; i++) { if (BCM_PBMP_MEMBER(&ports_pbmp,i)&& (port < num_ports)) { port_list[port]=i; port++; } } if (( port == 0 ) || ( port != num_ports )) { printf("portNumbersGet() failed \n"); return -1; } return BCM_E_NONE; } /* * This functions gets the port numbers and sets up ingress and * egress ports. Check ingress_port_setup() and egress_port_setup(). */ bcm_error_t test_setup(int unit) { int port_list[2], i; if (BCM_E_NONE != portNumbersGet(unit, port_list, 2)) { printf("portNumbersGet() failed\n"); return -1; } ingress_port = port_list[0]; if (BCM_E_NONE != ingress_port_setup(unit, ingress_port)) { printf("ingress_port_setup() failed for port %d\n", ingress_port); return -1; } return BCM_E_NONE; } /* * Test Harness * * Demonstrate use of Rx callbacks. * * Verify behavior by sending packets through the switch and back through * the CPU to the Rx callback routine. */ bcm_error_t test_harness(int unit) { int len; const char *mac = "00:00:00:00:00:03"; const int max_vlan_pri = 8; char command[128]; /* Buffer for diagnostic shell commands */ int vlan_pri; /* Send packets, loop them back through CPU port */ for (len = 100; len <= 120; len += 10) { for (vlan_pri = 0; vlan_pri < max_vlan_pri; vlan_pri += 2) { printf ("----------------------------------------------------------------\n"); sprintf(command, "tx 1 PortBitMap=%d Length=%d DestMac=%s VlanPrio=%d VLantag=1 PatternRandom=yes", ingress_port, len, mac, vlan_pri); bshell(unit, command); sal_sleep(1); /* Pause long enough to print packet data */ } } return BCM_E_NONE; } void verify(int unit) { bcm_error_t rv; if (BCM_FAILURE(rv = test_harness(0))) { printf("Rx verification failed: %s\n", bcm_errmsg(rv)); } } bcm_error_t execute() { bcm_error_t rv; int unit =0; bshell(unit, "config show; a ; version"); if (BCM_FAILURE((rv = test_setup(unit)))) { printf("test_setup() failed.\n"); return -1; } if (BCM_FAILURE((rv = rx_setup(unit)))) { printf("RX Setup Failed\n"); return -1; } verify(unit); return BCM_E_NONE; } const char *auto_execute = (ARGC == 1) ? ARGV[0] : "YES"; if (!sal_strcmp(auto_execute, "YES")) { print execute(); }
1.851563
2
final/include/link_unlink.h
toddas90/cpts360-fall2021
0
7996883
#ifndef LINK_UNLINK_H #define LINK_UNLINK_H #include "type.h" #include "util.h" int my_link(); int my_unlink(); int my_truncate(MINODE *del); #endif /* LINK_UNLINK_H */
0.585938
1
TOFileKit/Models/SystemDocumentProviders/TOSystemDocumentProviderManager.h
TimOliver/TOFileKit
7
7996891
// // ICCloudDocumentManager.h // icomics // // Created by <NAME> on 12/5/14. // Copyright (c) 2014 <NAME>. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface TOSystemDocumentBrowserManager : NSObject /* Fired when a comic was successfully imported from another document controller */ @property (nonatomic, copy) void (^importSucceededHandler)(void); /* Fired when everything's completed, whether successful or not. */ @property (nonatomic, copy) void (^completionHandler)(void); /* Confirm we're on an iOS version that'll support this */ + (BOOL)isAvailable; /* Create a new instance with the controller we'll present from */ - (instancetype)initWithParentViewController:(UIViewController *)parentController; /* Present the controller from a popover controller */ - (void)presentFromBarButtonItem:(UIBarButtonItem *)barItem; @end
0.941406
1
Src/GPUPerfAPI-Common/GPAVersion.h
janesma/amd_gpa
0
7996899
//============================================================================== // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved. /// \author AMD Developer Tools Team /// \file /// \brief Macros used for versioning GPUPerfAPI //============================================================================== #ifndef _GPA_VERSION_H_ #define _GPA_VERSION_H_ #define GPA_MAJOR_VERSION 2 #define GPA_MINOR_VERSION 24 #define GPA_BUILD_NUMBER 0 #define GPA_UPDATE_VERSION 0 #define GPA_STR_VALUE(s) #s #define GPA_VERSION_STRING(s) GPA_STR_VALUE(s) #define GPA_MAJOR_VERSION_STR GPA_VERSION_STRING(GPA_MAJOR_VERSION) #define GPA_MINOR_VERSION_STR GPA_VERSION_STRING(GPA_MINOR_VERSION) #define GPA_BUILD_NUMBER_STR GPA_VERSION_STRING(GPA_BUILD_NUMBER) #define GPA_UPDATE_VERSION_STR GPA_VERSION_STRING(GPA_UPDATE_VERSION) #define AMDT_PROJECT_SUFFIX_STR GPA_VERSION_STRING(AMDT_PROJECT_SUFFIX) #define GPA_COPYRIGHT_CURRENT_YEAR 2017 #define GPA_COPYRIGHT_STR "Copyright (c) 2010-" GPA_VERSION_STRING(GPA_COPYRIGHT_CURRENT_YEAR) " Advanced Micro Devices, Inc. All rights reserved." #endif // _GPA_VERSION_H_
0.988281
1
src/cmds/smac_adm.c
ahmedkrmn/embox
2
7996907
/** * @file * @brief * * @author <NAME> * @date 21.02.2013 */ #include <string.h> #include <stdio.h> #include <unistd.h> #include <sys/stat.h> #include <errno.h> #include <security/smac/smac.h> extern int cmd_smac_adm_user_set(const char *name, const char *label); extern int cmd_smac_adm_user_get(const char *name, char *buf, size_t buflen); #define BUFLEN 4096 static char buf[BUFLEN]; static int print_rules(void) { struct smac_env *env; struct smac_entry *ent; int res, i; if (0 != (res = smac_getenv(buf, BUFLEN, &env))) { return res; } printf("Total rules: %d\n", env->n); for (ent = env->entries, i = env->n; i > 0; ++ent, --i) { printf("%16s %16s ", ent->subject, ent->object); putchar(ent->flags & S_IROTH ? 'r' : '-'); putchar(ent->flags & S_IWOTH ? 'w' : '-'); putchar(ent->flags & S_IXOTH ? 'x' : '-'); putchar('\n'); } return 0; } static int new_rule(const char *subject, const char *object, const char *access) { int flags = 0; flags |= strchr(access, 'r') ? S_IROTH : 0; flags |= strchr(access, 'w') ? S_IWOTH : 0; flags |= strchr(access, 'x') ? S_IXOTH : 0; return smac_addenv(subject, object, flags); } static int print_label(const char *name) { int res; if (name == NULL) { res = smac_labelget(buf, BUFLEN); } else { res = cmd_smac_adm_user_get(name, buf, BUFLEN); } if (0 != res) { return res; } puts(buf); return 0; } int main(int argc, char *argv[]) { char *label = NULL; char *user = NULL; char *subject = NULL, *object = NULL, *access = NULL; enum action { ACT_NONE, ACT_SET, ACT_GET, ACT_FLUSH, ACT_PRINT, ACT_RULE, ACT_USER, ACT_HELP, } action = ACT_NONE; int opt; getopt_init(); while (-1 != (opt = getopt(argc, argv, "S:GFPR:U:o:a:h"))) { enum action act = ACT_NONE; switch(opt) { case 'S': act = ACT_SET; label = optarg; break; case 'G': act = ACT_GET; break; case 'F': act = ACT_FLUSH; break; case 'P': act = ACT_PRINT; break; case 'R': act = ACT_RULE; subject = optarg; break; case 'U': act = ACT_USER; user = optarg; label = argv[optind++]; break; case 'o': object = optarg; break; case 'a': access = optarg; break; case 'h': act = ACT_HELP; break; default: printf("Unknown argument -- %c\n", optopt); return -EINVAL; } if (act != ACT_NONE) { if (action != ACT_NONE) { printf("Incorrect commmand line, multiplie action specified\n"); return -EINVAL; } action = act; } } switch(action) { case ACT_SET: return smac_labelset(label); case ACT_GET: return print_label(optind < argc ? argv[optind] : NULL); case ACT_FLUSH: return smac_flushenv(); case ACT_RULE: return new_rule(subject, object, access); case ACT_PRINT: return print_rules(); case ACT_USER: return cmd_smac_adm_user_set(user, label); case ACT_NONE: default: break; } return 0; }
1.328125
1
hal/src/driver/glut/ep_glut.h
Euclideon/udshell
0
7996915
#pragma once #if !defined(UD_GLUT) #define UD_GLUT #include "driver.h" #if EPWINDOW_DRIVER == EPDRIVER_GLUT #pragma warning(disable:4505) // unreferenced local function has been removed - a warning generated by freeglut #define FREEGLUT_STATIC #define FREEGLUT_LIB_PRAGMAS 0 #include "GL/freeglut.h" #endif // EPRENDER_DRIVER == EPDRIVER_GLUT #endif // UD_GLUT
0.71875
1
kernel/objects/object.h
NeilKleistGao/NginD
13
7996923
/** * @copybrief * MIT License * Copyright (c) 2020 NeilKleistGao * 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. */ /// @file object.h #ifndef NGIND_OBJECT_H #define NGIND_OBJECT_H #include <map> #include <iostream> #include "memory/auto_collection_object.h" #include "updatable_object.h" #include "components/component.h" #include "script/lua_registration.h" namespace ngind::objects { class EntityObject; /** * This class is base of all objects in the game world. It can be serialized, auto collected * and update itself in each frame. */ class Object : public memory::AutoCollectionObject, public UpdatableObject { public: Object(); ~Object() override; /** * Add a child object * @param name: the name of child * @param object: the pointer to child object */ void addChild(const std::string& name, EntityObject* object); /** * Remove a reference of a child. If child is not found, nothing * @param name: the name of child */ void removeChild(const std::string& name); /** * Remove all children by given name. * @param name: the given name */ void removeAllChildren(const std::string& name); /** * Get the child. If child doesn't exist, it returns a null pointer * @param name: the name of child * @return Object*, the pointer to child */ EntityObject* getChildByName(const std::string& name); /** * Get children by given name. * @param name: the given name * @return std::vector<EntityObject*>, the list of children */ std::vector<EntityObject*> getChildrenByName(const std::string& name); /** * Get children by given name, and save it in the lua ref object. * @param ref: where the object would be saved * @param name: name of children */ void getChildrenByName(luabridge::LuaRef ref, const std::string& name); /** * Get all children objects. * @return std::vector<EntityObject*>, all children */ std::vector<EntityObject*> getChildren(); /** * Set parent object of this one * @param object: the parent object */ inline void setParent(Object* object) { this->_parent = object; } /** * Get parent object of this one * @return Object*, the pointer to parent */ inline Object* getParent() { return this->_parent; } /** * @see kernel/objects/updatable_object.h */ void update(const float&) override; /** * Add a component. If component exists, nothing will happen. * @param name: name of component * @param component: component pointer */ virtual void addComponent(const std::string& name, components::Component* component); /** * Get the component by name. If the component doesn't exist, it will return a null pointer. * @tparam Type: the actual type of component * @param name: the name of component * @return Type*, the pointer of component */ template<typename Type> Type* getComponent(const std::string& name) { if (_components.find(name) == _components.end()) { return nullptr; } return dynamic_cast<Type*>(_components[name]); } /** * Get all components by given type * @tparam Type: given component type * @param type: name of type * @return std::vector<Type*>, list of components */ template<typename Type> std::vector<Type*> getComponents(const std::string& type) { std::vector<Type*> res; for (auto [name, com] : _components) { if (com->getComponentName() == type) { res.push_back(dynamic_cast<Type*>(com)); } } return res; } /** * Remove a component by name. If the component doesn't exist, nothing will happen. * @tparam Type: the actual type of component * @param name: the name of component */ template<typename Type, typename std::enable_if_t<std::is_base_of_v<components::Component, Type>> N = 0> void removeComponent(const std::string& name) { if (_components.find(name) == _components.end()) { return; } _components[name]->removeReference(); _components.erase(name); } protected: /** * A RB-tree maintaining all children */ std::multimap<std::string, EntityObject*> _children; /** * A RB-tree maintaining all components */ std::map<std::string, components::Component*> _components; /** * Parent object */ Object* _parent; }; NGIND_LUA_BRIDGE_REGISTRATION(Object) { luabridge::getGlobalNamespace(script::LuaState::getInstance()->getState()) .beginNamespace("engine") .deriveClass<Object, memory::AutoCollectionObject>("Object") .addFunction("addChild", &Object::addChild) .addFunction("removeChild", &Object::removeChild) .addFunction("removeAllChildren", &Object::removeAllChildren) .addFunction("getChildByName", &Object::getChildByName) .addFunction<void>("getChildrenByName", &Object::getChildrenByName) .addFunction("addComponent", &Object::addComponent) .addFunction("setParent", &Object::setParent) .addFunction("getParent", &Object::getParent) .endClass() .endNamespace(); } } // namespace ngind::objects #endif //NGIND_OBJECT_H
1.648438
2
arch/arm/include/efm32/irq.h
liuweisword/Nuttx
15
7996931
/************************************************************************************ * arch/arm/include/efm32s/irq.h * * Copyright (C) 2014 <NAME>. All rights reserved. * Author: <NAME> <<EMAIL>> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ************************************************************************************/ /* This file should never be included directed but, rather, only indirectly through * nuttx/irq.h */ #ifndef __ARCH_ARM_INCLUDE_EFM32_IRQ_H #define __ARCH_ARM_INCLUDE_EFM32_IRQ_H /************************************************************************************ * Included Files ************************************************************************************/ #include <nuttx/config.h> #include <nuttx/irq.h> #include <arch/efm32/chip.h> /************************************************************************************ * Pre-processor Definitions ************************************************************************************/ /* IRQ numbers. The IRQ number corresponds vector number and hence map directly to * bits in the NVIC. This does, however, waste several words of memory in the IRQ * to handle mapping tables. */ /* Processor Exceptions (vectors 0-15) */ #define EFM32_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG_FEATURES) */ /* Vector 0: Reset stack pointer value */ /* Vector 1: Reset (not handler as an IRQ) */ #define EFM32_IRQ_NMI (2) /* Vector 2: Non-Maskable Interrupt (NMI) */ #define EFM32_IRQ_HARDFAULT (3) /* Vector 3: Hard fault */ #define EFM32_IRQ_MEMFAULT (4) /* Vector 4: Memory management (MPU) */ #define EFM32_IRQ_BUSFAULT (5) /* Vector 5: Bus fault */ #define EFM32_IRQ_USAGEFAULT (6) /* Vector 6: Usage fault */ #define EFM32_IRQ_SVCALL (11) /* Vector 11: SVC call */ #define EFM32_IRQ_DBGMONITOR (12) /* Vector 12: Debug Monitor */ /* Vector 13: Reserved */ #define EFM32_IRQ_PENDSV (14) /* Vector 14: Pendable system service request */ #define EFM32_IRQ_SYSTICK (15) /* Vector 15: System tick */ /* External interrupts (vectors >= 16). These definitions are chip-specific */ #define EFM32_IRQ_INTERRUPTS (16) /* Vector number of the first external interrupt */ #if defined(CONFIG_EFM32_EFM32TG) # include <arch/efm32/efm32tg_irq.h> #elif defined(CONFIG_EFM32_EFM32G) # include <arch/efm32/efm32g_irq.h> #elif defined(CONFIG_EFM32_EFM32GG) # include <arch/efm32/efm32gg_irq.h> #else # error "Unsupported EFM32 chip" #endif #ifdef CONFIG_EFM32_GPIO_IRQ /* If GPIO interrupt support is enabled then up to 16 additional GPIO interrupt * sources are available. There are actually only two physical interrupt lines: * GPIO_EVEN and GPIO_ODD. However, from the software point of view, there are * 16-additional interrupts generated from a second level of decoding. */ # define EFM32_IRQ_EXTI0 (NR_VECTORS+0) /* Port[n], pin0 external interrupt */ # define EFM32_IRQ_EXTI1 (NR_VECTORS+1) /* Port[n], pin1 external interrupt */ # define EFM32_IRQ_EXTI2 (NR_VECTORS+2) /* Port[n], pin2 external interrupt */ # define EFM32_IRQ_EXTI3 (NR_VECTORS+3) /* Port[n], pin3 external interrupt */ # define EFM32_IRQ_EXTI4 (NR_VECTORS+4) /* Port[n], pin4 external interrupt */ # define EFM32_IRQ_EXTI5 (NR_VECTORS+5) /* Port[n], pin5 external interrupt */ # define EFM32_IRQ_EXTI6 (NR_VECTORS+6) /* Port[n], pin6 external interrupt */ # define EFM32_IRQ_EXTI7 (NR_VECTORS+7) /* Port[n], pin7 external interrupt */ # define EFM32_IRQ_EXTI8 (NR_VECTORS+8) /* Port[n], pin8 external interrupt */ # define EFM32_IRQ_EXTI9 (NR_VECTORS+9) /* Port[n], pin9 external interrupt */ # define EFM32_IRQ_EXTI10 (NR_VECTORS+10) /* Port[n], pin10 external interrupt */ # define EFM32_IRQ_EXTI11 (NR_VECTORS+11) /* Port[n], pin11 external interrupt */ # define EFM32_IRQ_EXTI12 (NR_VECTORS+12) /* Port[n], pin12 external interrupt */ # define EFM32_IRQ_EXTI13 (NR_VECTORS+13) /* Port[n], pin13 external interrupt */ # define EFM32_IRQ_EXTI14 (NR_VECTORS+14) /* Port[n], pin14 external interrupt */ # define EFM32_IRQ_EXTI15 (NR_VECTORS+15) /* Port[n], pin15 external interrupt */ # define NR_IRQS (NR_VECTORS+16) /* Total number of interrupts */ #else # define NR_IRQS NR_VECTORS /* Total number of interrupts */ #endif /************************************************************************************ * Public Types ************************************************************************************/ /************************************************************************************ * Public Data ************************************************************************************/ #ifndef __ASSEMBLY__ #ifdef __cplusplus #define EXTERN extern "C" extern "C" { #else #define EXTERN extern #endif /************************************************************************************ * Public Functions ************************************************************************************/ #undef EXTERN #ifdef __cplusplus } #endif #endif #endif /* __ARCH_ARM_INCLUDE_EFM32_IRQ_H */
1.226563
1
Horario/Horario/include/Horario.h
JLRocha-UFPB/Atividades-LP1
0
7996939
#ifndef HORARIO_H #define HORARIO_H #include <iostream> using namespace std; class Horario { public: Horario(); //construtor sem parametro Horario(int hora,int minuto,int segundo); //construtor com tres parametros; void setHorario(int hora,int minuto,int segundo); void avancarHorario(); int getHora(); int getMinuto(); int getSegundo(); void setHora(int hora); void setMinuto(int minuto); void setSegundo(int segundo); private: int hora; int minuto; int segundo; }; #endif // HORARIO_H
0.976563
1
DataStructures/searchTree/testRedBlack.h
lambdaxing/dsaa_cpp2
0
7996947
#pragma once #include "redBlackTree.h" #include <map> const int num = 1000000; void testRedBlack() { redBlackTree<int, char> avl; for (int i = 1; i <= 20; ++i) { std::cout << avl.size() << std::endl; avl.insert(std::pair<int, char>(i, static_cast<char>(i + 96))); } avl.ascend(); std::cout << std::endl; for (int i = 1; i <= 10; ++i) { std::cout << avl.size() << std::endl; avl.erase(i); } avl.ascend(); std::cout << std::endl; } void testMapTime() { std::map<char, int> m; for (int i = 1; i < num; ++i) { m.insert(std::pair<const char, int>(i, 'a')); } for (int i = 1; i < num; ++i) { auto f = m.find(i); std::cout << f->first << " : " << f->second; } std::cout << std::endl; for (int i = 1; i < num; ++i) { m.erase(i); } for (int i = 1; i < num; ++i) { auto f = m.find(i); if (f != m.end()) std::cout << f->first << " : " << f->second; } std::cout << std::endl; } void testRedBlackTime() { redBlackTree<int, char> m; for (int i = 1; i < num; ++i) { m.insert(std::pair<const int, char>(i, 'a')); } for (int i = 1; i < num; ++i) { auto f = m.find(i); std::cout << f->first << " : " << f->second; } std::cout << std::endl; for (int i = 1; i < num; ++i) { m.erase(i); } for (int i = 1; i < num; ++i) { auto f = m.find(i); if (f != nullptr) std::cout << f->first << " : " << f->second; } std::cout << std::endl; }
1.75
2
include/afv-native/cryptodto/Channel.h
kuroneko/AFV-Native
6
7996955
/* cryptodto/Channel.h * * This file is part of AFV-Native. * * Copyright (c) 2019 <NAME> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef AFV_NATIVE_CHANNEL_H #define AFV_NATIVE_CHANNEL_H #include <vector> #include <string> #include <cstdint> #include <openssl/evp.h> #include <msgpack.hpp> #include "afv-native/cryptodto/params.h" #include "afv-native/cryptodto/SequenceTest.h" #include "afv-native/cryptodto/dto/ICryptoDTO.h" #include "afv-native/Log.h" namespace afv_native { namespace cryptodto { namespace dto { class ChannelConfig; class Header; } class Channel { protected: unsigned char aeadTransmitKey[aeadModeKeySize]; unsigned char aeadReceiveKey[aeadModeKeySize]; static void make_aead_key(unsigned char keyBuffer[]); size_t decryptChaCha20Poly1305( unsigned char *bodyOut, const unsigned char *cipherIn, size_t cipherLen, const dto::Header &header, const unsigned char *aadIn, size_t aadLen); size_t encryptChaCha20Poly1305( unsigned char *cipherOut, const unsigned char *plainIn, size_t plainLen, const dto::Header &header, const unsigned char *aadIn, size_t aadLen); static void makeChaCha20Poly1305Nonce(uint64_t sequence, unsigned char *nonceBuffer); protected: /** encodeDto takes the DTO provided as dto and encodes it into dtoBuf. * * This forms the ciphertext portion of an encrypted DTO message. * * @tparam T type of the DTO. T must provide a getName() method that * returns the DTO name, and be encodable by msgpack-c. * @param dtoBuf the sbuffer object to pass the encoded dto out in. * @param dto the dto to encode * @return true if the message was successfully encoded, false otherwise. */ template<class T> static bool encodeDto(msgpack::sbuffer &dtoBuf, const T &dto) { // assemble the body and pack it. std::string dtoName = dto.getName(); uint16_t nLen = static_cast<uint16_t>(dtoName.length()); dtoBuf.write(reinterpret_cast<char *>(&nLen), 2); dtoBuf.write(dtoName.data(), nLen); // because we don't know the dto size in advance, pack it into it's own // temp buffer, then copy it into the actual payload buffer. msgpack::sbuffer dtoTempBuf; msgpack::pack(dtoTempBuf, dto); nLen = static_cast<uint16_t>(dtoTempBuf.size()); if (dtoTempBuf.size() > UINT16_MAX) { return false; } dtoBuf.write(reinterpret_cast<char *>(&nLen), 2); dtoBuf.write(dtoTempBuf.data(), dtoTempBuf.size()); assert(dtoBuf.size() == (dtoTempBuf.size() + 2 + dtoName.size() + 2)); return true; } public: std::string ChannelTag; time_t LastTransmit; time_t LastReceive; explicit Channel(); virtual void setChannelConfig(const dto::ChannelConfig &config); template<class T> size_t Encapsulate( unsigned char *bufOut, size_t bufOutLen, sequence_t sequence, cryptodto::CryptoDtoMode mode, const T &dto) { msgpack::sbuffer dtoBuf; if (!encodeDto(dtoBuf, dto)) { return 0; } // use the generic encapsulate method. return Encapsulate( reinterpret_cast<const unsigned char *>(dtoBuf.data()), dtoBuf.size(), sequence, mode, bufOut, bufOutLen); } size_t Encapsulate( const unsigned char *plainTextBuf, size_t plainTextLen, sequence_t sequence, cryptodto::CryptoDtoMode mode, unsigned char *cipherTextBufOut, size_t cipherTextLen); bool Decapsulate( const unsigned char *cipherTextIn, size_t cipherTextLen, std::string &channelTag, sequence_t &sequence, CryptoDtoMode &modeOut, std::string &dtoNameOut, msgpack::sbuffer &dtoOut); }; } } #endif //AFV_NATIVE_CHANNEL_H
1.101563
1
src/libmodelbox/include/modelbox/stream_matcher.h
yamal-shang/modelbox
51
7996963
/* * Copyright 2021 The Modelbox Project Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MODELBOX_STREAM_MATCHER_H_ #define MODELBOX_STREAM_MATCHER_H_ #include <map> #include <memory> #include <vector> #include "modelbox/port.h" namespace modelbox { class GraphStream : public std::enable_shared_from_this<GraphStream> { // we can only have one relation stream parent or full public: GraphStream(); virtual ~GraphStream() = default; std::shared_ptr<GraphStream> GenerateConditionStream( std::shared_ptr<GraphStream> other_stream); std::shared_ptr<GraphStream> GenerateChildStream(); std::shared_ptr<GraphStream> GetParentStream(); std::shared_ptr<GraphStream> GetFullStream(); std::shared_ptr<GraphStream> GenerateSiblingStream(); bool IsSameConditonGroupStream(std::shared_ptr<GraphStream> other_stream); private: std::shared_ptr<GraphStream> parent_stream_; std::shared_ptr<GraphStream> full_stream_; // other conditon stream std::weak_ptr<GraphStream> next_stream_; }; class StreamMatcher { public: StreamMatcher(std::set<std::shared_ptr<NodeBase>> start_nodes, std::set<std::shared_ptr<NodeBase>> all_nodes); virtual ~StreamMatcher(); Status StartCheck(); std::shared_ptr<GraphStream> GenerateRootStream(); private: std::shared_ptr<GraphStream> GetInputStream(std::shared_ptr<NodeBase> node); Status GenerateOutputStream(std::shared_ptr<NodeBase> node, std::shared_ptr<GraphStream> input_stream); Status BindOutputStream(std::shared_ptr<NodeBase> node, std::shared_ptr<OutPort> output_port, std::shared_ptr<GraphStream> output_stream); Status UpdateCheckingNode(); std::shared_ptr<GraphStream> root_stream_; std::map<std::shared_ptr<InPort>, std::shared_ptr<GraphStream>> port_stream_map_; std::map<std::shared_ptr<InPort>, std::vector<std::shared_ptr<OutPort>>> port_connect_map_; std::set<std::shared_ptr<NodeBase>> checked_nodes_; std::set<std::shared_ptr<NodeBase>> checking_nodes_; std::set<std::shared_ptr<NodeBase>> all_nodes_; }; } // namespace modelbox #endif // MODELBOX_STREAM_CHECK_H_
1.265625
1
include/mc_updater/mc_updater.h
campbellhome/mc_common
0
7996971
// Copyright (c) 2012-2019 <NAME> // MIT license (see License.txt) #pragma once #include "common.h" #if defined(__cplusplus) extern "C" { #endif typedef struct tag_mc_updater_filenames { u32 count; u32 allocated; const char **data; } mc_updater_filenames; typedef struct tag_mc_updater_globals { const char *appName; const char *appdataName; const char *currentVersionJsonFilename; const char *p4VersionDir; const char *manifestFilename; mc_updater_filenames contentsFilenames; } mc_updater_globals; b32 mc_updater_main(mc_updater_globals *globals); #if defined(__cplusplus) } #endif
0.601563
1
Console.h
StarsiegePlayers/memstar
0
7996979
#ifndef __CONSOLE_H__ #define __CONSOLE_H__ #include "Memstar.h" #include "StringConversions.h" #include "List.h" #include "MultiPointer.h" enum VariableType { VAR_bool = 1, VAR_int = 2, VAR_float = 3, VAR_double = 4, /* VAR_zeroToOne = 5, */ /* VAR_vector3F = 6 */ }; namespace Console { void addFunction(const char* name, void* cb); void addVariable(const char* name, const void* address, const VariableType var_type); void echo(const char* fmt, ...); const char* execFunction(u32 argc, char* function, ...); void eval(const char* cmd); bool functionExists(const char* name); const char* getVariable(const char* name); void setVariable(const char* name, const char* value); extern List<const char*> variables, functions; struct VariableConstructor { VariableConstructor(const char* scripted, void* address, VariableType type) : mName(scripted), mAddress(address), mType(type), mNext(mFirst) { mFirst = (this); } static void Process() { VariableConstructor* node = mFirst; for (; node; node = node->mNext) { addVariable(node->mName, node->mAddress, node->mType); variables.Push(node->mName); } } protected: const char* mName; void* mAddress; VariableType mType; VariableConstructor* mNext; static VariableConstructor* mFirst; }; struct ConsoleConstructor { ConsoleConstructor(const char* scripted, void* cb) : mName(scripted), mCallback(cb), mNext(mFirst) { mFirst = (this); } static void Process() { ConsoleConstructor* node = mFirst; for (; node; node = node->mNext) { addFunction(node->mName, node->mCallback); functions.Push(node->mName); } } protected: const char* mName; void* mCallback; ConsoleConstructor* mNext; int mPrivilegeLevel; static ConsoleConstructor* mFirst; }; }; // namespace Console #define BuiltInVariable( __scripted__, __type__, __name__, __default__ ) \ __type__ __name__ = __default__; \ static const Console::VariableConstructor vc##__name__( __scripted__, &__name__, VAR_##__type__ ) #define BuiltInFunction( __scripted__, __name__ ) \ const char * __stdcall __name__##bin(s32 argc, const char *self, const char *argv[]); \ NAKED const char *__name__##stub() { \ __asm { mov eax, [esp+4] } \ __asm { add eax, 4 } \ __asm { push eax } \ __asm { sub eax, 4 } \ __asm { push dword ptr [eax] } \ __asm { dec ecx } \ __asm { push ecx } \ __asm { call __name__##bin } \ __asm { retn 4 } \ } \ static const Console::ConsoleConstructor cc##__name__( __scripted__, __name__##stub ); \ const char * __stdcall __name__##bin(s32 argc, const char *self, const char *argv[]) #endif // __CONSOLE_H__
1.523438
2
Objcs/Modules/Main/Transition1/TaobaoAnimationTrasition.h
Projects-OC/Objc
0
7996987
// // TaobaoAnimationTrasition.h // Object-CDemo // // Created by Mac on 2018/3/26. // Copyright © 2018年 MF. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface TaobaoAnimationTrasition : NSObject<UINavigationControllerDelegate> /** 转场过渡的图片 */ - (void)setTransitionImgView:(UIImageView *)transitionImgView; /** 转场前的图片frame */ - (void)setTransitionBeforeImgFrame:(CGRect)frame; /** 转场后的图片frame */ - (void)setTransitionAfterImgFrame:(CGRect)frame; @end
0.667969
1
include/ode.h
edomin/Xtreme3D_v2_forC
2
7996995
#ifndef X3D_ODE_H #define X3D_ODE_H double (__stdcall * X3D_OdeManagerCreate)(void); double (__stdcall * X3D_OdeManagerDestroy)(void); double (__stdcall * X3D_OdeManagerStep)(double delta); double (__stdcall * X3D_OdeManagerGetNumContactJoints)(void); double (__stdcall * X3D_OdeManagerSetGravity)(double x, double y, double z); double (__stdcall * X3D_OdeManagerSetSolver)(double osm); double (__stdcall * X3D_OdeManagerSetIterations)(double iterations); double (__stdcall * X3D_OdeManagerSetMaxContacts)(double maxcontacts); double (__stdcall * X3D_OdeManagerSetVisible)(double mode); double (__stdcall * X3D_OdeManagerSetGeomColor)(double color); double (__stdcall * X3D_OdeWorldSetAutoDisableFlag)(double flag); double (__stdcall * X3D_OdeWorldSetAutoDisableLinearThreshold)(double velocity); double (__stdcall * X3D_OdeWorldSetAutoDisableAngularThreshold)(double velocity); double (__stdcall * X3D_OdeWorldSetAutoDisableSteps)(double steps); double (__stdcall * X3D_OdeWorldSetAutoDisableTime)(double time); double (__stdcall * X3D_OdeDynamicSetAutoDisableFlag)(double object, double flag); double (__stdcall * X3D_OdeDynamicSetAutoDisableLinearThreshold)(double object, double velocity); double (__stdcall * X3D_OdeDynamicSetAutoDisableAngularThreshold)(double object, double velocity); double (__stdcall * X3D_OdeDynamicSetAutoDisableSteps)(double object, double steps); double (__stdcall * X3D_OdeDynamicSetAutoDisableTime)(double object, double time); double (__stdcall * X3D_OdeStaticCreate)(double object); double (__stdcall * X3D_OdeDynamicCreate)(double object); double (__stdcall * X3D_OdeDynamicAlignObject)(double object); double (__stdcall * X3D_OdeDynamicEnable)(double object, double mode); double (__stdcall * X3D_OdeDynamicCalibrateCenterOfMass)(double object); double (__stdcall * X3D_OdeDynamicAddForce)(double object, double x, double y, double z); double (__stdcall * X3D_OdeDynamicAddForceAtPos)(double object, double x, double y, double z, double px, double py, double pz); double (__stdcall * X3D_OdeDynamicAddForceAtRelPos)(double object, double x, double y, double z, double px, double py, double pz); double (__stdcall * X3D_OdeDynamicAddRelForce)(double object, double x, double y, double z); double (__stdcall * X3D_OdeDynamicAddRelForceAtPos)(double object, double x, double y, double z, double px, double py, double pz); double (__stdcall * X3D_OdeDynamicAddRelForceAtRelPos)(double object, double x, double y, double z, double px, double py, double pz); double (__stdcall * X3D_OdeDynamicAddTorque)(double object, double x, double y, double z); double (__stdcall * X3D_OdeDynamicAddRelTorque)(double object, double x, double y, double z); double (__stdcall * X3D_OdeDynamicGetContactCount)(double object); double (__stdcall * X3D_OdeDynamicGetContact)(double object, double ind); double (__stdcall * X3D_OdeStaticGetContactCount)(double object); double (__stdcall * X3D_OdeStaticGetContact)(double object, double ind); double (__stdcall * X3D_OdeAddBox)(double object, double width, double height, double depth); double (__stdcall * X3D_OdeAddCapsule)(double object, double length, double radius); double (__stdcall * X3D_OdeAddCone)(double object, double length, double radius); double (__stdcall * X3D_OdeAddCylinder)(double object, double length, double radius); double (__stdcall * X3D_OdeAddPlane)(double object); double (__stdcall * X3D_OdeAddSphere)(double object, double radius); double (__stdcall * X3D_OdeAddTriMesh)(double object); double (__stdcall * X3D_OdeSurfaceSetRollingFrictionCoeff)(double body, double rfc); double (__stdcall * X3D_OdeSurfaceEnableRollingFrictionCoeff)(double body, double mode); double (__stdcall * X3D_OdeSurfaceSetMode)(double body, double Mu2, double FDir1, double Bounce, double SoftERP, double SoftCFM, double Motion1, double Motion2, double Slip1, double Slip2); double (__stdcall * X3D_OdeSurfaceSetMu)(double body, double mu); double (__stdcall * X3D_OdeSurfaceSetMu2)(double body, double mu2); double (__stdcall * X3D_OdeSurfaceSetBounce)(double body, double bounce); double (__stdcall * X3D_OdeSurfaceSetBounceVel)(double body, double vel); double (__stdcall * X3D_OdeSurfaceSetSoftERP)(double body, double erp); double (__stdcall * X3D_OdeSurfaceSetSoftCFM)(double body, double cfm); double (__stdcall * X3D_OdeSurfaceSetMotion1)(double body, double motion1); double (__stdcall * X3D_OdeSurfaceSetMotion2)(double body, double motion2); double (__stdcall * X3D_OdeSurfaceSetSlip1)(double body, double slip1); double (__stdcall * X3D_OdeSurfaceSetSlip2)(double body, double slip2); double (__stdcall * X3D_OdeAddJointBall)(void); double (__stdcall * X3D_OdeAddJointFixed)(void); double (__stdcall * X3D_OdeAddJointHinge)(void); double (__stdcall * X3D_OdeAddJointHinge2)(void); double (__stdcall * X3D_OdeAddJointSlider)(void); double (__stdcall * X3D_OdeAddJointUniversal)(void); double (__stdcall * X3D_OdeJointSetObjects)(double joint, double object1, double object2); double (__stdcall * X3D_OdeJointEnable)(double joint, double mode); double (__stdcall * X3D_OdeJointInitialize)(double joint, double mode); double (__stdcall * X3D_OdeJointSetAnchor)(double joint, double x, double y, double z); double (__stdcall * X3D_OdeJointSetAnchorAtObject)(double joint, double object); double (__stdcall * X3D_OdeJointSetAxis1)(double joint, double x, double y, double z); double (__stdcall * X3D_OdeJointSetAxis2)(double joint, double x, double y, double z); double (__stdcall * X3D_OdeJointSetBounce)(double joint, double axis, double bounce); double (__stdcall * X3D_OdeJointSetCFM)(double joint, double axis, double cfm); double (__stdcall * X3D_OdeJointSetFMax)(double joint, double axis, double fmax); double (__stdcall * X3D_OdeJointSetFudgeFactor)(double joint, double axis, double fmax); double (__stdcall * X3D_OdeJointSetHiStop)(double joint, double axis, double histop); double (__stdcall * X3D_OdeJointSetLoStop)(double joint, double axis, double lostop); double (__stdcall * X3D_OdeJointSetStopCFM)(double joint, double axis, double cfm); double (__stdcall * X3D_OdeJointSetStopERP)(double joint, double axis, double erp); double (__stdcall * X3D_OdeJointSetVel)(double joint, double axis, double velocity); #endif
0.957031
1
src/xrt/compositor/util/comp_swapchain.h
leviathanch/monado
0
7997003
// Copyright 2019-2021, Collabora, Ltd. // SPDX-License-Identifier: BSL-1.0 /*! * @file * @brief Independent swapchain implementation. * @author <NAME> <<EMAIL>> * @author <NAME> <<EMAIL>> * @ingroup comp_util */ #pragma once #include "vk/vk_image_allocator.h" #include "util/u_threading.h" #include "util/u_index_fifo.h" #ifdef __cplusplus extern "C" { #endif /*! * A garbage collector that collects swapchains to be safely destroyed. * * @ingroup comp_util */ struct comp_swapchain_gc { //! Thread object for safely destroying swapchain. struct u_threading_stack destroy_swapchains; }; /*! * A single swapchain image, holds the needed state for tracking image usage. * * @ingroup comp_util * @see comp_swapchain */ struct comp_swapchain_image { //! Sampler used by the renderer and distortion code. VkSampler sampler; VkSampler repeat_sampler; //! Views used by the renderer and distortion code, for each array layer. struct { VkImageView *alpha; VkImageView *no_alpha; } views; //! The number of array slices in a texture, 1 == regular 2D texture. size_t array_size; }; /*! * A swapchain that is almost a one to one mapping to a OpenXR swapchain. * * Not used by the window backend that uses the comp_target to render to. * * The vk_bundle is owned by the compositor, its the state trackers job to make * sure that compositor lives for as long as the swapchain does and that all * swapchains are destroyed before the compositor is destroyed. * * @ingroup comp_util * @implements xrt_swapchain_native * @see comp_compositor */ struct comp_swapchain { struct xrt_swapchain_native base; struct vk_bundle *vk; struct comp_swapchain_gc *gc; struct vk_image_collection vkic; struct comp_swapchain_image images[XRT_MAX_SWAPCHAIN_IMAGES]; /*! * This fifo is used to always give out the oldest image to acquire * image, this should probably be made even smarter. */ struct u_index_fifo fifo; }; /* * * Helper functions. * */ /*! * Convenience function to convert a xrt_swapchain to a comp_swapchain. * * @ingroup comp_util * @private @memberof comp_swapchain */ static inline struct comp_swapchain * comp_swapchain(struct xrt_swapchain *xsc) { return (struct comp_swapchain *)xsc; } /* * * 'Exported' functions. * */ /*! * Do garbage collection, destroying any resources that has been scheduled for * destruction from other threads. * * @ingroup comp_util */ void comp_swapchain_garbage_collect(struct comp_swapchain_gc *cscgc); /*! * A compositor function that is implemented in the swapchain code. * * @ingroup comp_util */ xrt_result_t comp_swapchain_create(struct vk_bundle *vk, struct comp_swapchain_gc *cscgc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain **out_xsc); /*! * A compositor function that is implemented in the swapchain code. * * @ingroup comp_util */ xrt_result_t comp_swapchain_import(struct vk_bundle *vk, struct comp_swapchain_gc *cscgc, const struct xrt_swapchain_create_info *info, struct xrt_image_native *native_images, uint32_t image_count, struct xrt_swapchain **out_xsc); /*! * Swapchain destruct is delayed until it is safe to destroy them, this function * does the actual destruction and is called from @ref * comp_swapchain_garbage_collect. * * @ingroup comp_util */ void comp_swapchain_really_destroy(struct comp_swapchain *sc); #ifdef __cplusplus } #endif
1.304688
1
revelation/test/c/get_core_coords.c
futurecore/revelation
4
7997011
#include <stdio.h> #include "e_lib.h" int main(void) { e_coreid_t coreid; unsigned row, col, i; coreid = e_get_coreid(); e_coords_from_coreid(coreid, &row, &col); printf("Core id: %x row=%u col=%u\n", (unsigned)coreid, row, col); return 0; }
0.929688
1
tweak1lib/src/tweakcompat.c
CogentEmbedded/tweaktool
0
7997019
/** * @file tweakcompat.c * @ingroup tweak-api * @brief part of tweak2 - tweak1 compatibility layer implementation. * * @copyright 2018-2021 Cogent Embedded Inc. ALL RIGHTS RESERVED. * * This file is a part of Cogent Tweak Tool feature. * * It is subject to the license terms in the LICENSE file found in the top-level * directory of this distribution or by request via www.cogentembedded.com */ #include <tweak.h> #include <tweak2/appserver.h> #include <tweak2/log.h> #include <tweak2/types.h> #include <tweak2/variant.h> #include <math.h> #include <pthread.h> #include <stdarg.h> #include <stdio.h> #include <uthash.h> #include <stdarg.h> static tweak_app_server_context s_context = NULL; static pthread_mutex_t s_callback_lock = { 0 }; static tweak_update_handler s_callback = NULL; static void* s_callback_cookie = NULL; static uint32_t s_layout_id = 0L; static char* s_current_widget_name = NULL; static char* s_layout_meta = NULL; #define MAX_BUFFER_SIZE (4 * 1024) #define MAX_NAME_LENGTH 256 #define MAX_OPTIONS_STRING_SIZE 512 static char s_buffer[MAX_BUFFER_SIZE]; struct name_uri_pair { char* name; char* uri; UT_hash_handle hh; }; static pthread_rwlock_t s_name_uri_lock = { 0 }; struct name_uri_pair* s_name_uri_pairs = NULL; struct name_uri_pair* s_uri_name_pairs = NULL; static char s_uri_concat_buffer[MAX_BUFFER_SIZE]; static char* add_uri_mapping(const char* name, const char* uri) { struct name_uri_pair* pair = NULL; HASH_FIND_STR(s_name_uri_pairs, name, pair); if (pair != NULL) { TWEAK_FATAL("duplicate name"); } pair = malloc(sizeof(*pair)); if (pair == NULL) { TWEAK_FATAL("malloc() returned NULL"); } size_t length = strlen(name); char* name_dup = strdup(name); char* uri_dup = strdup(uri); pair->name = name_dup; pair->uri = uri_dup; HASH_ADD_KEYPTR(hh, s_name_uri_pairs, name_dup, length, pair); return uri_dup; } static char* add_name_mapping(const char* uri, const char* name) { struct name_uri_pair* pair = NULL; HASH_FIND_STR(s_uri_name_pairs, uri, pair); if (pair != NULL) { TWEAK_FATAL("duplicate name"); } pair = malloc(sizeof(*pair)); if (pair == NULL) { TWEAK_FATAL("malloc() returned NULL"); } char* name_dup = strdup(name); size_t length = strlen(uri); char* uri_dup = strdup(uri); pair->name = name_dup; pair->uri = uri_dup; HASH_ADD_KEYPTR(hh, s_uri_name_pairs, uri_dup, length, pair); return name_dup; } static char* get_uri(const char* name); static const char* map_uri(const char* layout_name, const char* name) { if (!name) { TWEAK_FATAL("Name parameter is NULL"); return NULL; } if (strlen(name) >= MAX_NAME_LENGTH) { TWEAK_FATAL("name is too long"); return NULL; } if (layout_name && strlen(layout_name) >= MAX_NAME_LENGTH) { TWEAK_FATAL("layout name is too long"); return NULL; } const char* uri = NULL; pthread_rwlock_wrlock(&s_name_uri_lock); s_uri_concat_buffer[0] = '\0'; if (layout_name != NULL) { if (layout_name[0] != '/') { strcat(s_uri_concat_buffer, "/"); } strcat(s_uri_concat_buffer, layout_name); strcat(s_uri_concat_buffer, "/"); strcat(s_uri_concat_buffer, name); } else { if (name[0] != '/') { strcat(s_uri_concat_buffer, "/"); } strcat(s_uri_concat_buffer, name); } uri = add_uri_mapping(name, s_uri_concat_buffer); add_name_mapping(s_uri_concat_buffer, name); pthread_rwlock_unlock(&s_name_uri_lock); return uri; } static char* get_uri(const char* name) { if (!name) { TWEAK_FATAL("name is NULL"); } struct name_uri_pair* pair = NULL; pthread_rwlock_rdlock(&s_name_uri_lock); HASH_FIND_STR(s_name_uri_pairs, name, pair); pthread_rwlock_unlock(&s_name_uri_lock); if (pair == NULL) { return NULL; } return pair->uri; } static char* get_name(const char* uri) { if (!uri) { TWEAK_FATAL("uri is NULL"); } struct name_uri_pair* pair = NULL; pthread_rwlock_rdlock(&s_name_uri_lock); HASH_FIND_STR(s_uri_name_pairs, uri, pair); pthread_rwlock_unlock(&s_name_uri_lock); if (pair == NULL) { return NULL; } return pair->name; } void tweak_on_update(const char* name) { (void) name; TWEAK_FATAL("Not supported in TWEAK 2." " Use tweak_set_update_handler"); } static void on_current_value_changed(tweak_app_context context, tweak_id id, tweak_variant* value, void *cookie) { (void)context; (void)value; (void)cookie; tweak_update_handler callback; void* callback_cookie; pthread_mutex_lock(&s_callback_lock); callback = s_callback; callback_cookie = s_callback_cookie; pthread_mutex_unlock(&s_callback_lock); if (callback) { tweak_app_item_snapshot* snapshot = tweak_app_item_get_snapshot(s_context, id); const char *name = get_name(tweak_variant_string_c_str(&snapshot->uri)); callback(name, callback_cookie); tweak_app_release_snapshot(s_context, snapshot); } } void tweak_set_update_handler(tweak_update_handler handler, void* cookie) { pthread_mutex_lock(&s_callback_lock); s_callback = handler; s_callback_cookie = cookie; pthread_mutex_unlock(&s_callback_lock); } int tweak_connect(void) { pthread_mutex_init(&s_callback_lock, NULL); pthread_rwlock_init(&s_name_uri_lock, NULL); tweak_app_server_callbacks callbacks = { .on_current_value_changed = &on_current_value_changed }; s_context = tweak_app_create_server_context(TWEAK_CONNECTION_TYPE, TWEAK_PARAMS, TWEAK_URI, &callbacks); if (!s_context) { TWEAK_LOG_ERROR("Library hasn't been initialized correctly"); return 0; } return 1; } static const char* LAYOUT_META_TEMPLATE = "{" "\"layout_id\": %u," "\"width\": %u," "\"horizontal_vertical\": %u," "\"layout_name\": \"%s\"" "}"; void tweak_add_layout(unsigned int width, unsigned int horizontal_vertical, const char* name) { ++s_layout_id; int result_size; result_size = snprintf(s_buffer, sizeof(s_buffer), LAYOUT_META_TEMPLATE, s_layout_id, width, horizontal_vertical, name); if (result_size >= MAX_BUFFER_SIZE) { TWEAK_FATAL("Buffer to format meta string is too small"); } char* old_layout_meta = s_layout_meta; s_layout_meta = strdup(s_buffer); if (!s_layout_meta) { TWEAK_FATAL("strdup() returned NULL"); } free(old_layout_meta); } void tweak_close() { if (!s_context) { TWEAK_LOG_ERROR("Library hasn't been initialized correctly"); return; } pthread_rwlock_wrlock(&s_name_uri_lock); struct name_uri_pair *pair = NULL; struct name_uri_pair *tmp = NULL; HASH_ITER(hh, s_name_uri_pairs, pair, tmp) { HASH_DEL(s_name_uri_pairs, pair); free(pair->name); free(pair->uri); free(pair); } s_name_uri_pairs = NULL; HASH_ITER(hh, s_uri_name_pairs, pair, tmp) { HASH_DEL(s_uri_name_pairs, pair); free(pair->name); free(pair->uri); free(pair); } s_uri_name_pairs = NULL; pthread_rwlock_unlock(&s_name_uri_lock); tweak_app_destroy_context(s_context); pthread_rwlock_destroy(&s_name_uri_lock); pthread_mutex_destroy(&s_callback_lock); s_context = NULL; free(s_layout_meta); s_layout_meta = NULL; } static const char* META_TEMPLATE_WITH_LAYOUT = "{" "\"type\": \"double\"," "\"control\": \"%s\"," "\"min\": %f," "\"max\": %f," "\"readonly\": false," "\"decimals\": %u," "\"layout\": %s" "}"; static const char* META_TEMPLATE_WITHOUT_LAYOUT = "{" "\"type\": \"double\"," "\"control\": \"%s\"," "\"min\": %f," "\"max\": %f," "\"readonly\": false," "\"decimals\": %u" "}"; void tweak_add_slider(const char* name, double minv, double maxv, double def, unsigned int precision) { int result_size; const char* uri = map_uri(s_current_widget_name, name); if (s_layout_meta) { result_size = snprintf(s_buffer, sizeof(s_buffer), META_TEMPLATE_WITH_LAYOUT, "slider", minv, maxv, precision, s_layout_meta); } else { result_size = snprintf(s_buffer, sizeof(s_buffer), META_TEMPLATE_WITHOUT_LAYOUT, "slider", minv, maxv, precision); } if (result_size >= MAX_BUFFER_SIZE) { TWEAK_FATAL("Buffer to format meta string is too small"); } tweak_variant value = TWEAK_VARIANT_INIT_EMPTY; tweak_variant_create_double(&value, def); tweak_id id = tweak_app_server_add_item(s_context, uri, name, s_buffer, &value, NULL); if (id == TWEAK_INVALID_ID) { TWEAK_LOG_ERROR("Can't add control, duplicate name"); } } void tweak_add_spinbox(const char* name, double minv, double maxv, double def, unsigned int precision) { int result_size; const char* uri = map_uri(s_current_widget_name, name); if (s_layout_meta) { result_size = snprintf(s_buffer, sizeof(s_buffer), META_TEMPLATE_WITH_LAYOUT, "spinbox", minv, maxv, precision, s_layout_meta); } else { result_size = snprintf(s_buffer, sizeof(s_buffer), META_TEMPLATE_WITHOUT_LAYOUT, "spinbox", minv, maxv, precision); } if (result_size >= MAX_BUFFER_SIZE) { TWEAK_FATAL("Buffer to format meta string is too small"); } tweak_variant value = TWEAK_VARIANT_INIT_EMPTY; tweak_variant_create_double(&value, def); tweak_id id = tweak_app_server_add_item(s_context, uri, name, s_buffer, &value, NULL); if (id == TWEAK_INVALID_ID) { TWEAK_LOG_ERROR("Can't add control, duplicate name"); } } static const char* BOOL_META_TEMPLATE_WITH_LAYOUT = "{" "\"type\": \"bool\"," "\"control\": \"%s\"," "\"min\": false," "\"max\": true," "\"readonly\": false," "\"layout\": %s" "}"; static const char* BOOL_META_TEMPLATE_WITHOUT_LAYOUT = "{" "\"type\": \"bool\"," "\"control\": \"%s\"," "\"min\": false," "\"max\": true," "\"readonly\": false" "}"; void tweak_add_checkbox(const char* name, int def_val) { int result_size; const char* uri = map_uri(s_current_widget_name, name); if (s_layout_meta) { result_size = snprintf(s_buffer, sizeof(s_buffer), BOOL_META_TEMPLATE_WITH_LAYOUT, "checkbox", s_layout_meta); } else { result_size = snprintf(s_buffer, sizeof(s_buffer), BOOL_META_TEMPLATE_WITHOUT_LAYOUT, "checkbox"); } if (result_size >= MAX_BUFFER_SIZE) { TWEAK_FATAL("Buffer to format meta string is too small"); } tweak_variant value = TWEAK_VARIANT_INIT_EMPTY; tweak_variant_create_bool(&value, def_val != 0); tweak_id id = tweak_app_server_add_item(s_context, uri, name, s_buffer, &value, NULL); if (id == TWEAK_INVALID_ID) { TWEAK_LOG_ERROR("Can't add control, duplicate name"); } } void tweak_add_button(const char* name) { int result_size; const char* uri = map_uri(s_current_widget_name, name); if (s_layout_meta) { result_size = snprintf(s_buffer, sizeof(s_buffer), BOOL_META_TEMPLATE_WITH_LAYOUT, "button", s_layout_meta); } else { result_size = snprintf(s_buffer, sizeof(s_buffer), BOOL_META_TEMPLATE_WITHOUT_LAYOUT, "button"); } if (result_size >= MAX_BUFFER_SIZE) { TWEAK_FATAL("Buffer to format meta string is too small"); } tweak_variant value = TWEAK_VARIANT_INIT_EMPTY; tweak_variant_create_bool(&value, false); tweak_id id = tweak_app_server_add_item(s_context, uri, name, s_buffer, &value, NULL); if (id == TWEAK_INVALID_ID) { TWEAK_LOG_ERROR("Can't add control, duplicate name"); } } static const char* RADIO_BUTTON_META_TEMPLATE_WITH_LAYOUT = "{" "\"type\": \"enum\"," "\"control\": \"radio\"," "\"options\": [%s]," "\"readonly\": false," "\"layout\": %s" "}"; static const char* RADIO_BUTTON_META_TEMPLATE_WITHOUT_LAYOUT = "{" "\"type\": \"enum\"," "\"control\": \"radio\"," "\"options\": [%s]," "\"readonly\": false" "}"; void tweak_add_groupbox(const char* name, const char* options, unsigned int def) { assert(options != NULL && strlen(options) < MAX_OPTIONS_STRING_SIZE); const char* uri = map_uri(s_current_widget_name, name); char* token; char* options_dup = strdup(options); char* rest = options_dup; s_buffer[0] = '\0'; token = strtok_r(rest, ";", &rest); while (token) { strcat(s_buffer, "\""); strcat(s_buffer, token); strcat(s_buffer, "\""); token = strtok_r(rest, ";", &rest); if (token) { strcat(s_buffer, ","); } } free(options_dup); char* options_json = strdup(s_buffer); int result_size; if (s_layout_meta) { result_size = snprintf(s_buffer, sizeof(s_buffer), RADIO_BUTTON_META_TEMPLATE_WITH_LAYOUT, options_json, s_layout_meta); } else { result_size = snprintf(s_buffer, sizeof(s_buffer), RADIO_BUTTON_META_TEMPLATE_WITHOUT_LAYOUT, options_json); } if (result_size >= MAX_BUFFER_SIZE) { TWEAK_FATAL("Buffer to format meta string is too small"); } free(options_json); tweak_variant value = TWEAK_VARIANT_INIT_EMPTY; tweak_variant_create_uint32(&value, def); tweak_id id = tweak_app_server_add_item(s_context, uri, name, s_buffer, &value, NULL); if (id == TWEAK_INVALID_ID) { TWEAK_LOG_ERROR("Can't add control, duplicate name"); } } void tweak_add_widget(const char* name) { char* old_widget_name = s_current_widget_name; s_current_widget_name = strdup(name); if (!s_current_widget_name) { TWEAK_FATAL("strdup() returned NULL"); } free(old_widget_name); } double tweak_get(const char* name, double defval) { const char* uri = get_uri(name); tweak_id id = tweak_app_find_id(s_context, uri); if (id == TWEAK_INVALID_ID) { TWEAK_LOG_ERROR("No tweak with name: %s", name); return defval; } tweak_variant variant_value = TWEAK_VARIANT_INIT_EMPTY; double result = defval; tweak_app_error_code error_code = tweak_app_item_clone_current_value((tweak_app_context)s_context, id, &variant_value); if (error_code == TWEAK_APP_SUCCESS) { switch (variant_value.type) { case TWEAK_VARIANT_TYPE_BOOL: result = variant_value.value.b; break; case TWEAK_VARIANT_TYPE_SINT8: result = variant_value.value.sint8; break; case TWEAK_VARIANT_TYPE_SINT16: result = variant_value.value.sint16; break; case TWEAK_VARIANT_TYPE_SINT32: result = variant_value.value.sint32; break; case TWEAK_VARIANT_TYPE_SINT64: result = variant_value.value.sint64; break; case TWEAK_VARIANT_TYPE_UINT8: result = variant_value.value.uint8; break; case TWEAK_VARIANT_TYPE_UINT16: result = variant_value.value.uint16; break; case TWEAK_VARIANT_TYPE_UINT32: result = variant_value.value.uint32; break; case TWEAK_VARIANT_TYPE_UINT64: result = variant_value.value.uint64; break; case TWEAK_VARIANT_TYPE_FLOAT: result = variant_value.value.fp32; break; case TWEAK_VARIANT_TYPE_DOUBLE: result = variant_value.value.fp64; break; default: break; } } else { TWEAK_LOG_ERROR("tweak_app_item_clone_current_value returned 0x%x", result); return defval; } return result; } void tweak_set(const char* name, double val) { const char* uri = get_uri(name); tweak_id id = tweak_app_find_id(s_context, uri); if (id == TWEAK_INVALID_ID) { TWEAK_LOG_ERROR("No tweak with name: %s", name); return; } tweak_variant_type type = tweak_app_item_get_type(s_context, id); if (type != TWEAK_VARIANT_TYPE_NULL) { tweak_variant value = TWEAK_VARIANT_INIT_EMPTY; switch (type) { case TWEAK_VARIANT_TYPE_BOOL: tweak_variant_create_bool(&value, val != 0); break; case TWEAK_VARIANT_TYPE_SINT8: tweak_variant_create_sint8(&value, (int8_t) val); break; case TWEAK_VARIANT_TYPE_SINT16: tweak_variant_create_sint16(&value, (int16_t) val); break; case TWEAK_VARIANT_TYPE_SINT32: tweak_variant_create_sint32(&value, (int32_t) val); break; case TWEAK_VARIANT_TYPE_SINT64: tweak_variant_create_sint64(&value, (int64_t) val); break; case TWEAK_VARIANT_TYPE_UINT8: tweak_variant_create_uint8(&value, (uint8_t) val); break; case TWEAK_VARIANT_TYPE_UINT16: tweak_variant_create_uint16(&value, (uint16_t) val); break; case TWEAK_VARIANT_TYPE_UINT32: tweak_variant_create_uint32(&value, (uint32_t) val); break; case TWEAK_VARIANT_TYPE_UINT64: tweak_variant_create_uint64(&value, (uint64_t) val); break; case TWEAK_VARIANT_TYPE_FLOAT: tweak_variant_create_float(&value, (float) val); break; case TWEAK_VARIANT_TYPE_DOUBLE: tweak_variant_create_double(&value, val); break; default: TWEAK_LOG_ERROR("Unsupported tweak type 0x%x", type); break; } tweak_app_error_code result = tweak_app_item_replace_current_value(s_context, id, &value); if (result != TWEAK_APP_SUCCESS) { TWEAK_LOG_ERROR("tweak_app_item_replace_current_value returned 0x%x", result); } } else { TWEAK_LOG_ERROR("Item %s has null type", name); } } double tweak_get_string(const char* name, double defval) { (void) name; (void) defval; TWEAK_LOG_WARN("tweak_get_string not implemented"); return 0; } uint64_t tweak_fopen(const char* name, const char* mode) { (void) name; (void) mode; TWEAK_LOG_WARN("tweak_get_string not implemented"); return 0; } uint64_t tweak_fclose(uint64_t fd) { (void) fd; TWEAK_LOG_WARN("tweak_fclose not implemented"); return 0; } uint64_t tweak_ftell(uint64_t fd) { (void) fd; TWEAK_LOG_WARN("tweak_ftell not implemented"); return 0; } uint64_t tweak_fseek(uint64_t fd, int32_t offset, int32_t where){ (void) fd; (void) offset; (void) where; TWEAK_LOG_WARN("tweak_fseek not implemented"); return 0; } uint64_t tweak_fwrite(uint64_t fd, uint32_t sz, void* p_data) { (void) fd; (void) sz; (void) p_data; TWEAK_LOG_WARN("tweak_fwrite not implemented"); return 0; } uint64_t tweak_fread(uint64_t fd, uint32_t sz, void* p_data) { (void) fd; (void) sz; (void) p_data; TWEAK_LOG_WARN("tweak_fread not implemented"); return 0; } uint64_t tweak_config_fopen(const char* name, const char* mode) { (void) name; (void) mode; TWEAK_LOG_WARN("tweak_config_fopen not implemented"); return 0; } uint64_t tweak_config_fclose(uint64_t fd) { (void) fd; TWEAK_LOG_WARN("tweak_config_fclose not implemented"); return 0; } uint64_t tweak_config_add(uint32_t sz, void* p_data) { (void) sz; (void) p_data; TWEAK_LOG_WARN("tweak_config_add not implemented"); return 0; } void tweak_get_file_path(char* dst, const char* mask, uint32_t read) { (void) dst; (void) mask; (void) read; TWEAK_LOG_WARN("tweak_get_file_path not implemented"); } uint32_t tweak_json_config_read(void* p_data, uint32_t max_sz, int cfg_enum, const char* cfg_name_ver, const char* path) { (void) p_data; (void) max_sz; (void) cfg_enum; (void) cfg_name_ver; (void) path; TWEAK_LOG_WARN("tweak_json_config_read not implemented"); return 0; } uint32_t tweak_json_config_write(void* p_data, uint32_t max_sz, int cfg_enum, const char* cfg_name_ver, const char* path) { (void) p_data; (void) max_sz; (void) cfg_enum; (void) cfg_name_ver; (void) path; TWEAK_LOG_WARN("tweak_json_config_write not implemented"); return 0; }
1.085938
1
NotificationHelper/NotificationHelper/NSObject+NotificationHelper.h
ruixiaoguo/NotificationHelper
1
7997027
// // NSObject+NotificationHelper.h // NotificationHelper // // Created by 0o on 2017/12/14. // Copyright © 2017年 Benight. All rights reserved. // #import <Foundation/Foundation.h> @interface NSObject (NotificationHelper) /** 发通知 */ - (void)postNotificationName:(nonnull NSString *)aName object:(nullable id)anObject userInfo:(nullable NSDictionary *)aUserInfo; /** 注册通知 */ - (nullable id <NSObject>)addObserverForName:(nonnull NSString *)name block:(nullable void (^)( NSNotification * _Nullable note))block; @end
0.71875
1
Chimera/3rd_Party/GSL_MSVC/eigen/testgen2.c
zzpwahaha/Chimera-Control-Trim
1
7997035
/* * testgen.c * <NAME> * * Compile: gcc -g -O2 -Wall -o testgen testgen.c -lm -lgsl -llapack -lf77blas -lcblas -latlas -lg2c * * Usage: testgen [options] * * -i : incremental matrices * -z : compute Schur vectors and test them * -n size : size of matrices * -l lower-bound : lower bound for matrix elements * -u upper-bound : upper bound for matrix elements * -c num : number of matrices to solve */ #include <stdio.h> #include <stdlib.h> #include <getopt.h> #include <math.h> #include <gsl/gsl_math.h> #include <gsl/gsl_eigen.h> #include <gsl/gsl_linalg.h> #include <gsl/gsl_rng.h> #include <gsl/gsl_randist.h> #include <gsl/gsl_ieee_utils.h> #include <gsl/gsl_complex.h> #include <gsl/gsl_complex_math.h> #include <gsl/gsl_blas.h> #include <gsl/gsl_sort.h> #include <gsl/gsl_sort_vector.h> typedef struct { gsl_eigen_gen_workspace *gen_p; gsl_matrix *A; gsl_matrix *B; gsl_vector_complex *alpha; gsl_vector *beta; gsl_vector_complex *evals; gsl_matrix *Q; gsl_matrix *Z; int compute_schur; size_t n_evals; } gen_workspace; gen_workspace *gen_alloc(size_t n, int compute_schur); void gen_free(gen_workspace *w); int gen_proc(gen_workspace *w); typedef struct { gsl_matrix *A; gsl_matrix *B; gsl_matrix *Q; gsl_matrix *Z; int N; char jobvsl; char jobvsr; char sort; int selctg; int lda; int ldb; int sdim; double *alphar; double *alphai; gsl_vector *beta; int ldvsr; int lwork; int info; double *work; gsl_vector_complex *evals; gsl_vector_complex *alpha; size_t n_evals; } lapack_workspace; lapack_workspace *lapack_alloc(const size_t n); void lapack_free(lapack_workspace *w); int lapack_proc(lapack_workspace *w); void dgges_(char *jobvsl, char *jobvsr, char *sort, int *selctg, int *n, double *a, int *lda, double *b, int *ldb, int *sdim, double *alphar, double *alphai, double *beta, double *vsl, int *ldvsl, double *vsr, int *ldvsr, double *work, int *lwork, int *bwork, int *info); /* * Global variables */ unsigned long count = 0; /* * Prototypes */ void make_random_matrix(gsl_matrix *m, gsl_rng *r, int lower, int upper); void make_random_integer_matrix(gsl_matrix *m, gsl_rng *r, int lower, int upper); void make_start_matrix(gsl_matrix *m, int lower); int inc_matrix (gsl_matrix *m, int lower, int upper); void output_matrix(gsl_matrix *m); void print_matrix(gsl_matrix *m, const char *str); int test_evals(gsl_vector_complex *obs, gsl_vector_complex *expected, gsl_matrix *A, gsl_matrix *B, const char *obsname, const char *expname); int test_alpha(gsl_vector_complex *obs, gsl_vector_complex *expected, gsl_matrix *A, gsl_matrix *B, const char *obsname, const char *expname); int test_beta(gsl_vector *obs, gsl_vector *expected, gsl_matrix *A, gsl_matrix *B, const char *obsname, const char *expname); void test_schur(gsl_matrix *A, gsl_matrix *S, gsl_matrix *Q, gsl_matrix *Z); void print_vector(gsl_vector_complex *eval, const char *str); int cmp(double a, double b); int compare(const void *a, const void *b); void sort_complex_vector(gsl_vector_complex *v); gen_workspace * gen_alloc(size_t n, int compute_schur) { gen_workspace *w; w = (gen_workspace *) calloc(1, sizeof(gen_workspace)); w->gen_p = gsl_eigen_gen_alloc(n); w->A = gsl_matrix_alloc(n, n); w->B = gsl_matrix_alloc(n, n); w->alpha = gsl_vector_complex_alloc(n); w->beta = gsl_vector_alloc(n); w->evals = gsl_vector_complex_alloc(n); w->compute_schur = compute_schur; if (compute_schur) { w->Q = gsl_matrix_alloc(n, n); w->Z = gsl_matrix_alloc(n, n); gsl_eigen_gen_params(1, 1, 0, w->gen_p); } return (w); } /* gen_alloc() */ void gen_free(gen_workspace *w) { if (w->gen_p) gsl_eigen_gen_free(w->gen_p); if (w->A) gsl_matrix_free(w->A); if (w->B) gsl_matrix_free(w->B); if (w->alpha) gsl_vector_complex_free(w->alpha); if (w->beta) gsl_vector_free(w->beta); if (w->evals) gsl_vector_complex_free(w->evals); if (w->Q) gsl_matrix_free(w->Q); if (w->Z) gsl_matrix_free(w->Z); free(w); } int gen_proc(gen_workspace *w) { int s; s = gsl_eigen_gen_QZ(w->A, w->B, w->alpha, w->beta, w->Q, w->Z, w->gen_p); w->n_evals = w->gen_p->n_evals; return s; } /* gen_proc() */ lapack_workspace * lapack_alloc(const size_t n) { lapack_workspace *w; double work[1]; w = (lapack_workspace *) calloc(1, sizeof(lapack_workspace)); w->A = gsl_matrix_alloc(n, n); w->B = gsl_matrix_alloc(n, n); w->Q = gsl_matrix_alloc(n, n); w->Z = gsl_matrix_alloc(n, n); w->alphar = malloc(n * sizeof(double)); w->alphai = malloc(n * sizeof(double)); w->beta = gsl_vector_alloc(n); w->alpha = gsl_vector_complex_alloc(n); w->evals = gsl_vector_complex_alloc(n); w->N = (int) n; w->n_evals = 0; w->jobvsl = 'N'; w->jobvsr = 'N'; w->sort = 'N'; w->info = 0; w->lwork = -1; dgges_(&w->jobvsl, &w->jobvsr, &w->sort, (int *) 0, &w->N, w->A->data, (int *) &w->A->tda, w->B->data, (int *) &w->B->tda, &w->sdim, w->alphar, w->alphai, w->beta->data, w->Q->data, (int *) &w->Q->tda, w->Z->data, (int *) &w->Z->tda, work, &w->lwork, (int *) 0, &w->info); w->lwork = (int) work[0]; w->work = malloc(w->lwork * sizeof(double)); return (w); } /* lapack_alloc() */ void lapack_free(lapack_workspace *w) { if (w->A) gsl_matrix_free(w->A); if (w->B) gsl_matrix_free(w->B); if (w->Q) gsl_matrix_free(w->Q); if (w->Z) gsl_matrix_free(w->Z); if (w->work) free(w->work); if (w->alphar) free(w->alphar); if (w->alphai) free(w->alphai); if (w->beta) gsl_vector_free(w->beta); if (w->alpha) gsl_vector_complex_free(w->alpha); if (w->evals) gsl_vector_complex_free(w->evals); free(w); } /* lapack_free() */ int lapack_proc(lapack_workspace *w) { dgges_(&w->jobvsl, &w->jobvsr, &w->sort, (int *) 0, &w->N, w->A->data, (int *) &w->A->tda, w->B->data, (int *) &w->B->tda, &w->sdim, w->alphar, w->alphai, w->beta->data, w->Q->data, (int *) &w->Q->tda, w->Z->data, (int *) &w->Z->tda, w->work, &w->lwork, (int *) 0, &w->info); return (w->info); } /* lapack_proc() */ /********************************************** * General routines **********************************************/ void make_random_matrix(gsl_matrix *m, gsl_rng *r, int lower, int upper) { size_t i, j; size_t N = m->size1; for (i = 0; i < N; ++i) { for (j = 0; j < N; ++j) { gsl_matrix_set(m, i, j, gsl_rng_uniform(r) * (upper - lower) + lower); } } } /* make_random_matrix() */ void make_random_integer_matrix(gsl_matrix *m, gsl_rng *r, int lower, int upper) { size_t i, j; size_t N = m->size1; for (i = 0; i < N; ++i) { for (j = 0; j < N; ++j) { double a = gsl_rng_uniform(r) * (upper - lower) + lower; gsl_matrix_set(m, i, j, floor(a)); } } } /* make_random_integer_matrix() */ void make_start_matrix(gsl_matrix *m, int lower) { size_t i, j; size_t N = m->size1; for (i = 0; i < N; ++i) for (j = 0; j < N; ++j) gsl_matrix_set(m, i, j, (double)lower); } /* make_start_matrix() */ int inc_matrix (gsl_matrix *m, int lower, int upper) { size_t i = 0; size_t N = m->size1 * m->size2; int carry = 1; for (i = 0; carry > 0 && i < N; i++) { double v = m->data[i] + carry; carry = (v > upper) ? 1 : 0; m->data[i] = (v > upper) ? lower : v; } return carry; } /* inc_matrix() */ void output_matrix(gsl_matrix *m) { size_t i, j; size_t N = m->size1; size_t M = m->size2; for (i = 0; i < N; ++i) { for (j = 0; j < M; ++j) { printf("%10.18e%s", /*printf("%10.18e%s",*/ gsl_matrix_get(m, i, j), (j < M - 1) ? "," : ";\n"); } } } void print_matrix(gsl_matrix *m, const char *str) { size_t i, j; size_t N = m->size1; size_t M = m->size2; gsl_matrix_view v; size_t rows, cols; size_t r, c; char buf[100]; /*print_octave(m, str); return;*/ /*rows = GSL_MIN(15, N);*/ rows = N; cols = GSL_MIN(15, N); /*cols = N;*/ for (i = 0; i < N; i += rows) { for (j = 0; j < M; j += cols) { r = GSL_MIN(rows, N - i); c = GSL_MIN(cols, N - j); v = gsl_matrix_submatrix(m, i, j, r, c); sprintf(buf, "%s(%u:%u,%u:%u)", str, i + 1, i + r, j + 1, j + c); printf("%s = [\n", buf); output_matrix(&v.matrix); printf("]\n"); } } } /* print_matrix() */ int test_evals(gsl_vector_complex *obs, gsl_vector_complex *expected, gsl_matrix *A, gsl_matrix *B, const char *obsname, const char *expname) { size_t N = expected->size; size_t i, k; double max, max_abserr, max_relerr; max = 0.0; max_abserr = 0.0; max_relerr = 0.0; k = 0; for (i = 0; i < N; ++i) { gsl_complex z = gsl_vector_complex_get(expected, i); max = GSL_MAX_DBL(max, gsl_complex_abs(z)); } for (i = 0; i < N; ++i) { gsl_complex z_obs = gsl_vector_complex_get(obs, i); gsl_complex z_exp = gsl_vector_complex_get(expected, i); double x_obs = GSL_REAL(z_obs); double y_obs = GSL_IMAG(z_obs); double x_exp = GSL_REAL(z_exp); double y_exp = GSL_IMAG(z_exp); double abserr_x = fabs(x_obs - x_exp); double abserr_y = fabs(y_obs - y_exp); double noise = max * GSL_DBL_EPSILON * N * N; max_abserr = GSL_MAX_DBL(max_abserr, abserr_x + abserr_y); if (abserr_x < noise && abserr_y < noise) continue; if (abserr_x > 1.0e-6 || abserr_y > 1.0e-6) ++k; } if (k) { printf("==== CASE %lu ===========================\n\n", count); print_matrix(A, "A"); print_matrix(B, "B"); printf("=== eval - %s ===\n", expname); print_vector(expected, expname); printf("=== eval - %s ===\n", obsname); print_vector(obs, obsname); printf("max abserr = %g max relerr = %g\n", max_abserr, max_relerr); printf("=========================================\n\n"); } return k; } /* test_evals() */ int test_alpha(gsl_vector_complex *obs, gsl_vector_complex *expected, gsl_matrix *A, gsl_matrix *B, const char *obsname, const char *expname) { size_t N = expected->size; size_t i, k; double max, max_abserr, max_relerr; max = 0.0; max_abserr = 0.0; max_relerr = 0.0; k = 0; for (i = 0; i < N; ++i) { gsl_complex z = gsl_vector_complex_get(expected, i); max = GSL_MAX_DBL(max, gsl_complex_abs(z)); } for (i = 0; i < N; ++i) { gsl_complex z_obs = gsl_vector_complex_get(obs, i); gsl_complex z_exp = gsl_vector_complex_get(expected, i); double x_obs = GSL_REAL(z_obs); double y_obs = fabs(GSL_IMAG(z_obs)); double x_exp = GSL_REAL(z_exp); double y_exp = fabs(GSL_IMAG(z_exp)); double abserr_x = fabs(x_obs - x_exp); double abserr_y = fabs(y_obs - y_exp); double noise = max * GSL_DBL_EPSILON * N * N; max_abserr = GSL_MAX_DBL(max_abserr, abserr_x + abserr_y); if (abserr_x < noise && abserr_y < noise) continue; if (abserr_x > 1.0e-6 || abserr_y > 1.0e-6) ++k; } if (k) { printf("==== CASE %lu ===========================\n\n", count); print_matrix(A, "A"); print_matrix(B, "B"); printf("=== alpha - %s ===\n", expname); print_vector(expected, expname); printf("=== alpha - %s ===\n", obsname); print_vector(obs, obsname); printf("max abserr = %g max relerr = %g\n", max_abserr, max_relerr); printf("=========================================\n\n"); } return k; } /* test_alpha() */ int test_beta(gsl_vector *obs, gsl_vector *expected, gsl_matrix *A, gsl_matrix *B, const char *obsname, const char *expname) { size_t N = expected->size; size_t i, k; double max, max_abserr, max_relerr; max = 0.0; max_abserr = 0.0; max_relerr = 0.0; k = 0; for (i = 0; i < N; ++i) { double z = gsl_vector_get(expected, i); max = GSL_MAX_DBL(max, fabs(z)); } for (i = 0; i < N; ++i) { double v_obs = gsl_vector_get(obs, i); double v_exp = gsl_vector_get(expected, i); double abserr = fabs(v_obs - v_exp); double noise = max * GSL_DBL_EPSILON * N * N; max_abserr = GSL_MAX_DBL(max_abserr, abserr); if (abserr < noise) continue; if (abserr > 1.0e-6) ++k; } if (k) { printf("==== CASE %lu ===========================\n\n", count); print_matrix(A, "A"); print_matrix(B, "B"); printf("=== beta - %s ===\n", expname); printf("%s = [\n", expname); gsl_vector_fprintf(stdout, expected, "%.12e"); printf("]\n"); printf("=== beta - %s ===\n", obsname); printf("%s = [\n", obsname); gsl_vector_fprintf(stdout, obs, "%.12e"); printf("]\n"); printf("max abserr = %g max relerr = %g\n", max_abserr, max_relerr); printf("=========================================\n\n"); } return k; } /* test_beta() */ /* test if A = Q S Z^t */ void test_schur(gsl_matrix *A, gsl_matrix *S, gsl_matrix *Q, gsl_matrix *Z) { const size_t N = A->size1; gsl_matrix *T1, *T2; size_t i, j, k; double lhs, rhs; double abserr; T1 = gsl_matrix_alloc(N, N); T2 = gsl_matrix_alloc(N, N); /* compute T1 = S Z^t */ gsl_blas_dgemm(CblasNoTrans, CblasTrans, 1.0, S, Z, 0.0, T1); /* compute T2 = Q T1 = Q S Z^t */ gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, 1.0, Q, T1, 0.0, T2); k = 0; for (i = 0; i < N; ++i) { for (j = 0; j < N; ++j) { lhs = gsl_matrix_get(A, i, j); rhs = gsl_matrix_get(T2, i, j); abserr = fabs(lhs - rhs); if (abserr > 1.0e-6) ++k; } } if (k) { printf("==== CASE %lu ===========================\n\n", count); print_matrix(A, "A"); printf("=== Schur Form matrix ===\n"); print_matrix(S, "S"); printf("=== Left Schur matrix ===\n"); print_matrix(Q, "Q"); printf("=== Right Schur matrix ===\n"); print_matrix(Z, "Z"); printf("=== Q S Z^t ===\n"); print_matrix(T1, "Q S Z^t"); printf("=== A - Q S Z^t ===\n"); gsl_matrix_sub(T2, A); print_matrix(T1, "A - Q S Z^t"); printf("=========================================\n\n"); } gsl_matrix_free(T1); gsl_matrix_free(T2); } /* test_schur() */ void print_vector(gsl_vector_complex *eval, const char *str) { size_t N = eval->size; size_t i; gsl_complex z; printf("%s = [\n", str); for (i = 0; i < N; ++i) { z = gsl_vector_complex_get(eval, i); printf("%.18e %.18e;\n", GSL_REAL(z), GSL_IMAG(z)); } printf("]\n"); } /* print_vector() */ int cmp(double a, double b) { return ((a > b) ? 1 : ((a < b) ? -1 : 0)); } /* cmp() */ int compare(const void *a, const void *b) { const double *x = a; const double *y = b; int r1 = cmp(y[0], x[0]); int r2 = cmp(y[1], x[1]); if (!gsl_finite(x[0])) return 1; if (!gsl_finite(y[0])) return -1; if (fabs(x[0] - y[0]) < 1.0e-8) { /* real parts are very close to each other */ return r2; } else { return r1 ? r1 : r2; } } /* compare() */ void sort_complex_vector(gsl_vector_complex *v) { qsort(v->data, v->size, 2 * sizeof(double), &compare); } /* sort_complex_vector() */ int main(int argc, char *argv[]) { gen_workspace *gen_workspace_p; lapack_workspace *lapack_workspace_p; size_t N; int c; int lower; int upper; int incremental; size_t nmat; gsl_matrix *A, *B; gsl_rng *r; int s; int compute_schur; size_t i; gsl_ieee_env_setup(); gsl_rng_env_setup(); N = 30; lower = -10; upper = 10; incremental = 0; nmat = 0; compute_schur = 0; while ((c = getopt(argc, argv, "ic:n:l:u:z")) != (-1)) { switch (c) { case 'i': incremental = 1; break; case 'n': N = strtol(optarg, NULL, 0); break; case 'l': lower = strtol(optarg, NULL, 0); break; case 'u': upper = strtol(optarg, NULL, 0); break; case 'c': nmat = strtoul(optarg, NULL, 0); break; case 'z': compute_schur = 1; break; case '?': default: printf("usage: %s [-i] [-z] [-n size] [-l lower-bound] [-u upper-bound] [-c num]\n", argv[0]); exit(1); break; } /* switch (c) */ } A = gsl_matrix_alloc(N, N); B = gsl_matrix_alloc(N, N); gen_workspace_p = gen_alloc(N, compute_schur); lapack_workspace_p = lapack_alloc(N); r = gsl_rng_alloc(gsl_rng_default); if (incremental) { make_start_matrix(A, lower); /* we need B to be non-singular */ make_random_integer_matrix(B, r, lower, upper); } fprintf(stderr, "testing N = %d", N); if (incremental) fprintf(stderr, " incrementally"); else fprintf(stderr, " randomly"); fprintf(stderr, " on element range [%d, %d]", lower, upper); if (compute_schur) fprintf(stderr, ", with Schur vectors"); fprintf(stderr, "\n"); while (1) { if (nmat && (count >= nmat)) break; ++count; if (!incremental) { make_random_matrix(A, r, lower, upper); make_random_matrix(B, r, lower, upper); } else { s = inc_matrix(A, lower, upper); if (s) break; /* all done */ make_random_integer_matrix(B, r, lower, upper); } /*if (count != 89120) continue;*/ /* make copies of matrices */ gsl_matrix_memcpy(gen_workspace_p->A, A); gsl_matrix_memcpy(gen_workspace_p->B, B); gsl_matrix_transpose_memcpy(lapack_workspace_p->A, A); gsl_matrix_transpose_memcpy(lapack_workspace_p->B, B); /* compute eigenvalues with LAPACK */ s = lapack_proc(lapack_workspace_p); if (s != GSL_SUCCESS) { printf("LAPACK failed, case %lu\n", count); exit(1); } #if 0 print_matrix(A, "A"); print_matrix(B, "B"); gsl_matrix_transpose(lapack_workspace_p->A); gsl_matrix_transpose(lapack_workspace_p->B); print_matrix(lapack_workspace_p->A, "S_lapack"); print_matrix(lapack_workspace_p->B, "T_lapack"); #endif /* compute eigenvalues with GSL */ s = gen_proc(gen_workspace_p); if (s != GSL_SUCCESS) { printf("=========== CASE %lu ============\n", count); printf("Failed to converge: found %u eigenvalues\n", gen_workspace_p->n_evals); print_matrix(A, "A"); print_matrix(B, "B"); print_matrix(gen_workspace_p->A, "Af"); print_matrix(gen_workspace_p->B, "Bf"); print_matrix(lapack_workspace_p->A, "Ae"); print_matrix(lapack_workspace_p->B, "Be"); exit(1); } #if 0 print_matrix(gen_workspace_p->A, "S_gsl"); print_matrix(gen_workspace_p->B, "T_gsl"); #endif /* compute alpha / beta vectors */ for (i = 0; i < N; ++i) { double beta; gsl_complex alpha, z; beta = gsl_vector_get(gen_workspace_p->beta, i); if (beta == 0.0) GSL_SET_COMPLEX(&z, GSL_POSINF, GSL_POSINF); else { alpha = gsl_vector_complex_get(gen_workspace_p->alpha, i); z = gsl_complex_div_real(alpha, beta); } gsl_vector_complex_set(gen_workspace_p->evals, i, z); beta = gsl_vector_get(lapack_workspace_p->beta, i); GSL_SET_COMPLEX(&alpha, lapack_workspace_p->alphar[i], lapack_workspace_p->alphai[i]); if (beta == 0.0) GSL_SET_COMPLEX(&z, GSL_POSINF, GSL_POSINF); else z = gsl_complex_div_real(alpha, beta); gsl_vector_complex_set(lapack_workspace_p->evals, i, z); gsl_vector_complex_set(lapack_workspace_p->alpha, i, alpha); } #if 0 gsl_sort_vector(gen_workspace_p->beta); gsl_sort_vector(lapack_workspace_p->beta); sort_complex_vector(gen_workspace_p->alpha); sort_complex_vector(lapack_workspace_p->alpha); s = test_alpha(gen_workspace_p->alpha, lapack_workspace_p->alpha, A, B, "gen", "lapack"); s = test_beta(gen_workspace_p->beta, lapack_workspace_p->beta, A, B, "gen", "lapack"); #endif #if 1 sort_complex_vector(gen_workspace_p->evals); sort_complex_vector(lapack_workspace_p->evals); s = test_evals(gen_workspace_p->evals, lapack_workspace_p->evals, A, B, "gen", "lapack"); #endif if (compute_schur) { test_schur(A, gen_workspace_p->A, gen_workspace_p->Q, gen_workspace_p->Z); test_schur(B, gen_workspace_p->B, gen_workspace_p->Q, gen_workspace_p->Z); } } gsl_matrix_free(A); gsl_matrix_free(B); gen_free(gen_workspace_p); lapack_free(lapack_workspace_p); if (r) gsl_rng_free(r); return 0; } /* main() */
1.789063
2
libs/qmlglsink/gst-plugins-good/gst/matroska/lzo.c
ant-nihil/routen-qgroundcontrol
6
7997043
/* * LZO 1x decompression * Copyright (c) 2006 <NAME> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <gst/gst.h> #include <stdlib.h> #include <string.h> #include "lzo.h" /*! define if we may write up to 12 bytes beyond the output buffer */ /* #define OUTBUF_PADDED 1 */ /*! define if we may read up to 8 bytes beyond the input buffer */ /* #define INBUF_PADDED 1 */ typedef struct LZOContext { const guint8 *in, *in_end; guint8 *out_start, *out, *out_end; int error; } LZOContext; /* * \brief read one byte from input buffer, avoiding overrun * \return byte read */ static inline int get_byte (LZOContext * c) { if (c->in < c->in_end) return *c->in++; c->error |= LZO_INPUT_DEPLETED; return 1; } #ifdef INBUF_PADDED #define GETB(c) (*(c).in++) #else #define GETB(c) get_byte(&(c)) #endif /* * \brief decode a length value in the coding used by lzo * \param x previous byte value * \param mask bits used from x * \return decoded length value */ static inline int get_len (LZOContext * c, int x, int mask) { int cnt = x & mask; if (!cnt) { while (!(x = get_byte (c))) cnt += 255; cnt += mask + x; } return cnt; } /*#define UNALIGNED_LOADSTORE */ #define BUILTIN_MEMCPY #ifdef UNALIGNED_LOADSTORE #define COPY2(d, s) *(guint16 *)(d) = *(guint16 *)(s); #define COPY4(d, s) *(guint32 *)(d) = *(guint32 *)(s); #elif defined(BUILTIN_MEMCPY) #define COPY2(d, s) memcpy(d, s, 2); #define COPY4(d, s) memcpy(d, s, 4); #else #define COPY2(d, s) (d)[0] = (s)[0]; (d)[1] = (s)[1]; #define COPY4(d, s) (d)[0] = (s)[0]; (d)[1] = (s)[1]; (d)[2] = (s)[2]; (d)[3] = (s)[3]; #endif /* * \brief copy bytes from input to output buffer with checking * \param cnt number of bytes to copy, must be >= 0 */ static inline void copy (LZOContext * c, int cnt) { register const guint8 *src = c->in; register guint8 *dst = c->out; if (cnt > c->in_end - src) { cnt = MAX (c->in_end - src, 0); c->error |= LZO_INPUT_DEPLETED; } if (cnt > c->out_end - dst) { cnt = MAX (c->out_end - dst, 0); c->error |= LZO_OUTPUT_FULL; } #if defined(INBUF_PADDED) && defined(OUTBUF_PADDED) COPY4 (dst, src); src += 4; dst += 4; cnt -= 4; if (cnt > 0) #endif memcpy (dst, src, cnt); c->in = src + cnt; c->out = dst + cnt; } /* * \brief copy previously decoded bytes to current position * \param back how many bytes back we start * \param cnt number of bytes to copy, must be >= 0 * * cnt > back is valid, this will copy the bytes we just copied, * thus creating a repeating pattern with a period length of back. */ static inline void copy_backptr (LZOContext * c, int back, int cnt) { register const guint8 *src = &c->out[-back]; register guint8 *dst = c->out; if (src < c->out_start || src > dst) { c->error |= LZO_INVALID_BACKPTR; return; } if (cnt > c->out_end - dst) { cnt = MAX (c->out_end - dst, 0); c->error |= LZO_OUTPUT_FULL; } if (back == 1) { memset (dst, *src, cnt); dst += cnt; } else { #ifdef OUTBUF_PADDED COPY2 (dst, src); COPY2 (dst + 2, src + 2); src += 4; dst += 4; cnt -= 4; if (cnt > 0) { COPY2 (dst, src); COPY2 (dst + 2, src + 2); COPY2 (dst + 4, src + 4); COPY2 (dst + 6, src + 6); src += 8; dst += 8; cnt -= 8; } #endif if (cnt > 0) { int blocklen = back; while (cnt > blocklen) { memcpy (dst, src, blocklen); dst += blocklen; cnt -= blocklen; blocklen <<= 1; } memcpy (dst, src, cnt); } dst += cnt; } c->out = dst; } /* * \brief decode LZO 1x compressed data * \param out output buffer * \param outlen size of output buffer, number of bytes left are returned here * \param in input buffer * \param inlen size of input buffer, number of bytes left are returned here * \return 0 on success, otherwise error flags, see lzo.h * * make sure all buffers are appropriately padded, in must provide * LZO_INPUT_PADDING, out must provide LZO_OUTPUT_PADDING additional bytes */ int lzo1x_decode (void *out, int *outlen, const void *in, int *inlen) { int state = 0; int x; LZOContext c; c.in = in; c.in_end = (const guint8 *) in + *inlen; c.out = c.out_start = out; c.out_end = (guint8 *) out + *outlen; c.error = 0; x = GETB (c); if (x > 17) { copy (&c, x - 17); x = GETB (c); if (x < 16) c.error |= LZO_ERROR; } if (c.in > c.in_end) c.error |= LZO_INPUT_DEPLETED; while (!c.error) { int cnt, back; if (x > 15) { if (x > 63) { cnt = (x >> 5) - 1; back = (GETB (c) << 3) + ((x >> 2) & 7) + 1; } else if (x > 31) { cnt = get_len (&c, x, 31); x = GETB (c); back = (GETB (c) << 6) + (x >> 2) + 1; } else { cnt = get_len (&c, x, 7); back = (1 << 14) + ((x & 8) << 11); x = GETB (c); back += (GETB (c) << 6) + (x >> 2); if (back == (1 << 14)) { if (cnt != 1) c.error |= LZO_ERROR; break; } } } else if (!state) { cnt = get_len (&c, x, 15); copy (&c, cnt + 3); x = GETB (c); if (x > 15) continue; cnt = 1; back = (1 << 11) + (GETB (c) << 2) + (x >> 2) + 1; } else { cnt = 0; back = (GETB (c) << 2) + (x >> 2) + 1; } copy_backptr (&c, back, cnt + 2); state = cnt = x & 3; copy (&c, cnt); x = GETB (c); } *inlen = c.in_end - c.in; if (c.in > c.in_end) *inlen = 0; *outlen = c.out_end - c.out; return c.error; } #ifdef TEST #include <stdio.h> #include <lzo/lzo1x.h> #include "log.h" #define MAXSZ (10*1024*1024) int main (int argc, char *argv[]) { FILE *in = fopen (argv[1], "rb"); guint8 *orig = av_malloc (MAXSZ + 16); guint8 *comp = av_malloc (2 * MAXSZ + 16); guint8 *decomp = av_malloc (MAXSZ + 16); gsize s = fread (orig, 1, MAXSZ, in); lzo_uint clen = 0; long tmp[LZO1X_MEM_COMPRESS]; int inlen, outlen; int i; av_log_level = AV_LOG_DEBUG; lzo1x_999_compress (orig, s, comp, &clen, tmp); for (i = 0; i < 300; i++) { START_TIMER inlen = clen; outlen = MAXSZ; #ifdef LIBLZO if (lzo1x_decompress_safe (comp, inlen, decomp, &outlen, NULL)) #elif defined(LIBLZO_UNSAFE) if (lzo1x_decompress (comp, inlen, decomp, &outlen, NULL)) #else if (lzo1x_decode (decomp, &outlen, comp, &inlen)) #endif av_log (NULL, AV_LOG_ERROR, "decompression error\n"); STOP_TIMER ("lzod") } if (memcmp (orig, decomp, s)) av_log (NULL, AV_LOG_ERROR, "decompression incorrect\n"); else av_log (NULL, AV_LOG_ERROR, "decompression ok\n"); fclose (in); return 0; } #endif
1.328125
1
include/RomanNumberMath.h
anonymokata/20BC3BC1-A1D6-459E-9489-30AE40BD3760
0
7997051
#ifndef __ROMAN_H_ #define __ROMAN_H_ typedef struct { char Symbol; int Value; } RomanDigit; typedef struct { int Size; RomanDigit Digit[100]; } RomanNumber; /* Number Instantiation and Validation Functions */ RomanDigit rdEncode(char); RomanNumber rnEncode(char *); /* Core Mathmatical Functions */ RomanNumber rnAdd(RomanNumber, RomanNumber); RomanNumber rnSubtract(RomanNumber, RomanNumber); /* Debugging and Validation Helper Functions */ char *rnPrint(RomanNumber); uint32_t rnValue(RomanNumber); /* Algorithm Implementation Functions */ RomanNumber rnSortDigits(RomanNumber); RomanNumber rnConcatinate(RomanNumber, RomanNumber); RomanNumber rnRemoveSubtractiveNotation(RomanNumber); RomanNumber rnSimplifyDigits(RomanNumber); RomanNumber rnConvertToSubtractiveNotation(RomanNumber); RomanNumber rnExpandValue(RomanNumber, RomanNumber); void rnRemoveCommonDigits(RomanNumber *, RomanNumber *); #endif
1.710938
2
targets/os/win32/nanoCLR/Windows.Devices.Spi/win_dev_spi_native.h
TIPConsulting/nf-interpreter
0
7997059
// // Copyright (c) .NET Foundation and Contributors // See LICENSE file in the project root for full license information. // #ifndef _WIN_DEV_SPI_NATIVE_H_ #define _WIN_DEV_SPI_NATIVE_H_ #include "stdafx.h" struct Library_win_dev_spi_native_Windows_Devices_Spi_SpiBusInfo { static const int FIELD___ChipSelectLineCount = 1; NANOCLR_NATIVE_DECLARE(get_MaxClockFrequency___I4); NANOCLR_NATIVE_DECLARE(get_MinClockFrequency___I4); //--// }; struct Library_win_dev_spi_native_Windows_Devices_Spi_SpiConnectionSettings { static const int FIELD___csLine = 1; static const int FIELD___clockFrequency = 2; static const int FIELD___databitLength = 3; static const int FIELD___spiMode = 4; static const int FIELD___spiSharingMode = 5; static const int FIELD___bitOrder = 6; //--// }; struct Library_win_dev_spi_native_Windows_Devices_Spi_SpiController { static const int FIELD_STATIC__DeviceCollection = 0; //--// }; struct Library_win_dev_spi_native_Windows_Devices_Spi_SpiDevice { static const int FIELD___syncLock = 1; static const int FIELD___spiBus = 2; static const int FIELD___deviceId = 3; static const int FIELD___connectionSettings = 4; static const int FIELD___disposedValue = 5; NANOCLR_NATIVE_DECLARE(NativeTransfer___VOID__SZARRAY_U1__SZARRAY_U1__BOOLEAN); NANOCLR_NATIVE_DECLARE(NativeTransfer___VOID__SZARRAY_U2__SZARRAY_U2__BOOLEAN); NANOCLR_NATIVE_DECLARE(NativeInit___VOID); NANOCLR_NATIVE_DECLARE(DisposeNative___VOID); NANOCLR_NATIVE_DECLARE(GetDeviceSelector___STATIC__STRING); //--// //static uint16_t ComputePrescaler (uint8_t bus, int32_t requestedFrequency); //static nfSPIConfig GetConfig(int bus, CLR_RT_HeapBlock* config); }; extern const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_Windows_Devices_Spi; #endif //_WIN_DEV_SPI_NATIVE_H_
0.804688
1
todo.h
MehmetUstek/Custom-Linux-Shell-Seashell
0
7997067
#include <unistd.h> #include <stdlib.h> #include <ctype.h> #include "queue.h" #include "linkedList.h" #ifndef TODO_H_ #define TODO_H_ void sortByDate(node_t * head); struct Queue* searchProject(char* name); void searchProjectWithLinkedList(char* name); void listProject(char* project); void setAlarm(int month,int day,char* desc, char* project); void sortByDate(node_t * head) { node_t * current = head; bubbleSort(current); print_list(current); } struct Queue* searchProject(char* name) { FILE *fp; char temp[512]; char* token; int line=1; struct Queue* queue = createQueue(1000); int count=0; fp = fopen ("todos.txt","r"); if(fp==NULL){ printf("INVALID FILE. EXITING\n"); exit(EXIT_FAILURE); } while(fgets(temp, 512, fp) != NULL) { token= strtok(temp,","); // printf("%s\n",token); if(strcmp(token,name)==0){ enqueue(queue,line); count++; } line++; } fclose(fp); return queue; } void searchProjectWithLinkedList(char* name) { FILE *fp; char temp[512]; char* temp1 = malloc(512* sizeof(char)); char* token; char* project = malloc(512* sizeof(char)); int month=1; int day=1; char* desc = malloc(512* sizeof(char)); int line=1; node_t * head = NULL; head = (node_t *) malloc(sizeof(node_t)); int count=0; fp = fopen ("todos.txt","r"); if(fp==NULL){ printf("INVALID FILE. EXITING\n"); exit(EXIT_FAILURE); } while(fgets(temp, 512, fp) != NULL) { token= strtok(temp,","); strcpy(project,token); token= strtok(NULL,","); strcpy(desc,token); token= strtok(NULL,","); token= strtok(token,"."); strcpy(temp1,token); day= atoi(temp1); token= strtok(NULL,"."); strcpy(temp1,token); month= atoi(temp1); if(strcmp(project,name)==0){ push(head,month,day,desc,project); count++; } line++; } fclose(fp); sortByDate(head); freeList(head); free(project); free(temp1); free(desc); // return head; } bool containsInArray(int line, int* arr, int size){ // for(int i=0;i<(sizeof(arr)/sizeof(int))-1;i++){ size_t length= sizeof(arr)/sizeof(int)-1; if(size==length || size > length){ return false; } if(line==arr[size]){ return true; } else{ size++; containsInArray(line,arr,size); } // } } int searchTodo(char* name){ FILE *fp; char temp[512]; char* token = malloc(512* sizeof(char)); int line=0; char* desc = malloc(512* sizeof(char)); // node_t * head = NULL; // head = (node_t *) malloc(sizeof(node_t)); fp = fopen ("todos.txt","r"); if(fp==NULL){ printf("INVALID FILE. EXITING\n"); exit(EXIT_FAILURE); } while(fgets(temp, 512, fp) != NULL) { token= strtok(temp,","); token= strtok(NULL,","); strcpy(desc,token); line++; // printf("%s \n",desc); // printf("%s",name); if(strcmp(desc,name)==0){ fclose(fp); // free(desc); // free(token); return line; } } // free(desc); // free(token); fclose(fp); return -1; } void addTodo(char* project, char* description, char* date){ FILE *fp; FILE *fp1; char temp[512]; int line=0; int month; int day; char* token; line= searchTodo(description); if(line==-1){ fp = fopen ("todos.txt","a"); fprintf(fp,"%s,%s,%s\n",project,description, date); fclose(fp); }else{ int i=0; fp = fopen ("todos.txt","r"); if(fp==NULL){ printf("INVALID FILE. EXITING\n"); exit(EXIT_FAILURE); } fp1 = fopen ("todostemp.txt","w"); if(fp1==NULL){ printf("INVALID FILE. EXITING\n"); exit(EXIT_FAILURE); } while(fgets(temp, 512, fp) != NULL) { i++; if(i!=line){ fputs(temp,fp1); } } // fprintf(fp,"%s,%s\n",name,dir); fclose(fp); fprintf(fp1,"%s,%s,%s\n",project,description, date); fclose(fp1); remove("todos.txt"); rename("todostemp.txt","todos.txt"); // printf("%d %d %s %s",month,day,description,project); token= strtok(date,"."); day=atoi(token); token= strtok(NULL,"."); month= atoi(token); setAlarm(month,day,description,project); } } void delProject(char* project){ FILE *fp; FILE *fp1; char temp[512]; int line; int i=0; struct Queue* linearr = malloc(1000 * sizeof(int)); linearr= searchProject(project); // struct Queue* queue = createQueue(1000); if(linearr==NULL){ return; } fp = fopen ("todos.txt","r"); if(fp==NULL){ printf("INVALID FILE. EXITING\n"); exit(EXIT_FAILURE); } fp1 = fopen ("todostemp.txt","w"); if(fp1==NULL){ printf("INVALID FILE. EXITING\n"); exit(EXIT_FAILURE); } while(fgets(temp, 512, fp) != NULL) { i++; if(linearr->array[linearr->front]!=i){ fputs(temp,fp1); } else{ dequeue(linearr); } } // free(linearr); fclose(fp); fclose(fp1); remove("todos.txt"); rename("todostemp.txt","todos.txt"); } void delTodo(char* description){ FILE *fp; FILE *fp1; char temp[512]; int line; int i=0; line= searchTodo(description); if(line==-1){ return; ///TODO: } fp = fopen ("todos.txt","r"); if(fp==NULL){ printf("INVALID FILE. EXITING\n"); exit(EXIT_FAILURE); } fp1 = fopen ("todostemp.txt","w"); if(fp1==NULL){ printf("INVALID FILE. EXITING\n"); exit(EXIT_FAILURE); } while(fgets(temp, 512, fp) != NULL) { i++; if(i!=line){ fputs(temp,fp1); } } fclose(fp); fclose(fp1); remove("todos.txt"); rename("todostemp.txt","todos.txt"); } void listToday(char* project){ } // void allListToday(){ // ///TODO: Get today's date. // int date; // listDate(date); // } void listDate(char* date){ // int month; // int day; // char* token; // token= strtok(date,"."); // // printf("%s\n",token); // month= atoi(token); // // printf("%d",hour); // token= strtok(NULL,"."); // day= atoi(token); } // void listProject(char* project){ // FILE *fp; // char temp[512]; // int line; // int i=1; // char* date = malloc(512* sizeof(char)); // char* desc = malloc(512* sizeof(char)); // char* token; // struct Queue* linearr = createQueue(1000); // linearr= searchProject(project); // if(linearr==NULL){ // return; // ///TODO: // } // fp = fopen ("todos.txt","r"); // if(fp==NULL){ // printf("INVALID FILE. EXITING\n"); // exit(EXIT_FAILURE); // } // printf("Todos for project: %s\n",project); // while(fgets(temp, 512, fp) != NULL) { // token = strtok(temp,","); // token= strtok(NULL,","); // strcpy(desc,token); // token= strtok(NULL,","); // strcpy(date,token); // if(linearr->array[linearr->front]==i){ // printf("Todo Date: %s Todo Description: %s\n",date,desc); // ///TODO: Sort by date. // dequeue(linearr); // } // i++; // } // printf("\n"); // free(linearr); // fclose(fp); // } void listProject(char* project) { // FILE *fp; // char temp[512]; // int line; // int i=1; // node_t * head; searchProjectWithLinkedList(project); // printf("%s",head->desc); } void sortAllTodos(){ FILE *fp; char temp[512]; char* temp1 = malloc(512* sizeof(char)); char* token; char* project = malloc(512* sizeof(char)); int month=1; int day=1; char* desc = malloc(512* sizeof(char)); int line=1; node_t * head = NULL; head = (node_t *) malloc(sizeof(node_t)); int count=0; fp = fopen ("todos.txt","r"); if(fp==NULL){ printf("INVALID FILE. EXITING\n"); exit(EXIT_FAILURE); } while(fgets(temp, 512, fp) != NULL) { token= strtok(temp,","); strcpy(project,token); token= strtok(NULL,","); strcpy(desc,token); token= strtok(NULL,","); token= strtok(token,"."); strcpy(temp1,token); day= atoi(temp1); token= strtok(NULL,"."); strcpy(temp1,token); month= atoi(temp1); push(head,month,day,desc,project); count++; line++; } fclose(fp); sortByDate(head); freeList(head); free(project); free(temp1); free(desc); } void setAlarm(int month,int day,char* desc, char* project) { // printf("%d\n",minute); // if((info->tm_hour== hour) && (info->tm_min== minute)){ // printf("%d %d ",hour,minute); // playSong(filename); // } FILE *fp = fopen("crontab.txt", "a"); if(fp==NULL){ printf("Crontab file is busy now. Please try again later"); } else{ fprintf(fp,"%s ","* *"); fprintf(fp,"%d ",day); fprintf(fp,"%d ",month); fprintf(fp,"%s ","*"); fprintf(fp,"%s ","DISPLAY=:0.0"); fprintf(fp,"%s ","DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus"); fprintf(fp,"/usr/bin/notify-send %s '%s' \n", project,desc); char* path=realpath("crontab.txt",NULL); char *argv[3]; argv[0]="crontab"; argv[1]=path; argv[2]=NULL; int pid= fork(); if(pid==0){ execvp("crontab",argv); } } fclose(fp); } #endif
2.46875
2
sextractor/src/retina.c
yerkesobservatory/variousnsundry
0
7997075
/* * retina.c * * Filter the image raster using a "retina" (convolution neural network). * *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% * * This file part of: SExtractor * * Copyright: (C) 1995-2010 <NAME> -- IAP/CNRS/UPMC * * License: GNU General Public License * * SExtractor is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * SExtractor 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 SExtractor. If not, see <http://www.gnu.org/licenses/>. * * Last modified: 11/10/2010 * *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "define.h" #include "globals.h" #include "fits/fitscat.h" #include "bpro.h" #include "image.h" #include "retina.h" /******************************** readretina *********************************/ /* Return the response of the retina at a given image position. */ float readretina(picstruct *field, retistruct *retina, float x, float y) { float *pix, resp, norm; int i, ix,iy; ix = (int)(x+0.499999); iy = (int)(y+0.499999); if (ix>=0 && ix<field->width && iy>=field->ymin && iy<field->ymax) norm = field->strip[ix+(iy%field->stripheight)*field->width]; else norm = retina->minnorm; if (norm<retina->minnorm) norm = retina->minnorm; /* Copy the right pixels to the retina */ pix = retina->pix; copyimage(field, pix, retina->width, retina->height, ix,iy); for (i=retina->npix; i--;) *(pix++) /= norm; *pix = -2.5*log10(norm/retina->minnorm); play_bpann(retina->bpann, retina->pix, &resp); return resp; } /********************************** getretina ********************************/ /* Read an ANN retina file. */ retistruct *getretina(char *filename) { #define FILTEST(x) \ if (x != RETURN_OK) \ error(EXIT_FAILURE, "*Error*: RETINA header in ", filename) retistruct *retina; catstruct *fcat; tabstruct *ftab; int ival; QMALLOC(retina, retistruct, 1); /* We first map the catalog */ if (!(fcat = read_cat(filename))) error(EXIT_FAILURE, "*Error*: retina file not found: ", filename); /* Test if the requested table is present */ if (!(ftab = name_to_tab(fcat, "BP-ANN", 0))) error(EXIT_FAILURE, "*Error*: no BP-ANN info found in ", filename); FILTEST(fitsread(ftab->headbuf, "BPTYPE ", gstr,H_STRING,T_STRING)); if (strcmp(gstr, "RETINA_2D")) error(EXIT_FAILURE, "*Error*: not a suitable retina in ", filename); FILTEST(fitsread(ftab->headbuf, "RENAXIS ", &ival ,H_INT, T_LONG)); if (ival != 2) error(EXIT_FAILURE, "*Error*: not a 2D retina in ", filename); FILTEST(fitsread(ftab->headbuf, "RENAXIS1", &retina->width ,H_INT, T_LONG)); FILTEST(fitsread(ftab->headbuf, "RENAXIS2", &retina->height ,H_INT, T_LONG)); retina->npix = retina->width*retina->height; FILTEST(fitsread(ftab->headbuf, "RENORM ",&retina->minnorm,H_FLOAT,T_FLOAT)); retina->bpann = loadtab_bpann(ftab, filename); QMALLOC(retina->pix, float, retina->bpann->nn[0]); close_cat(fcat); free_cat(&fcat,1); return retina; } /********************************** endretina ********************************/ /* Free a retina structure. */ void endretina(retistruct *retina) { free(retina->pix); free_bpann(retina->bpann); free(retina); return; }
1.414063
1