diff --git a/.gitattributes b/.gitattributes index c40459e252078848749f2465af57ba7d68274e4e..db34239798b3f4158e81ccb7f70d9dc9c33bc5e7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -104,3 +104,14 @@ local-test-sqlite3-delta-01/afc-sqlite3/test/fuzzdata5.db filter=lfs diff=lfs me local-test-sqlite3-delta-03/afc-sqlite3/contacts.lsm filter=lfs diff=lfs merge=lfs -text local-test-sqlite3-delta-03/fuzz-tooling/infra/cifuzz/test_data/timeout_fuzzer filter=lfs diff=lfs merge=lfs -text local-test-freerdp-full-01/afc-freerdp/client/Windows/resource/FreeRDP.ico filter=lfs diff=lfs merge=lfs -text +local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata4.db filter=lfs diff=lfs merge=lfs -text +local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata6.db filter=lfs diff=lfs merge=lfs -text +local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata1.db filter=lfs diff=lfs merge=lfs -text +local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata3.db filter=lfs diff=lfs merge=lfs -text +local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata2.db filter=lfs diff=lfs merge=lfs -text +local-test-sqlite3-delta-03/afc-sqlite3/test/sessionfuzz-data1.db filter=lfs diff=lfs merge=lfs -text +local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata7.db filter=lfs diff=lfs merge=lfs -text +local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata8.db filter=lfs diff=lfs merge=lfs -text +local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata5.db filter=lfs diff=lfs merge=lfs -text +local-test-libexif-delta-01-exif-003/fuzz-tooling/infra/cifuzz/test_data/timeout_fuzzer filter=lfs diff=lfs merge=lfs -text +local-test-libpostal-full-01/afc-libpostal/src/transliteration_data.c filter=lfs diff=lfs merge=lfs -text diff --git a/local-test-freerdp-full-01/afc-freerdp/channels/CMakeLists.txt b/local-test-freerdp-full-01/afc-freerdp/channels/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..6c95b386c498043bc4c826f9ca1225501a695f4f --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/channels/CMakeLists.txt @@ -0,0 +1,285 @@ +# FreeRDP: A Remote Desktop Protocol Implementation +# FreeRDP cmake build script +# +# Copyright 2012 Marc-Andre Moreau +# +# 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(CMakeParseArguments) +include(CMakeDependentOption) + +macro(define_channel_options) + set(PREFIX "CHANNEL") + + cmake_parse_arguments( + ${PREFIX} "" "NAME;TYPE;DESCRIPTION;SPECIFICATIONS;DEFAULT;CLIENT_DEFAULT;SERVER_DEFAULT" "" ${ARGN} + ) + + string(TOUPPER "CHANNEL_${CHANNEL_NAME}" CHANNEL_OPTION) + string(TOUPPER "CHANNEL_${CHANNEL_NAME}_CLIENT" CHANNEL_CLIENT_OPTION) + string(TOUPPER "CHANNEL_${CHANNEL_NAME}_SERVER" CHANNEL_SERVER_OPTION) + string(TOUPPER "${CHANNEL_TYPE}" CHANNEL_TYPE) + + if(CHANNEL_DEFAULT) + set(OPTION_DEFAULT ${CHANNEL_DEFAULT}) + elseif(CHANNEL_CLIENT_OPTION OR CHANNEL_SERVER_OPTION) + set(OPTION_DEFAULT "ON") + endif() + + set(CHANNEL_OPTION_DOC "Build ${CHANNEL_NAME} ${CHANNEL_TYPE} channel") + set(CHANNEL_CLIENT_OPTION_DOC "Build ${CHANNEL_NAME} ${CHANNEL_TYPE} channel client") + set(CHANNEL_SERVER_OPTION_DOC "Build ${CHANNEL_NAME} ${CHANNEL_TYPE} channel server") + + if("${CHANNEL_TYPE}" STREQUAL "DYNAMIC") + cmake_dependent_option(${CHANNEL_OPTION} "${CHANNEL_OPTION_DOC}" ${CHANNEL_DEFAULT} "CHANNEL_DRDYNVC" OFF) + else() + option(${CHANNEL_OPTION} "${CHANNEL_OPTION_DOC}" ${CHANNEL_DEFAULT}) + endif() + + cmake_dependent_option( + ${CHANNEL_CLIENT_OPTION} "${CHANNEL_CLIENT_OPTION_DOC}" ${CHANNEL_CLIENT_DEFAULT} "${CHANNEL_OPTION}" OFF + ) + + cmake_dependent_option( + ${CHANNEL_SERVER_OPTION} "${CHANNEL_SERVER_OPTION_DOC}" ${CHANNEL_SERVER_DEFAULT} "${CHANNEL_OPTION}" OFF + ) +endmacro(define_channel_options) + +macro(define_channel _channel_name) + set(CHANNEL_NAME ${_channel_name}) + set(MODULE_NAME ${CHANNEL_NAME}) + string(TOUPPER "CHANNEL_${CHANNEL_NAME}" MODULE_PREFIX) +endmacro(define_channel) + +macro(define_channel_client _channel_name) + set(CHANNEL_NAME ${_channel_name}) + set(MODULE_NAME "${CHANNEL_NAME}-client") + string(TOUPPER "CHANNEL_${CHANNEL_NAME}_CLIENT" MODULE_PREFIX) +endmacro(define_channel_client) + +macro(define_channel_server _channel_name) + set(CHANNEL_NAME ${_channel_name}) + set(MODULE_NAME "${CHANNEL_NAME}-server") + string(TOUPPER "CHANNEL_${CHANNEL_NAME}_SERVER" MODULE_PREFIX) +endmacro(define_channel_server) + +macro(define_channel_client_subsystem _channel_name _subsystem _type) + set(CHANNEL_NAME ${_channel_name}) + set(CHANNEL_SUBSYSTEM ${_subsystem}) + string(LENGTH "${_type}" _type_length) + string(TOUPPER "CHANNEL_${CHANNEL_NAME}_CLIENT" CHANNEL_PREFIX) + if(_type_length GREATER 0) + set(SUBSYSTEM_TYPE ${_type}) + set(MODULE_NAME "${CHANNEL_NAME}-client-${CHANNEL_SUBSYSTEM}-${SUBSYSTEM_TYPE}") + string(TOUPPER "CHANNEL_${CHANNEL_NAME}_CLIENT_${CHANNEL_SUBSYSTEM}_${SUBSYSTEM_TYPE}" MODULE_PREFIX) + else() + set(MODULE_NAME "${CHANNEL_NAME}-client-${CHANNEL_SUBSYSTEM}") + string(TOUPPER "CHANNEL_${CHANNEL_NAME}_CLIENT_${CHANNEL_SUBSYSTEM}" MODULE_PREFIX) + endif() +endmacro(define_channel_client_subsystem) + +macro(define_channel_server_subsystem _channel_name _subsystem _type) + set(CHANNEL_NAME ${_channel_name}) + set(CHANNEL_SUBSYSTEM ${_subsystem}) + set(MODULE_NAME "${CHANNEL_NAME}-server-${CHANNEL_SUBSYSTEM}") + string(TOUPPER "CHANNEL_${CHANNEL_NAME}_server_${CHANNEL_SUBSYSTEM}" MODULE_PREFIX) +endmacro(define_channel_server_subsystem) + +macro(add_channel_client _channel_prefix _channel_name) + if(${_channel_prefix}_CLIENT) + add_subdirectory(client) + if(${${_channel_prefix}_CLIENT_STATIC}) + set(CHANNEL_STATIC_CLIENT_MODULES ${CHANNEL_STATIC_CLIENT_MODULES} ${_channel_prefix} PARENT_SCOPE) + set(${_channel_prefix}_CLIENT_NAME ${${_channel_prefix}_CLIENT_NAME} PARENT_SCOPE) + set(${_channel_prefix}_CLIENT_CHANNEL ${${_channel_prefix}_CLIENT_CHANNEL} PARENT_SCOPE) + set(${_channel_prefix}_CLIENT_ENTRY ${${_channel_prefix}_CLIENT_ENTRY} PARENT_SCOPE) + set(CHANNEL_STATIC_CLIENT_ENTRIES ${CHANNEL_STATIC_CLIENT_ENTRIES} ${${_channel_prefix}_CLIENT_ENTRY} + PARENT_SCOPE + ) + endif() + endif() +endmacro(add_channel_client) + +macro(add_channel_server _channel_prefix _channel_name) + if(${_channel_prefix}_SERVER) + add_subdirectory(server) + if(${${_channel_prefix}_SERVER_STATIC}) + set(CHANNEL_STATIC_SERVER_MODULES ${CHANNEL_STATIC_SERVER_MODULES} ${_channel_prefix} PARENT_SCOPE) + set(${_channel_prefix}_SERVER_NAME ${${_channel_prefix}_SERVER_NAME} PARENT_SCOPE) + set(${_channel_prefix}_SERVER_CHANNEL ${${_channel_prefix}_SERVER_CHANNEL} PARENT_SCOPE) + set(${_channel_prefix}_SERVER_ENTRY ${${_channel_prefix}_SERVER_ENTRY} PARENT_SCOPE) + set(CHANNEL_STATIC_SERVER_ENTRIES ${CHANNEL_STATIC_SERVER_ENTRIES} ${${_channel_prefix}_SERVER_ENTRY} + PARENT_SCOPE + ) + endif() + endif() +endmacro(add_channel_server) + +macro(add_channel_client_subsystem _channel_prefix _channel_name _subsystem _type) + add_subdirectory(${_subsystem}) + set(_channel_module_name "${_channel_name}-client") + string(LENGTH "${_type}" _type_length) + if(_type_length GREATER 0) + string(TOUPPER "CHANNEL_${_channel_name}_CLIENT_${_subsystem}_${_type}" _subsystem_prefix) + else() + string(TOUPPER "CHANNEL_${_channel_name}_CLIENT_${_subsystem}" _subsystem_prefix) + endif() + if(${${_subsystem_prefix}_STATIC}) + get_target_property(CHANNEL_SUBSYSTEMS ${_channel_module_name} SUBSYSTEMS) + if(_type_length GREATER 0) + set(SUBSYSTEMS ${SUBSYSTEMS} "${_subsystem}-${_type}") + else() + set(SUBSYSTEMS ${SUBSYSTEMS} ${_subsystem}) + endif() + set_target_properties(${_channel_module_name} PROPERTIES SUBSYSTEMS "${SUBSYSTEMS}") + endif() +endmacro(add_channel_client_subsystem) + +macro(channel_install _targets _destination _export_target) + if(NOT BUILD_SHARED_LIBS) + foreach(_target_name IN ITEMS ${_targets}) + target_include_directories(${_target_name} INTERFACE $) + endforeach() + install(TARGETS ${_targets} DESTINATION ${_destination} EXPORT ${_export_target}) + endif() +endmacro(channel_install) + +macro(server_channel_install _targets _destination) + channel_install(${_targets} ${_destination} "FreeRDP-ServerTargets") +endmacro(server_channel_install) + +macro(client_channel_install _targets _destination) + channel_install(${_targets} ${_destination} "FreeRDP-ClientTargets") +endmacro(client_channel_install) + +macro(add_channel_client_library _module_prefix _module_name _channel_name _dynamic _entry) + set(_lnk_dir ${${_module_prefix}_LINK_DIRS}) + if(NOT "${_lnk_dir}" STREQUAL "") + link_directories(${_lnk_dir}) + endif() + + set(${_module_prefix}_STATIC ON PARENT_SCOPE) + set(${_module_prefix}_NAME ${_module_name} PARENT_SCOPE) + set(${_module_prefix}_CHANNEL ${_channel_name} PARENT_SCOPE) + set(${_module_prefix}_ENTRY ${_entry} PARENT_SCOPE) + + add_library(${_module_name} OBJECT ${${_module_prefix}_SRCS}) + set_property(TARGET ${_module_name} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client") + + if(${_module_prefix}_LIBS) + target_link_libraries(${_module_name} PUBLIC ${${_module_prefix}_LIBS}) + endif() + client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH}) +endmacro(add_channel_client_library) + +macro( + add_channel_client_subsystem_library + _module_prefix + _module_name + _channel_name + _type + _dynamic + _entry +) + set(_lnk_dir ${${_module_prefix}_LINK_DIRS}) + if(NOT "${_lnk_dir}" STREQUAL "") + link_directories(${_lnk_dir}) + endif() + + set(${_module_prefix}_STATIC ON PARENT_SCOPE) + set(${_module_prefix}_NAME ${_module_name} PARENT_SCOPE) + set(${_module_prefix}_TYPE ${_type} PARENT_SCOPE) + + add_library(${_module_name} OBJECT ${${_module_prefix}_SRCS}) + set_property(TARGET ${_module_name} PROPERTY FOLDER "Channels/${_channel_name}/Client/Subsystem/${CHANNEL_SUBSYSTEM}") + + if(${_module_prefix}_LIBS) + target_link_libraries(${_module_name} PUBLIC ${${_module_prefix}_LIBS}) + endif() + client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH}) +endmacro(add_channel_client_subsystem_library) + +macro(add_channel_server_library _module_prefix _module_name _channel_name _dynamic _entry) + set(_lnk_dir ${${_module_prefix}_LINK_DIRS}) + if(NOT "${_lnk_dir}" STREQUAL "") + link_directories(${_lnk_dir}) + endif() + + set(${_module_prefix}_STATIC ON PARENT_SCOPE) + set(${_module_prefix}_NAME ${_module_name} PARENT_SCOPE) + set(${_module_prefix}_CHANNEL ${_channel_name} PARENT_SCOPE) + set(${_module_prefix}_ENTRY ${_entry} PARENT_SCOPE) + + add_library(${_module_name} OBJECT ${${_module_prefix}_SRCS}) + set_property(TARGET ${_module_name} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Server") + + if(${_module_prefix}_LIBS) + target_link_libraries(${_module_name} PUBLIC ${${_module_prefix}_LIBS}) + endif() + server_channel_install(${_module_name} ${FREERDP_ADDIN_PATH}) +endmacro(add_channel_server_library) + +set(FILENAME "ChannelOptions.cmake") +file(GLOB FILEPATHS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/${FILENAME}") + +# We need special treatment for drdynvc: +# It needs to be the first entry so that every +# dynamic channel has the dependent options available. +set(DRDYNVC_MATCH "") + +foreach(FILEPATH ${FILEPATHS}) + if(${FILEPATH} MATCHES "^([^/]*)drdynvc/+${FILENAME}") + set(DRDYNVC_MATCH ${FILEPATH}) + endif() +endforeach() + +if(NOT "${DRDYNVC_MATCH}" STREQUAL "") + list(REMOVE_ITEM FILEPATHS ${DRDYNVC_MATCH}) + list(APPEND FILEPATHS ${DRDYNVC_MATCH}) + list(REVERSE FILEPATHS) # list PREPEND is not available on old CMake3 +endif() + +foreach(FILEPATH ${FILEPATHS}) + if(${FILEPATH} MATCHES "^([^/]*)/+${FILENAME}") + string(REGEX REPLACE "^([^/]*)/+${FILENAME}" "\\1" DIR ${FILEPATH}) + set(CHANNEL_OPTION) + include(${FILEPATH}) + if(${CHANNEL_OPTION}) + set(CHANNEL_MESSAGE "Adding ${CHANNEL_TYPE} channel") + if(${CHANNEL_CLIENT_OPTION}) + set(CHANNEL_MESSAGE "${CHANNEL_MESSAGE} client") + endif() + if(${CHANNEL_SERVER_OPTION}) + set(CHANNEL_MESSAGE "${CHANNEL_MESSAGE} server") + endif() + set(CHANNEL_MESSAGE "${CHANNEL_MESSAGE} \"${CHANNEL_NAME}\"") + set(CHANNEL_MESSAGE "${CHANNEL_MESSAGE}: ${CHANNEL_DESCRIPTION}") + message(STATUS "${CHANNEL_MESSAGE}") + add_subdirectory(${DIR}) + endif() + endif() +endforeach(FILEPATH) + +if(WITH_CHANNELS) + if(WITH_CLIENT_CHANNELS) + add_subdirectory(client) + set(FREERDP_CHANNELS_CLIENT_SRCS ${FREERDP_CHANNELS_CLIENT_SRCS} PARENT_SCOPE) + set(FREERDP_CHANNELS_CLIENT_LIBS ${FREERDP_CHANNELS_CLIENT_LIBS} PARENT_SCOPE) + endif() + + if(WITH_SERVER_CHANNELS) + add_subdirectory(server) + set(FREERDP_CHANNELS_SERVER_SRCS ${FREERDP_CHANNELS_SERVER_SRCS} PARENT_SCOPE) + set(FREERDP_CHANNELS_SERVER_LIBS ${FREERDP_CHANNELS_SERVER_LIBS} PARENT_SCOPE) + endif() +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Additions/OrderedDictionary.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Additions/OrderedDictionary.m new file mode 100644 index 0000000000000000000000000000000000000000..9b371863416a6d1dd5b07bbfe1b8f390aa0e0c4f --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Additions/OrderedDictionary.m @@ -0,0 +1,167 @@ +// +// OrderedDictionary.m +// OrderedDictionary +// +// Modified version (Added indexForKey/Value functions) +// +// Created by Matt Gallagher on 19/12/08. +// Copyright 2008 Matt Gallagher. All rights reserved. +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. Permission is granted to anyone to +// use this software for any purpose, including commercial applications, and to +// alter it and redistribute it freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source +// distribution. +// + +#import "OrderedDictionary.h" + +NSString *DescriptionForObject(NSObject *object, id locale, NSUInteger indent) +{ + NSString *objectString; + if ([object isKindOfClass:[NSString class]]) + { + objectString = (NSString *)[[object retain] autorelease]; + } + else if ([object respondsToSelector:@selector(descriptionWithLocale:indent:)]) + { + objectString = [(NSDictionary *)object descriptionWithLocale:locale indent:indent]; + } + else if ([object respondsToSelector:@selector(descriptionWithLocale:)]) + { + objectString = [(NSSet *)object descriptionWithLocale:locale]; + } + else + { + objectString = [object description]; + } + return objectString; +} + +@implementation OrderedDictionary + +- (id)init +{ + return [self initWithCapacity:0]; +} + +- (id)initWithCapacity:(NSUInteger)capacity +{ + self = [super init]; + if (self != nil) + { + dictionary = [[NSMutableDictionary alloc] initWithCapacity:capacity]; + array = [[NSMutableArray alloc] initWithCapacity:capacity]; + } + return self; +} + +- (void)dealloc +{ + [dictionary release]; + [array release]; + [super dealloc]; +} + +- (id)copy +{ + return [self mutableCopy]; +} + +- (void)setObject:(id)anObject forKey:(id)aKey +{ + if (![dictionary objectForKey:aKey]) + { + [array addObject:aKey]; + } + [dictionary setObject:anObject forKey:aKey]; +} + +- (void)removeObjectForKey:(id)aKey +{ + [dictionary removeObjectForKey:aKey]; + [array removeObject:aKey]; +} + +- (NSUInteger)count +{ + return [dictionary count]; +} + +- (id)objectForKey:(id)aKey +{ + return [dictionary objectForKey:aKey]; +} + +- (NSEnumerator *)keyEnumerator +{ + return [array objectEnumerator]; +} + +- (NSEnumerator *)reverseKeyEnumerator +{ + return [array reverseObjectEnumerator]; +} + +- (void)insertObject:(id)anObject forKey:(id)aKey atIndex:(NSUInteger)anIndex +{ + if ([dictionary objectForKey:aKey]) + { + [self removeObjectForKey:aKey]; + } + [array insertObject:aKey atIndex:anIndex]; + [dictionary setObject:anObject forKey:aKey]; +} + +- (id)keyAtIndex:(NSUInteger)anIndex +{ + return [array objectAtIndex:anIndex]; +} + +- (NSUInteger)indexForKey:(id)key +{ + return [array indexOfObject:key]; +} + +- (NSUInteger)indexForValue:(id)value +{ + NSArray *keys = [self allKeysForObject:value]; + if ([keys count] > 0) + { + return [self indexForKey:[keys objectAtIndex:0]]; + } + + return NSNotFound; +} + +- (NSString *)descriptionWithLocale:(id)locale indent:(NSUInteger)level +{ + NSMutableString *indentString = [NSMutableString string]; + NSUInteger count = level; + for (NSUInteger i = 0; i < count; i++) + { + [indentString appendFormat:@" "]; + } + + NSMutableString *description = [NSMutableString string]; + [description appendFormat:@"%@{\n", indentString]; + for (NSObject *key in self) + { + [description appendFormat:@"%@ %@ = %@;\n", indentString, + DescriptionForObject(key, locale, level), + DescriptionForObject([self objectForKey:key], locale, level)]; + } + [description appendFormat:@"%@}\n", indentString]; + return description; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Additions/TSXAdditions.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Additions/TSXAdditions.m new file mode 100644 index 0000000000000000000000000000000000000000..39862967bef92c70f6a3315463e951e96b10a811 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Additions/TSXAdditions.m @@ -0,0 +1,239 @@ +/* + Additions to Cocoa touch classes + + Copyright 2013 Thincast Technologies GmbH, Authors: Dorian Johnson, Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "TSXAdditions.h" +#include +#include +#include + +@implementation NSObject (TSXAdditions) + +- (void)setValuesForKeyPathsWithDictionary:(NSDictionary *)keyedValues +{ + for (id keyPath in keyedValues) + [self setValue:[keyedValues objectForKey:keyPath] forKeyPath:keyPath]; +} + +- mutableDeepCopy +{ + if ([self respondsToSelector:@selector(mutableCopyWithZone:)]) + return [self mutableCopy]; + else if ([self respondsToSelector:@selector(copyWithZone:)]) + return [self copy]; + else + return [self retain]; +} + +@end + +#pragma mark - + +@implementation NSString (TSXAdditions) + +#pragma mark Creation routines ++ (NSString *)stringWithUUID +{ + CFUUIDRef uuidObj = CFUUIDCreate(nil); + NSString *uuidString = (NSString *)CFUUIDCreateString(nil, uuidObj); + CFRelease(uuidObj); + return [uuidString autorelease]; +} + +/* Code from + * http://code.google.com/p/google-toolbox-for-mac/source/browse/trunk/Foundation/GTMNSData%2BHex.m?r=344 + */ +- (NSData *)dataFromHexString +{ + NSData *hexData = [self dataUsingEncoding:NSASCIIStringEncoding]; + const char *hexBuf = [hexData bytes]; + NSUInteger hexLen = [hexData length]; + + // This indicates an error converting to ASCII. + if (!hexData) + return nil; + + if ((hexLen % 2) != 0) + { + return nil; + } + + NSMutableData *binaryData = [NSMutableData dataWithLength:(hexLen / 2)]; + unsigned char *binaryPtr = [binaryData mutableBytes]; + unsigned char value = 0; + for (NSUInteger i = 0; i < hexLen; i++) + { + char c = hexBuf[i]; + + if (!isxdigit(c)) + { + return nil; + } + + if (isdigit(c)) + { + value += c - '0'; + } + else if (islower(c)) + { + value += 10 + c - 'a'; + } + else + { + value += 10 + c - 'A'; + } + + if (i & 1) + { + *binaryPtr++ = value; + value = 0; + } + else + { + value <<= 4; + } + } + + return [NSData dataWithData:binaryData]; +} + ++ (NSString *)hexStringFromData:(const unsigned char *)data + ofSize:(unsigned int)size + withSeparator:(NSString *)sep + afterNthChar:(int)sepnth +{ + NSMutableString *result; + NSString *immutableResult; + + result = [[NSMutableString alloc] init]; + for (int i = 0; i < size; i++) + { + if (i && sep && sepnth && i % sepnth == 0) + [result appendString:sep]; + [result appendFormat:@"%02X", data[i]]; + } + + immutableResult = [NSString stringWithString:result]; + [result release]; + return immutableResult; +} + +@end + +#pragma mark Mutable deep copy for dictionary, array and set + +@implementation NSDictionary (TSXAdditions) + +- mutableDeepCopy +{ + NSMutableDictionary *newDictionary = [[NSMutableDictionary alloc] init]; + NSEnumerator *enumerator = [self keyEnumerator]; + id key; + while ((key = [enumerator nextObject])) + { + id obj = [[self objectForKey:key] mutableDeepCopy]; + [newDictionary setObject:obj forKey:key]; + [obj release]; + } + return newDictionary; +} + +@end + +@implementation NSArray (TSXAdditions) + +- mutableDeepCopy +{ + NSMutableArray *newArray = [[NSMutableArray alloc] init]; + NSEnumerator *enumerator = [self objectEnumerator]; + id obj; + while ((obj = [enumerator nextObject])) + { + obj = [obj mutableDeepCopy]; + [newArray addObject:obj]; + [obj release]; + } + return newArray; +} + +@end + +@implementation NSSet (TSXAdditions) + +- mutableDeepCopy +{ + NSMutableSet *newSet = [[NSMutableSet alloc] init]; + NSEnumerator *enumerator = [self objectEnumerator]; + id obj; + while ((obj = [enumerator nextObject])) + { + obj = [obj mutableDeepCopy]; + [newSet addObject:obj]; + [obj release]; + } + return newSet; +} + +@end + +#pragma mark - + +/* Code from + * http://stackoverflow.com/questions/1305225/best-way-to-serialize-a-nsdata-into-an-hexadeximal-string + */ +@implementation NSData (TSXAdditions) + +#pragma mark - String Conversion +- (NSString *)hexadecimalString +{ + /* Returns hexadecimal string of NSData. Empty string if data is empty. */ + + const unsigned char *dataBuffer = (const unsigned char *)[self bytes]; + + if (!dataBuffer) + return [NSString string]; + + NSUInteger dataLength = [self length]; + NSMutableString *hexString = [NSMutableString stringWithCapacity:(dataLength * 2)]; + + for (int i = 0; i < dataLength; ++i) + [hexString appendString:[NSString stringWithFormat:@"%02lx", (unsigned long)dataBuffer[i]]]; + + return [NSString stringWithString:hexString]; +} + +/* Code from http://cocoawithlove.com/2009/06/base64-encoding-options-on-mac-and.html */ +- (NSString *)base64EncodedString +{ + // Construct an OpenSSL context + BIO *context = BIO_new(BIO_s_mem()); + + // Tell the context to encode base64 + BIO *command = BIO_new(BIO_f_base64()); + context = BIO_push(command, context); + BIO_set_flags(context, BIO_FLAGS_BASE64_NO_NL); + + // Encode all the data + ERR_clear_error(); + BIO_write(context, [self bytes], [self length]); + (void)BIO_flush(context); + + // Get the data out of the context + char *outputBuffer; + long outputLength = BIO_get_mem_data(context, &outputBuffer); + NSString *encodedString = [[NSString alloc] initWithBytes:outputBuffer + length:outputLength + encoding:NSASCIIStringEncoding]; + + BIO_free_all(context); + + return encodedString; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Additions/Toast+UIView.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Additions/Toast+UIView.m new file mode 100644 index 0000000000000000000000000000000000000000..38d1bef8747a20b577054a525b08e048bbaa4f3d --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Additions/Toast+UIView.m @@ -0,0 +1,367 @@ +/*************************************************************************** + + Toast+UIView.h + Toast + Version 0.1 + + Copyright (c) 2011 Charles Scalesse. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + ***************************************************************************/ + +#import "Toast+UIView.h" +#import +#import + +#define kMaxWidth 0.8 +#define kMaxHeight 0.8 + +#define kHorizontalPadding 10.0 +#define kVerticalPadding 10.0 +#define kCornerRadius 10.0 +#define kOpacity 0.8 +#define kFontSize 16.0 +#define kMaxTitleLines 999 +#define kMaxMessageLines 999 + +#define kFadeDuration 0.2 + +#define kDefaultLength 3 +#define kDefaultPosition @"bottom" + +#define kImageWidth 80.0 +#define kImageHeight 80.0 + +static NSString *kDurationKey = @"duration"; + +@interface UIView (ToastPrivate) + +- (CGPoint)getPositionFor:(id)position toast:(UIView *)toast; +- (UIView *)makeViewForMessage:(NSString *)message title:(NSString *)title image:(UIImage *)image; + +@end + +@implementation UIView (Toast) + +#pragma mark - +#pragma mark Toast Methods + +- (void)makeToast:(NSString *)message +{ + [self makeToast:message duration:kDefaultLength position:kDefaultPosition]; +} + +- (void)makeToast:(NSString *)message duration:(float)interval position:(id)point +{ + UIView *toast = [self makeViewForMessage:message title:nil image:nil]; + [self showToast:toast duration:interval position:point]; +} + +- (void)makeToast:(NSString *)message + duration:(float)interval + position:(id)point + title:(NSString *)title +{ + UIView *toast = [self makeViewForMessage:message title:title image:nil]; + [self showToast:toast duration:interval position:point]; +} + +- (void)makeToast:(NSString *)message + duration:(float)interval + position:(id)point + image:(UIImage *)image +{ + UIView *toast = [self makeViewForMessage:message title:nil image:image]; + [self showToast:toast duration:interval position:point]; +} + +- (void)makeToast:(NSString *)message + duration:(float)interval + position:(id)point + title:(NSString *)title + image:(UIImage *)image +{ + UIView *toast = [self makeViewForMessage:message title:title image:image]; + [self showToast:toast duration:interval position:point]; +} + +- (void)showToast:(UIView *)toast +{ + [self showToast:toast duration:kDefaultLength position:kDefaultPosition]; +} + +- (void)showToast:(UIView *)toast duration:(float)interval position:(id)point +{ + + /**************************************************** + * * + * Displays a view for a given duration & position. * + * * + ****************************************************/ + + CGPoint toastPoint = [self getPositionFor:point toast:toast]; + + // use an associative reference to associate the toast view with the display interval + objc_setAssociatedObject(toast, &kDurationKey, [NSNumber numberWithFloat:interval], + OBJC_ASSOCIATION_RETAIN); + + [toast setCenter:toastPoint]; + [toast setAlpha:0.0]; + [self addSubview:toast]; + + [UIView beginAnimations:@"fade_in" context:toast]; + [UIView setAnimationDuration:kFadeDuration]; + [UIView setAnimationDelegate:self]; + [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)]; + [UIView setAnimationCurve:UIViewAnimationCurveEaseOut]; + [toast setAlpha:1.0]; + [UIView commitAnimations]; +} + +#pragma mark - +#pragma mark Animation Delegate Method + +- (void)animationDidStop:(NSString *)animationID finished:(BOOL)finished context:(void *)context +{ + + UIView *toast = (UIView *)context; + + // retrieve the display interval associated with the view + float interval = [(NSNumber *)objc_getAssociatedObject(toast, &kDurationKey) floatValue]; + + if ([animationID isEqualToString:@"fade_in"]) + { + + [UIView beginAnimations:@"fade_out" context:toast]; + [UIView setAnimationDelay:interval]; + [UIView setAnimationDuration:kFadeDuration]; + [UIView setAnimationDelegate:self]; + [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)]; + [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; + [toast setAlpha:0.0]; + [UIView commitAnimations]; + } + else if ([animationID isEqualToString:@"fade_out"]) + { + + [toast removeFromSuperview]; + } +} + +#pragma mark - +#pragma mark Private Methods + +- (CGPoint)getPositionFor:(id)point toast:(UIView *)toast +{ + + /************************************************************************************* + * * + * Converts string literals @"top", @"bottom", @"center", or any point wrapped in an * + * NSValue object into a CGPoint * + * * + *************************************************************************************/ + + if ([point isKindOfClass:[NSString class]]) + { + + if ([point caseInsensitiveCompare:@"top"] == NSOrderedSame) + { + return CGPointMake(self.bounds.size.width / 2, + (toast.frame.size.height / 2) + kVerticalPadding); + } + else if ([point caseInsensitiveCompare:@"bottom"] == NSOrderedSame) + { + return CGPointMake(self.bounds.size.width / 2, + (self.bounds.size.height - (toast.frame.size.height / 2)) - + kVerticalPadding); + } + else if ([point caseInsensitiveCompare:@"center"] == NSOrderedSame) + { + return CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2); + } + } + else if ([point isKindOfClass:[NSValue class]]) + { + return [point CGPointValue]; + } + + NSLog(@"Error: Invalid position for toast."); + return [self getPositionFor:kDefaultPosition toast:toast]; +} + +- (UIView *)makeViewForMessage:(NSString *)message title:(NSString *)title image:(UIImage *)image +{ + + /*********************************************************************************** + * * + * Dynamically build a toast view with any combination of message, title, & image. * + * * + ***********************************************************************************/ + + if ((message == nil) && (title == nil) && (image == nil)) + return nil; + + UILabel *messageLabel = nil; + UILabel *titleLabel = nil; + UIImageView *imageView = nil; + + // create the parent view + UIView *wrapperView = [[[UIView alloc] init] autorelease]; + [wrapperView.layer setCornerRadius:kCornerRadius]; + [wrapperView setBackgroundColor:[[UIColor blackColor] colorWithAlphaComponent:kOpacity]]; + wrapperView.autoresizingMask = + UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin | + UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin; + + if (image != nil) + { + imageView = [[[UIImageView alloc] initWithImage:image] autorelease]; + [imageView setContentMode:UIViewContentModeScaleAspectFit]; + [imageView + setFrame:CGRectMake(kHorizontalPadding, kVerticalPadding, kImageWidth, kImageHeight)]; + } + + float imageWidth, imageHeight, imageLeft; + + // the imageView frame values will be used to size & position the other views + if (imageView != nil) + { + imageWidth = imageView.bounds.size.width; + imageHeight = imageView.bounds.size.height; + imageLeft = kHorizontalPadding; + } + else + { + imageWidth = imageHeight = imageLeft = 0; + } + + if (title != nil) + { + titleLabel = [[[UILabel alloc] init] autorelease]; + [titleLabel setNumberOfLines:kMaxTitleLines]; + [titleLabel setFont:[UIFont boldSystemFontOfSize:kFontSize]]; + [titleLabel setTextAlignment:UITextAlignmentLeft]; + [titleLabel setLineBreakMode:UILineBreakModeWordWrap]; + [titleLabel setTextColor:[UIColor whiteColor]]; + [titleLabel setBackgroundColor:[UIColor clearColor]]; + [titleLabel setAlpha:1.0]; + [titleLabel setText:title]; + + // size the title label according to the length of the text + CGSize maxSizeTitle = CGSizeMake((self.bounds.size.width * kMaxWidth) - imageWidth, + self.bounds.size.height * kMaxHeight); + CGSize expectedSizeTitle = [title sizeWithFont:titleLabel.font + constrainedToSize:maxSizeTitle + lineBreakMode:titleLabel.lineBreakMode]; + [titleLabel setFrame:CGRectMake(0, 0, expectedSizeTitle.width, expectedSizeTitle.height)]; + } + + if (message != nil) + { + messageLabel = [[[UILabel alloc] init] autorelease]; + [messageLabel setNumberOfLines:kMaxMessageLines]; + [messageLabel setFont:[UIFont systemFontOfSize:kFontSize]]; + [messageLabel setLineBreakMode:UILineBreakModeWordWrap]; + [messageLabel setTextColor:[UIColor whiteColor]]; + [messageLabel setTextAlignment:UITextAlignmentCenter]; + [messageLabel setBackgroundColor:[UIColor clearColor]]; + [messageLabel setAlpha:1.0]; + [messageLabel setText:message]; + + // size the message label according to the length of the text + CGSize maxSizeMessage = CGSizeMake((self.bounds.size.width * kMaxWidth) - imageWidth, + self.bounds.size.height * kMaxHeight); + CGSize expectedSizeMessage = [message sizeWithFont:messageLabel.font + constrainedToSize:maxSizeMessage + lineBreakMode:messageLabel.lineBreakMode]; + [messageLabel + setFrame:CGRectMake(0, 0, expectedSizeMessage.width, expectedSizeMessage.height)]; + } + + // titleLabel frame values + float titleWidth, titleHeight, titleTop, titleLeft; + + if (titleLabel != nil) + { + titleWidth = titleLabel.bounds.size.width; + titleHeight = titleLabel.bounds.size.height; + titleTop = kVerticalPadding; + titleLeft = imageLeft + imageWidth + kHorizontalPadding; + } + else + { + titleWidth = titleHeight = titleTop = titleLeft = 0; + } + + // messageLabel frame values + float messageWidth, messageHeight, messageLeft, messageTop; + + if (messageLabel != nil) + { + messageWidth = messageLabel.bounds.size.width; + messageHeight = messageLabel.bounds.size.height; + messageLeft = imageLeft + imageWidth + kHorizontalPadding; + messageTop = titleTop + titleHeight + kVerticalPadding; + } + else + { + messageWidth = messageHeight = messageLeft = messageTop = 0; + } + + // compare the title & message widths and use the longer value to calculate the size of the + // wrapper width the same logic applies to the x value (left) + float longerWidth = (messageWidth < titleWidth) ? titleWidth : messageWidth; + float longerLeft = (messageLeft < titleLeft) ? titleLeft : messageLeft; + + // if the image width is larger than longerWidth, use the image width to calculate the wrapper + // width. the same logic applies to the wrapper height + float wrapperWidth = + ((longerLeft + longerWidth + kHorizontalPadding) < imageWidth + (kHorizontalPadding * 2)) + ? imageWidth + (kHorizontalPadding * 2) + : (longerLeft + longerWidth + kHorizontalPadding); + float wrapperHeight = + ((messageTop + messageHeight + kVerticalPadding) < imageHeight + (kVerticalPadding * 2)) + ? imageHeight + (kVerticalPadding * 2) + : (messageTop + messageHeight + kVerticalPadding); + + [wrapperView setFrame:CGRectMake(0, 0, wrapperWidth, wrapperHeight)]; + + if (titleLabel != nil) + { + [titleLabel setFrame:CGRectMake(titleLeft, titleTop, titleWidth, titleHeight)]; + [wrapperView addSubview:titleLabel]; + } + + if (messageLabel != nil) + { + [messageLabel setFrame:CGRectMake(messageLeft, messageTop, messageWidth, messageHeight)]; + [wrapperView addSubview:messageLabel]; + } + + if (imageView != nil) + { + [wrapperView addSubview:imageView]; + } + + return wrapperView; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/AppDelegate.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/AppDelegate.m new file mode 100644 index 0000000000000000000000000000000000000000..b964593fb3a16d523a7b0c437c46ef395f12fe7c --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/AppDelegate.m @@ -0,0 +1,127 @@ +/* + App delegate + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "AppDelegate.h" + +#import "AboutController.h" +#import "HelpController.h" +#import "BookmarkListController.h" +#import "AppSettingsController.h" +#import "MainTabBarController.h" +#import "Utils.h" + +@implementation AppDelegate + +@synthesize window = _window, tabBarController = _tabBarController; + +- (BOOL)application:(UIApplication *)application + didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Set default values for most NSUserDefaults + [[NSUserDefaults standardUserDefaults] + registerDefaults:[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] + pathForResource:@"Defaults" + ofType:@"plist"]]]; + + // init global settings + SetSwapMouseButtonsFlag( + [[NSUserDefaults standardUserDefaults] boolForKey:@"ui.swap_mouse_buttons"]); + SetInvertScrollingFlag( + [[NSUserDefaults standardUserDefaults] boolForKey:@"ui.invert_scrolling"]); + + // create bookmark view and navigation controller + BookmarkListController *bookmarkListController = + [[[BookmarkListController alloc] initWithNibName:@"BookmarkListView" + bundle:nil] autorelease]; + UINavigationController *bookmarkNavigationController = [[[UINavigationController alloc] + initWithRootViewController:bookmarkListController] autorelease]; + + // create app settings view and navigation controller + AppSettingsController *appSettingsController = + [[[AppSettingsController alloc] initWithStyle:UITableViewStyleGrouped] autorelease]; + UINavigationController *appSettingsNavigationController = [[[UINavigationController alloc] + initWithRootViewController:appSettingsController] autorelease]; + + // create help view controller + HelpController *helpViewController = [[[HelpController alloc] initWithNibName:nil + bundle:nil] autorelease]; + + // create about view controller + AboutController *aboutViewController = + [[[AboutController alloc] initWithNibName:nil bundle:nil] autorelease]; + + // add tab-bar controller to the main window and display everything + NSArray *tabItems = + [NSArray arrayWithObjects:bookmarkNavigationController, appSettingsNavigationController, + helpViewController, aboutViewController, nil]; + [_tabBarController setViewControllers:tabItems]; + if ([_window respondsToSelector:@selector(setRootViewController:)]) + [_window setRootViewController:_tabBarController]; + else + [_window addSubview:[_tabBarController view]]; + [_window makeKeyAndVisible]; + + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application +{ + /* + Sent when the application is about to move from active to inactive state. This can occur for + certain types of temporary interruptions (such as an incoming phone call or SMS message) or + when the user quits the application and it begins the transition to the background state. Use + this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. + Games should use this method to pause the game. + */ +} + +- (void)applicationDidEnterBackground:(UIApplication *)application +{ + /* + Use this method to release shared resources, save user data, invalidate timers, and store + enough application state information to restore your application to its current state in case + it is terminated later. If your application supports background execution, this method is + called instead of applicationWillTerminate: when the user quits. + */ +} + +- (void)applicationWillEnterForeground:(UIApplication *)application +{ + /* + Called as part of the transition from the background to the inactive state; here you can undo + many of the changes made on entering the background. + */ + // cancel disconnect timer +} + +- (void)applicationDidBecomeActive:(UIApplication *)application +{ + /* + Restart any tasks that were paused (or not yet started) while the application was inactive. If + the application was previously in the background, optionally refresh the user interface. + */ +} + +- (void)applicationWillTerminate:(UIApplication *)application +{ + /* + Called when the application is about to terminate. + Save data if appropriate. + See also applicationDidEnterBackground:. + */ +} + +- (void)dealloc +{ + [_window release]; + [super dealloc]; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AboutController.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AboutController.h new file mode 100644 index 0000000000000000000000000000000000000000..7af340c74e557a3430d4369345136e181f04744c --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AboutController.h @@ -0,0 +1,19 @@ +/* + Application info controller + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import + +@interface AboutController : UIViewController +{ + NSString *last_link_clicked; + UIWebView *webView; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AboutController.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AboutController.m new file mode 100644 index 0000000000000000000000000000000000000000..1d7f8a2ad814cd79b10d39956cfbc6fd009afbba --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AboutController.m @@ -0,0 +1,120 @@ +/* + Application info controller + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "AboutController.h" +#import "Utils.h" +#import "BlockAlertView.h" + +@implementation AboutController + +// The designated initializer. Override if you create the controller programmatically and want to +// perform customization that is not appropriate for viewDidLoad. +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) + { + + // set title and tab-bar image + [self setTitle:NSLocalizedString(@"About", @"About Controller title")]; + UIImage *tabBarIcon = [UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"tabbar_icon_about" + ofType:@"png"]]; + [self setTabBarItem:[[[UITabBarItem alloc] + initWithTitle:NSLocalizedString(@"About", @"Tabbar item about") + image:tabBarIcon + tag:0] autorelease]]; + + last_link_clicked = nil; + } + return self; +} + +- (void)dealloc +{ + [super dealloc]; + [last_link_clicked release]; +} + +// Implement loadView to create a view hierarchy programmatically, without using a nib. +- (void)loadView +{ + webView = [[[UIWebView alloc] initWithFrame:CGRectZero] autorelease]; + [webView + setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [webView setAutoresizesSubviews:YES]; + [webView setDelegate:self]; + [webView setDataDetectorTypes:UIDataDetectorTypeNone]; + [self setView:webView]; +} + +// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. +- (void)viewDidLoad +{ + [super viewDidLoad]; + + NSString *filename = (IsPhone() ? @"about_phone" : @"about"); + NSString *htmlString = [[[NSString alloc] + initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:filename + ofType:@"html" + inDirectory:@"about_page"] + encoding:NSUTF8StringEncoding + error:nil] autorelease]; + + [webView + loadHTMLString:[NSString stringWithFormat:htmlString, TSXAppFullVersion(), + [[UIDevice currentDevice] systemName], + [[UIDevice currentDevice] systemVersion], + [[UIDevice currentDevice] model]] + baseURL:[NSURL fileURLWithPath:[[[NSBundle mainBundle] bundlePath] + stringByAppendingPathComponent:@"about_page"]]]; +} + +// Override to allow orientations other than the default portrait orientation. +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +#pragma mark - +#pragma mark UIWebView callbacks +- (BOOL)webView:(UIWebView *)webView + shouldStartLoadWithRequest:(NSURLRequest *)request + navigationType:(UIWebViewNavigationType)navigationType +{ + if ([[request URL] isFileURL]) + return YES; + + if (navigationType == UIWebViewNavigationTypeLinkClicked) + { + [last_link_clicked release]; + last_link_clicked = [[[request URL] absoluteString] retain]; + BlockAlertView *alert = [BlockAlertView + alertWithTitle:NSLocalizedString(@"External Link", @"External Link Alert Title") + message:[NSString stringWithFormat: + NSLocalizedString( + @"Open [%@] in Browser?", + @"Open link in browser (with link as parameter)"), + last_link_clicked]]; + + [alert setCancelButtonWithTitle:NSLocalizedString(@"No", @"No Button") block:nil]; + [alert addButtonWithTitle:NSLocalizedString(@"OK", @"OK Button") + block:^{ + [[UIApplication sharedApplication] + openURL:[NSURL URLWithString:last_link_clicked]]; + }]; + + [alert show]; + + return NO; + } + return YES; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AdvancedBookmarkEditorController.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AdvancedBookmarkEditorController.h new file mode 100644 index 0000000000000000000000000000000000000000..1257d46de1204aeab5d930ac8bce0e5845d76367 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AdvancedBookmarkEditorController.h @@ -0,0 +1,26 @@ +/* + Controller to edit advanced bookmark settings + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "EditorBaseController.h" + +@class ComputerBookmark; +@class ConnectionParams; + +@interface AdvancedBookmarkEditorController : EditorBaseController +{ + @private + ComputerBookmark *_bookmark; + ConnectionParams *_params; +} + +// init for the given bookmark +- (id)initWithBookmark:(ComputerBookmark *)bookmark; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AdvancedBookmarkEditorController.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AdvancedBookmarkEditorController.m new file mode 100644 index 0000000000000000000000000000000000000000..2b02ce251fde9109d0d525cc45487b43113ef034 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AdvancedBookmarkEditorController.m @@ -0,0 +1,407 @@ +/* + Controller to edit advanced bookmark settings + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "AdvancedBookmarkEditorController.h" +#import "Bookmark.h" +#import "Utils.h" +#import "EditorSelectionController.h" +#import "ScreenSelectionController.h" +#import "PerformanceEditorController.h" +#import "BookmarkGatewaySettingsController.h" + +@interface AdvancedBookmarkEditorController () + +@end + +#define SECTION_ADVANCED_SETTINGS 0 +#define SECTION_COUNT 1 + +@implementation AdvancedBookmarkEditorController + +- (id)initWithBookmark:(ComputerBookmark *)bookmark +{ + if ((self = [super initWithStyle:UITableViewStyleGrouped])) + { + // set additional settings state according to bookmark data + _bookmark = [bookmark retain]; + _params = [bookmark params]; + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + [self setTitle:NSLocalizedString(@"Advanced Settings", @"Advanced Settings title")]; +} + +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + + // we need to reload the table view data here to have up-to-date data for the + // advanced settings accessory items (like for resolution/color mode settings) + [[self tableView] reloadData]; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +#pragma mark - +#pragma mark Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + // Return the number of sections. + return SECTION_COUNT; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + // Return the number of rows in the section. + switch (section) + { + case SECTION_ADVANCED_SETTINGS: // advanced settings + return 9; + default: + break; + } + + return 0; +} + +// set section headers +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + switch (section) + { + case SECTION_ADVANCED_SETTINGS: + return NSLocalizedString(@"Advanced", @"'Advanced': advanced settings header"); + } + return @"unknown"; +} + +// Customize the appearance of table view cells. +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + + // determine the required cell type + NSString *cellType = nil; + switch ([indexPath section]) + { + case SECTION_ADVANCED_SETTINGS: // advanced settings + { + switch ([indexPath row]) + { + case 0: // Enable/Disable TSG Settings + cellType = TableCellIdentifierYesNo; + break; + case 1: // TS Gateway Settings + cellType = TableCellIdentifierSubEditor; + break; + case 2: // 3G Settings + cellType = TableCellIdentifierYesNo; + break; + case 3: // 3G screen/color depth + cellType = TableCellIdentifierSelection; + break; + case 4: // 3G performance settings + cellType = TableCellIdentifierSubEditor; + break; + case 5: // security mode + cellType = TableCellIdentifierSelection; + break; + case 6: // remote program + case 7: // work dir + cellType = TableCellIdentifierText; + break; + case 8: // console mode + cellType = TableCellIdentifierYesNo; + break; + default: + break; + } + break; + } + } + NSAssert(cellType != nil, @"Couldn't determine cell type"); + + // get the table view cell + UITableViewCell *cell = [self tableViewCellFromIdentifier:cellType]; + NSAssert(cell, @"Invalid cell"); + + // set cell values + switch ([indexPath section]) + { + // advanced settings + case SECTION_ADVANCED_SETTINGS: + [self initAdvancedSettings:indexPath cell:cell]; + break; + + default: + break; + } + + return cell; +} + +// updates advanced settings in the UI +- (void)initAdvancedSettings:(NSIndexPath *)indexPath cell:(UITableViewCell *)cell +{ + BOOL enable_3G_settings = [_params boolForKey:@"enable_3g_settings"]; + switch (indexPath.row) + { + case 0: + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] + setText:NSLocalizedString(@"Enable TS Gateway", + @"'Enable TS Gateway': Bookmark enable TSG settings")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] setOn:[_params boolForKey:@"enable_tsg_settings"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; + break; + } + case 1: + { + BOOL enable_tsg_settings = [_params boolForKey:@"enable_tsg_settings"]; + EditSubEditTableViewCell *editCell = (EditSubEditTableViewCell *)cell; + [[editCell label] + setText:NSLocalizedString(@"TS Gateway Settings", + @"'TS Gateway Settings': Bookmark TS Gateway Settings")]; + [[editCell label] setEnabled:enable_tsg_settings]; + [editCell setSelectionStyle:enable_tsg_settings ? UITableViewCellSelectionStyleBlue + : UITableViewCellSelectionStyleNone]; + break; + } + case 2: + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] + setText:NSLocalizedString(@"3G Settings", + @"'3G Settings': Bookmark enable 3G settings")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] setOn:[_params boolForKey:@"enable_3g_settings"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; + break; + } + case 3: + { + EditSelectionTableViewCell *selCell = (EditSelectionTableViewCell *)cell; + [[selCell label] + setText:NSLocalizedString(@"3G Screen", + @"'3G Screen': Bookmark 3G Screen settings")]; + NSString *resolution = ScreenResolutionDescription( + [_params intForKeyPath:@"settings_3g.screen_resolution_type"], + [_params intForKeyPath:@"settings_3g.width"], + [_params intForKeyPath:@"settings_3g.height"]); + int colorBits = [_params intForKeyPath:@"settings_3g.colors"]; + [[selCell selection] + setText:[NSString stringWithFormat:@"%@@%d", resolution, colorBits]]; + [[selCell label] setEnabled:enable_3G_settings]; + [[selCell selection] setEnabled:enable_3G_settings]; + [selCell setSelectionStyle:enable_3G_settings ? UITableViewCellSelectionStyleBlue + : UITableViewCellSelectionStyleNone]; + break; + } + case 4: + { + EditSubEditTableViewCell *editCell = (EditSubEditTableViewCell *)cell; + [[editCell label] + setText:NSLocalizedString(@"3G Performance", + @"'3G Performance': Bookmark 3G Performance Settings")]; + [[editCell label] setEnabled:enable_3G_settings]; + [editCell setSelectionStyle:enable_3G_settings ? UITableViewCellSelectionStyleBlue + : UITableViewCellSelectionStyleNone]; + break; + } + case 5: + { + EditSelectionTableViewCell *selCell = (EditSelectionTableViewCell *)cell; + [[selCell label] + setText:NSLocalizedString(@"Security", + @"'Security': Bookmark protocol security settings")]; + [[selCell selection] + setText:ProtocolSecurityDescription([_params intForKey:@"security"])]; + break; + } + case 6: + { + EditTextTableViewCell *textCell = (EditTextTableViewCell *)cell; + [[textCell label] + setText:NSLocalizedString(@"Remote Program", + @"'Remote Program': Bookmark remote program settings")]; + [[textCell textfield] setText:[_params StringForKey:@"remote_program"]]; + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + [self adjustEditTextTableViewCell:textCell]; + break; + } + case 7: + { + EditTextTableViewCell *textCell = (EditTextTableViewCell *)cell; + [[textCell label] + setText:NSLocalizedString( + @"Working Directory", + @"'Working Directory': Bookmark working directory settings")]; + [[textCell textfield] setText:[_params StringForKey:@"working_dir"]]; + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + [self adjustEditTextTableViewCell:textCell]; + break; + } + case 8: + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] + setText:NSLocalizedString(@"Console Mode", + @"'Console Mode': Bookmark console mode settings")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] setOn:[_params boolForKey:@"console"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; + break; + } + default: + NSLog(@"Invalid row index in settings table!"); + break; + } +} + +#pragma mark - +#pragma mark Table view delegate + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + UIViewController *viewCtrl = nil; + + // determine view + switch ([indexPath row]) + { + case 1: + if ([_params boolForKey:@"enable_tsg_settings"]) + viewCtrl = [[[BookmarkGatewaySettingsController alloc] initWithBookmark:_bookmark] + autorelease]; + break; + case 3: + if ([_params boolForKey:@"enable_3g_settings"]) + viewCtrl = [[[ScreenSelectionController alloc] + initWithConnectionParams:_params + keyPath:@"settings_3g"] autorelease]; + break; + case 4: + if ([_params boolForKey:@"enable_3g_settings"]) + viewCtrl = [[[PerformanceEditorController alloc] + initWithConnectionParams:_params + keyPath:@"settings_3g"] autorelease]; + break; + case 5: + viewCtrl = [[[EditorSelectionController alloc] + initWithConnectionParams:_params + entries:[NSArray arrayWithObject:@"security"] + selections:[NSArray arrayWithObject:SelectionForSecuritySetting()]] + autorelease]; + break; + default: + break; + } + + // display view + if (viewCtrl) + [[self navigationController] pushViewController:viewCtrl animated:YES]; +} + +#pragma mark - +#pragma mark Text Field delegate + +- (BOOL)textFieldShouldReturn:(UITextField *)textField +{ + [textField resignFirstResponder]; + return NO; +} + +- (BOOL)textFieldShouldEndEditing:(UITextField *)textField +{ + switch (textField.tag) + { + // update remote program/work dir settings + case GET_TAG(SECTION_ADVANCED_SETTINGS, 6): + { + [_params setValue:[textField text] forKey:@"remote_program"]; + break; + } + + case GET_TAG(SECTION_ADVANCED_SETTINGS, 7): + { + [_params setValue:[textField text] forKey:@"working_dir"]; + break; + } + + default: + break; + } + return YES; +} + +#pragma mark - Action handlers + +- (void)toggleSettingValue:(id)sender +{ + UISwitch *valueSwitch = (UISwitch *)sender; + switch (valueSwitch.tag) + { + case GET_TAG(SECTION_ADVANCED_SETTINGS, 0): + { + [_params setBool:[valueSwitch isOn] forKey:@"enable_tsg_settings"]; + NSArray *indexPaths = + [NSArray arrayWithObjects:[NSIndexPath indexPathForRow:1 + inSection:SECTION_ADVANCED_SETTINGS], + [NSIndexPath indexPathForRow:2 + inSection:SECTION_ADVANCED_SETTINGS], + nil]; + [[self tableView] reloadRowsAtIndexPaths:indexPaths + withRowAnimation:UITableViewRowAnimationNone]; + break; + } + + case GET_TAG(SECTION_ADVANCED_SETTINGS, 2): + { + [_params setBool:[valueSwitch isOn] forKey:@"enable_3g_settings"]; + NSArray *indexPaths = + [NSArray arrayWithObjects:[NSIndexPath indexPathForRow:3 + inSection:SECTION_ADVANCED_SETTINGS], + [NSIndexPath indexPathForRow:2 + inSection:SECTION_ADVANCED_SETTINGS], + nil]; + [[self tableView] reloadRowsAtIndexPaths:indexPaths + withRowAnimation:UITableViewRowAnimationNone]; + break; + } + + case GET_TAG(SECTION_ADVANCED_SETTINGS, 8): + [_params setBool:[valueSwitch isOn] forKey:@"console"]; + break; + + default: + break; + } +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AppSettingsController.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AppSettingsController.h new file mode 100644 index 0000000000000000000000000000000000000000..4de1271b0ed59b382d1143a06d6e12815681d6a6 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AppSettingsController.h @@ -0,0 +1,15 @@ +/* + Controller to specify application wide settings + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "EditorBaseController.h" + +@interface AppSettingsController : EditorBaseController + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AppSettingsController.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AppSettingsController.m new file mode 100644 index 0000000000000000000000000000000000000000..2a18f2b8730b7ffbb4b29c0d388656f9c014d611 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/AppSettingsController.m @@ -0,0 +1,360 @@ +/* + Controller to specify application wide settings + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "AppSettingsController.h" +#import "Utils.h" +#import "Toast+UIView.h" + +@implementation AppSettingsController + +// keep this up-to-date for correct section display/hiding +#define SECTION_UI_SETTINGS 0 +#define SECTION_CERTIFICATE_HANDLING_SETTINGS 1 +#define SECTION_NUM_SECTIONS 2 + +#pragma mark - +#pragma mark Initialization + +- (id)initWithStyle:(UITableViewStyle)style +{ + if ((self = [super initWithStyle:style])) + { + UIImage *tabBarIcon = [UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"tabbar_icon_settings" + ofType:@"png"]]; + [self + setTabBarItem:[[[UITabBarItem alloc] + initWithTitle:NSLocalizedString(@"Settings", @"Tabbar item settings") + image:tabBarIcon + tag:0] autorelease]]; + } + return self; +} + +#pragma mark - +#pragma mark View lifecycle + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + // set title + [self setTitle:NSLocalizedString(@"Settings", @"App Settings title")]; +} + +- (void)viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; +} + +// Override to allow orientations other than the default portrait orientation. +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [super dealloc]; +} + +#pragma mark - +#pragma mark Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + // Return the number of sections. + return SECTION_NUM_SECTIONS; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + // Return the number of rows in the section. + switch (section) + { + case SECTION_UI_SETTINGS: // UI settings + return 5; + case SECTION_CERTIFICATE_HANDLING_SETTINGS: // certificate handling settings + return 2; + default: + break; + } + + return 0; +} + +// set section headers +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + switch (section) + { + case SECTION_UI_SETTINGS: + return NSLocalizedString(@"User Interface", @"UI settings section title"); + case SECTION_CERTIFICATE_HANDLING_SETTINGS: + return NSLocalizedString(@"Server Certificate Handling", + @"Server Certificate Handling section title"); + default: + return nil; + } + return @"unknown"; +} + +// Customize the appearance of table view cells. +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + + // determine the required cell type + NSString *cellIdentifier = nil; + switch ([indexPath section]) + { + case SECTION_UI_SETTINGS: + { + switch ([indexPath row]) + { + case 0: + case 1: + case 2: + case 3: + case 4: + cellIdentifier = TableCellIdentifierYesNo; + break; + } + break; + } + case SECTION_CERTIFICATE_HANDLING_SETTINGS: + { + switch ([indexPath row]) + { + case 0: + cellIdentifier = TableCellIdentifierYesNo; + break; + case 1: + cellIdentifier = TableCellIdentifierSubEditor; + break; + } + break; + } + } + NSAssert(cellIdentifier != nil, @"Couldn't determine cell type"); + + // get the table view cell + UITableViewCell *cell = [self tableViewCellFromIdentifier:cellIdentifier]; + NSAssert(cell, @"Invalid cell"); + + // set cell values + switch ([indexPath section]) + { + case SECTION_UI_SETTINGS: + [self initUISettings:indexPath cell:cell]; + break; + + case SECTION_CERTIFICATE_HANDLING_SETTINGS: + [self initCertificateHandlingSettings:indexPath cell:cell]; + break; + + default: + break; + } + + return cell; +} + +#pragma mark - Initialization helpers + +// updates UI settings in the UI +- (void)initUISettings:(NSIndexPath *)indexPath cell:(UITableViewCell *)cell +{ + switch ([indexPath row]) + { + case 0: + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] setText:NSLocalizedString(@"Hide Status Bar", + "Show/Hide Phone Status Bar setting")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] + setOn:[[NSUserDefaults standardUserDefaults] boolForKey:@"ui.hide_status_bar"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; + break; + } + case 1: + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] + setText:NSLocalizedString(@"Hide Tool Bar", "Show/Hide Tool Bar setting")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] + setOn:[[NSUserDefaults standardUserDefaults] boolForKey:@"ui.hide_tool_bar"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; + break; + } + case 2: + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] + setText:NSLocalizedString(@"Swap Mouse Buttons", "Swap Mouse Button UI setting")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] + setOn:[[NSUserDefaults standardUserDefaults] boolForKey:@"ui.swap_mouse_buttons"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; + break; + } + case 3: + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] + setText:NSLocalizedString(@"Invert Scrolling", "Invert Scrolling UI setting")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] + setOn:[[NSUserDefaults standardUserDefaults] boolForKey:@"ui.invert_scrolling"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; + break; + } + case 4: + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] setText:NSLocalizedString(@"Touch Pointer Auto Scroll", + "Touch Pointer Auto Scroll UI setting")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] setOn:[[NSUserDefaults standardUserDefaults] + boolForKey:@"ui.auto_scroll_touchpointer"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; + break; + } + default: + NSLog(@"Invalid row index in settings table!"); + break; + } +} + +// updates certificate handling settings in the UI +- (void)initCertificateHandlingSettings:(NSIndexPath *)indexPath cell:(UITableViewCell *)cell +{ + switch ([indexPath row]) + { + case 0: + { + EditFlagTableViewCell *flagCell = (EditFlagTableViewCell *)cell; + [[flagCell label] setText:NSLocalizedString(@"Accept all Certificates", + "Accept All Certificates setting")]; + [[flagCell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[flagCell toggle] setOn:[[NSUserDefaults standardUserDefaults] + boolForKey:@"security.accept_certificates"]]; + [[flagCell toggle] addTarget:self + action:@selector(toggleSettingValue:) + forControlEvents:UIControlEventValueChanged]; + break; + } + case 1: + { + EditSubEditTableViewCell *subCell = (EditSubEditTableViewCell *)cell; + [[subCell label] setText:NSLocalizedString(@"Erase Certificate Cache", + @"Erase certificate cache button")]; + break; + } + default: + NSLog(@"Invalid row index in settings table!"); + break; + } +} + +#pragma mark - +#pragma mark Table view delegate + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + + // deselect any row to fake a button-pressed like effect + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + + // ensure everything is stored in our settings before we proceed + [[self view] endEditing:NO]; + + // clear certificate cache + if ([indexPath section] == SECTION_CERTIFICATE_HANDLING_SETTINGS && [indexPath row] == 1) + { + // delete certificates cache + NSError *err; + if ([[NSFileManager defaultManager] + removeItemAtPath:[[NSSearchPathForDirectoriesInDomains( + NSDocumentDirectory, NSUserDomainMask, YES) lastObject] + stringByAppendingPathComponent:@"/.freerdp"] + error:&err]) + [[self view] makeToast:NSLocalizedString(@"Certificate Cache cleared!", + @"Clear Certificate cache success message") + duration:ToastDurationNormal + position:@"center"]; + else + [[self view] makeToast:NSLocalizedString(@"Error clearing the Certificate Cache!", + @"Clear Certificate cache failed message") + duration:ToastDurationNormal + position:@"center"]; + } +} + +#pragma mark - +#pragma mark Action Handlers + +- (void)toggleSettingValue:(id)sender +{ + UISwitch *valueSwitch = (UISwitch *)sender; + switch ([valueSwitch tag]) + { + case GET_TAG(SECTION_UI_SETTINGS, 0): + [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] + forKey:@"ui.hide_status_bar"]; + break; + + case GET_TAG(SECTION_UI_SETTINGS, 1): + [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] + forKey:@"ui.hide_tool_bar"]; + break; + + case GET_TAG(SECTION_UI_SETTINGS, 2): + [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] + forKey:@"ui.swap_mouse_buttons"]; + SetSwapMouseButtonsFlag([valueSwitch isOn]); + break; + + case GET_TAG(SECTION_UI_SETTINGS, 3): + [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] + forKey:@"ui.invert_scrolling"]; + SetInvertScrollingFlag([valueSwitch isOn]); + break; + + case GET_TAG(SECTION_UI_SETTINGS, 4): + [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] + forKey:@"ui.auto_scroll_touchpointer"]; + SetInvertScrollingFlag([valueSwitch isOn]); + break; + + case GET_TAG(SECTION_CERTIFICATE_HANDLING_SETTINGS, 0): + [[NSUserDefaults standardUserDefaults] setBool:[valueSwitch isOn] + forKey:@"security.accept_certificates"]; + break; + + default: + break; + } +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkEditorController.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkEditorController.h new file mode 100644 index 0000000000000000000000000000000000000000..c0c26f934480def62a1c98c5ca5e78565fa0594e --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkEditorController.h @@ -0,0 +1,38 @@ +/* + Bookmark editor controller + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import +#import "EditorBaseController.h" + +@class ComputerBookmark; +@class ConnectionParams; + +@protocol BookmarkEditorDelegate +// bookmark editing finished +- (void)commitBookmark:(ComputerBookmark *)bookmark; +@end + +@interface BookmarkEditorController : EditorBaseController +{ + @private + ComputerBookmark *_bookmark; + ConnectionParams *_params; + + BOOL _display_server_settings; + + id delegate; +} + +@property(nonatomic, assign) id delegate; + +// init for the given bookmark +- (id)initWithBookmark:(ComputerBookmark *)bookmark; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkEditorController.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkEditorController.m new file mode 100644 index 0000000000000000000000000000000000000000..de49e3e86e6bb9bc0ddd53cd4978818b58522da8 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkEditorController.m @@ -0,0 +1,427 @@ +/* + Bookmark editor controller + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "BookmarkEditorController.h" +#import "Bookmark.h" +#import "Utils.h" +#import "ScreenSelectionController.h" +#import "PerformanceEditorController.h" +#import "CredentialsEditorController.h" +#import "AdvancedBookmarkEditorController.h" +#import "BlockAlertView.h" + +@implementation BookmarkEditorController + +@synthesize delegate; + +#define SECTION_SERVER 0 +#define SECTION_CREDENTIALS 1 +#define SECTION_SETTINGS 2 +#define SECTION_COUNT 3 + +#pragma mark - +#pragma mark Initialization + +- (id)initWithBookmark:(ComputerBookmark *)bookmark +{ + if ((self = [super initWithStyle:UITableViewStyleGrouped])) + { + // set additional settings state according to bookmark data + if ([[bookmark uuid] length] == 0) + _bookmark = [bookmark copy]; + else + _bookmark = [bookmark copyWithUUID]; + _params = [_bookmark params]; + + _display_server_settings = YES; + } + return self; +} + +#pragma mark - +#pragma mark View lifecycle + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + // replace back button with a custom handler that checks if the required bookmark settings were + // specified + UIBarButtonItem *saveButton = + [[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Save", @"Save Button title") + style:UIBarButtonItemStyleDone + target:self + action:@selector(handleSave:)] autorelease]; + UIBarButtonItem *cancelButton = + [[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Cancel", @"Cancel Button title") + style:UIBarButtonItemStyleBordered + target:self + action:@selector(handleCancel:)] autorelease]; + [[self navigationItem] setLeftBarButtonItem:cancelButton]; + [[self navigationItem] setRightBarButtonItem:saveButton]; +} + +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + + // we need to reload the table view data here to have up-to-date data for the + // advanced settings accessory items (like for resolution/color mode settings) + [[self tableView] reloadData]; +} + +// Override to allow orientations other than the default portrait orientation. +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +#pragma mark - +#pragma mark Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + // Return the number of sections. + return SECTION_COUNT; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + // Return the number of rows in the section. + switch (section) + { + case SECTION_SERVER: // server settings + return (_display_server_settings ? 3 : 0); + case SECTION_CREDENTIALS: // credentials + return 1; + case SECTION_SETTINGS: // session settings + return 3; + default: + break; + } + + return 0; +} + +// set section headers +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + switch (section) + { + case SECTION_SERVER: + return (_display_server_settings + ? NSLocalizedString(@"Host", @"'Host': host settings header") + : nil); + case SECTION_CREDENTIALS: + return NSLocalizedString(@"Credentials", @"'Credentials': credentials settings header"); + case SECTION_SETTINGS: + return NSLocalizedString(@"Settings", @"'Session Settings': session settings header"); + } + return @"unknown"; +} + +// Customize the appearance of table view cells. +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + + // determine the required cell type + NSString *cellType = nil; + switch ([indexPath section]) + { + case SECTION_SERVER: + cellType = TableCellIdentifierText; + break; + + case SECTION_CREDENTIALS: + cellType = TableCellIdentifierSelection; + break; + + case SECTION_SETTINGS: // settings + { + switch ([indexPath row]) + { + case 0: // screen/color depth + cellType = TableCellIdentifierSelection; + break; + case 1: // performance settings + case 2: // advanced settings + cellType = TableCellIdentifierSubEditor; + break; + default: + break; + } + } + break; + + default: + break; + } + NSAssert(cellType != nil, @"Couldn't determine cell type"); + + // get the table view cell + UITableViewCell *cell = [self tableViewCellFromIdentifier:cellType]; + NSAssert(cell, @"Invalid cell"); + + // set cell values + switch ([indexPath section]) + { + // server settings + case SECTION_SERVER: + [self initServerSettings:indexPath cell:cell]; + break; + + // credentials + case SECTION_CREDENTIALS: + [self initCredentialSettings:indexPath cell:cell]; + break; + + // session settings + case SECTION_SETTINGS: + [self initSettings:indexPath cell:cell]; + break; + + default: + break; + } + + return cell; +} + +// updates server settings in the UI +- (void)initServerSettings:(NSIndexPath *)indexPath cell:(UITableViewCell *)cell +{ + EditTextTableViewCell *textCell = (EditTextTableViewCell *)cell; + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + switch ([indexPath row]) + { + case 0: + [[textCell label] setText:NSLocalizedString(@"Label", @"'Label': Bookmark label")]; + [[textCell textfield] setText:[_bookmark label]]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + break; + case 1: + [[textCell label] setText:NSLocalizedString(@"Host", @"'Host': Bookmark hostname")]; + [[textCell textfield] setText:[_params StringForKey:@"hostname"]]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + break; + case 2: + [[textCell label] setText:NSLocalizedString(@"Port", @"'Port': Bookmark port")]; + [[textCell textfield] + setText:[NSString stringWithFormat:@"%d", [_params intForKey:@"port"]]]; + [[textCell textfield] setKeyboardType:UIKeyboardTypeNumberPad]; + break; + default: + NSLog(@"Invalid row index in settings table!"); + break; + } + + [self adjustEditTextTableViewCell:textCell]; +} + +// updates credentials in the UI +- (void)initCredentialSettings:(NSIndexPath *)indexPath cell:(UITableViewCell *)cell +{ + EditSelectionTableViewCell *selCell = (EditSelectionTableViewCell *)cell; + switch (indexPath.row) + { + case 0: + [[selCell label] + setText:NSLocalizedString(@"Credentials", @"'Credentials': Bookmark credentials")]; + [[selCell selection] setText:[_params StringForKey:@"username"]]; + break; + default: + NSLog(@"Invalid row index in settings table!"); + break; + } +} + +// updates session settings in the UI +- (void)initSettings:(NSIndexPath *)indexPath cell:(UITableViewCell *)cell +{ + switch (indexPath.row) + { + case 0: + { + EditSelectionTableViewCell *selCell = (EditSelectionTableViewCell *)cell; + [[selCell label] + setText:NSLocalizedString(@"Screen", @"'Screen': Bookmark Screen settings")]; + NSString *resolution = ScreenResolutionDescription( + [_params intForKey:@"screen_resolution_type"], [_params intForKey:@"width"], + [_params intForKey:@"height"]); + int colorBits = [_params intForKey:@"colors"]; + [[selCell selection] + setText:[NSString stringWithFormat:@"%@@%d", resolution, colorBits]]; + break; + } + case 1: + { + EditSubEditTableViewCell *editCell = (EditSubEditTableViewCell *)cell; + [[editCell label] + setText:NSLocalizedString(@"Performance", + @"'Performance': Bookmark Performance Settings")]; + break; + } + case 2: + { + EditSubEditTableViewCell *editCell = (EditSubEditTableViewCell *)cell; + [[editCell label] + setText:NSLocalizedString(@"Advanced", @"'Advanced': Bookmark Advanced Settings")]; + break; + } + default: + NSLog(@"Invalid row index in settings table!"); + break; + } +} + +#pragma mark - +#pragma mark Table view delegate + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + UIViewController *viewCtrl = nil; + + // determine view + switch ([indexPath section]) + { + case SECTION_CREDENTIALS: + { + if ([indexPath row] == 0) + viewCtrl = + [[[CredentialsEditorController alloc] initWithBookmark:_bookmark] autorelease]; + break; + } + + case SECTION_SETTINGS: + { + switch ([indexPath row]) + { + case 0: + viewCtrl = [[[ScreenSelectionController alloc] initWithConnectionParams:_params] + autorelease]; + break; + case 1: + viewCtrl = [[[PerformanceEditorController alloc] + initWithConnectionParams:_params] autorelease]; + break; + case 2: + viewCtrl = [[[AdvancedBookmarkEditorController alloc] + initWithBookmark:_bookmark] autorelease]; + break; + default: + break; + } + + break; + } + } + + // display view + if (viewCtrl) + [[self navigationController] pushViewController:viewCtrl animated:YES]; +} + +#pragma mark - +#pragma mark Text Field delegate + +- (BOOL)textFieldShouldReturn:(UITextField *)textField +{ + [textField resignFirstResponder]; + return NO; +} + +- (BOOL)textFieldShouldEndEditing:(UITextField *)textField +{ + switch (textField.tag) + { + // update server settings + case GET_TAG(SECTION_SERVER, 0): + [_bookmark setLabel:[textField text]]; + break; + + case GET_TAG(SECTION_SERVER, 1): + [_params setValue:[textField text] forKey:@"hostname"]; + break; + + case GET_TAG(SECTION_SERVER, 2): + [_params setInt:[[textField text] intValue] forKey:@"port"]; + break; + + default: + break; + } + return YES; +} + +#pragma mark - +#pragma mark Action Handlers + +- (void)handleSave:(id)sender +{ + // resign any first responder (so that we finish editing any bookmark parameter that might be + // currently edited) + [[self view] endEditing:NO]; + + // verify that bookmark is complete (only for manual bookmarks) + if ([[_bookmark label] length] == 0 || [[_params StringForKey:@"hostname"] length] == 0 || + [_params intForKey:@"port"] == 0) + { + BlockAlertView *alertView = [BlockAlertView + alertWithTitle:NSLocalizedString(@"Cancel without saving?", + @"Incomplete bookmark error title") + message:NSLocalizedString(@"Press 'Cancel' to abort!\nPress 'Continue' to " + @"specify the required fields!", + @"Incomplete bookmark error message")]; + [alertView + setCancelButtonWithTitle:NSLocalizedString(@"Cancel", @"Cancel Button") + block:^{ + // cancel bookmark editing and return to previous view controller + [[self navigationController] popViewControllerAnimated:YES]; + }]; + [alertView addButtonWithTitle:NSLocalizedString(@"Continue", @"Continue Button") block:nil]; + [alertView show]; + return; + } + + // commit bookmark + if ([[self delegate] respondsToSelector:@selector(commitBookmark:)]) + [[self delegate] commitBookmark:_bookmark]; + + // return to previous view controller + [[self navigationController] popViewControllerAnimated:YES]; +} + +- (void)handleCancel:(id)sender +{ + // return to previous view controller + [[self navigationController] popViewControllerAnimated:YES]; +} + +#pragma mark - +#pragma mark Memory management + +- (void)didReceiveMemoryWarning +{ + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Relinquish ownership any cached data, images, etc that aren't in use. +} + +- (void)dealloc +{ + [super dealloc]; + [_bookmark autorelease]; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkGatewaySettingsController.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkGatewaySettingsController.h new file mode 100644 index 0000000000000000000000000000000000000000..26b059a734206048445ba362f2b583aa5919e55c --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkGatewaySettingsController.h @@ -0,0 +1,26 @@ +/* + Controller to edit ts gateway bookmark settings + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "EditorBaseController.h" + +@class ComputerBookmark; +@class ConnectionParams; + +@interface BookmarkGatewaySettingsController : EditorBaseController +{ + @private + ComputerBookmark *_bookmark; + ConnectionParams *_params; +} + +// init for the given bookmark +- (id)initWithBookmark:(ComputerBookmark *)bookmark; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkGatewaySettingsController.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkGatewaySettingsController.m new file mode 100644 index 0000000000000000000000000000000000000000..d58bdbd4c1f067bdd30a04eb1056e7d114523a58 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkGatewaySettingsController.m @@ -0,0 +1,242 @@ +// +// BookmarkGatewaySettingsController.m +// FreeRDP +// +// Created by a Thincast Developer on 4/30/13. +// +// + +#import "BookmarkGatewaySettingsController.h" +#import "Bookmark.h" +#import "Utils.h" +#import "EditorSelectionController.h" + +#define SECTION_TSGATEWAY_SETTINGS 0 +#define SECTION_COUNT 1 + +@interface BookmarkGatewaySettingsController () + +@end + +@implementation BookmarkGatewaySettingsController + +- (id)initWithBookmark:(ComputerBookmark *)bookmark +{ + if ((self = [super initWithStyle:UITableViewStyleGrouped])) + { + // set additional settings state according to bookmark data + _bookmark = [bookmark retain]; + _params = [bookmark params]; + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + [self setTitle:NSLocalizedString(@"TS Gateway Settings", @"TS Gateway Settings title")]; +} + +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + + // we need to reload the table view data here to have up-to-date data for the + // advanced settings accessory items (like for resolution/color mode settings) + [[self tableView] reloadData]; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +- (void)dealloc +{ + [super dealloc]; + [_bookmark release]; +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + // Return the number of sections. + return SECTION_COUNT; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + // Return the number of rows in the section. + switch (section) + { + case SECTION_TSGATEWAY_SETTINGS: // ts gateway settings + return 5; + default: + break; + } + + return 0; +} + +// set section headers +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + switch (section) + { + case SECTION_TSGATEWAY_SETTINGS: + return NSLocalizedString(@"TS Gateway", @"'TS Gateway': ts gateway settings header"); + } + return @"unknown"; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + // determine the required cell type + NSString *cellType = nil; + switch ([indexPath section]) + { + case SECTION_TSGATEWAY_SETTINGS: // advanced settings + { + switch ([indexPath row]) + { + case 0: // hostname + case 1: // port + case 2: // username + case 4: // domain + cellType = TableCellIdentifierText; + break; + case 3: // password + cellType = TableCellIdentifierSecretText; + break; + default: + break; + } + break; + } + } + NSAssert(cellType != nil, @"Couldn't determine cell type"); + + // get the table view cell + UITableViewCell *cell = [self tableViewCellFromIdentifier:cellType]; + NSAssert(cell, @"Invalid cell"); + + // set cell values + switch ([indexPath section]) + { + // advanced settings + case SECTION_TSGATEWAY_SETTINGS: + [self initGatewaySettings:indexPath cell:cell]; + break; + + default: + break; + } + + return cell; +} + +// updates server settings in the UI +- (void)initGatewaySettings:(NSIndexPath *)indexPath cell:(UITableViewCell *)cell +{ + EditTextTableViewCell *textCell = (EditTextTableViewCell *)cell; + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + switch ([indexPath row]) + { + case 0: + { + [[textCell label] setText:NSLocalizedString(@"Host", @"'Host': Bookmark hostname")]; + [[textCell textfield] setText:[_params StringForKey:@"tsg_hostname"]]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + break; + } + case 1: + { + int port = [_params intForKey:@"tsg_port"]; + if (port == 0) + port = 443; + [[textCell label] setText:NSLocalizedString(@"Port", @"'Port': Bookmark port")]; + [[textCell textfield] setText:[NSString stringWithFormat:@"%d", port]]; + [[textCell textfield] setKeyboardType:UIKeyboardTypeNumberPad]; + break; + } + case 2: + { + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[textCell label] + setText:NSLocalizedString(@"Username", @"'Username': Bookmark username")]; + [[textCell textfield] setText:[_params StringForKey:@"tsg_username"]]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + break; + } + case 3: + { + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[textCell label] + setText:NSLocalizedString(@"Password", @"'Password': Bookmark password")]; + [[textCell textfield] setText:[_params StringForKey:@"tsg_password"]]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + break; + } + case 4: + { + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[textCell label] setText:NSLocalizedString(@"Domain", @"'Domain': Bookmark domain")]; + [[textCell textfield] setText:[_params StringForKey:@"tsg_domain"]]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + break; + } + default: + NSLog(@"Invalid row index in settings table!"); + break; + } + + [self adjustEditTextTableViewCell:textCell]; +} + +#pragma mark - +#pragma mark Text Field delegate + +- (BOOL)textFieldShouldReturn:(UITextField *)textField +{ + [textField resignFirstResponder]; + return NO; +} + +- (BOOL)textFieldShouldEndEditing:(UITextField *)textField +{ + switch (textField.tag) + { + // update server settings + case GET_TAG(SECTION_TSGATEWAY_SETTINGS, 0): + [_params setValue:[textField text] forKey:@"tsg_hostname"]; + break; + + case GET_TAG(SECTION_TSGATEWAY_SETTINGS, 1): + [_params setInt:[[textField text] intValue] forKey:@"tsg_port"]; + break; + + case GET_TAG(SECTION_TSGATEWAY_SETTINGS, 2): + [_params setValue:[textField text] forKey:@"tsg_username"]; + break; + + case GET_TAG(SECTION_TSGATEWAY_SETTINGS, 3): + [_params setValue:[textField text] forKey:@"tsg_password"]; + break; + + case GET_TAG(SECTION_TSGATEWAY_SETTINGS, 4): + [_params setValue:[textField text] forKey:@"tsg_domain"]; + break; + + default: + break; + } + return YES; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkListController.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkListController.h new file mode 100644 index 0000000000000000000000000000000000000000..79734523df672f05b3adf8749d4b1b521aca2faf --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkListController.h @@ -0,0 +1,56 @@ +/* + bookmarks and active session view controller + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import +#import "Bookmark.h" +#import "BookmarkTableCell.h" +#import "SessionTableCell.h" +#import "BookmarkEditorController.h" +#import "Reachability.h" + +@interface BookmarkListController : UIViewController +{ + // custom bookmark and session table cells + BookmarkTableCell *_bmTableCell; + SessionTableCell *_sessTableCell; + + // child views + UISearchBar *_searchBar; + UITableView *_tableView; + + // array with search results (or nil if no search active) + NSMutableArray *_manual_search_result; + NSMutableArray *_history_search_result; + + // bookmark arrays + NSMutableArray *_manual_bookmarks; + + // bookmark star images + UIImage *_star_on_img; + UIImage *_star_off_img; + + // array with active sessions + NSMutableArray *_active_sessions; + + // array with connection history entries + NSMutableArray *_connection_history; + + // temporary bookmark when asking if the user wants to store a bookmark for a session initiated + // by a quick connect + ComputerBookmark *_temporary_bookmark; +} + +@property(nonatomic, retain) IBOutlet UISearchBar *searchBar; +@property(nonatomic, retain) IBOutlet UITableView *tableView; +@property(nonatomic, retain) IBOutlet BookmarkTableCell *bmTableCell; +@property(nonatomic, retain) IBOutlet SessionTableCell *sessTableCell; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkListController.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkListController.m new file mode 100644 index 0000000000000000000000000000000000000000..c286de8ffdc4ac0497350217d0f14dde11e6e0ce --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/BookmarkListController.m @@ -0,0 +1,957 @@ +/* + bookmarks and active session view controller + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "BookmarkListController.h" +#import "Utils.h" +#import "BookmarkEditorController.h" +#import "RDPSessionViewController.h" +#import "Toast+UIView.h" +#import "Reachability.h" +#import "GlobalDefaults.h" +#import "BlockAlertView.h" + +#define SECTION_SESSIONS 0 +#define SECTION_BOOKMARKS 1 +#define NUM_SECTIONS 2 + +@interface BookmarkListController (Private) +#pragma mark misc functions +- (UIButton *)disclosureButtonWithImage:(UIImage *)image; +- (void)performSearch:(NSString *)searchText; +#pragma mark Persisting bookmarks +- (void)scheduleWriteBookmarksToDataStore; +- (void)writeBookmarksToDataStore; +- (void)scheduleWriteManualBookmarksToDataStore; +- (void)writeManualBookmarksToDataStore; +- (void)readManualBookmarksFromDataStore; +- (void)writeArray:(NSArray *)bookmarks toDataStoreURL:(NSURL *)url; +- (NSMutableArray *)arrayFromDataStoreURL:(NSURL *)url; +- (NSURL *)manualBookmarksDataStoreURL; +- (NSURL *)connectionHistoryDataStoreURL; +@end + +@implementation BookmarkListController + +@synthesize searchBar = _searchBar, tableView = _tableView, bmTableCell = _bmTableCell, + sessTableCell = _sessTableCell; + +// The designated initializer. Override if you create the controller programmatically and want to +// perform customization that is not appropriate for viewDidLoad. +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) + { + // load bookmarks + [self readManualBookmarksFromDataStore]; + + // load connection history + [self readConnectionHistoryFromDataStore]; + + // init search result array + _manual_search_result = nil; + + // register for session notifications + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(sessionDisconnected:) + name:TSXSessionDidDisconnectNotification + object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(sessionFailedToConnect:) + name:TSXSessionDidFailToConnectNotification + object:nil]; + + // set title and tabbar controller image + [self setTitle:NSLocalizedString(@"Connections", + @"'Connections': bookmark controller title")]; + [self setTabBarItem:[[[UITabBarItem alloc] + initWithTabBarSystemItem:UITabBarSystemItemBookmarks + tag:0] autorelease]]; + + // load images + _star_on_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"icon_accessory_star_on" + ofType:@"png"]] retain]; + _star_off_img = + [[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] + pathForResource:@"icon_accessory_star_off" + ofType:@"png"]] retain]; + + // init reachability detection + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(reachabilityChanged:) + name:kReachabilityChangedNotification + object:nil]; + + // init other properties + _active_sessions = [[NSMutableArray alloc] init]; + _temporary_bookmark = nil; + } + return self; +} + +- (void)loadView +{ + [super loadView]; +} + +// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. +- (void)viewDidLoad +{ + [super viewDidLoad]; + + // set edit button to allow bookmark list editing + [[self navigationItem] setRightBarButtonItem:[self editButtonItem]]; +} + +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + + // in case we had a search - search again cause the bookmark searchable items could have changed + if ([[_searchBar text] length] > 0) + [self performSearch:[_searchBar text]]; + + // to reflect any bookmark changes - reload table + [_tableView reloadData]; +} + +- (void)viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; + + // clear any search + [_searchBar setText:@""]; + [_searchBar resignFirstResponder]; + [self performSearch:@""]; +} + +// Override to allow orientations other than the default portrait orientation. +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + // Return YES for supported orientations + return YES; +} + +- (void)didReceiveMemoryWarning +{ + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Release any cached data, images, etc that aren't in use. +} + +- (void)viewDidUnload +{ + [super viewDidUnload]; + // Release any retained subviews of the main view. + // e.g. self.myOutlet = nil; +} + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + [_temporary_bookmark release]; + [_connection_history release]; + [_active_sessions release]; + [_manual_search_result release]; + [_manual_bookmarks release]; + + [_star_on_img release]; + [_star_off_img release]; + + [super dealloc]; +} + +#pragma mark - +#pragma mark Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + // Return the number of sections. + return NUM_SECTIONS; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + + switch (section) + { + case SECTION_SESSIONS: + return 0; + break; + + case SECTION_BOOKMARKS: + { + // (+1 for Add Bookmark entry) + if (_manual_search_result != nil) + return ([_manual_search_result count] + [_history_search_result count] + 1); + return ([_manual_bookmarks count] + 1); + } + break; + + default: + break; + } + return 0; +} + +- (UITableViewCell *)cellForGenericListEntry +{ + static NSString *CellIdentifier = @"BookmarkListCell"; + UITableViewCell *cell = [[self tableView] dequeueReusableCellWithIdentifier:CellIdentifier]; + if (cell == nil) + { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault + reuseIdentifier:CellIdentifier]; + [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; + [cell setAccessoryView:[self disclosureButtonWithImage:_star_off_img]]; + } + + return cell; +} + +- (BookmarkTableCell *)cellForBookmark +{ + static NSString *BookmarkCellIdentifier = @"BookmarkCell"; + BookmarkTableCell *cell = (BookmarkTableCell *)[[self tableView] + dequeueReusableCellWithIdentifier:BookmarkCellIdentifier]; + if (cell == nil) + { + [[NSBundle mainBundle] loadNibNamed:@"BookmarkTableViewCell" owner:self options:nil]; + [_bmTableCell setAccessoryView:[self disclosureButtonWithImage:_star_on_img]]; + cell = _bmTableCell; + _bmTableCell = nil; + } + + return cell; +} + +// Customize the appearance of table view cells. +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + + switch ([indexPath section]) + { + case SECTION_SESSIONS: + { + // get custom session cell + static NSString *SessionCellIdentifier = @"SessionCell"; + SessionTableCell *cell = (SessionTableCell *)[tableView + dequeueReusableCellWithIdentifier:SessionCellIdentifier]; + if (cell == nil) + { + [[NSBundle mainBundle] loadNibNamed:@"SessionTableViewCell" owner:self options:nil]; + cell = _sessTableCell; + _sessTableCell = nil; + } + + // set cell data + RDPSession *session = [_active_sessions objectAtIndex:[indexPath row]]; + [[cell title] setText:[session sessionName]]; + [[cell server] setText:[[session params] StringForKey:@"hostname"]]; + [[cell username] setText:[[session params] StringForKey:@"username"]]; + [[cell screenshot] + setImage:[session getScreenshotWithSize:[[cell screenshot] bounds].size]]; + [[cell disconnectButton] setTag:[indexPath row]]; + return cell; + } + + case SECTION_BOOKMARKS: + { + // special handling for first cell - quick connect/quick create Bookmark cell + if ([indexPath row] == 0) + { + // if a search text is entered the cell becomes a quick connect/quick create + // bookmark cell - otherwise it's just an add bookmark cell + UITableViewCell *cell = [self cellForGenericListEntry]; + if ([[_searchBar text] length] == 0) + { + [[cell textLabel] + setText:[@" " stringByAppendingString: + NSLocalizedString(@"Add Connection", + @"'Add Connection': button label")]]; + [((UIButton *)[cell accessoryView]) setHidden:YES]; + } + else + { + [[cell textLabel] setText:[@" " stringByAppendingString:[_searchBar text]]]; + [((UIButton *)[cell accessoryView]) setHidden:NO]; + } + + return cell; + } + else + { + // do we have a history cell or bookmark cell? + if ([self isIndexPathToHistoryItem:indexPath]) + { + UITableViewCell *cell = [self cellForGenericListEntry]; + [[cell textLabel] + setText:[@" " stringByAppendingString: + [_history_search_result + objectAtIndex: + [self historyIndexFromIndexPath:indexPath]]]]; + [((UIButton *)[cell accessoryView]) setHidden:NO]; + return cell; + } + else + { + // set cell properties + ComputerBookmark *entry; + BookmarkTableCell *cell = [self cellForBookmark]; + if (_manual_search_result == nil) + entry = [_manual_bookmarks + objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]]; + else + entry = [[_manual_search_result + objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]] + valueForKey:@"bookmark"]; + + [[cell title] setText:[entry label]]; + [[cell subTitle] setText:[[entry params] StringForKey:@"hostname"]]; + return cell; + } + } + } + + default: + break; + } + + NSAssert(0, @"Failed to create cell"); + return nil; +} + +// Override to support conditional editing of the table view. +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath +{ + // dont allow to edit Add Bookmark item + if ([indexPath section] == SECTION_SESSIONS) + return NO; + if ([indexPath section] == SECTION_BOOKMARKS && [indexPath row] == 0) + return NO; + return YES; +} + +// Override to support editing the table view. +- (void)tableView:(UITableView *)tableView + commitEditingStyle:(UITableViewCellEditingStyle)editingStyle + forRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (editingStyle == UITableViewCellEditingStyleDelete) + { + // Delete the row from the data source + switch ([indexPath section]) + { + case SECTION_BOOKMARKS: + { + if (_manual_search_result == nil) + [_manual_bookmarks + removeObjectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]]; + else + { + // history item or bookmark? + if ([self isIndexPathToHistoryItem:indexPath]) + { + [_connection_history + removeObject: + [_history_search_result + objectAtIndex:[self historyIndexFromIndexPath:indexPath]]]; + [_history_search_result + removeObjectAtIndex:[self historyIndexFromIndexPath:indexPath]]; + } + else + { + [_manual_bookmarks + removeObject: + [[_manual_search_result + objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]] + valueForKey:@"bookmark"]]; + [_manual_search_result + removeObjectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]]; + } + } + [self scheduleWriteManualBookmarksToDataStore]; + break; + } + } + + [tableView reloadSections:[NSIndexSet indexSetWithIndex:[indexPath section]] + withRowAnimation:UITableViewRowAnimationNone]; + } +} + +// Override to support rearranging the table view. +- (void)tableView:(UITableView *)tableView + moveRowAtIndexPath:(NSIndexPath *)fromIndexPath + toIndexPath:(NSIndexPath *)toIndexPath +{ + if ([fromIndexPath compare:toIndexPath] != NSOrderedSame) + { + switch ([fromIndexPath section]) + { + case SECTION_BOOKMARKS: + { + int fromIdx = [self bookmarkIndexFromIndexPath:fromIndexPath]; + int toIdx = [self bookmarkIndexFromIndexPath:toIndexPath]; + ComputerBookmark *temp_bookmark = + [[_manual_bookmarks objectAtIndex:fromIdx] retain]; + [_manual_bookmarks removeObjectAtIndex:fromIdx]; + if (toIdx >= [_manual_bookmarks count]) + [_manual_bookmarks addObject:temp_bookmark]; + else + [_manual_bookmarks insertObject:temp_bookmark atIndex:toIdx]; + [temp_bookmark release]; + + [self scheduleWriteManualBookmarksToDataStore]; + break; + } + } + } +} + +// prevent that an item is moved before the Add Bookmark item +- (NSIndexPath *)tableView:(UITableView *)tableView + targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath + toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath +{ + // don't allow to move: + // - items between sections + // - the quick connect/quick create bookmark cell + // - any item while a search is applied + if ([proposedDestinationIndexPath row] == 0 || + ([sourceIndexPath section] != [proposedDestinationIndexPath section]) || + _manual_search_result != nil) + { + return sourceIndexPath; + } + else + { + return proposedDestinationIndexPath; + } +} + +// Override to support conditional rearranging of the table view. +- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath +{ + // dont allow to reorder Add Bookmark item + if ([indexPath section] == SECTION_BOOKMARKS && [indexPath row] == 0) + return NO; + return YES; +} + +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + if (section == SECTION_SESSIONS && [_active_sessions count] > 0) + return NSLocalizedString(@"My Sessions", @"'My Session': section sessions header"); + if (section == SECTION_BOOKMARKS) + return NSLocalizedString(@"Manual Connections", + @"'Manual Connections': section manual bookmarks header"); + return nil; +} + +- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section +{ + return nil; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +{ + if ([indexPath section] == SECTION_SESSIONS) + return 72; + return [tableView rowHeight]; +} + +#pragma mark - +#pragma mark Table view delegate + +- (void)setEditing:(BOOL)editing animated:(BOOL)animated +{ + [super setEditing:editing animated:animated]; + [[self tableView] setEditing:editing animated:animated]; +} + +- (void)accessoryButtonTapped:(UIControl *)button withEvent:(UIEvent *)event +{ + // forward a tap on our custom accessory button to the real accessory button handler + NSIndexPath *indexPath = + [[self tableView] indexPathForRowAtPoint:[[[event touchesForView:button] anyObject] + locationInView:[self tableView]]]; + if (indexPath == nil) + return; + + [[[self tableView] delegate] tableView:[self tableView] + accessoryButtonTappedForRowWithIndexPath:indexPath]; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + if ([indexPath section] == SECTION_SESSIONS) + { + // resume session + RDPSession *session = [_active_sessions objectAtIndex:[indexPath row]]; + UIViewController *ctrl = + [[[RDPSessionViewController alloc] initWithNibName:@"RDPSessionView" + bundle:nil + session:session] autorelease]; + [ctrl setHidesBottomBarWhenPushed:YES]; + [[self navigationController] pushViewController:ctrl animated:YES]; + } + else + { + ComputerBookmark *bookmark = nil; + if ([indexPath section] == SECTION_BOOKMARKS) + { + // first row has either quick connect or add bookmark item + if ([indexPath row] == 0) + { + if ([[_searchBar text] length] == 0) + { + // show add bookmark controller + ComputerBookmark *bookmark = + [[[ComputerBookmark alloc] initWithBaseDefaultParameters] autorelease]; + BookmarkEditorController *bookmarkEditorController = + [[[BookmarkEditorController alloc] initWithBookmark:bookmark] autorelease]; + [bookmarkEditorController + setTitle:NSLocalizedString(@"Add Connection", @"Add Connection title")]; + [bookmarkEditorController setDelegate:self]; + [bookmarkEditorController setHidesBottomBarWhenPushed:YES]; + [[self navigationController] pushViewController:bookmarkEditorController + animated:YES]; + } + else + { + // create a quick connect bookmark and add an entry to the quick connect history + // (if not already in the history) + bookmark = [self bookmarkForQuickConnectTo:[_searchBar text]]; + if (![_connection_history containsObject:[_searchBar text]]) + { + [_connection_history addObject:[_searchBar text]]; + [self scheduleWriteConnectionHistoryToDataStore]; + } + } + } + else + { + if (_manual_search_result != nil) + { + if ([self isIndexPathToHistoryItem:indexPath]) + { + // create a quick connect bookmark for a history item + NSString *item = [_history_search_result + objectAtIndex:[self historyIndexFromIndexPath:indexPath]]; + bookmark = [self bookmarkForQuickConnectTo:item]; + } + else + bookmark = [[_manual_search_result + objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]] + valueForKey:@"bookmark"]; + } + else + bookmark = [_manual_bookmarks + objectAtIndex:[self bookmarkIndexFromIndexPath: + indexPath]]; // -1 because of ADD BOOKMARK entry + } + + // set reachability status + WakeUpWWAN(); + [bookmark + setConntectedViaWLAN:[[Reachability + reachabilityWithHostName:[[bookmark params] + StringForKey:@"hostname"]] + currentReachabilityStatus] == ReachableViaWiFi]; + } + + if (bookmark != nil) + { + // create rdp session + RDPSession *session = [[[RDPSession alloc] initWithBookmark:bookmark] autorelease]; + UIViewController *ctrl = + [[[RDPSessionViewController alloc] initWithNibName:@"RDPSessionView" + bundle:nil + session:session] autorelease]; + [ctrl setHidesBottomBarWhenPushed:YES]; + [[self navigationController] pushViewController:ctrl animated:YES]; + [_active_sessions addObject:session]; + } + } +} + +- (void)tableView:(UITableView *)tableView + accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath +{ + // get the bookmark + NSString *bookmark_editor_title = + NSLocalizedString(@"Edit Connection", @"Edit Connection title"); + ComputerBookmark *bookmark = nil; + if ([indexPath section] == SECTION_BOOKMARKS) + { + if ([indexPath row] == 0) + { + // create a new bookmark and init hostname and label + bookmark = [self bookmarkForQuickConnectTo:[_searchBar text]]; + bookmark_editor_title = NSLocalizedString(@"Add Connection", @"Add Connection title"); + } + else + { + if (_manual_search_result != nil) + { + if ([self isIndexPathToHistoryItem:indexPath]) + { + // create a new bookmark and init hostname and label + NSString *item = [_history_search_result + objectAtIndex:[self historyIndexFromIndexPath:indexPath]]; + bookmark = [self bookmarkForQuickConnectTo:item]; + bookmark_editor_title = + NSLocalizedString(@"Add Connection", @"Add Connection title"); + } + else + bookmark = [[_manual_search_result + objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]] + valueForKey:@"bookmark"]; + } + else + bookmark = [_manual_bookmarks + objectAtIndex:[self bookmarkIndexFromIndexPath:indexPath]]; // -1 because of ADD + // BOOKMARK entry + } + } + + // bookmark found? - start the editor + if (bookmark != nil) + { + BookmarkEditorController *editBookmarkController = + [[[BookmarkEditorController alloc] initWithBookmark:bookmark] autorelease]; + [editBookmarkController setHidesBottomBarWhenPushed:YES]; + [editBookmarkController setTitle:bookmark_editor_title]; + [editBookmarkController setDelegate:self]; + [[self navigationController] pushViewController:editBookmarkController animated:YES]; + } +} + +#pragma mark - +#pragma mark Search Bar Delegates + +- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar +{ + // show cancel button + [searchBar setShowsCancelButton:YES animated:YES]; + return YES; +} + +- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar +{ + // clear search result + [_manual_search_result release]; + _manual_search_result = nil; + + // clear text and remove cancel button + [searchBar setText:@""]; + [searchBar resignFirstResponder]; +} + +- (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar +{ + [searchBar setShowsCancelButton:NO animated:YES]; + + // re-enable table selection + [_tableView setAllowsSelection:YES]; + + return YES; +} + +- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar +{ + [_searchBar resignFirstResponder]; +} + +- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText +{ + [self performSearch:searchText]; + [_tableView reloadData]; +} + +#pragma mark - Session handling + +// session was added +- (void)sessionDisconnected:(NSNotification *)notification +{ + // remove session from active sessions + RDPSession *session = (RDPSession *)[notification object]; + [_active_sessions removeObject:session]; + + // if this view is currently active refresh entries + if ([[self navigationController] visibleViewController] == self) + [_tableView reloadSections:[NSIndexSet indexSetWithIndex:SECTION_SESSIONS] + withRowAnimation:UITableViewRowAnimationNone]; + + // if session's bookmark is not in the bookmark list ask the user if he wants to add it + // (this happens if the session is created using the quick connect feature) + if (![_manual_bookmarks containsObject:[session bookmark]]) + { + // retain the bookmark in case we want to save it later + _temporary_bookmark = [[session bookmark] retain]; + + // ask the user if he wants to save the bookmark + NSString *title = + NSLocalizedString(@"Save Connection Settings?", @"Save connection settings title"); + NSString *message = NSLocalizedString( + @"Your Connection Settings have not been saved. Do you want to save them?", + @"Save connection settings message"); + BlockAlertView *alert = [BlockAlertView alertWithTitle:title message:message]; + [alert setCancelButtonWithTitle:NSLocalizedString(@"No", @"No Button") block:nil]; + [alert addButtonWithTitle:NSLocalizedString(@"Yes", @"Yes Button") + block:^{ + if (_temporary_bookmark) + { + [_manual_bookmarks addObject:_temporary_bookmark]; + [_tableView + reloadSections:[NSIndexSet + indexSetWithIndex:SECTION_BOOKMARKS] + withRowAnimation:UITableViewRowAnimationNone]; + [_temporary_bookmark autorelease]; + _temporary_bookmark = nil; + } + }]; + [alert show]; + } +} + +- (void)sessionFailedToConnect:(NSNotification *)notification +{ + // remove session from active sessions + RDPSession *session = (RDPSession *)[notification object]; + [_active_sessions removeObject:session]; + + // display error toast + [[self view] makeToast:NSLocalizedString(@"Failed to connect to session!", + @"Failed to connect error message") + duration:ToastDurationNormal + position:@"center"]; +} + +#pragma mark - Reachability notification +- (void)reachabilityChanged:(NSNotification *)notification +{ + // no matter how the network changed - we will disconnect + // disconnect session (if there is any) + if ([_active_sessions count] > 0) + { + RDPSession *session = [_active_sessions objectAtIndex:0]; + [session disconnect]; + } +} + +#pragma mark - BookmarkEditorController delegate + +- (void)commitBookmark:(ComputerBookmark *)bookmark +{ + // if we got a manual bookmark that is not in the list yet - add it otherwise replace it + BOOL found = NO; + for (int idx = 0; idx < [_manual_bookmarks count]; ++idx) + { + if ([[bookmark uuid] isEqualToString:[[_manual_bookmarks objectAtIndex:idx] uuid]]) + { + [_manual_bookmarks replaceObjectAtIndex:idx withObject:bookmark]; + found = YES; + break; + } + } + if (!found) + [_manual_bookmarks addObject:bookmark]; + + // remove any quick connect history entry with the same hostname + NSString *hostname = [[bookmark params] StringForKey:@"hostname"]; + if ([_connection_history containsObject:hostname]) + { + [_connection_history removeObject:hostname]; + [self scheduleWriteConnectionHistoryToDataStore]; + } + + [self scheduleWriteManualBookmarksToDataStore]; +} + +- (IBAction)disconnectButtonPressed:(id)sender +{ + // disconnect session and refresh table view + RDPSession *session = [_active_sessions objectAtIndex:[sender tag]]; + [session disconnect]; +} + +#pragma mark - Misc functions + +- (BOOL)hasNoBookmarks +{ + return ([_manual_bookmarks count] == 0); +} + +- (UIButton *)disclosureButtonWithImage:(UIImage *)image +{ + // we make the button a little bit bigger (image width * 2, height + 10) so that the user + // doesn't accidentally connect to the bookmark ... + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; + [button setFrame:CGRectMake(0, 0, [image size].width * 2, [image size].height + 10)]; + [button setImage:image forState:UIControlStateNormal]; + [button addTarget:self + action:@selector(accessoryButtonTapped:withEvent:) + forControlEvents:UIControlEventTouchUpInside]; + [button setUserInteractionEnabled:YES]; + return button; +} + +- (void)performSearch:(NSString *)searchText +{ + [_manual_search_result autorelease]; + + if ([searchText length] > 0) + { + _manual_search_result = [FilterBookmarks( + _manual_bookmarks, + [searchText componentsSeparatedByCharactersInSet:[NSCharacterSet + whitespaceAndNewlineCharacterSet]]) + retain]; + _history_search_result = [FilterHistory(_connection_history, searchText) retain]; + } + else + { + _history_search_result = nil; + _manual_search_result = nil; + } +} + +- (int)bookmarkIndexFromIndexPath:(NSIndexPath *)indexPath +{ + return [indexPath row] - + ((_history_search_result != nil) ? [_history_search_result count] : 0) - 1; +} + +- (int)historyIndexFromIndexPath:(NSIndexPath *)indexPath +{ + return [indexPath row] - 1; +} + +- (BOOL)isIndexPathToHistoryItem:(NSIndexPath *)indexPath +{ + return (([indexPath row] - 1) < [_history_search_result count]); +} + +- (ComputerBookmark *)bookmarkForQuickConnectTo:(NSString *)host +{ + ComputerBookmark *bookmark = + [[[ComputerBookmark alloc] initWithBaseDefaultParameters] autorelease]; + [bookmark setLabel:host]; + [[bookmark params] setValue:host forKey:@"hostname"]; + return bookmark; +} + +#pragma mark - Persisting bookmarks + +- (void)scheduleWriteBookmarksToDataStore +{ + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ + [self writeBookmarksToDataStore]; + }]; +} + +- (void)writeBookmarksToDataStore +{ + [self writeManualBookmarksToDataStore]; +} + +- (void)scheduleWriteManualBookmarksToDataStore +{ + [[NSOperationQueue mainQueue] + addOperation:[[[NSInvocationOperation alloc] + initWithTarget:self + selector:@selector(writeManualBookmarksToDataStore) + object:nil] autorelease]]; +} + +- (void)writeManualBookmarksToDataStore +{ + [self writeArray:_manual_bookmarks toDataStoreURL:[self manualBookmarksDataStoreURL]]; +} + +- (void)scheduleWriteConnectionHistoryToDataStore +{ + [[NSOperationQueue mainQueue] + addOperation:[[[NSInvocationOperation alloc] + initWithTarget:self + selector:@selector(writeConnectionHistoryToDataStore) + object:nil] autorelease]]; +} + +- (void)writeConnectionHistoryToDataStore +{ + [self writeArray:_connection_history toDataStoreURL:[self connectionHistoryDataStoreURL]]; +} + +- (void)writeArray:(NSArray *)bookmarks toDataStoreURL:(NSURL *)url +{ + NSData *archived_data = [NSKeyedArchiver archivedDataWithRootObject:bookmarks]; + [archived_data writeToURL:url atomically:YES]; +} + +- (void)readManualBookmarksFromDataStore +{ + [_manual_bookmarks autorelease]; + _manual_bookmarks = [self arrayFromDataStoreURL:[self manualBookmarksDataStoreURL]]; + + if (_manual_bookmarks == nil) + { + _manual_bookmarks = [[NSMutableArray alloc] init]; + [_manual_bookmarks + addObject:[[[GlobalDefaults sharedGlobalDefaults] newTestServerBookmark] autorelease]]; + } +} + +- (void)readConnectionHistoryFromDataStore +{ + [_connection_history autorelease]; + _connection_history = [self arrayFromDataStoreURL:[self connectionHistoryDataStoreURL]]; + + if (_connection_history == nil) + _connection_history = [[NSMutableArray alloc] init]; +} + +- (NSMutableArray *)arrayFromDataStoreURL:(NSURL *)url +{ + NSData *archived_data = [NSData dataWithContentsOfURL:url]; + + if (!archived_data) + return nil; + + return [[NSKeyedUnarchiver unarchiveObjectWithData:archived_data] retain]; +} + +- (NSURL *)manualBookmarksDataStoreURL +{ + return [NSURL + fileURLWithPath:[NSString stringWithFormat:@"%@/%@", + [NSSearchPathForDirectoriesInDomains( + NSDocumentDirectory, NSUserDomainMask, YES) + lastObject], + @"com.freerdp.ifreerdp.bookmarks.plist"]]; +} + +- (NSURL *)connectionHistoryDataStoreURL +{ + return [NSURL + fileURLWithPath:[NSString + stringWithFormat:@"%@/%@", + [NSSearchPathForDirectoriesInDomains( + NSDocumentDirectory, NSUserDomainMask, YES) + lastObject], + @"com.freerdp.ifreerdp.connection_history.plist"]]; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/CredentialsEditorController.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/CredentialsEditorController.h new file mode 100644 index 0000000000000000000000000000000000000000..4dc12c3ef4b2c9829d94c1ad6d610e46a6dd7afd --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/CredentialsEditorController.h @@ -0,0 +1,26 @@ +/* + Controller to edit bookmark credentials + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "EditorBaseController.h" + +@class ComputerBookmark; +@class ConnectionParams; + +@interface CredentialsEditorController : EditorBaseController +{ + @private + ComputerBookmark *_bookmark; + ConnectionParams *_params; +} + +// init for the given bookmark +- (id)initWithBookmark:(ComputerBookmark *)bookmark; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/CredentialsEditorController.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/CredentialsEditorController.m new file mode 100644 index 0000000000000000000000000000000000000000..4dbea53bcd2ec39612cbc938274861be613b07a7 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/CredentialsEditorController.m @@ -0,0 +1,215 @@ +/* + Controller to edit bookmark credentials + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "CredentialsEditorController.h" +#import "Bookmark.h" +#import "Utils.h" + +@interface CredentialsEditorController () + +@end + +#define SECTION_CREDENTIALS 0 +#define SECTION_COUNT 1 + +@implementation CredentialsEditorController + +- (id)initWithBookmark:(ComputerBookmark *)bookmark +{ + if ((self = [super initWithStyle:UITableViewStyleGrouped])) + { + // set additional settings state according to bookmark data + _bookmark = [bookmark retain]; + _params = [bookmark params]; + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + [self setTitle:NSLocalizedString(@"Credentials", @"Credentials title")]; +} + +- (void)viewDidUnload +{ + [super viewDidUnload]; + // Release any retained subviews of the main view. +} + +- (void)viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; + + // foce any active editing to stop + [[self view] endEditing:NO]; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +- (void)dealloc +{ + [super dealloc]; + [_bookmark release]; +} + +#pragma mark - +#pragma mark Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + // Return the number of sections. + return SECTION_COUNT; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + // Return the number of rows in the section. + switch (section) + { + case SECTION_CREDENTIALS: // credentials + return 3; + default: + break; + } + + return 0; +} + +// set section headers +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + switch (section) + { + case SECTION_CREDENTIALS: + return NSLocalizedString(@"Credentials", @"'Credentials': credentials settings header"); + } + return @"unknown"; +} + +// Customize the appearance of table view cells. +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + + // determine the required cell type + NSString *cellType = nil; + switch ([indexPath section]) + { + case SECTION_CREDENTIALS: // credentials + if ([indexPath row] == 1) + cellType = TableCellIdentifierSecretText; // password field + else + cellType = TableCellIdentifierText; + break; + + default: + break; + } + NSAssert(cellType != nil, @"Couldn't determine cell type"); + + // get the table view cell + UITableViewCell *cell = [self tableViewCellFromIdentifier:cellType]; + NSAssert(cell, @"Invalid cell"); + + // set cell values + switch ([indexPath section]) + { + // credentials + case SECTION_CREDENTIALS: + [self initCredentialSettings:indexPath cell:cell]; + break; + + default: + break; + } + + return cell; +} + +// updates credentials in the UI +- (void)initCredentialSettings:(NSIndexPath *)indexPath cell:(UITableViewCell *)cell +{ + switch (indexPath.row) + { + case 0: + { + EditTextTableViewCell *textCell = (EditTextTableViewCell *)cell; + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[textCell label] + setText:NSLocalizedString(@"Username", @"'Username': Bookmark username")]; + [[textCell textfield] setText:[_params StringForKey:@"username"]]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + break; + } + case 1: + { + EditSecretTextTableViewCell *textCell = (EditSecretTextTableViewCell *)cell; + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[textCell label] + setText:NSLocalizedString(@"Password", @"'Password': Bookmark password")]; + [[textCell textfield] setText:[_params StringForKey:@"password"]]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + break; + } + case 2: + { + EditTextTableViewCell *textCell = (EditTextTableViewCell *)cell; + [[textCell textfield] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[textCell label] setText:NSLocalizedString(@"Domain", @"'Domain': Bookmark domain")]; + [[textCell textfield] setText:[_params StringForKey:@"domain"]]; + [[textCell textfield] + setPlaceholder:NSLocalizedString(@"not set", @"not set placeholder")]; + break; + } + default: + NSLog(@"Invalid row index in settings table!"); + break; + } +} + +#pragma mark - +#pragma mark Text Field delegate + +- (BOOL)textFieldShouldReturn:(UITextField *)textField +{ + [textField resignFirstResponder]; + return NO; +} + +- (BOOL)textFieldShouldEndEditing:(UITextField *)textField +{ + switch (textField.tag) + { + // update credentials settings + case GET_TAG(SECTION_CREDENTIALS, 0): + [_params setValue:[textField text] forKey:@"username"]; + break; + + case GET_TAG(SECTION_CREDENTIALS, 1): + [_params setValue:[textField text] forKey:@"password"]; + break; + + case GET_TAG(SECTION_CREDENTIALS, 2): + [_params setValue:[textField text] forKey:@"domain"]; + break; + + default: + break; + } + return YES; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/CredentialsInputController.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/CredentialsInputController.h new file mode 100644 index 0000000000000000000000000000000000000000..9bfbda549bc6e70feb707165a4ae1dec991e99b4 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/CredentialsInputController.h @@ -0,0 +1,35 @@ +/* + Credentials input controller + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import + +@class RDPSession; + +@interface CredentialsInputController : UIViewController +{ + @private + IBOutlet UITextField *_textfield_username; + IBOutlet UITextField *_textfield_password; + IBOutlet UITextField *_textfield_domain; + IBOutlet UIButton *_btn_login; + IBOutlet UIButton *_btn_cancel; + IBOutlet UIScrollView *_scroll_view; + IBOutlet UILabel *_lbl_message; + + RDPSession *_session; + NSMutableDictionary *_params; +} + +- (id)initWithNibName:(NSString *)nibNameOrNil + bundle:(NSBundle *)nibBundleOrNil + session:(RDPSession *)session + params:(NSMutableDictionary *)params; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/CredentialsInputController.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/CredentialsInputController.m new file mode 100644 index 0000000000000000000000000000000000000000..fed6c727cbfe14cd946fe01e45c1e87ca463ae0a --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/CredentialsInputController.m @@ -0,0 +1,160 @@ +/* + Credentials input controller + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "CredentialsInputController.h" +#import "RDPSession.h" +#import "Utils.h" + +@implementation CredentialsInputController + +- (id)initWithNibName:(NSString *)nibNameOrNil + bundle:(NSBundle *)nibBundleOrNil + session:(RDPSession *)session + params:(NSMutableDictionary *)params +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) + { + _session = session; + _params = params; + [self setModalPresentationStyle:UIModalPresentationFormSheet]; + + // on iphone we have the problem that the buttons are hidden by the keyboard + // we solve this issue by registering keyboard notification handlers and adjusting the + // scrollview accordingly + if (IsPhone()) + { + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardWillShow:) + name:UIKeyboardWillShowNotification + object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardWillHide:) + name:UIKeyboardWillHideNotification + object:nil]; + } + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + // set localized strings + [_lbl_message + setText:NSLocalizedString( + @"Please provide the missing user information in order to proceed and login.", + @"Credentials input view message")]; + [_textfield_username + setPlaceholder:NSLocalizedString(@"Username", @"Credentials Input Username hint")]; + [_textfield_password + setPlaceholder:NSLocalizedString(@"Password", @"Credentials Input Password hint")]; + [_textfield_domain + setPlaceholder:NSLocalizedString(@"Domain", @"Credentials Input Domain hint")]; + [_btn_login setTitle:NSLocalizedString(@"Login", @"Login Button") + forState:UIControlStateNormal]; + [_btn_cancel setTitle:NSLocalizedString(@"Cancel", @"Cancel Button") + forState:UIControlStateNormal]; + + // init scrollview content size + [_scroll_view setContentSize:[_scroll_view frame].size]; + + // set params in the view + [_textfield_username setText:[_params valueForKey:@"username"]]; + [_textfield_password setText:[_params valueForKey:@"password"]]; + [_textfield_domain setText:[_params valueForKey:@"domain"]]; +} + +- (void)viewDidUnload +{ + [super viewDidUnload]; +} + +- (void)viewDidDisappear:(BOOL)animated +{ + [super viewDidDisappear:animated]; + // set signal + [[_session uiRequestCompleted] signal]; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +- (void)dealloc +{ + [super dealloc]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +#pragma mark - +#pragma mark iOS Keyboard Notification Handlers + +- (void)keyboardWillShow:(NSNotification *)notification +{ + CGRect keyboardEndFrame = + [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; + CGRect keyboardFrame = [[self view] convertRect:keyboardEndFrame toView:nil]; + + [UIView beginAnimations:nil context:NULL]; + [UIView setAnimationCurve:[[[notification userInfo] + objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]]; + [UIView + setAnimationDuration:[[[notification userInfo] + objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]]; + CGRect frame = [_scroll_view frame]; + frame.size.height -= keyboardFrame.size.height; + [_scroll_view setFrame:frame]; + [UIView commitAnimations]; +} + +- (void)keyboardWillHide:(NSNotification *)notification +{ + CGRect keyboardEndFrame = + [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; + CGRect keyboardFrame = [[self view] convertRect:keyboardEndFrame toView:nil]; + + [UIView beginAnimations:nil context:NULL]; + [UIView setAnimationCurve:[[[notification userInfo] + objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]]; + [UIView + setAnimationDuration:[[[notification userInfo] + objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]]; + CGRect frame = [_scroll_view frame]; + frame.size.height += keyboardFrame.size.height; + [_scroll_view setFrame:frame]; + [UIView commitAnimations]; +} + +#pragma mark - Action handlers + +- (IBAction)loginPressed:(id)sender +{ + // read input back in + [_params setValue:[_textfield_username text] forKey:@"username"]; + [_params setValue:[_textfield_password text] forKey:@"password"]; + [_params setValue:[_textfield_domain text] forKey:@"domain"]; + [_params setValue:[NSNumber numberWithBool:YES] forKey:@"result"]; + + // dismiss controller + [self dismissModalViewControllerAnimated:YES]; +} + +- (IBAction)cancelPressed:(id)sender +{ + [_params setValue:[NSNumber numberWithBool:NO] forKey:@"result"]; + + // dismiss controller + [self dismissModalViewControllerAnimated:YES]; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/EditorBaseController.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/EditorBaseController.h new file mode 100644 index 0000000000000000000000000000000000000000..37c95b34268a6dbb1d8d9d02a8a78e9fe8281787 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/EditorBaseController.h @@ -0,0 +1,44 @@ +/* + Basic interface for settings editors + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import +#import "EditTextTableViewCell.h" +#import "EditFlagTableViewCell.h" +#import "EditSelectionTableViewCell.h" +#import "EditSubEditTableViewCell.h" +#import "EditSecretTextTableViewCell.h" +#import "EditButtonTableViewCell.h" + +extern NSString *TableCellIdentifierText; +extern NSString *TableCellIdentifierSecretText; +extern NSString *TableCellIdentifierYesNo; +extern NSString *TableCellIdentifierSelection; +extern NSString *TableCellIdentifierSubEditor; +extern NSString *TableCellIdentifierMultiChoice; +extern NSString *TableCellIdentifierButton; + +@interface EditorBaseController : UITableViewController +{ + @private + IBOutlet EditTextTableViewCell *_textTableViewCell; + IBOutlet EditSecretTextTableViewCell *_secretTextTableViewCell; + IBOutlet EditFlagTableViewCell *_flagTableViewCell; + IBOutlet EditSelectionTableViewCell *_selectionTableViewCell; + IBOutlet EditSubEditTableViewCell *_subEditTableViewCell; + IBOutlet EditButtonTableViewCell *_buttonTableViewCell; +} + +// returns one of the requested table view cells +- (UITableViewCell *)tableViewCellFromIdentifier:(NSString *)identifier; + +// Adjust text input cells label/textfield width according to the label's text size +- (void)adjustEditTextTableViewCell:(EditTextTableViewCell *)cell; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/EditorBaseController.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/EditorBaseController.m new file mode 100644 index 0000000000000000000000000000000000000000..70c5f4e980be14ff0fba8b8e5e496810573d5b42 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/EditorBaseController.m @@ -0,0 +1,110 @@ +/* + Basic interface for settings editors + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "EditorBaseController.h" + +@interface EditorBaseController () + +@end + +NSString *TableCellIdentifierText = @"cellIdText"; +NSString *TableCellIdentifierSecretText = @"cellIdSecretText"; +NSString *TableCellIdentifierYesNo = @"cellIdYesNo"; +NSString *TableCellIdentifierSelection = @"cellIdSelection"; +NSString *TableCellIdentifierSubEditor = @"cellIdSubEditor"; +NSString *TableCellIdentifierMultiChoice = @"cellIdMultiChoice"; +NSString *TableCellIdentifierButton = @"cellIdButton"; + +@implementation EditorBaseController + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +#pragma mark - Create table view cells +- (UITableViewCell *)tableViewCellFromIdentifier:(NSString *)identifier +{ + // try to reuse a cell + UITableViewCell *cell = [[self tableView] dequeueReusableCellWithIdentifier:identifier]; + if (cell != nil) + return cell; + + // we have to create a new cell + if ([identifier isEqualToString:TableCellIdentifierText]) + { + [[NSBundle mainBundle] loadNibNamed:@"EditTextTableViewCell" owner:self options:nil]; + cell = _textTableViewCell; + _textTableViewCell = nil; + } + else if ([identifier isEqualToString:TableCellIdentifierSecretText]) + { + [[NSBundle mainBundle] loadNibNamed:@"EditSecretTextTableViewCell" owner:self options:nil]; + cell = _secretTextTableViewCell; + _secretTextTableViewCell = nil; + } + else if ([identifier isEqualToString:TableCellIdentifierYesNo]) + { + [[NSBundle mainBundle] loadNibNamed:@"EditFlagTableViewCell" owner:self options:nil]; + cell = _flagTableViewCell; + _flagTableViewCell = nil; + } + else if ([identifier isEqualToString:TableCellIdentifierSelection]) + { + [[NSBundle mainBundle] loadNibNamed:@"EditSelectionTableViewCell" owner:self options:nil]; + cell = _selectionTableViewCell; + _selectionTableViewCell = nil; + } + else if ([identifier isEqualToString:TableCellIdentifierSubEditor]) + { + [[NSBundle mainBundle] loadNibNamed:@"EditSubEditTableViewCell" owner:self options:nil]; + cell = _subEditTableViewCell; + _subEditTableViewCell = nil; + } + else if ([identifier isEqualToString:TableCellIdentifierButton]) + { + [[NSBundle mainBundle] loadNibNamed:@"EditButtonTableViewCell" owner:self options:nil]; + cell = _buttonTableViewCell; + _buttonTableViewCell = nil; + } + else if ([identifier isEqualToString:TableCellIdentifierMultiChoice]) + { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 + reuseIdentifier:identifier] autorelease]; + } + else + { + NSAssert(false, @"Unknown table cell identifier"); + } + + return cell; +} + +#pragma mark - Utility functions +- (void)adjustEditTextTableViewCell:(EditTextTableViewCell *)cell +{ + UILabel *label = [cell label]; + UITextField *textField = [cell textfield]; + + // adjust label + CGFloat width = [[label text] sizeWithFont:[label font]].width; + CGRect frame = [label frame]; + CGFloat delta = width - frame.size.width; + frame.size.width = width; + [label setFrame:frame]; + + // adjust text field + frame = [textField frame]; + frame.origin.x += delta; + frame.size.width -= delta; + [textField setFrame:frame]; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/EditorSelectionController.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/EditorSelectionController.m new file mode 100644 index 0000000000000000000000000000000000000000..13a7363b8fb8d919bf9775b783dfd82e1b84bbb1 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/EditorSelectionController.m @@ -0,0 +1,143 @@ +/* + Generic controller to select a single item from a list of options + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "EditorSelectionController.h" +#import "ConnectionParams.h" +#import "OrderedDictionary.h" + +@interface EditorSelectionController (Private) +- (OrderedDictionary *)selectionForIndex:(int)index; +@end + +@implementation EditorSelectionController + +- (id)initWithConnectionParams:(ConnectionParams *)params + entries:(NSArray *)entries + selections:(NSArray *)selections +{ + self = [super initWithStyle:UITableViewStyleGrouped]; + if (self) + { + _params = [params retain]; + _entries = [entries retain]; + _selections = [selections retain]; + + // allocate and init current selections array + _cur_selections = [[NSMutableArray alloc] initWithCapacity:[_entries count]]; + for (int i = 0; i < [entries count]; ++i) + { + NSString *entry = [entries objectAtIndex:i]; + if ([_params hasValueForKeyPath:entry]) + { + NSUInteger idx = [(OrderedDictionary *)[selections objectAtIndex:i] + indexForValue:[NSNumber numberWithInt:[_params intForKeyPath:entry]]]; + [_cur_selections addObject:[NSNumber numberWithInt:(idx != NSNotFound ? idx : 0)]]; + } + else + [_cur_selections addObject:[NSNumber numberWithInt:0]]; + } + } + return self; +} + +- (void)didReceiveMemoryWarning +{ + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Release any cached data, images, etc that aren't in use. + [_params autorelease]; + [_entries autorelease]; + [_selections autorelease]; + [_cur_selections autorelease]; +} + +#pragma mark - View lifecycle + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + // Return YES for supported orientations + return YES; +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + // Return the number of sections. + return [_entries count]; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + // Return the number of rows in the section. + return [[self selectionForIndex:section] count]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell = [self tableViewCellFromIdentifier:TableCellIdentifierMultiChoice]; + + // get selection + OrderedDictionary *selection = [self selectionForIndex:[indexPath section]]; + + // set cell properties + [[cell textLabel] setText:[selection keyAtIndex:[indexPath row]]]; + + // set default checkmark + if ([indexPath row] == [[_cur_selections objectAtIndex:[indexPath section]] intValue]) + [cell setAccessoryType:UITableViewCellAccessoryCheckmark]; + else + [cell setAccessoryType:UITableViewCellAccessoryNone]; + + return cell; +} + +#pragma mark - Table view delegate + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + // has selection change? + int cur_selection = [[_cur_selections objectAtIndex:[indexPath section]] intValue]; + if ([indexPath row] != cur_selection) + { + [tableView deselectRowAtIndexPath:indexPath animated:NO]; + + NSIndexPath *oldIndexPath = [NSIndexPath indexPathForRow:cur_selection + inSection:[indexPath section]]; + + // clear old checkmark + UITableViewCell *old_sel_cell = [tableView cellForRowAtIndexPath:oldIndexPath]; + old_sel_cell.accessoryType = UITableViewCellAccessoryNone; + + // set new checkmark + UITableViewCell *new_sel_cell = [tableView cellForRowAtIndexPath:indexPath]; + new_sel_cell.accessoryType = UITableViewCellAccessoryCheckmark; + + // get value from selection dictionary + OrderedDictionary *dict = [self selectionForIndex:[indexPath section]]; + int sel_value = [[dict valueForKey:[dict keyAtIndex:[indexPath row]]] intValue]; + + // update selection index and params value + [_cur_selections replaceObjectAtIndex:[indexPath section] + withObject:[NSNumber numberWithInt:[indexPath row]]]; + [_params setInt:sel_value forKeyPath:[_entries objectAtIndex:[indexPath section]]]; + } +} + +#pragma mark - Convenience functions + +- (OrderedDictionary *)selectionForIndex:(int)index +{ + return (OrderedDictionary *)[_selections objectAtIndex:index]; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/EncryptionController.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/EncryptionController.h new file mode 100644 index 0000000000000000000000000000000000000000..f516cf635906238fddea3ad37cf55a6c49a315a7 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/EncryptionController.h @@ -0,0 +1,25 @@ +/* + Password Encryption Controller + + Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import +#import "Encryptor.h" + +@interface EncryptionController : NSObject +{ + Encryptor *_shared_encryptor; +} + ++ (EncryptionController *)sharedEncryptionController; + +// Return a Encryptor suitable for encrypting or decrypting with the master password +- (Encryptor *)decryptor; +- (Encryptor *)encryptor; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/EncryptionController.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/EncryptionController.m new file mode 100644 index 0000000000000000000000000000000000000000..2abb36f9d5e3571732faa7531f23d9230eee6ebf --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/EncryptionController.m @@ -0,0 +1,155 @@ +/* + Password Encryption Controller + + Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "EncryptionController.h" +#import "SFHFKeychainUtils.h" +#import "TSXAdditions.h" + +@interface EncryptionController (Private) + +- (BOOL)verifyPassword:(Encryptor *)decryptor; +- (NSData *)encryptedVerificationData; +- (void)setEncryptedVerificationData:(Encryptor *)encryptor; + +- (NSString *)keychainServerName; +- (NSString *)keychainUsername; +- (void)setKeychainPassword:(NSString *)password; +- (NSString *)keychainPassword; +- (NSString *)keychainDefaultPassword; + +@end + +static EncryptionController *_shared_encryption_controller = nil; + +#pragma mark - + +@implementation EncryptionController + ++ (EncryptionController *)sharedEncryptionController +{ + @synchronized(self) + { + if (_shared_encryption_controller == nil) + _shared_encryption_controller = [[EncryptionController alloc] init]; + } + + return _shared_encryption_controller; +} + +#pragma mark Getting an encryptor or decryptor + +- (Encryptor *)encryptor +{ + if (_shared_encryptor) + return _shared_encryptor; + + NSString *saved_password = [self keychainPassword]; + if (saved_password == nil) + { + saved_password = [self keychainDefaultPassword]; + Encryptor *encryptor = [[[Encryptor alloc] initWithPassword:saved_password] autorelease]; + [self setEncryptedVerificationData:encryptor]; + _shared_encryptor = [encryptor retain]; + } + else + { + Encryptor *encryptor = [[[Encryptor alloc] initWithPassword:saved_password] autorelease]; + if ([self verifyPassword:encryptor]) + _shared_encryptor = [encryptor retain]; + } + + return _shared_encryptor; +} + +// For the current implementation, decryptors and encryptors are equivalent. +- (Encryptor *)decryptor +{ + return [self encryptor]; +} + +@end + +#pragma mark - + +@implementation EncryptionController (Private) + +#pragma mark - +#pragma mark Keychain password storage + +- (NSString *)keychainServerName +{ + return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"]; +} + +- (NSString *)keychainUsername +{ + return @"master.password"; +} + +- (void)setKeychainPassword:(NSString *)password +{ + NSError *error; + if (password == nil) + { + [SFHFKeychainUtils deleteItemForUsername:[self keychainUsername] + andServerName:[self keychainServerName] + error:&error]; + return; + } + + [SFHFKeychainUtils storeUsername:[self keychainUsername] + andPassword:password + forServerName:[self keychainServerName] + updateExisting:YES + error:&error]; +} + +- (NSString *)keychainPassword +{ + NSError *error; + return [SFHFKeychainUtils getPasswordForUsername:[self keychainUsername] + andServerName:[self keychainServerName] + error:&error]; +} + +- (NSString *)keychainDefaultPassword +{ + NSString *password = [[NSUserDefaults standardUserDefaults] stringForKey:@"UUID"]; + if ([password length] == 0) + { + password = [NSString stringWithUUID]; + [[NSUserDefaults standardUserDefaults] setObject:password forKey:@"UUID"]; + [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"TSXMasterPasswordVerification"]; + } + return password; +} + +#pragma mark - +#pragma mark Verification of encryption key against verification data + +- (BOOL)verifyPassword:(Encryptor *)decryptor +{ + return [[decryptor plaintextPassword] + isEqualToString:[decryptor decryptString:[self encryptedVerificationData]]]; +} + +- (NSData *)encryptedVerificationData +{ + return [[NSUserDefaults standardUserDefaults] dataForKey:@"TSXMasterPasswordVerification"]; +} + +- (void)setEncryptedVerificationData:(Encryptor *)encryptor +{ + [[NSUserDefaults standardUserDefaults] + setObject:[encryptor encryptString:[encryptor plaintextPassword]] + forKey:@"TSXMasterPasswordVerification"]; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/HelpController.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/HelpController.h new file mode 100644 index 0000000000000000000000000000000000000000..9e7b93341362a6f9083fb646d78e4b498954200f --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/HelpController.h @@ -0,0 +1,17 @@ +/* + Application help controller + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import + +@interface HelpController : UIViewController +{ + UIWebView *webView; +} +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/HelpController.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/HelpController.m new file mode 100644 index 0000000000000000000000000000000000000000..7ea97c799ae7da614fdaa86ba2e3eaa7172fe0b0 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/HelpController.m @@ -0,0 +1,76 @@ +/* + Application help controller + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "HelpController.h" +#import "Utils.h" + +@implementation HelpController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) + { + // set title and tab-bar image + [self setTitle:NSLocalizedString(@"Help", @"Help Controller title")]; + UIImage *tabBarIcon = [UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"tabbar_icon_help" + ofType:@"png"]]; + [self setTabBarItem:[[[UITabBarItem alloc] + initWithTitle:NSLocalizedString(@"Help", @"Tabbar item help") + image:tabBarIcon + tag:0] autorelease]]; + } + return self; +} + +// Implement loadView to create a view hierarchy programmatically, without using a nib. +- (void)loadView +{ + webView = [[[UIWebView alloc] initWithFrame:CGRectZero] autorelease]; + [webView + setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [webView setAutoresizesSubviews:YES]; + [webView setDelegate:self]; + [webView setDataDetectorTypes:UIDataDetectorTypeNone]; + [self setView:webView]; +} + +- (void)dealloc +{ + [super dealloc]; +} + +// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. +- (void)viewDidLoad +{ + [super viewDidLoad]; + + NSString *filename = (IsPhone() ? @"gestures_phone" : @"gestures"); + NSString *htmlString = [[[NSString alloc] + initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:filename + ofType:@"html" + inDirectory:@"help_page"] + encoding:NSUTF8StringEncoding + error:nil] autorelease]; + + [webView + loadHTMLString:htmlString + baseURL:[NSURL fileURLWithPath:[[[NSBundle mainBundle] bundlePath] + stringByAppendingPathComponent:@"help_page"]]]; +} + +// Override to allow orientations other than the default portrait orientation. +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/MainTabBarController.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/MainTabBarController.h new file mode 100644 index 0000000000000000000000000000000000000000..d1b4c584b9b598706237a3f061bcb95d4fba8703 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/MainTabBarController.h @@ -0,0 +1,18 @@ +/* + main tabbar controller + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import +#import + +@interface MainTabBarController : UITabBarController +{ +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/MainTabBarController.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/MainTabBarController.m new file mode 100644 index 0000000000000000000000000000000000000000..afd71e8be5dd27c82daa3d3298e1d9e50af7277b --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/MainTabBarController.m @@ -0,0 +1,20 @@ +/* + main tabbar controller + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "MainTabBarController.h" + +@implementation MainTabBarController + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation +{ + return YES; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/PerformanceEditorController.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/PerformanceEditorController.h new file mode 100644 index 0000000000000000000000000000000000000000..c83cb47ee5faee3ac73ccc41bd7eddc71565db9f --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/PerformanceEditorController.h @@ -0,0 +1,25 @@ +/* + controller for performance settings selection + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "EditorBaseController.h" + +@class ConnectionParams; + +@interface PerformanceEditorController : EditorBaseController +{ + @private + ConnectionParams *_params; + NSString *_keyPath; +} + +- (id)initWithConnectionParams:(ConnectionParams *)params; +- (id)initWithConnectionParams:(ConnectionParams *)params keyPath:(NSString *)keyPath; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/PerformanceEditorController.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/PerformanceEditorController.m new file mode 100644 index 0000000000000000000000000000000000000000..1c50982c4029df5a9325d4aaf413c5434dee7ded --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/PerformanceEditorController.m @@ -0,0 +1,244 @@ +/* + controller for performance settings selection + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "PerformanceEditorController.h" +#import "ConnectionParams.h" +#import "Utils.h" + +@interface PerformanceEditorController (Private) +- (NSString *)keyPathForKey:(NSString *)key; +@end + +@implementation PerformanceEditorController + +- (id)initWithConnectionParams:(ConnectionParams *)params +{ + return [self initWithConnectionParams:params keyPath:nil]; +} + +- (id)initWithConnectionParams:(ConnectionParams *)params keyPath:(NSString *)keyPath; +{ + self = [super initWithStyle:UITableViewStyleGrouped]; + + if (self) + { + _params = [params retain]; + _keyPath = (keyPath != nil ? [keyPath retain] : nil); + } + + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +- (void)viewDidUnload +{ + [super viewDidUnload]; + // Release any retained subviews of the main view. +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +- (NSString *)keyPathForKey:(NSString *)key +{ + if (_keyPath) + return [_keyPath stringByAppendingFormat:@".%@", key]; + + return key; +} + +- (void)dealloc +{ + [super dealloc]; + [_params release]; +} + +#pragma mark - +#pragma mark Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + // Return the number of sections. + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return 7; +} + +// set section headers +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + return NSLocalizedString(@"Performance Settings", + @"'Performance Settings': performance settings header"); +} + +// Customize the appearance of table view cells. +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + // get the table view cell + EditFlagTableViewCell *cell = + (EditFlagTableViewCell *)[self tableViewCellFromIdentifier:TableCellIdentifierYesNo]; + NSAssert(cell, @"Invalid cell"); + + switch ([indexPath row]) + { + case 0: + { + [[cell label] setText:NSLocalizedString(@"RemoteFX", @"RemoteFX performance setting")]; + [[cell toggle] setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_remotefx"]]]; + break; + } + + case 1: + { + [[cell label] setText:NSLocalizedString(@"GFX", @"GFX performance setting")]; + [[cell toggle] setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_gfx"]]]; + break; + } + + case 2: + { + [[cell label] setText:NSLocalizedString(@"H264", @"H264 performance setting")]; + [[cell toggle] setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_h264"]]]; + break; + } + + case 3: + { + [[cell label] setText:NSLocalizedString(@"Desktop Background", + @"Desktop background performance setting")]; + [[cell toggle] + setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_show_desktop"]]]; + break; + } + + case 4: + { + [[cell label] setText:NSLocalizedString(@"Font Smoothing", + @"Font smoothing performance setting")]; + [[cell toggle] + setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_font_smoothing"]]]; + break; + } + + case 5: + { + [[cell label] setText:NSLocalizedString(@"Desktop Composition", + @"Desktop composition performance setting")]; + [[cell toggle] + setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_desktop_composition"]]]; + break; + } + + case 6: + { + [[cell label] setText:NSLocalizedString(@"Window contents while dragging", + @"Window Dragging performance setting")]; + [[cell toggle] + setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_window_dragging"]]]; + break; + } + + case 7: + { + [[cell label] setText:NSLocalizedString(@"Menu Animation", + @"Menu Animations performance setting")]; + [[cell toggle] + setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_menu_animation"]]]; + break; + } + + case 8: + { + [[cell label] + setText:NSLocalizedString(@"Visual Styles", @"Use Themes performance setting")]; + [[cell toggle] + setOn:[_params boolForKeyPath:[self keyPathForKey:@"perf_windows_themes"]]]; + break; + } + + default: + break; + } + + [[cell toggle] setTag:GET_TAG_FROM_PATH(indexPath)]; + [[cell toggle] addTarget:self + action:@selector(togglePerformanceSetting:) + forControlEvents:UIControlEventValueChanged]; + return cell; +} + +#pragma mark - +#pragma mark Action Handlers + +- (void)togglePerformanceSetting:(id)sender +{ + UISwitch *valueSwitch = (UISwitch *)sender; + + switch (valueSwitch.tag) + { + case GET_TAG(0, 0): + [_params setBool:[valueSwitch isOn] forKeyPath:[self keyPathForKey:@"perf_remotefx"]]; + break; + + case GET_TAG(0, 1): + [_params setBool:[valueSwitch isOn] forKeyPath:[self keyPathForKey:@"perf_gfx"]]; + break; + + case GET_TAG(0, 2): + [_params setBool:[valueSwitch isOn] forKeyPath:[self keyPathForKey:@"perf_h264"]]; + break; + + case GET_TAG(0, 3): + [_params setBool:[valueSwitch isOn] + forKeyPath:[self keyPathForKey:@"perf_show_desktop"]]; + break; + + case GET_TAG(0, 4): + [_params setBool:[valueSwitch isOn] + forKeyPath:[self keyPathForKey:@"perf_font_smoothing"]]; + break; + + case GET_TAG(0, 5): + [_params setBool:[valueSwitch isOn] + forKeyPath:[self keyPathForKey:@"perf_desktop_composition"]]; + break; + + case GET_TAG(0, 6): + [_params setBool:[valueSwitch isOn] + forKeyPath:[self keyPathForKey:@"perf_window_dragging"]]; + break; + + case GET_TAG(0, 7): + [_params setBool:[valueSwitch isOn] + forKeyPath:[self keyPathForKey:@"perf_menu_animation"]]; + break; + + case GET_TAG(0, 8): + [_params setBool:[valueSwitch isOn] + forKeyPath:[self keyPathForKey:@"perf_windows_themes"]]; + break; + + default: + break; + } +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/RDPSessionViewController.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/RDPSessionViewController.h new file mode 100644 index 0000000000000000000000000000000000000000..202708e25bf686b69a68f07ccf73204171d8e3a1 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/RDPSessionViewController.h @@ -0,0 +1,75 @@ +/* + RDP Session View Controller + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import +#import "RDPSession.h" +#import "RDPKeyboard.h" +#import "RDPSessionView.h" +#import "TouchPointerView.h" +#import "AdvancedKeyboardView.h" + +@interface RDPSessionViewController + : UIViewController +{ + // scrollview that hosts the rdp session view + IBOutlet UIScrollView *_session_scrollview; + + // rdp session view + IBOutlet RDPSessionView *_session_view; + + // touch pointer view + IBOutlet TouchPointerView *_touchpointer_view; + BOOL _autoscroll_with_touchpointer; + BOOL _is_autoscrolling; + + // rdp session toolbar + IBOutlet UIToolbar *_session_toolbar; + BOOL _session_toolbar_visible; + + // dummy text field used to display the keyboard + IBOutlet UITextField *_dummy_textfield; + + // connecting view and the controls within that view + IBOutlet UIView *_connecting_view; + IBOutlet UILabel *_lbl_connecting; + IBOutlet UIActivityIndicatorView *_connecting_indicator_view; + IBOutlet UIButton *_cancel_connect_button; + + // extended keyboard toolbar + UIToolbar *_keyboard_toolbar; + + // rdp session + RDPSession *_session; + BOOL _session_initilized; + + // flag that indicates whether the keyboard is visible or not + BOOL _keyboard_visible; + + // flag to switch between left/right mouse button mode + BOOL _toggle_mouse_button; + + // keyboard extension view + AdvancedKeyboardView *_advanced_keyboard_view; + BOOL _advanced_keyboard_visible; + BOOL _requesting_advanced_keyboard; + CGFloat _keyboard_last_height; + + // delayed mouse move event sending + NSTimer *_mouse_move_event_timer; + int _mouse_move_events_skipped; + CGPoint _prev_long_press_position; +} + +- (id)initWithNibName:(NSString *)nibNameOrNil + bundle:(NSBundle *)nibBundleOrNil + session:(RDPSession *)session; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/RDPSessionViewController.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/RDPSessionViewController.m new file mode 100644 index 0000000000000000000000000000000000000000..161564ce1ac623d1788ff432ceabc8cdcc91ef53 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/RDPSessionViewController.m @@ -0,0 +1,1113 @@ +/* + RDP Session View Controller + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import +#import "RDPSessionViewController.h" +#import "RDPKeyboard.h" +#import "Utils.h" +#import "Toast+UIView.h" +#import "ConnectionParams.h" +#import "CredentialsInputController.h" +#import "VerifyCertificateController.h" +#import "BlockAlertView.h" + +#define TOOLBAR_HEIGHT 30 + +#define AUTOSCROLLDISTANCE 20 +#define AUTOSCROLLTIMEOUT 0.05 + +@interface RDPSessionViewController (Private) +- (void)showSessionToolbar:(BOOL)show; +- (UIToolbar *)keyboardToolbar; +- (void)initGestureRecognizers; +- (void)suspendSession; +- (NSDictionary *)eventDescriptorForMouseEvent:(int)event position:(CGPoint)position; +- (void)handleMouseMoveForPosition:(CGPoint)position; +@end + +@implementation RDPSessionViewController + +#pragma mark class methods + +- (id)initWithNibName:(NSString *)nibNameOrNil + bundle:(NSBundle *)nibBundleOrNil + session:(RDPSession *)session +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) + { + _session = [session retain]; + [_session setDelegate:self]; + _session_initilized = NO; + + _mouse_move_events_skipped = 0; + _mouse_move_event_timer = nil; + + _advanced_keyboard_view = nil; + _advanced_keyboard_visible = NO; + _requesting_advanced_keyboard = NO; + _keyboard_last_height = 0; + + _session_toolbar_visible = NO; + + _toggle_mouse_button = NO; + + _autoscroll_with_touchpointer = + [[NSUserDefaults standardUserDefaults] boolForKey:@"ui.auto_scroll_touchpointer"]; + _is_autoscrolling = NO; + + [UIView setAnimationDelegate:self]; + [UIView setAnimationDidStopSelector:@selector(animationStopped:finished:context:)]; + } + + return self; +} + +// Implement loadView to create a view hierarchy programmatically, without using a nib. +- (void)loadView +{ + // load default view and set background color and resizing mask + [super loadView]; + + // init keyboard handling vars + _keyboard_visible = NO; + + // init keyboard toolbar + _keyboard_toolbar = [[self keyboardToolbar] retain]; + [_dummy_textfield setInputAccessoryView:_keyboard_toolbar]; + + // init gesture recognizers + [self initGestureRecognizers]; + + // hide session toolbar + [_session_toolbar + setFrame:CGRectMake(0.0, -TOOLBAR_HEIGHT, [[self view] bounds].size.width, TOOLBAR_HEIGHT)]; +} + +// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. +- (void)viewDidLoad +{ + [super viewDidLoad]; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation +{ + if (![_touchpointer_view isHidden]) + [_touchpointer_view ensurePointerIsVisible]; +} + +- (void)didReceiveMemoryWarning +{ + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Release any cached data, images, etc. that aren't in use. +} + +- (void)viewDidUnload +{ + [super viewDidUnload]; + // Release any retained subviews of the main view. + // e.g. self.myOutlet = nil; +} + +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + + // hide navigation bar and (if enabled) the status bar + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"ui.hide_status_bar"]) + { + if (animated == YES) + [[UIApplication sharedApplication] setStatusBarHidden:YES + withAnimation:UIStatusBarAnimationSlide]; + else + [[UIApplication sharedApplication] setStatusBarHidden:YES + withAnimation:UIStatusBarAnimationNone]; + } + [[self navigationController] setNavigationBarHidden:YES animated:animated]; + + // if session is suspended - notify that we got a new bitmap context + if ([_session isSuspended]) + [self sessionBitmapContextWillChange:_session]; + + // init keyboard + [[RDPKeyboard getSharedRDPKeyboard] initWithSession:_session delegate:self]; +} + +- (void)viewDidAppear:(BOOL)animated +{ + [super viewDidAppear:animated]; + + if (!_session_initilized) + { + if ([_session isSuspended]) + { + [_session resume]; + [self sessionBitmapContextDidChange:_session]; + [_session_view setNeedsDisplay]; + } + else + [_session connect]; + + _session_initilized = YES; + } +} + +- (void)viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; + + // show navigation and status bar again + if (animated == YES) + [[UIApplication sharedApplication] setStatusBarHidden:NO + withAnimation:UIStatusBarAnimationSlide]; + else + [[UIApplication sharedApplication] setStatusBarHidden:NO + withAnimation:UIStatusBarAnimationNone]; + [[self navigationController] setNavigationBarHidden:NO animated:animated]; + + // reset all modifier keys on rdp keyboard + [[RDPKeyboard getSharedRDPKeyboard] reset]; + + // hide toolbar and keyboard + [self showSessionToolbar:NO]; + [_dummy_textfield resignFirstResponder]; +} + +- (void)dealloc +{ + // remove any observers + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + // the session lives on longer so set the delegate to nil + [_session setDelegate:nil]; + + [_advanced_keyboard_view release]; + [_keyboard_toolbar release]; + [_session release]; + [super dealloc]; +} + +#pragma mark - +#pragma mark ScrollView delegate methods + +- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView +{ + return _session_view; +} + +- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView + withView:(UIView *)view + atScale:(float)scale +{ + NSLog(@"New zoom scale: %f", scale); + [_session_view setNeedsDisplay]; +} + +#pragma mark - +#pragma mark TextField delegate methods +- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField +{ + _keyboard_visible = YES; + _advanced_keyboard_visible = NO; + return YES; +} + +- (BOOL)textFieldShouldEndEditing:(UITextField *)textField +{ + _keyboard_visible = NO; + _advanced_keyboard_visible = NO; + return YES; +} + +- (BOOL)textField:(UITextField *)textField + shouldChangeCharactersInRange:(NSRange)range + replacementString:(NSString *)string +{ + if ([string length] > 0) + { + for (int i = 0; i < [string length]; i++) + { + unichar curChar = [string characterAtIndex:i]; + + // special handling for return/enter key + if (curChar == '\n') + [[RDPKeyboard getSharedRDPKeyboard] sendEnterKeyStroke]; + else + [[RDPKeyboard getSharedRDPKeyboard] sendUnicode:curChar]; + } + } + else + { + [[RDPKeyboard getSharedRDPKeyboard] sendBackspaceKeyStroke]; + } + + return NO; +} + +#pragma mark - +#pragma mark AdvancedKeyboardDelegate functions +- (void)advancedKeyPressedVKey:(int)key +{ + [[RDPKeyboard getSharedRDPKeyboard] sendVirtualKeyCode:key]; +} + +- (void)advancedKeyPressedUnicode:(int)key +{ + [[RDPKeyboard getSharedRDPKeyboard] sendUnicode:key]; +} + +#pragma mark - RDP keyboard handler + +- (void)modifiersChangedForKeyboard:(RDPKeyboard *)keyboard +{ + UIBarButtonItem *curItem; + + // shift button (only on iPad) + int objectIdx = 0; + if (IsPad()) + { + objectIdx = 2; + curItem = (UIBarButtonItem *)[[_keyboard_toolbar items] objectAtIndex:objectIdx]; + [curItem setStyle:[keyboard shiftPressed] ? UIBarButtonItemStyleDone + : UIBarButtonItemStyleBordered]; + } + + // ctrl button + objectIdx += 2; + curItem = (UIBarButtonItem *)[[_keyboard_toolbar items] objectAtIndex:objectIdx]; + [curItem + setStyle:[keyboard ctrlPressed] ? UIBarButtonItemStyleDone : UIBarButtonItemStyleBordered]; + + // win button + objectIdx += 2; + curItem = (UIBarButtonItem *)[[_keyboard_toolbar items] objectAtIndex:objectIdx]; + [curItem + setStyle:[keyboard winPressed] ? UIBarButtonItemStyleDone : UIBarButtonItemStyleBordered]; + + // alt button + objectIdx += 2; + curItem = (UIBarButtonItem *)[[_keyboard_toolbar items] objectAtIndex:objectIdx]; + [curItem + setStyle:[keyboard altPressed] ? UIBarButtonItemStyleDone : UIBarButtonItemStyleBordered]; +} + +#pragma mark - +#pragma mark RDPSessionDelegate functions + +- (void)session:(RDPSession *)session didFailToConnect:(int)reason +{ + // remove and release connecting view + [_connecting_indicator_view stopAnimating]; + [_connecting_view removeFromSuperview]; + [_connecting_view autorelease]; + + // return to bookmark list + [[self navigationController] popViewControllerAnimated:YES]; +} + +- (void)sessionWillConnect:(RDPSession *)session +{ + // load connecting view + [[NSBundle mainBundle] loadNibNamed:@"RDPConnectingView" owner:self options:nil]; + + // set strings + [_lbl_connecting setText:NSLocalizedString(@"Connecting", @"Connecting progress view - label")]; + [_cancel_connect_button setTitle:NSLocalizedString(@"Cancel", @"Cancel Button") + forState:UIControlStateNormal]; + + // center view and give it round corners + [_connecting_view setCenter:[[self view] center]]; + [[_connecting_view layer] setCornerRadius:10]; + + // display connecting view and start indicator + [[self view] addSubview:_connecting_view]; + [_connecting_indicator_view startAnimating]; +} + +- (void)sessionDidConnect:(RDPSession *)session +{ + // register keyboard notification handlers + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardWillShow:) + name:UIKeyboardWillShowNotification + object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardDidShow:) + name:UIKeyboardDidShowNotification + object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardWillHide:) + name:UIKeyboardWillHideNotification + object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardDidHide:) + name:UIKeyboardDidHideNotification + object:nil]; + + // remove and release connecting view + [_connecting_indicator_view stopAnimating]; + [_connecting_view removeFromSuperview]; + [_connecting_view autorelease]; + + // check if session settings changed ... + // The 2nd width check is to ignore changes in resolution settings due to the RDVH display bug + // (refer to RDPSEssion.m for more details) + ConnectionParams *orig_params = [session params]; + rdpSettings *sess_params = [session getSessionParams]; + if (([orig_params intForKey:@"width"] != sess_params->DesktopWidth && + [orig_params intForKey:@"width"] != (sess_params->DesktopWidth + 1)) || + [orig_params intForKey:@"height"] != sess_params->DesktopHeight || + [orig_params intForKey:@"colors"] != sess_params->ColorDepth) + { + // display notification that the session params have been changed by the server + NSString *message = + [NSString stringWithFormat:NSLocalizedString( + @"The server changed the screen settings to %dx%dx%d", + @"Screen settings not supported message with width, " + @"height and colors parameter"), + sess_params->DesktopWidth, sess_params->DesktopHeight, + sess_params->ColorDepth]; + [[self view] makeToast:message duration:ToastDurationNormal position:@"bottom"]; + } +} + +- (void)sessionWillDisconnect:(RDPSession *)session +{ +} + +- (void)sessionDidDisconnect:(RDPSession *)session +{ + // return to bookmark list + [[self navigationController] popViewControllerAnimated:YES]; +} + +- (void)sessionBitmapContextWillChange:(RDPSession *)session +{ + // calc new view frame + rdpSettings *sess_params = [session getSessionParams]; + CGRect view_rect = CGRectMake(0, 0, sess_params->DesktopWidth, sess_params->DesktopHeight); + + // reset zoom level and update content size + [_session_scrollview setZoomScale:1.0]; + [_session_scrollview setContentSize:view_rect.size]; + + // set session view size + [_session_view setFrame:view_rect]; + + // show/hide toolbar + [_session + setToolbarVisible:![[NSUserDefaults standardUserDefaults] boolForKey:@"ui.hide_tool_bar"]]; + [self showSessionToolbar:[_session toolbarVisible]]; +} + +- (void)sessionBitmapContextDidChange:(RDPSession *)session +{ + // associate view with session + [_session_view setSession:session]; + + // issue an update (this might be needed in case we had a resize for instance) + [_session_view setNeedsDisplay]; +} + +- (void)session:(RDPSession *)session needsRedrawInRect:(CGRect)rect +{ + [_session_view setNeedsDisplayInRect:rect]; +} + +- (void)session:(RDPSession *)session requestsAuthenticationWithParams:(NSMutableDictionary *)params +{ + CredentialsInputController *view_controller = + [[[CredentialsInputController alloc] initWithNibName:@"CredentialsInputView" + bundle:nil + session:_session + params:params] autorelease]; + [self presentModalViewController:view_controller animated:YES]; +} + +- (void)session:(RDPSession *)session verifyCertificateWithParams:(NSMutableDictionary *)params +{ + VerifyCertificateController *view_controller = + [[[VerifyCertificateController alloc] initWithNibName:@"VerifyCertificateView" + bundle:nil + session:_session + params:params] autorelease]; + [self presentModalViewController:view_controller animated:YES]; +} + +- (CGSize)sizeForFitScreenForSession:(RDPSession *)session +{ + if (IsPad()) + return [self view].bounds.size; + else + { + // on phones make a resolution that has a 16:10 ratio with the phone's height + CGSize size = [self view].bounds.size; + CGFloat maxSize = (size.width > size.height) ? size.width : size.height; + return CGSizeMake(maxSize * 1.6f, maxSize); + } +} + +#pragma mark - Keyboard Toolbar Handlers + +- (void)showAdvancedKeyboardAnimated +{ + // calc initial and final rect of the advanced keyboard view + CGRect rect = [[_keyboard_toolbar superview] bounds]; + rect.origin.y = [_keyboard_toolbar bounds].size.height; + rect.size.height -= rect.origin.y; + + // create new view (hidden) and add to host-view of keyboard toolbar + _advanced_keyboard_view = [[AdvancedKeyboardView alloc] + initWithFrame:CGRectMake(rect.origin.x, [[_keyboard_toolbar superview] bounds].size.height, + rect.size.width, rect.size.height) + delegate:self]; + [[_keyboard_toolbar superview] addSubview:_advanced_keyboard_view]; + // we set autoresize to YES for the keyboard toolbar's superview so that our adv. keyboard view + // gets properly resized + [[_keyboard_toolbar superview] setAutoresizesSubviews:YES]; + + // show view with animation + [UIView beginAnimations:nil context:NULL]; + [_advanced_keyboard_view setFrame:rect]; + [UIView commitAnimations]; +} + +- (IBAction)toggleKeyboardWhenOtherVisible:(id)sender +{ + if (_advanced_keyboard_visible == NO) + { + [self showAdvancedKeyboardAnimated]; + } + else + { + // hide existing view + [UIView beginAnimations:@"hide_advanced_keyboard_view" context:NULL]; + CGRect rect = [_advanced_keyboard_view frame]; + rect.origin.y = [[_keyboard_toolbar superview] bounds].size.height; + [_advanced_keyboard_view setFrame:rect]; + [UIView commitAnimations]; + + // the view is released in the animationDidStop selector registered in init + } + + // toggle flag + _advanced_keyboard_visible = !_advanced_keyboard_visible; +} + +- (IBAction)toggleWinKey:(id)sender +{ + [[RDPKeyboard getSharedRDPKeyboard] toggleWinKey]; +} + +- (IBAction)toggleShiftKey:(id)sender +{ + [[RDPKeyboard getSharedRDPKeyboard] toggleShiftKey]; +} + +- (IBAction)toggleCtrlKey:(id)sender +{ + [[RDPKeyboard getSharedRDPKeyboard] toggleCtrlKey]; +} + +- (IBAction)toggleAltKey:(id)sender +{ + [[RDPKeyboard getSharedRDPKeyboard] toggleAltKey]; +} + +- (IBAction)pressEscKey:(id)sender +{ + [[RDPKeyboard getSharedRDPKeyboard] sendEscapeKeyStroke]; +} + +#pragma mark - +#pragma mark event handlers + +- (void)animationStopped:(NSString *)animationID + finished:(NSNumber *)finished + context:(void *)context +{ + if ([animationID isEqualToString:@"hide_advanced_keyboard_view"]) + { + // cleanup advanced keyboard view + [_advanced_keyboard_view removeFromSuperview]; + [_advanced_keyboard_view autorelease]; + _advanced_keyboard_view = nil; + } +} + +- (IBAction)switchSession:(id)sender +{ + [self suspendSession]; +} + +- (IBAction)toggleKeyboard:(id)sender +{ + if (!_keyboard_visible) + [_dummy_textfield becomeFirstResponder]; + else + [_dummy_textfield resignFirstResponder]; +} + +- (IBAction)toggleExtKeyboard:(id)sender +{ + // if the sys kb is shown but not the advanced kb then toggle the advanced kb + if (_keyboard_visible && !_advanced_keyboard_visible) + [self toggleKeyboardWhenOtherVisible:nil]; + else + { + // if not visible request the advanced keyboard view + if (_advanced_keyboard_visible == NO) + _requesting_advanced_keyboard = YES; + [self toggleKeyboard:nil]; + } +} + +- (IBAction)toggleTouchPointer:(id)sender +{ + BOOL toggle_visibilty = ![_touchpointer_view isHidden]; + [_touchpointer_view setHidden:toggle_visibilty]; + if (toggle_visibilty) + [_session_scrollview setContentInset:UIEdgeInsetsZero]; + else + [_session_scrollview setContentInset:[_touchpointer_view getEdgeInsets]]; +} + +- (IBAction)disconnectSession:(id)sender +{ + [_session disconnect]; +} + +- (IBAction)cancelButtonPressed:(id)sender +{ + [_session disconnect]; +} + +#pragma mark - +#pragma mark iOS Keyboard Notification Handlers + +// the keyboard is given in a portrait frame of reference +- (BOOL)isLandscape +{ + + UIInterfaceOrientation ori = [[UIApplication sharedApplication] statusBarOrientation]; + return (ori == UIInterfaceOrientationLandscapeLeft || + ori == UIInterfaceOrientationLandscapeRight); +} + +- (void)shiftKeyboard:(NSNotification *)notification +{ + + CGRect keyboardEndFrame = + [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; + + CGFloat previousHeight = _keyboard_last_height; + + if ([self isLandscape]) + { + // landscape has the keyboard based on x, so x can go negative + _keyboard_last_height = keyboardEndFrame.size.width + keyboardEndFrame.origin.x; + } + else + { + // portrait has the keyboard based on the difference of the height and the frames y. + CGFloat height = [[UIScreen mainScreen] bounds].size.height; + _keyboard_last_height = height - keyboardEndFrame.origin.y; + } + + CGFloat shiftHeight = _keyboard_last_height - previousHeight; + + [UIView beginAnimations:nil context:NULL]; + [UIView setAnimationCurve:[[[notification userInfo] + objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]]; + [UIView + setAnimationDuration:[[[notification userInfo] + objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]]; + CGRect frame = [_session_scrollview frame]; + frame.size.height -= shiftHeight; + [_session_scrollview setFrame:frame]; + [_touchpointer_view setFrame:frame]; + [UIView commitAnimations]; +} + +- (void)keyboardWillShow:(NSNotification *)notification +{ + [self shiftKeyboard:notification]; + + [_touchpointer_view ensurePointerIsVisible]; +} + +- (void)keyboardDidShow:(NSNotification *)notification +{ + if (_requesting_advanced_keyboard) + { + [self showAdvancedKeyboardAnimated]; + _advanced_keyboard_visible = YES; + _requesting_advanced_keyboard = NO; + } +} + +- (void)keyboardWillHide:(NSNotification *)notification +{ + + [self shiftKeyboard:notification]; +} + +- (void)keyboardDidHide:(NSNotification *)notification +{ + // release adanced keyboard view + if (_advanced_keyboard_visible == YES) + { + _advanced_keyboard_visible = NO; + [_advanced_keyboard_view removeFromSuperview]; + [_advanced_keyboard_view autorelease]; + _advanced_keyboard_view = nil; + } +} + +#pragma mark - +#pragma mark Gesture handlers + +- (void)handleSingleTap:(UITapGestureRecognizer *)gesture +{ + CGPoint pos = [gesture locationInView:_session_view]; + if (_toggle_mouse_button) + { + [_session + sendInputEvent:[self eventDescriptorForMouseEvent:GetRightMouseButtonClickEvent(YES) + position:pos]]; + [_session + sendInputEvent:[self eventDescriptorForMouseEvent:GetRightMouseButtonClickEvent(NO) + position:pos]]; + } + else + { + [_session + sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(YES) + position:pos]]; + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(NO) + position:pos]]; + } + + _toggle_mouse_button = NO; +} + +- (void)handleDoubleTap:(UITapGestureRecognizer *)gesture +{ + CGPoint pos = [gesture locationInView:_session_view]; + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(YES) + position:pos]]; + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(NO) + position:pos]]; + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(YES) + position:pos]]; + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(NO) + position:pos]]; + _toggle_mouse_button = NO; +} + +- (void)handleLongPress:(UILongPressGestureRecognizer *)gesture +{ + CGPoint pos = [gesture locationInView:_session_view]; + + if ([gesture state] == UIGestureRecognizerStateBegan) + [_session + sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(YES) + position:pos]]; + else if ([gesture state] == UIGestureRecognizerStateChanged) + [self handleMouseMoveForPosition:pos]; + else if ([gesture state] == UIGestureRecognizerStateEnded) + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(NO) + position:pos]]; +} + +- (void)handleDoubleLongPress:(UILongPressGestureRecognizer *)gesture +{ + // this point is mapped against the scroll view because we want to have relative movement to the + // screen/scrollview + CGPoint pos = [gesture locationInView:_session_scrollview]; + + if ([gesture state] == UIGestureRecognizerStateBegan) + _prev_long_press_position = pos; + else if ([gesture state] == UIGestureRecognizerStateChanged) + { + int delta = _prev_long_press_position.y - pos.y; + + if (delta > GetScrollGestureDelta()) + { + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetMouseWheelEvent(YES) + position:pos]]; + _prev_long_press_position = pos; + } + else if (delta < -GetScrollGestureDelta()) + { + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetMouseWheelEvent(NO) + position:pos]]; + _prev_long_press_position = pos; + } + } +} + +- (void)handleSingle2FingersTap:(UITapGestureRecognizer *)gesture +{ + _toggle_mouse_button = !_toggle_mouse_button; +} + +- (void)handleSingle3FingersTap:(UITapGestureRecognizer *)gesture +{ + [_session setToolbarVisible:![_session toolbarVisible]]; + [self showSessionToolbar:[_session toolbarVisible]]; +} + +#pragma mark - +#pragma mark Touch Pointer delegates +// callback if touch pointer should be closed +- (void)touchPointerClose +{ + [self toggleTouchPointer:nil]; +} + +// callback for a left click action +- (void)touchPointerLeftClick:(CGPoint)pos down:(BOOL)down +{ + CGPoint session_view_pos = [_touchpointer_view convertPoint:pos toView:_session_view]; + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetLeftMouseButtonClickEvent(down) + position:session_view_pos]]; +} + +// callback for a right click action +- (void)touchPointerRightClick:(CGPoint)pos down:(BOOL)down +{ + CGPoint session_view_pos = [_touchpointer_view convertPoint:pos toView:_session_view]; + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetRightMouseButtonClickEvent(down) + position:session_view_pos]]; +} + +- (void)doAutoScrolling +{ + int scrollX = 0; + int scrollY = 0; + CGPoint curPointerPos = [_touchpointer_view getPointerPosition]; + CGRect viewBounds = [_touchpointer_view bounds]; + CGRect scrollBounds = [_session_view bounds]; + + // add content insets to scroll bounds + scrollBounds.size.width += [_session_scrollview contentInset].right; + scrollBounds.size.height += [_session_scrollview contentInset].bottom; + + // add zoom factor + scrollBounds.size.width *= [_session_scrollview zoomScale]; + scrollBounds.size.height *= [_session_scrollview zoomScale]; + + if (curPointerPos.x > (viewBounds.size.width - [_touchpointer_view getPointerWidth])) + scrollX = AUTOSCROLLDISTANCE; + else if (curPointerPos.x < 0) + scrollX = -AUTOSCROLLDISTANCE; + + if (curPointerPos.y > (viewBounds.size.height - [_touchpointer_view getPointerHeight])) + scrollY = AUTOSCROLLDISTANCE; + else if (curPointerPos.y < (_session_toolbar_visible ? TOOLBAR_HEIGHT : 0)) + scrollY = -AUTOSCROLLDISTANCE; + + CGPoint newOffset = [_session_scrollview contentOffset]; + newOffset.x += scrollX; + newOffset.y += scrollY; + + // if offset is going off screen - stop scrolling in that direction + if (newOffset.x < 0) + { + scrollX = 0; + newOffset.x = 0; + } + else if (newOffset.x > (scrollBounds.size.width - viewBounds.size.width)) + { + scrollX = 0; + newOffset.x = MAX(scrollBounds.size.width - viewBounds.size.width, 0); + } + if (newOffset.y < 0) + { + scrollY = 0; + newOffset.y = 0; + } + else if (newOffset.y > (scrollBounds.size.height - viewBounds.size.height)) + { + scrollY = 0; + newOffset.y = MAX(scrollBounds.size.height - viewBounds.size.height, 0); + } + + // perform scrolling + [_session_scrollview setContentOffset:newOffset]; + + // continue scrolling? + if (scrollX != 0 || scrollY != 0) + [self performSelector:@selector(doAutoScrolling) + withObject:nil + afterDelay:AUTOSCROLLTIMEOUT]; + else + _is_autoscrolling = NO; +} + +// callback for a right click action +- (void)touchPointerMove:(CGPoint)pos +{ + CGPoint session_view_pos = [_touchpointer_view convertPoint:pos toView:_session_view]; + [self handleMouseMoveForPosition:session_view_pos]; + + if (_autoscroll_with_touchpointer && !_is_autoscrolling) + { + _is_autoscrolling = YES; + [self performSelector:@selector(doAutoScrolling) + withObject:nil + afterDelay:AUTOSCROLLTIMEOUT]; + } +} + +// callback if scrolling is performed +- (void)touchPointerScrollDown:(BOOL)down +{ + [_session sendInputEvent:[self eventDescriptorForMouseEvent:GetMouseWheelEvent(down) + position:CGPointZero]]; +} + +// callback for toggling the standard keyboard +- (void)touchPointerToggleKeyboard +{ + if (_advanced_keyboard_visible) + [self toggleKeyboardWhenOtherVisible:nil]; + else + [self toggleKeyboard:nil]; +} + +// callback for toggling the extended keyboard +- (void)touchPointerToggleExtendedKeyboard +{ + [self toggleExtKeyboard:nil]; +} + +// callback for reset view +- (void)touchPointerResetSessionView +{ + [_session_scrollview setZoomScale:1.0 animated:YES]; +} + +@end + +@implementation RDPSessionViewController (Private) + +#pragma mark - +#pragma mark Helper functions + +- (void)showSessionToolbar:(BOOL)show +{ + // already shown or hidden? + if (_session_toolbar_visible == show) + return; + + if (show) + { + [UIView beginAnimations:@"showToolbar" context:nil]; + [UIView setAnimationDuration:.4]; + [UIView setAnimationCurve:UIViewAnimationCurveLinear]; + [_session_toolbar + setFrame:CGRectMake(0.0, 0.0, [[self view] bounds].size.width, TOOLBAR_HEIGHT)]; + [UIView commitAnimations]; + _session_toolbar_visible = YES; + } + else + { + [UIView beginAnimations:@"hideToolbar" context:nil]; + [UIView setAnimationDuration:.4]; + [UIView setAnimationCurve:UIViewAnimationCurveLinear]; + [_session_toolbar setFrame:CGRectMake(0.0, -TOOLBAR_HEIGHT, [[self view] bounds].size.width, + TOOLBAR_HEIGHT)]; + [UIView commitAnimations]; + _session_toolbar_visible = NO; + } +} + +- (UIToolbar *)keyboardToolbar +{ + UIToolbar *keyboard_toolbar = [[[UIToolbar alloc] initWithFrame:CGRectNull] autorelease]; + [keyboard_toolbar setBarStyle:UIBarStyleBlackOpaque]; + + UIBarButtonItem *esc_btn = + [[[UIBarButtonItem alloc] initWithTitle:@"Esc" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(pressEscKey:)] autorelease]; + UIImage *win_icon = + [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"toolbar_icon_win" + ofType:@"png"]]; + UIBarButtonItem *win_btn = + [[[UIBarButtonItem alloc] initWithImage:win_icon + style:UIBarButtonItemStyleBordered + target:self + action:@selector(toggleWinKey:)] autorelease]; + UIBarButtonItem *ctrl_btn = + [[[UIBarButtonItem alloc] initWithTitle:@"Ctrl" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(toggleCtrlKey:)] autorelease]; + UIBarButtonItem *alt_btn = + [[[UIBarButtonItem alloc] initWithTitle:@"Alt" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(toggleAltKey:)] autorelease]; + UIBarButtonItem *ext_btn = [[[UIBarButtonItem alloc] + initWithTitle:@"Ext" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(toggleKeyboardWhenOtherVisible:)] autorelease]; + UIBarButtonItem *done_btn = [[[UIBarButtonItem alloc] + initWithBarButtonSystemItem:UIBarButtonSystemItemDone + target:self + action:@selector(toggleKeyboard:)] autorelease]; + UIBarButtonItem *flex_spacer = + [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace + target:nil + action:nil] autorelease]; + + // iPad gets a shift button, iphone doesn't (there's just not enough space ...) + NSArray *items; + if (IsPad()) + { + UIBarButtonItem *shift_btn = + [[[UIBarButtonItem alloc] initWithTitle:@"Shift" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(toggleShiftKey:)] autorelease]; + items = [NSArray arrayWithObjects:esc_btn, flex_spacer, shift_btn, flex_spacer, ctrl_btn, + flex_spacer, win_btn, flex_spacer, alt_btn, flex_spacer, + ext_btn, flex_spacer, done_btn, nil]; + } + else + { + items = [NSArray arrayWithObjects:esc_btn, flex_spacer, ctrl_btn, flex_spacer, win_btn, + flex_spacer, alt_btn, flex_spacer, ext_btn, flex_spacer, + done_btn, nil]; + } + + [keyboard_toolbar setItems:items]; + [keyboard_toolbar sizeToFit]; + return keyboard_toolbar; +} + +- (void)initGestureRecognizers +{ + // single and double tap recognizer + UITapGestureRecognizer *doubleTapRecognizer = + [[[UITapGestureRecognizer alloc] initWithTarget:self + action:@selector(handleDoubleTap:)] autorelease]; + [doubleTapRecognizer setNumberOfTouchesRequired:1]; + [doubleTapRecognizer setNumberOfTapsRequired:2]; + + UITapGestureRecognizer *singleTapRecognizer = + [[[UITapGestureRecognizer alloc] initWithTarget:self + action:@selector(handleSingleTap:)] autorelease]; + [singleTapRecognizer requireGestureRecognizerToFail:doubleTapRecognizer]; + [singleTapRecognizer setNumberOfTouchesRequired:1]; + [singleTapRecognizer setNumberOfTapsRequired:1]; + + // 2 fingers - tap recognizer + UITapGestureRecognizer *single2FingersTapRecognizer = [[[UITapGestureRecognizer alloc] + initWithTarget:self + action:@selector(handleSingle2FingersTap:)] autorelease]; + [single2FingersTapRecognizer setNumberOfTouchesRequired:2]; + [single2FingersTapRecognizer setNumberOfTapsRequired:1]; + + // long press gesture recognizer + UILongPressGestureRecognizer *longPressRecognizer = [[[UILongPressGestureRecognizer alloc] + initWithTarget:self + action:@selector(handleLongPress:)] autorelease]; + [longPressRecognizer setMinimumPressDuration:0.5]; + + // double long press gesture recognizer + UILongPressGestureRecognizer *doubleLongPressRecognizer = [[[UILongPressGestureRecognizer alloc] + initWithTarget:self + action:@selector(handleDoubleLongPress:)] autorelease]; + [doubleLongPressRecognizer setNumberOfTouchesRequired:2]; + [doubleLongPressRecognizer setMinimumPressDuration:0.5]; + + // 3 finger, single tap gesture for showing/hiding the toolbar + UITapGestureRecognizer *single3FingersTapRecognizer = [[[UITapGestureRecognizer alloc] + initWithTarget:self + action:@selector(handleSingle3FingersTap:)] autorelease]; + [single3FingersTapRecognizer setNumberOfTapsRequired:1]; + [single3FingersTapRecognizer setNumberOfTouchesRequired:3]; + + // add gestures to scroll view + [_session_scrollview addGestureRecognizer:singleTapRecognizer]; + [_session_scrollview addGestureRecognizer:doubleTapRecognizer]; + [_session_scrollview addGestureRecognizer:single2FingersTapRecognizer]; + [_session_scrollview addGestureRecognizer:longPressRecognizer]; + [_session_scrollview addGestureRecognizer:doubleLongPressRecognizer]; + [_session_scrollview addGestureRecognizer:single3FingersTapRecognizer]; +} + +- (void)suspendSession +{ + // suspend session and pop navigation controller + [_session suspend]; + + // pop current view controller + [[self navigationController] popViewControllerAnimated:YES]; +} + +- (NSDictionary *)eventDescriptorForMouseEvent:(int)event position:(CGPoint)position +{ + return [NSDictionary + dictionaryWithObjectsAndKeys:@"mouse", @"type", [NSNumber numberWithUnsignedShort:event], + @"flags", + [NSNumber numberWithUnsignedShort:lrintf(position.x)], + @"coord_x", + [NSNumber numberWithUnsignedShort:lrintf(position.y)], + @"coord_y", nil]; +} + +- (void)sendDelayedMouseEventWithTimer:(NSTimer *)timer +{ + _mouse_move_event_timer = nil; + NSDictionary *event = [timer userInfo]; + [_session sendInputEvent:event]; + [timer autorelease]; +} + +- (void)handleMouseMoveForPosition:(CGPoint)position +{ + NSDictionary *event = [self eventDescriptorForMouseEvent:PTR_FLAGS_MOVE position:position]; + + // cancel pending mouse move events + [_mouse_move_event_timer invalidate]; + _mouse_move_events_skipped++; + + if (_mouse_move_events_skipped >= 5) + { + [_session sendInputEvent:event]; + _mouse_move_events_skipped = 0; + } + else + { + [_mouse_move_event_timer autorelease]; + _mouse_move_event_timer = + [[NSTimer scheduledTimerWithTimeInterval:0.05 + target:self + selector:@selector(sendDelayedMouseEventWithTimer:) + userInfo:event + repeats:NO] retain]; + } +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/ScreenSelectionController.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/ScreenSelectionController.h new file mode 100644 index 0000000000000000000000000000000000000000..4df34e1c3e9677b5861b976ccd3bc73d9c211116 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/ScreenSelectionController.h @@ -0,0 +1,34 @@ +/* + controller for screen settings selection + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "EditorBaseController.h" + +@class ConnectionParams; +@class OrderedDictionary; + +@interface ScreenSelectionController : EditorBaseController +{ + @private + NSString *_keyPath; + ConnectionParams *_params; + + // available options + OrderedDictionary *_color_options; + NSArray *_resolution_modes; + + // current selections + int _selection_color; + int _selection_resolution; +} + +- (id)initWithConnectionParams:(ConnectionParams *)params; +- (id)initWithConnectionParams:(ConnectionParams *)params keyPath:(NSString *)keyPath; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/ScreenSelectionController.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/ScreenSelectionController.m new file mode 100644 index 0000000000000000000000000000000000000000..b1ca4c0d3c04c09e195dcc91c8ec23475b1920be --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/ScreenSelectionController.m @@ -0,0 +1,253 @@ +/* + controller for screen settings selection + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "ScreenSelectionController.h" +#import "Utils.h" +#import "OrderedDictionary.h" +#import "ConnectionParams.h" + +@interface ScreenSelectionController (Private) +- (NSString *)keyPathForKey:(NSString *)key; +@end + +@implementation ScreenSelectionController + +- (id)initWithConnectionParams:(ConnectionParams *)params +{ + return [self initWithConnectionParams:params keyPath:nil]; +} + +- (id)initWithConnectionParams:(ConnectionParams *)params keyPath:(NSString *)keyPath +{ + self = [super initWithStyle:UITableViewStyleGrouped]; + if (self) + { + _params = [params retain]; + _keyPath = (keyPath != nil ? [keyPath retain] : nil); + + _color_options = (OrderedDictionary *)[SelectionForColorSetting() retain]; + _resolution_modes = [ResolutionModes() retain]; + + // init current selections + NSUInteger idx = [_color_options + indexForValue:[NSNumber + numberWithInt:[_params + intForKeyPath:[self keyPathForKey:@"colors"]]]]; + _selection_color = (idx != NSNotFound) ? idx : 0; + + idx = [_resolution_modes + indexOfObject:ScreenResolutionDescription( + [_params + intForKeyPath:[self keyPathForKey:@"screen_resolution_type"]], + [_params intForKeyPath:[self keyPathForKey:@"width"]], + [_params intForKeyPath:[self keyPathForKey:@"height"]])]; + _selection_resolution = (idx != NSNotFound) ? idx : 0; + } + return self; +} + +- (void)dealloc +{ + [super dealloc]; + [_params autorelease]; + [_keyPath autorelease]; + [_color_options autorelease]; + [_resolution_modes autorelease]; +} + +- (NSString *)keyPathForKey:(NSString *)key +{ + if (_keyPath) + return [_keyPath stringByAppendingFormat:@".%@", key]; + return key; +} + +#pragma mark - View lifecycle + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + // Return YES for supported orientations + return YES; +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 2; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + // Return the number of rows in the section. + if (section == 0) + return [_color_options count]; + return [_resolution_modes count] + 2; // +2 for custom width/height input fields +} + +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell = nil; + switch ([indexPath section]) + { + case 0: + cell = [self tableViewCellFromIdentifier:TableCellIdentifierMultiChoice]; + [[cell textLabel] setText:[_color_options keyAtIndex:[indexPath row]]]; + break; + + case 1: + if ([indexPath row] < [_resolution_modes count]) + { + cell = [self tableViewCellFromIdentifier:TableCellIdentifierMultiChoice]; + [[cell textLabel] setText:[_resolution_modes objectAtIndex:[indexPath row]]]; + } + else + cell = [self tableViewCellFromIdentifier:TableCellIdentifierText]; + break; + + default: + break; + } + + if ([indexPath section] == 1) + { + BOOL enabled = ([_params intForKeyPath:[self keyPathForKey:@"screen_resolution_type"]] == + TSXScreenOptionCustom); + if ([indexPath row] == [_resolution_modes count]) + { + int value = [_params intForKeyPath:[self keyPathForKey:@"width"]]; + EditTextTableViewCell *textCell = (EditTextTableViewCell *)cell; + [[textCell label] setText:NSLocalizedString(@"Width", @"Custom Screen Width")]; + [[textCell textfield] setText:[NSString stringWithFormat:@"%d", value ? value : 800]]; + [[textCell textfield] setKeyboardType:UIKeyboardTypeNumberPad]; + [[textCell label] setEnabled:enabled]; + [[textCell textfield] setEnabled:enabled]; + [[textCell textfield] setTag:1]; + } + else if ([indexPath row] == ([_resolution_modes count] + 1)) + { + int value = [_params intForKeyPath:[self keyPathForKey:@"height"]]; + EditTextTableViewCell *textCell = (EditTextTableViewCell *)cell; + [[textCell label] setText:NSLocalizedString(@"Height", @"Custom Screen Height")]; + [[textCell textfield] setText:[NSString stringWithFormat:@"%d", value ? value : 600]]; + [[textCell textfield] setKeyboardType:UIKeyboardTypeNumberPad]; + [[textCell label] setEnabled:enabled]; + [[textCell textfield] setEnabled:enabled]; + [[textCell textfield] setTag:2]; + } + } + + // set default checkmark + if ([indexPath row] == ([indexPath section] == 0 ? _selection_color : _selection_resolution)) + [cell setAccessoryType:UITableViewCellAccessoryCheckmark]; + else + [cell setAccessoryType:UITableViewCellAccessoryNone]; + + return cell; +} + +#pragma mark - Table view delegate + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + // custom width/height cells are not selectable + if ([indexPath section] == 1 && [indexPath row] >= [_resolution_modes count]) + return; + + // has selection change? + int cur_selection = ([indexPath section] == 0 ? _selection_color : _selection_resolution); + if ([indexPath row] != cur_selection) + { + [tableView deselectRowAtIndexPath:indexPath animated:NO]; + + NSIndexPath *oldIndexPath = [NSIndexPath indexPathForRow:cur_selection + inSection:[indexPath section]]; + + // clear old checkmark + UITableViewCell *old_sel_cell = [tableView cellForRowAtIndexPath:oldIndexPath]; + old_sel_cell.accessoryType = UITableViewCellAccessoryNone; + + // set new checkmark + UITableViewCell *new_sel_cell = [tableView cellForRowAtIndexPath:indexPath]; + new_sel_cell.accessoryType = UITableViewCellAccessoryCheckmark; + + if ([indexPath section] == 0) + { + // get value from color dictionary + int sel_value = + [[_color_options valueForKey:[_color_options keyAtIndex:[indexPath row]]] intValue]; + + // update selection index and params value + [_params setInt:sel_value forKeyPath:[self keyPathForKey:@"colors"]]; + _selection_color = [indexPath row]; + } + else + { + // update selection index and params value + int width, height; + TSXScreenOptions mode; + ScanScreenResolution([_resolution_modes objectAtIndex:[indexPath row]], &width, &height, + &mode); + [_params setInt:mode forKeyPath:[self keyPathForKey:@"screen_resolution_type"]]; + if (mode != TSXScreenOptionCustom) + { + [_params setInt:width forKeyPath:[self keyPathForKey:@"width"]]; + [_params setInt:height forKeyPath:[self keyPathForKey:@"height"]]; + } + _selection_resolution = [indexPath row]; + + // refresh width/height edit fields if custom selection changed + NSArray *indexPaths = [NSArray + arrayWithObjects:[NSIndexPath indexPathForRow:[_resolution_modes count] + inSection:1], + [NSIndexPath indexPathForRow:([_resolution_modes count] + 1) + inSection:1], + nil]; + [[self tableView] reloadRowsAtIndexPaths:indexPaths + withRowAnimation:UITableViewRowAnimationNone]; + } + } +} + +#pragma mark - +#pragma mark Text Field delegate + +- (BOOL)textFieldShouldReturn:(UITextField *)textField +{ + [textField resignFirstResponder]; + return NO; +} + +- (BOOL)textFieldShouldEndEditing:(UITextField *)textField +{ + + switch ([textField tag]) + { + // update resolution settings (and check for invalid input) + case 1: + if ([[textField text] intValue] < 640) + [textField setText:@"640"]; + [_params setInt:[[textField text] intValue] forKeyPath:[self keyPathForKey:@"width"]]; + break; + + case 2: + if ([[textField text] intValue] < 480) + [textField setText:@"480"]; + [_params setInt:[[textField text] intValue] forKeyPath:[self keyPathForKey:@"height"]]; + break; + + default: + break; + } + return YES; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/VerifyCertificateController.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/VerifyCertificateController.h new file mode 100644 index 0000000000000000000000000000000000000000..cc7453fa8d7ceaddd44915c0d905d2a0eb993d89 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/VerifyCertificateController.h @@ -0,0 +1,33 @@ +/* + Certificate verification controller + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import + +@class RDPSession; + +@interface VerifyCertificateController : UIViewController +{ + @private + IBOutlet UILabel *_label_issuer; + IBOutlet UIButton *_btn_accept; + IBOutlet UIButton *_btn_decline; + IBOutlet UILabel *_label_message; + IBOutlet UILabel *_label_for_issuer; + + RDPSession *_session; + NSMutableDictionary *_params; +} + +- (id)initWithNibName:(NSString *)nibNameOrNil + bundle:(NSBundle *)nibBundleOrNil + session:(RDPSession *)session + params:(NSMutableDictionary *)params; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/VerifyCertificateController.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/VerifyCertificateController.m new file mode 100644 index 0000000000000000000000000000000000000000..c6412393f77b4a2fc3a088d016bc867bf802d2a6 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Controllers/VerifyCertificateController.m @@ -0,0 +1,86 @@ +/* + Certificate verification controller + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "VerifyCertificateController.h" +#import "RDPSession.h" + +@implementation VerifyCertificateController + +- (id)initWithNibName:(NSString *)nibNameOrNil + bundle:(NSBundle *)nibBundleOrNil + session:(RDPSession *)session + params:(NSMutableDictionary *)params +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) + { + _session = session; + _params = params; + [self setModalPresentationStyle:UIModalPresentationFormSheet]; + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + NSString *message = NSLocalizedString( + @"The identity of the remote computer cannot be verified. Do you want to connect anyway?", + @"Verify certificate view message"); + + // init strings + [_label_message setText:message]; + [_label_for_issuer + setText:NSLocalizedString(@"Issuer:", @"Verify certificate view issuer label")]; + [_btn_accept setTitle:NSLocalizedString(@"Yes", @"Yes Button") forState:UIControlStateNormal]; + [_btn_decline setTitle:NSLocalizedString(@"No", @"No Button") forState:UIControlStateNormal]; + + [_label_issuer setText:[_params valueForKey:@"issuer"]]; +} + +- (void)viewDidUnload +{ + [super viewDidUnload]; + // Release any retained subviews of the main view. +} + +- (void)viewDidDisappear:(BOOL)animated +{ + [super viewDidDisappear:animated]; + + // set signal + [[_session uiRequestCompleted] signal]; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +#pragma mark - Action handlers + +- (IBAction)acceptPressed:(id)sender +{ + [_params setValue:[NSNumber numberWithBool:YES] forKey:@"result"]; + + // dismiss controller + [self dismissModalViewControllerAnimated:YES]; +} + +- (IBAction)declinePressed:(id)sender +{ + [_params setValue:[NSNumber numberWithBool:NO] forKey:@"result"]; + + // dismiss controller + [self dismissModalViewControllerAnimated:YES]; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/FreeRDP/ios_cliprdr.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/FreeRDP/ios_cliprdr.m new file mode 100644 index 0000000000000000000000000000000000000000..e71a1ec7e631093eea9132579a72698a6e8896f6 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/FreeRDP/ios_cliprdr.m @@ -0,0 +1,499 @@ +/** + * FreeRDP: A Remote Desktop Protocol Implementation + * Android Clipboard Redirection + * + * Copyright 2013 Felix Long + * Copyright 2015 Thincast Technologies GmbH + * Copyright 2015 DI (FH) Martin Haimberger + * Copyright 2023 Iordan Iordanov + * + * 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 + +#include +#include +#include + +#include +#include + +#include "ios_cliprdr.h" + +UINT ios_cliprdr_send_client_format_list(CliprdrClientContext *cliprdr) +{ + UINT rc = ERROR_INTERNAL_ERROR; + UINT32 formatId; + UINT32 numFormats; + UINT32 *pFormatIds; + const char *formatName; + CLIPRDR_FORMAT *formats; + CLIPRDR_FORMAT_LIST formatList = { 0 }; + + if (!cliprdr) + return ERROR_INVALID_PARAMETER; + + mfContext *afc = (mfContext *)cliprdr->custom; + + if (!afc || !afc->cliprdr) + return ERROR_INVALID_PARAMETER; + + pFormatIds = NULL; + numFormats = ClipboardGetFormatIds(afc->clipboard, &pFormatIds); + formats = (CLIPRDR_FORMAT *)calloc(numFormats, sizeof(CLIPRDR_FORMAT)); + + if (!formats) + goto fail; + + for (UINT32 index = 0; index < numFormats; index++) + { + formatId = pFormatIds[index]; + formatName = ClipboardGetFormatName(afc->clipboard, formatId); + formats[index].formatId = formatId; + formats[index].formatName = NULL; + + if ((formatId > CF_MAX) && formatName) + { + formats[index].formatName = _strdup(formatName); + + if (!formats[index].formatName) + goto fail; + } + } + + formatList.common.msgFlags = 0; + formatList.numFormats = numFormats; + formatList.formats = formats; + formatList.common.msgType = CB_FORMAT_LIST; + + if (!afc->cliprdr->ClientFormatList) + goto fail; + + rc = afc->cliprdr->ClientFormatList(afc->cliprdr, &formatList); +fail: + free(pFormatIds); + free(formats); + return rc; +} + +static UINT ios_cliprdr_send_client_format_data_request(CliprdrClientContext *cliprdr, + UINT32 formatId) +{ + UINT rc = ERROR_INVALID_PARAMETER; + CLIPRDR_FORMAT_DATA_REQUEST formatDataRequest = { 0 }; + mfContext *afc; + + if (!cliprdr) + goto fail; + + afc = (mfContext *)cliprdr->custom; + + if (!afc || !afc->clipboardRequestEvent || !cliprdr->ClientFormatDataRequest) + goto fail; + + formatDataRequest.common.msgType = CB_FORMAT_DATA_REQUEST; + formatDataRequest.common.msgFlags = 0; + formatDataRequest.requestedFormatId = formatId; + afc->requestedFormatId = formatId; + (void)ResetEvent(afc->clipboardRequestEvent); + rc = cliprdr->ClientFormatDataRequest(cliprdr, &formatDataRequest); +fail: + return rc; +} + +static UINT ios_cliprdr_send_client_capabilities(CliprdrClientContext *cliprdr) +{ + CLIPRDR_CAPABILITIES capabilities; + CLIPRDR_GENERAL_CAPABILITY_SET generalCapabilitySet; + + if (!cliprdr || !cliprdr->ClientCapabilities) + return ERROR_INVALID_PARAMETER; + + capabilities.cCapabilitiesSets = 1; + capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET *)&(generalCapabilitySet); + generalCapabilitySet.capabilitySetType = CB_CAPSTYPE_GENERAL; + generalCapabilitySet.capabilitySetLength = 12; + generalCapabilitySet.version = CB_CAPS_VERSION_2; + generalCapabilitySet.generalFlags = CB_USE_LONG_FORMAT_NAMES; + return cliprdr->ClientCapabilities(cliprdr, &capabilities); +} + +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT ios_cliprdr_monitor_ready(CliprdrClientContext *cliprdr, + const CLIPRDR_MONITOR_READY *monitorReady) +{ + UINT rc; + mfContext *afc; + + if (!cliprdr || !monitorReady) + return ERROR_INVALID_PARAMETER; + + afc = (mfContext *)cliprdr->custom; + + if (!afc) + return ERROR_INVALID_PARAMETER; + + if ((rc = ios_cliprdr_send_client_capabilities(cliprdr)) != CHANNEL_RC_OK) + return rc; + + if ((rc = ios_cliprdr_send_client_format_list(cliprdr)) != CHANNEL_RC_OK) + return rc; + + afc->clipboardSync = TRUE; + return CHANNEL_RC_OK; +} + +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT ios_cliprdr_server_capabilities(CliprdrClientContext *cliprdr, + const CLIPRDR_CAPABILITIES *capabilities) +{ + CLIPRDR_CAPABILITY_SET *capabilitySet; + mfContext *afc; + + if (!cliprdr || !capabilities) + return ERROR_INVALID_PARAMETER; + + afc = (mfContext *)cliprdr->custom; + + if (!afc) + return ERROR_INVALID_PARAMETER; + + for (UINT32 index = 0; index < capabilities->cCapabilitiesSets; index++) + { + capabilitySet = &(capabilities->capabilitySets[index]); + + if ((capabilitySet->capabilitySetType == CB_CAPSTYPE_GENERAL) && + (capabilitySet->capabilitySetLength >= CB_CAPSTYPE_GENERAL_LEN)) + { + CLIPRDR_GENERAL_CAPABILITY_SET *generalCapabilitySet = + (CLIPRDR_GENERAL_CAPABILITY_SET *)capabilitySet; + afc->clipboardCapabilities = generalCapabilitySet->generalFlags; + break; + } + } + + return CHANNEL_RC_OK; +} + +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT ios_cliprdr_server_format_list(CliprdrClientContext *cliprdr, + const CLIPRDR_FORMAT_LIST *formatList) +{ + UINT rc; + CLIPRDR_FORMAT *format; + mfContext *afc; + + if (!cliprdr || !formatList) + return ERROR_INVALID_PARAMETER; + + afc = (mfContext *)cliprdr->custom; + + if (!afc) + return ERROR_INVALID_PARAMETER; + + if (afc->serverFormats) + { + for (UINT32 index = 0; index < afc->numServerFormats; index++) + free(afc->serverFormats[index].formatName); + + free(afc->serverFormats); + afc->serverFormats = NULL; + afc->numServerFormats = 0; + } + + if (formatList->numFormats < 1) + return CHANNEL_RC_OK; + + afc->numServerFormats = formatList->numFormats; + afc->serverFormats = (CLIPRDR_FORMAT *)calloc(afc->numServerFormats, sizeof(CLIPRDR_FORMAT)); + + if (!afc->serverFormats) + return CHANNEL_RC_NO_MEMORY; + + for (UINT32 index = 0; index < afc->numServerFormats; index++) + { + afc->serverFormats[index].formatId = formatList->formats[index].formatId; + afc->serverFormats[index].formatName = NULL; + + if (formatList->formats[index].formatName) + { + afc->serverFormats[index].formatName = _strdup(formatList->formats[index].formatName); + + if (!afc->serverFormats[index].formatName) + return CHANNEL_RC_NO_MEMORY; + } + } + + BOOL unicode = FALSE; + BOOL text = FALSE; + for (UINT32 index = 0; index < afc->numServerFormats; index++) + { + format = &(afc->serverFormats[index]); + + if (format->formatId == CF_UNICODETEXT) + unicode = TRUE; + + else if (format->formatId == CF_TEXT) + text = TRUE; + } + + if (unicode) + return ios_cliprdr_send_client_format_data_request(cliprdr, CF_UNICODETEXT); + if (text) + return ios_cliprdr_send_client_format_data_request(cliprdr, CF_TEXT); + return CHANNEL_RC_OK; +} + +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT +ios_cliprdr_server_format_list_response(CliprdrClientContext *cliprdr, + const CLIPRDR_FORMAT_LIST_RESPONSE *formatListResponse) +{ + if (!cliprdr || !formatListResponse) + return ERROR_INVALID_PARAMETER; + + return CHANNEL_RC_OK; +} + +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT +ios_cliprdr_server_lock_clipboard_data(CliprdrClientContext *cliprdr, + const CLIPRDR_LOCK_CLIPBOARD_DATA *lockClipboardData) +{ + if (!cliprdr || !lockClipboardData) + return ERROR_INVALID_PARAMETER; + + return CHANNEL_RC_OK; +} + +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT +ios_cliprdr_server_unlock_clipboard_data(CliprdrClientContext *cliprdr, + const CLIPRDR_UNLOCK_CLIPBOARD_DATA *unlockClipboardData) +{ + if (!cliprdr || !unlockClipboardData) + return ERROR_INVALID_PARAMETER; + + return CHANNEL_RC_OK; +} + +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT +ios_cliprdr_server_format_data_request(CliprdrClientContext *cliprdr, + const CLIPRDR_FORMAT_DATA_REQUEST *formatDataRequest) +{ + UINT rc; + BYTE *data; + UINT32 size; + UINT32 formatId; + CLIPRDR_FORMAT_DATA_RESPONSE response = { 0 }; + mfContext *afc; + + if (!cliprdr || !formatDataRequest || !cliprdr->ClientFormatDataResponse) + return ERROR_INVALID_PARAMETER; + + afc = (mfContext *)cliprdr->custom; + + if (!afc) + return ERROR_INVALID_PARAMETER; + + formatId = formatDataRequest->requestedFormatId; + data = (BYTE *)ClipboardGetData(afc->clipboard, formatId, &size); + response.common.msgFlags = CB_RESPONSE_OK; + response.common.dataLen = size; + response.requestedFormatData = data; + + if (!data) + { + response.common.msgFlags = CB_RESPONSE_FAIL; + response.common.dataLen = 0; + response.requestedFormatData = NULL; + } + + rc = cliprdr->ClientFormatDataResponse(cliprdr, &response); + free(data); + return rc; +} + +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT +ios_cliprdr_server_format_data_response(CliprdrClientContext *cliprdr, + const CLIPRDR_FORMAT_DATA_RESPONSE *formatDataResponse) +{ + BYTE *data; + UINT32 size; + UINT32 formatId; + CLIPRDR_FORMAT *format = NULL; + mfContext *afc; + freerdp *instance; + + if (!cliprdr || !formatDataResponse) + return ERROR_INVALID_PARAMETER; + + afc = (mfContext *)cliprdr->custom; + + if (!afc) + return ERROR_INVALID_PARAMETER; + + instance = ((rdpContext *)afc)->instance; + + if (!instance) + return ERROR_INVALID_PARAMETER; + + for (UINT32 index = 0; index < afc->numServerFormats; index++) + { + if (afc->requestedFormatId == afc->serverFormats[index].formatId) + format = &(afc->serverFormats[index]); + } + + if (!format) + { + (void)SetEvent(afc->clipboardRequestEvent); + return ERROR_INTERNAL_ERROR; + } + + if (format->formatName) + formatId = ClipboardRegisterFormat(afc->clipboard, format->formatName); + else + formatId = format->formatId; + + size = formatDataResponse->common.dataLen; + + ClipboardLock(afc->clipboard); + if (!ClipboardSetData(afc->clipboard, formatId, formatDataResponse->requestedFormatData, size)) + return ERROR_INTERNAL_ERROR; + + (void)SetEvent(afc->clipboardRequestEvent); + + if ((formatId == CF_TEXT) || (formatId == CF_UNICODETEXT)) + { + formatId = ClipboardRegisterFormat(afc->clipboard, "UTF8_STRING"); + data = (BYTE *)ClipboardGetData(afc->clipboard, formatId, &size); + size = (UINT32)strnlen(data, size); + if (afc->ServerCutText != NULL) + { + afc->ServerCutText((rdpContext *)afc, (uint8_t *)data, size); + } + } + ClipboardUnlock(afc->clipboard); + + return CHANNEL_RC_OK; +} + +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT +ios_cliprdr_server_file_contents_request(CliprdrClientContext *cliprdr, + const CLIPRDR_FILE_CONTENTS_REQUEST *fileContentsRequest) +{ + if (!cliprdr || !fileContentsRequest) + return ERROR_INVALID_PARAMETER; + + return CHANNEL_RC_OK; +} + +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT ios_cliprdr_server_file_contents_response( + CliprdrClientContext *cliprdr, const CLIPRDR_FILE_CONTENTS_RESPONSE *fileContentsResponse) +{ + if (!cliprdr || !fileContentsResponse) + return ERROR_INVALID_PARAMETER; + + return CHANNEL_RC_OK; +} + +BOOL ios_cliprdr_init(mfContext *afc, CliprdrClientContext *cliprdr) +{ + wClipboard *clipboard; + HANDLE hevent; + + if (!afc || !cliprdr) + return FALSE; + + if (!(hevent = CreateEvent(NULL, TRUE, FALSE, NULL))) + return FALSE; + + if (!(clipboard = ClipboardCreate())) + { + (void)CloseHandle(hevent); + return FALSE; + } + + afc->cliprdr = cliprdr; + afc->clipboard = clipboard; + afc->clipboardRequestEvent = hevent; + cliprdr->custom = (void *)afc; + cliprdr->MonitorReady = ios_cliprdr_monitor_ready; + cliprdr->ServerCapabilities = ios_cliprdr_server_capabilities; + cliprdr->ServerFormatList = ios_cliprdr_server_format_list; + cliprdr->ServerFormatListResponse = ios_cliprdr_server_format_list_response; + cliprdr->ServerLockClipboardData = ios_cliprdr_server_lock_clipboard_data; + cliprdr->ServerUnlockClipboardData = ios_cliprdr_server_unlock_clipboard_data; + cliprdr->ServerFormatDataRequest = ios_cliprdr_server_format_data_request; + cliprdr->ServerFormatDataResponse = ios_cliprdr_server_format_data_response; + cliprdr->ServerFileContentsRequest = ios_cliprdr_server_file_contents_request; + cliprdr->ServerFileContentsResponse = ios_cliprdr_server_file_contents_response; + return TRUE; +} + +BOOL ios_cliprdr_uninit(mfContext *afc, CliprdrClientContext *cliprdr) +{ + if (!afc || !cliprdr) + return FALSE; + + cliprdr->custom = NULL; + afc->cliprdr = NULL; + ClipboardDestroy(afc->clipboard); + (void)CloseHandle(afc->clipboardRequestEvent); + return TRUE; +} diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/FreeRDP/ios_freerdp.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/FreeRDP/ios_freerdp.h new file mode 100644 index 0000000000000000000000000000000000000000..6aa60fc9ba683e1167553c7da66d31a79308b033 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/FreeRDP/ios_freerdp.h @@ -0,0 +1,87 @@ +/* + RDP run-loop + + Copyright 2013 Thincast Technologies GmbH, Authors: Martin Fleisz, Dorian Johnson + Copyright 2023 Iordan Iordanov + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import + +#import +#import +#import "TSXTypes.h" +#import +#import + +@class RDPSession, RDPSessionView; + +typedef BOOL (*pServerCutText)(rdpContext *context, UINT8 *data, UINT32 size); + +// FreeRDP extended structs +typedef struct mf_info mfInfo; + +typedef struct mf_context +{ + rdpContext _p; + + mfInfo *mfi; + rdpSettings *settings; + + BOOL clipboardSync; + wClipboard *clipboard; + UINT32 numServerFormats; + UINT32 requestedFormatId; + HANDLE clipboardRequestEvent; + CLIPRDR_FORMAT *serverFormats; + CliprdrClientContext *cliprdr; + UINT32 clipboardCapabilities; + pServerCutText ServerCutText; +} mfContext; + +struct mf_info +{ + // RDP + freerdp *instance; + mfContext *context; + rdpContext *_context; + + // UI + RDPSession *session; + + // Graphics + CGContextRef bitmap_context; + + // Events + int event_pipe_producer; + int event_pipe_consumer; + HANDLE handle; + + // Tracking connection state + volatile TSXConnectionState connection_state; + volatile BOOL + unwanted; // set when controlling Session no longer wants the connection to continue +}; + +#define MFI_FROM_INSTANCE(inst) (((mfContext *)((inst)->context))->mfi) + +enum MF_EXIT_CODE +{ + MF_EXIT_SUCCESS = 0, + + MF_EXIT_CONN_FAILED = 128, + MF_EXIT_CONN_CANCELED = 129, + MF_EXIT_LOGON_TIMEOUT = 130, + + MF_EXIT_UNKNOWN = 255 +}; + +void ios_init_freerdp(void); +void ios_uninit_freerdp(void); +freerdp *ios_freerdp_new(void); +int ios_run_freerdp(freerdp *instance); +void ios_freerdp_free(freerdp *instance); +void ios_send_clipboard_data(void *context, const void *data, UINT32 size); diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/FreeRDP/ios_freerdp_ui.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/FreeRDP/ios_freerdp_ui.h new file mode 100644 index 0000000000000000000000000000000000000000..96299d32b814846f9fbfe354693e295860ec522b --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/FreeRDP/ios_freerdp_ui.h @@ -0,0 +1,29 @@ +/* + RDP ui callbacks + + Copyright 2013 Thincast Technologies GmbH, Authors: Martin Fleisz, Dorian Johnson + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "ios_freerdp.h" + +BOOL ios_ui_begin_paint(rdpContext* context); +BOOL ios_ui_end_paint(rdpContext* context); +BOOL ios_ui_resize_window(rdpContext* context); + +BOOL ios_ui_authenticate(freerdp* instance, char** username, char** password, char** domain); +BOOL ios_ui_gw_authenticate(freerdp* instance, char** username, char** password, char** domain); +DWORD ios_ui_verify_certificate_ex(freerdp* instance, const char* host, UINT16 port, + const char* common_name, const char* subject, const char* issuer, + const char* fingerprint, DWORD flags); + +DWORD ios_ui_verify_changed_certificate_ex(freerdp* instance, const char* host, UINT16 port, + const char* common_name, const char* subject, + const char* issuer, const char* fingerprint, + const char* old_subject, const char* old_issuer, + const char* old_fingerprint, DWORD flags); + +void ios_allocate_display_buffer(mfInfo* mfi); diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/FreeRDP/ios_freerdp_ui.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/FreeRDP/ios_freerdp_ui.m new file mode 100644 index 0000000000000000000000000000000000000000..d03513ee6b1ab7139626647826ef60d3009e3001 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/FreeRDP/ios_freerdp_ui.m @@ -0,0 +1,211 @@ +/* + RDP ui callbacks + + Copyright 2013 Thincast Technologies GmbH, Authors: Martin Fleisz, Dorian Johnson + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import + +#import +#import "ios_freerdp_ui.h" + +#import "RDPSession.h" + +#pragma mark - +#pragma mark Certificate authentication + +static void ios_resize_display_buffer(mfInfo *mfi); +static BOOL ios_ui_authenticate_raw(freerdp *instance, char **username, char **password, + char **domain, const char *title) +{ + mfInfo *mfi = MFI_FROM_INSTANCE(instance); + NSMutableDictionary *params = [NSMutableDictionary + dictionaryWithObjectsAndKeys:(*username) ? [NSString stringWithUTF8String:*username] : @"", + @"username", + (*password) ? [NSString stringWithUTF8String:*password] : @"", + @"password", + (*domain) ? [NSString stringWithUTF8String:*domain] : @"", + @"domain", + [NSString stringWithUTF8String:freerdp_settings_get_string( + instance->context->settings, + FreeRDP_ServerHostname)], + @"hostname", // used for the auth prompt message; not changed + nil]; + // request auth UI + [mfi->session performSelectorOnMainThread:@selector(sessionRequestsAuthenticationWithParams:) + withObject:params + waitUntilDone:YES]; + // wait for UI request to be completed + [[mfi->session uiRequestCompleted] lock]; + [[mfi->session uiRequestCompleted] wait]; + [[mfi->session uiRequestCompleted] unlock]; + + if (![[params valueForKey:@"result"] boolValue]) + { + mfi->unwanted = YES; + return FALSE; + } + + // Free old values + free(*username); + free(*password); + free(*domain); + // set values back + *username = _strdup([[params objectForKey:@"username"] UTF8String]); + *password = _strdup([[params objectForKey:@"password"] UTF8String]); + *domain = _strdup([[params objectForKey:@"domain"] UTF8String]); + + if (!(*username) || !(*password) || !(*domain)) + { + free(*username); + free(*password); + free(*domain); + return FALSE; + } + + return TRUE; +} + +BOOL ios_ui_authenticate(freerdp *instance, char **username, char **password, char **domain) +{ + return ios_ui_authenticate_raw(instance, username, password, domain, ""); +} + +BOOL ios_ui_gw_authenticate(freerdp *instance, char **username, char **password, char **domain) +{ + return ios_ui_authenticate_raw(instance, username, password, domain, "gateway"); +} + +DWORD ios_ui_verify_certificate_ex(freerdp *instance, const char *host, UINT16 port, + const char *common_name, const char *subject, const char *issuer, + const char *fingerprint, DWORD flags) +{ + // check whether we accept all certificates + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"security.accept_certificates"] == YES) + return 2; + + mfInfo *mfi = MFI_FROM_INSTANCE(instance); + NSMutableDictionary *params = [NSMutableDictionary + dictionaryWithObjectsAndKeys:(subject) ? [NSString stringWithUTF8String:subject] : @"", + @"subject", + (issuer) ? [NSString stringWithUTF8String:issuer] : @"", + @"issuer", + (fingerprint) ? [NSString stringWithUTF8String:subject] : @"", + @"fingerprint", nil]; + // request certificate verification UI + [mfi->session performSelectorOnMainThread:@selector(sessionVerifyCertificateWithParams:) + withObject:params + waitUntilDone:YES]; + // wait for UI request to be completed + [[mfi->session uiRequestCompleted] lock]; + [[mfi->session uiRequestCompleted] wait]; + [[mfi->session uiRequestCompleted] unlock]; + + if (![[params valueForKey:@"result"] boolValue]) + { + mfi->unwanted = YES; + return 0; + } + + return 1; +} + +DWORD ios_ui_verify_changed_certificate_ex(freerdp *instance, const char *host, UINT16 port, + const char *common_name, const char *subject, + const char *issuer, const char *fingerprint, + const char *old_subject, const char *old_issuer, + const char *old_fingerprint, DWORD flags) +{ + return ios_ui_verify_certificate_ex(instance, host, port, common_name, subject, issuer, + fingerprint, flags); +} + +#pragma mark - +#pragma mark Graphics updates + +BOOL ios_ui_begin_paint(rdpContext *context) +{ + rdpGdi *gdi = context->gdi; + gdi->primary->hdc->hwnd->invalid->null = TRUE; + return TRUE; +} + +BOOL ios_ui_end_paint(rdpContext *context) +{ + mfInfo *mfi = MFI_FROM_INSTANCE(context->instance); + rdpGdi *gdi = context->gdi; + CGRect dirty_rect = + CGRectMake(gdi->primary->hdc->hwnd->invalid->x, gdi->primary->hdc->hwnd->invalid->y, + gdi->primary->hdc->hwnd->invalid->w, gdi->primary->hdc->hwnd->invalid->h); + + if (!gdi->primary->hdc->hwnd->invalid->null) + [mfi->session performSelectorOnMainThread:@selector(setNeedsDisplayInRectAsValue:) + withObject:[NSValue valueWithCGRect:dirty_rect] + waitUntilDone:NO]; + + return TRUE; +} + +BOOL ios_ui_resize_window(rdpContext *context) +{ + rdpSettings *settings; + rdpGdi *gdi; + + if (!context || !context->settings) + return FALSE; + + settings = context->settings; + gdi = context->gdi; + + if (!gdi_resize(gdi, freerdp_settings_get_uint32(settings, FreeRDP_DesktopWidth), + freerdp_settings_get_uint32(settings, FreeRDP_DesktopHeight))) + return FALSE; + + ios_resize_display_buffer(MFI_FROM_INSTANCE(context->instance)); + return TRUE; +} + +#pragma mark - +#pragma mark Exported + +static void ios_create_bitmap_context(mfInfo *mfi) +{ + [mfi->session performSelectorOnMainThread:@selector(sessionBitmapContextWillChange) + withObject:nil + waitUntilDone:YES]; + rdpGdi *gdi = mfi->instance->context->gdi; + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + + if (FreeRDPGetBytesPerPixel(gdi->dstFormat) == 2) + mfi->bitmap_context = CGBitmapContextCreate( + gdi->primary_buffer, gdi->width, gdi->height, 5, gdi->stride, colorSpace, + kCGBitmapByteOrder16Little | kCGImageAlphaNoneSkipFirst); + else + mfi->bitmap_context = CGBitmapContextCreate( + gdi->primary_buffer, gdi->width, gdi->height, 8, gdi->stride, colorSpace, + kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst); + + CGColorSpaceRelease(colorSpace); + [mfi->session performSelectorOnMainThread:@selector(sessionBitmapContextDidChange) + withObject:nil + waitUntilDone:YES]; +} + +void ios_allocate_display_buffer(mfInfo *mfi) +{ + ios_create_bitmap_context(mfi); +} + +void ios_resize_display_buffer(mfInfo *mfi) +{ + // Release the old context in a thread-safe manner + CGContextRef old_context = mfi->bitmap_context; + mfi->bitmap_context = NULL; + CGContextRelease(old_context); + // Create the new context + ios_create_bitmap_context(mfi); +} diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Misc/Reachability.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Misc/Reachability.m new file mode 100644 index 0000000000000000000000000000000000000000..4d577f6acf3a478da0dbfc51d69d917383557833 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Misc/Reachability.m @@ -0,0 +1,277 @@ +/* + + File: Reachability.m + Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. + + Version: 2.2 + + Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. + ("Apple") in consideration of your agreement to the following terms, and your + use, installation, modification or redistribution of this Apple software + constitutes acceptance of these terms. If you do not agree with these terms, + please do not use, install, modify or redistribute this Apple software. + + In consideration of your agreement to abide by the following terms, and subject + to these terms, Apple grants you a personal, non-exclusive license, under + Apple's copyrights in this original Apple software (the "Apple Software"), to + use, reproduce, modify and redistribute the Apple Software, with or without + modifications, in source and/or binary forms; provided that if you redistribute + the Apple Software in its entirety and without modifications, you must retain + this notice and the following text and disclaimers in all such redistributions + of the Apple Software. + Neither the name, trademarks, service marks or logos of Apple Inc. may be used + to endorse or promote products derived from the Apple Software without specific + prior written permission from Apple. Except as expressly stated in this notice, + no other rights or licenses, express or implied, are granted by Apple herein, + including but not limited to any patent rights that may be infringed by your + derivative works or by other works in which the Apple Software may be + incorporated. + + The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO + WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED + WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN + COMBINATION WITH YOUR PRODUCTS. + + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR + DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF + CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF + APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Copyright (C) 2010 Apple Inc. All Rights Reserved. + +*/ + +#import +#import +#import +#import +#import +#import + +#import + +#import "Reachability.h" + +#define kShouldPrintReachabilityFlags 1 + +static void PrintReachabilityFlags(SCNetworkReachabilityFlags flags, const char *comment) +{ +#if kShouldPrintReachabilityFlags + + NSLog(@"Reachability Flag Status: %c%c %c%c%c%c%c%c%c %s\n", + (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', + (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', + + (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', + (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', + (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', + (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-', comment); +#endif +} + +@implementation Reachability +static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, + void *info) +{ +#pragma unused(target, flags) + NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback"); + NSCAssert([(NSObject *)info isKindOfClass:[Reachability class]], + @"info was wrong class in ReachabilityCallback"); + + // We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively + // in case someone uses the Reachablity object in a different thread. + NSAutoreleasePool *myPool = [[NSAutoreleasePool alloc] init]; + + Reachability *noteObject = (Reachability *)info; + // Post a notification to notify the client that the network reachability changed. + [[NSNotificationCenter defaultCenter] postNotificationName:kReachabilityChangedNotification + object:noteObject]; + + [myPool release]; +} + +- (BOOL)startNotifier +{ + BOOL retVal = NO; + SCNetworkReachabilityContext context = { 0, self, NULL, NULL, NULL }; + if (SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, &context)) + { + if (SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetCurrent(), + kCFRunLoopDefaultMode)) + { + retVal = YES; + } + } + return retVal; +} + +- (void)stopNotifier +{ + if (reachabilityRef != NULL) + { + SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), + kCFRunLoopDefaultMode); + } +} + +- (void)dealloc +{ + [self stopNotifier]; + if (reachabilityRef != NULL) + { + CFRelease(reachabilityRef); + } + [super dealloc]; +} + ++ (Reachability *)reachabilityWithHostName:(NSString *)hostName; +{ + Reachability *retVal = NULL; + SCNetworkReachabilityRef reachability = + SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]); + if (reachability != NULL) + { + retVal = [[[self alloc] init] autorelease]; + if (retVal != NULL) + { + retVal->reachabilityRef = reachability; + retVal->localWiFiRef = NO; + } + } + return retVal; +} + ++ (Reachability *)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress; +{ + SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress( + kCFAllocatorDefault, (const struct sockaddr *)hostAddress); + Reachability *retVal = NULL; + if (reachability != NULL) + { + retVal = [[[self alloc] init] autorelease]; + if (retVal != NULL) + { + retVal->reachabilityRef = reachability; + retVal->localWiFiRef = NO; + } + } + return retVal; +} + ++ (Reachability *)reachabilityForInternetConnection; +{ + struct sockaddr_in zeroAddress; + bzero(&zeroAddress, sizeof(zeroAddress)); + zeroAddress.sin_len = sizeof(zeroAddress); + zeroAddress.sin_family = AF_INET; + return [self reachabilityWithAddress:&zeroAddress]; +} + ++ (Reachability *)reachabilityForLocalWiFi; +{ + struct sockaddr_in localWifiAddress; + bzero(&localWifiAddress, sizeof(localWifiAddress)); + localWifiAddress.sin_len = sizeof(localWifiAddress); + localWifiAddress.sin_family = AF_INET; + // IN_LINKLOCALNETNUM is defined in as 169.254.0.0 + localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); + Reachability *retVal = [self reachabilityWithAddress:&localWifiAddress]; + if (retVal != NULL) + { + retVal->localWiFiRef = YES; + } + return retVal; +} + +#pragma mark Network Flag Handling + +- (NetworkStatus)localWiFiStatusForFlags:(SCNetworkReachabilityFlags)flags +{ + PrintReachabilityFlags(flags, "localWiFiStatusForFlags"); + + BOOL retVal = NotReachable; + if ((flags & kSCNetworkReachabilityFlagsReachable) && + (flags & kSCNetworkReachabilityFlagsIsDirect)) + { + retVal = ReachableViaWiFi; + } + return retVal; +} + +- (NetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags +{ + PrintReachabilityFlags(flags, "networkStatusForFlags"); + if ((flags & kSCNetworkReachabilityFlagsReachable) == 0) + { + // if target host is not reachable + return NotReachable; + } + + BOOL retVal = NotReachable; + + if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0) + { + // if target host is reachable and no connection is required + // then we'll assume (for now) that your on Wi-Fi + retVal = ReachableViaWiFi; + } + + if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand) != 0) || + (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)) + { + // ... and the connection is on-demand (or on-traffic) if the + // calling application is using the CFSocketStream or higher APIs + + if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0) + { + // ... and no [user] intervention is needed + retVal = ReachableViaWiFi; + } + } + + if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN) + { + // ... but WWAN connections are OK if the calling application + // is using the CFNetwork (CFSocketStream?) APIs. + retVal = ReachableViaWWAN; + } + return retVal; +} + +- (BOOL)connectionRequired; +{ + NSAssert(reachabilityRef != NULL, @"connectionRequired called with NULL reachabilityRef"); + SCNetworkReachabilityFlags flags; + if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) + { + return (flags & kSCNetworkReachabilityFlagsConnectionRequired); + } + return NO; +} + +- (NetworkStatus)currentReachabilityStatus +{ + NSAssert(reachabilityRef != NULL, @"currentNetworkStatus called with NULL reachabilityRef"); + NetworkStatus retVal = NotReachable; + SCNetworkReachabilityFlags flags; + if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) + { + if (localWiFiRef) + { + retVal = [self localWiFiStatusForFlags:flags]; + } + else + { + retVal = [self networkStatusForFlags:flags]; + } + } + return retVal; +} +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Models/Encryptor.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Models/Encryptor.h new file mode 100644 index 0000000000000000000000000000000000000000..c0592c0dbd9af563882c0facdd566e9b7e880d8e --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Models/Encryptor.h @@ -0,0 +1,43 @@ +/* + Password Encryptor + + Copyright 2013 Thincast Technologies GmbH, Author: Dorian Johnson + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +/* Encrypts data using AES 128 with a 256 bit key derived using PBKDF2-HMAC-SHA1 */ + +#import + +// Encryption block cipher config +#define TSXEncryptorBlockCipherAlgo kCCAlgorithmAES128 +#define TSXEncryptorBlockCipherKeySize kCCKeySizeAES256 +#define TSXEncryptorBlockCipherOptions kCCOptionPKCS7Padding +#define TSXEncryptorBlockCipherBlockSize 16 + +// Key generation: If any of these are changed, existing password stores will no longer work +#define TSXEncryptorPBKDF2Rounds 100 +#define TSXEncryptorPBKDF2Salt "9D¶3L}S¿lA[e€3C«" +#define TSXEncryptorPBKDF2SaltLen TSXEncryptorBlockCipherOptions +#define TSXEncryptorPBKDF2KeySize TSXEncryptorBlockCipherKeySize + +@interface Encryptor : NSObject +{ + @private + NSData *_encryption_key; + NSString *_plaintext_password; +} + +@property(readonly) NSString *plaintextPassword; + +- (id)initWithPassword:(NSString *)plaintext_password; + +- (NSData *)encryptData:(NSData *)plaintext_data; +- (NSData *)decryptData:(NSData *)encrypted_data; +- (NSData *)encryptString:(NSString *)plaintext_string; +- (NSString *)decryptString:(NSData *)encrypted_string; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Models/RDPKeyboard.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Models/RDPKeyboard.h new file mode 100644 index 0000000000000000000000000000000000000000..0757d994bb1f673a1a8cc24ac80e06fc1c171684 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Models/RDPKeyboard.h @@ -0,0 +1,76 @@ +/* + RDP Keyboard helper + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import +#import "RDPSession.h" + +@class RDPKeyboard; + +@protocol RDPKeyboardDelegate +@optional +- (void)modifiersChangedForKeyboard:(RDPKeyboard *)keyboard; +@end + +@interface RDPKeyboard : NSObject +{ + + RDPSession *_session; + + int _virtual_key_map[256]; + int _unicode_map[256]; + NSDictionary *_special_keys; + + NSObject *_delegate; + + BOOL _ctrl_pressed; + BOOL _alt_pressed; + BOOL _shift_pressed; + BOOL _win_pressed; +} + +@property(assign) id delegate; +@property(readonly) BOOL ctrlPressed; +@property(readonly) BOOL altPressed; +@property(readonly) BOOL shiftPressed; +@property(readonly) BOOL winPressed; + +// returns a keyboard instance ++ (RDPKeyboard *)getSharedRDPKeyboard; + +// init the keyboard and assign the given rdp session and delegate +- (void)initWithSession:(RDPSession *)session delegate:(NSObject *)delegate; + +// called to reset any pending key states (i.e. pressed modifier keys) +- (void)reset; + +// sends the given unicode character to the server +- (void)sendUnicode:(int)character; + +// send a key stroke event using the given virtual key code +- (void)sendVirtualKeyCode:(int)keyCode; + +// toggle ctrl key, returns true if pressed, otherwise false +- (void)toggleCtrlKey; + +// toggle alt key, returns true if pressed, otherwise false +- (void)toggleAltKey; + +// toggle shift key, returns true if pressed, otherwise false +- (void)toggleShiftKey; + +// toggle windows key, returns true if pressed, otherwise false +- (void)toggleWinKey; + +// send key strokes +- (void)sendEnterKeyStroke; +- (void)sendEscapeKeyStroke; +- (void)sendBackspaceKeyStroke; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Models/RDPKeyboard.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Models/RDPKeyboard.m new file mode 100644 index 0000000000000000000000000000000000000000..668228939f69611c6d7d7b8a6d8d85ddcbcfc1ba --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Models/RDPKeyboard.m @@ -0,0 +1,310 @@ +/* + RDP Keyboard helper + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "RDPKeyboard.h" +#include + +@interface RDPKeyboard (Private) +- (void)sendVirtualKey:(int)vKey up:(BOOL)up; +- (void)handleSpecialKey:(int)character; +- (void)handleAlphaNumChar:(int)character; +- (void)notifyDelegateModifiersChanged; +@end + +@implementation RDPKeyboard + +@synthesize delegate = _delegate, ctrlPressed = _ctrl_pressed, altPressed = _alt_pressed, + shiftPressed = _shift_pressed, winPressed = _win_pressed; + +- (id)init +{ + if ((self = [super init]) != nil) + { + [self initWithSession:nil delegate:nil]; + + memset(_virtual_key_map, 0, sizeof(_virtual_key_map)); + memset(_unicode_map, 0, sizeof(_unicode_map)); + + // init vkey map - used for alpha-num characters + _virtual_key_map['0'] = VK_KEY_0; + _virtual_key_map['1'] = VK_KEY_1; + _virtual_key_map['2'] = VK_KEY_2; + _virtual_key_map['3'] = VK_KEY_3; + _virtual_key_map['4'] = VK_KEY_4; + _virtual_key_map['5'] = VK_KEY_5; + _virtual_key_map['6'] = VK_KEY_6; + _virtual_key_map['7'] = VK_KEY_7; + _virtual_key_map['8'] = VK_KEY_8; + _virtual_key_map['9'] = VK_KEY_9; + + _virtual_key_map['a'] = VK_KEY_A; + _virtual_key_map['b'] = VK_KEY_B; + _virtual_key_map['c'] = VK_KEY_C; + _virtual_key_map['d'] = VK_KEY_D; + _virtual_key_map['e'] = VK_KEY_E; + _virtual_key_map['f'] = VK_KEY_F; + _virtual_key_map['g'] = VK_KEY_G; + _virtual_key_map['h'] = VK_KEY_H; + _virtual_key_map['i'] = VK_KEY_I; + _virtual_key_map['j'] = VK_KEY_J; + _virtual_key_map['k'] = VK_KEY_K; + _virtual_key_map['l'] = VK_KEY_L; + _virtual_key_map['m'] = VK_KEY_M; + _virtual_key_map['n'] = VK_KEY_N; + _virtual_key_map['o'] = VK_KEY_O; + _virtual_key_map['p'] = VK_KEY_P; + _virtual_key_map['q'] = VK_KEY_Q; + _virtual_key_map['r'] = VK_KEY_R; + _virtual_key_map['s'] = VK_KEY_S; + _virtual_key_map['t'] = VK_KEY_T; + _virtual_key_map['u'] = VK_KEY_U; + _virtual_key_map['v'] = VK_KEY_V; + _virtual_key_map['w'] = VK_KEY_W; + _virtual_key_map['x'] = VK_KEY_X; + _virtual_key_map['y'] = VK_KEY_Y; + _virtual_key_map['z'] = VK_KEY_Z; + + // init scancode map - used for special characters + _unicode_map['-'] = 45; + _unicode_map['/'] = 47; + _unicode_map[':'] = 58; + _unicode_map[';'] = 59; + _unicode_map['('] = 40; + _unicode_map[')'] = 41; + _unicode_map['&'] = 38; + _unicode_map['@'] = 64; + _unicode_map['.'] = 46; + _unicode_map[','] = 44; + _unicode_map['?'] = 63; + _unicode_map['!'] = 33; + _unicode_map['\''] = 39; + _unicode_map['\"'] = 34; + + _unicode_map['['] = 91; + _unicode_map[']'] = 93; + _unicode_map['{'] = 123; + _unicode_map['}'] = 125; + _unicode_map['#'] = 35; + _unicode_map['%'] = 37; + _unicode_map['^'] = 94; + _unicode_map['*'] = 42; + _unicode_map['+'] = 43; + _unicode_map['='] = 61; + + _unicode_map['_'] = 95; + _unicode_map['\\'] = 92; + _unicode_map['|'] = 124; + _unicode_map['~'] = 126; + _unicode_map['<'] = 60; + _unicode_map['>'] = 62; + _unicode_map['$'] = 36; + } + return self; +} + +- (void)dealloc +{ + [super dealloc]; +} + +#pragma mark - +#pragma mark class methods + +// return a keyboard instance ++ (RDPKeyboard *)getSharedRDPKeyboard +{ + static RDPKeyboard *_shared_keyboard = nil; + + if (_shared_keyboard == nil) + { + @synchronized(self) + { + if (_shared_keyboard == nil) + _shared_keyboard = [[RDPKeyboard alloc] init]; + } + } + + return _shared_keyboard; +} + +// reset the keyboard instance and assign the given rdp instance +- (void)initWithSession:(RDPSession *)session delegate:(NSObject *)delegate +{ + _alt_pressed = NO; + _ctrl_pressed = NO; + _shift_pressed = NO; + _win_pressed = NO; + + _session = session; + _delegate = delegate; +} + +- (void)reset +{ + // reset pressed ctrl, alt, shift or win key + if (_shift_pressed) + [self toggleShiftKey]; + if (_alt_pressed) + [self toggleAltKey]; + if (_ctrl_pressed) + [self toggleCtrlKey]; + if (_win_pressed) + [self toggleWinKey]; +} + +// handles button pressed input event from the iOS keyboard +// performs all conversions etc. +- (void)sendUnicode:(int)character +{ + if (isalnum(character)) + [self handleAlphaNumChar:character]; + else + [self handleSpecialKey:character]; + + [self reset]; +} + +// send a backspace key press +- (void)sendVirtualKeyCode:(int)keyCode +{ + [self sendVirtualKey:keyCode up:NO]; + [self sendVirtualKey:keyCode up:YES]; +} + +#pragma mark modifier key handling +// toggle ctrl key, returns true if pressed, otherwise false +- (void)toggleCtrlKey +{ + [self sendVirtualKey:VK_LCONTROL up:_ctrl_pressed]; + _ctrl_pressed = !_ctrl_pressed; + [self notifyDelegateModifiersChanged]; +} + +// toggle alt key, returns true if pressed, otherwise false +- (void)toggleAltKey +{ + [self sendVirtualKey:VK_LMENU up:_alt_pressed]; + _alt_pressed = !_alt_pressed; + [self notifyDelegateModifiersChanged]; +} + +// toggle shift key, returns true if pressed, otherwise false +- (void)toggleShiftKey +{ + [self sendVirtualKey:VK_LSHIFT up:_shift_pressed]; + _shift_pressed = !_shift_pressed; + [self notifyDelegateModifiersChanged]; +} + +// toggle windows key, returns true if pressed, otherwise false +- (void)toggleWinKey +{ + [self sendVirtualKey:(VK_LWIN | KBDEXT) up:_win_pressed]; + _win_pressed = !_win_pressed; + [self notifyDelegateModifiersChanged]; +} + +#pragma mark Sending special key strokes + +- (void)sendEnterKeyStroke +{ + [self sendVirtualKeyCode:(VK_RETURN | KBDEXT)]; +} + +- (void)sendEscapeKeyStroke +{ + [self sendVirtualKeyCode:VK_ESCAPE]; +} + +- (void)sendBackspaceKeyStroke +{ + [self sendVirtualKeyCode:VK_BACK]; +} + +@end + +#pragma mark - +@implementation RDPKeyboard (Private) + +- (void)handleAlphaNumChar:(int)character +{ + // if we receive an uppercase letter - make it lower and send an shift down event to server + BOOL shift_was_sent = NO; + if (isupper(character) && _shift_pressed == NO) + { + character = tolower(character); + [self sendVirtualKey:VK_LSHIFT up:NO]; + shift_was_sent = YES; + } + + // convert the character to a VK + int vk = _virtual_key_map[character]; + if (vk != 0) + { + // send key pressed + [self sendVirtualKey:vk up:NO]; + [self sendVirtualKey:vk up:YES]; + } + + // send the missing shift up if we had a shift down + if (shift_was_sent) + [self sendVirtualKey:VK_LSHIFT up:YES]; +} + +- (void)handleSpecialKey:(int)character +{ + NSDictionary *eventDescriptor = nil; + if (character < 256) + { + // convert the character to a unicode character + int code = _unicode_map[character]; + if (code != 0) + eventDescriptor = [NSDictionary + dictionaryWithObjectsAndKeys:@"keyboard", @"type", @"unicode", @"subtype", + [NSNumber numberWithUnsignedShort:0], @"flags", + [NSNumber numberWithUnsignedShort:code], + @"unicode_char", nil]; + } + + if (eventDescriptor == nil) + eventDescriptor = [NSDictionary + dictionaryWithObjectsAndKeys:@"keyboard", @"type", @"unicode", @"subtype", + [NSNumber numberWithUnsignedShort:0], @"flags", + [NSNumber numberWithUnsignedShort:character], + @"unicode_char", nil]; + + [_session sendInputEvent:eventDescriptor]; +} + +// sends the vk code to the session +- (void)sendVirtualKey:(int)vKey up:(BOOL)up +{ + DWORD scancode = GetVirtualScanCodeFromVirtualKeyCode(vKey, 4); + int flags = (up ? KBD_FLAGS_RELEASE : KBD_FLAGS_DOWN); + flags |= ((scancode & KBDEXT) ? KBD_FLAGS_EXTENDED : 0); + [_session + sendInputEvent:[NSDictionary + dictionaryWithObjectsAndKeys:@"keyboard", @"type", @"scancode", + @"subtype", + [NSNumber numberWithUnsignedShort:flags], + @"flags", + [NSNumber + numberWithUnsignedShort:(scancode & + 0xFF)], + @"scancode", nil]]; +} + +- (void)notifyDelegateModifiersChanged +{ + if ([[self delegate] respondsToSelector:@selector(modifiersChangedForKeyboard:)]) + [[self delegate] modifiersChangedForKeyboard:self]; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/AdvancedKeyboardView.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/AdvancedKeyboardView.h new file mode 100644 index 0000000000000000000000000000000000000000..2aa6cae27aeebd5871dc0f419565d83e916c62d3 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/AdvancedKeyboardView.h @@ -0,0 +1,48 @@ +/* + Advanced keyboard view interface + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import + +// forward declaration +@protocol AdvancedKeyboardDelegate +@optional +// called when a function key was pressed and a virtual keycode is provided +// @key: virtual key code +- (void)advancedKeyPressedVKey:(int)key; +// called when a function key was pressed and the keys unicode is provided +// @key: unicode character +- (void)advancedKeyPressedUnicode:(int)key; +@end + +@interface AdvancedKeyboardView : UIView +{ + @private + // view containing function keys (F-keys) and function block (ins, del, home, end, ...) + UIView *_function_keys_view; + + // view containing numpad keys (0-9, +-/*) + UIView *_numpad_keys_view; + + // view containing cursor keys (up, down, left, right) + UIView *_cursor_keys_view; + + // currently visible view + UIView *_cur_view; + + // delegate + NSObject *_delegate; +} + +@property(assign) NSObject *delegate; + +// init keyboard view with frame and delegate +- (id)initWithFrame:(CGRect)frame delegate:(NSObject *)delegate; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BlockAlertView.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BlockAlertView.h new file mode 100644 index 0000000000000000000000000000000000000000..dbeb0eede0616f0a12df4760289844252d613bcb --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BlockAlertView.h @@ -0,0 +1,42 @@ +// +// BlockAlertView.h +// +// + +#import + +@interface BlockAlertView : NSObject +{ + @protected + UIView *_view; + NSMutableArray *_blocks; + CGFloat _height; + NSString *_title; + NSString *_message; + BOOL _shown; + BOOL _cancelBounce; +} + ++ (BlockAlertView *)alertWithTitle:(NSString *)title message:(NSString *)message; + ++ (void)showInfoAlertWithTitle:(NSString *)title message:(NSString *)message; ++ (void)showErrorAlert:(NSError *)error; + +- (id)initWithTitle:(NSString *)title message:(NSString *)message; + +- (void)setDestructiveButtonWithTitle:(NSString *)title block:(void (^)())block; +- (void)setCancelButtonWithTitle:(NSString *)title block:(void (^)())block; +- (void)addButtonWithTitle:(NSString *)title block:(void (^)())block; + +- (void)addComponents:(CGRect)frame; + +- (void)show; +- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated; + +- (void)setupDisplay; + +@property(nonatomic, retain) UIImage *backgroundImage; +@property(nonatomic, readonly) UIView *view; +@property(nonatomic, readwrite) BOOL vignetteBackground; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BlockAlertView.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BlockAlertView.m new file mode 100644 index 0000000000000000000000000000000000000000..1ae94a5e3e0f29d5c0eedc1b8844dd985627111f --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BlockAlertView.m @@ -0,0 +1,475 @@ +// +// BlockAlertView.m +// +// + +#import "BlockAlertView.h" +#import "BlockBackground.h" +#import "BlockUI.h" + +@implementation BlockAlertView + +@synthesize view = _view; +@synthesize backgroundImage = _backgroundImage; +@synthesize vignetteBackground = _vignetteBackground; + +static UIImage *background = nil; +static UIImage *backgroundlandscape = nil; +static UIFont *titleFont = nil; +static UIFont *messageFont = nil; +static UIFont *buttonFont = nil; + +#pragma mark - init + ++ (void)initialize +{ + if (self == [BlockAlertView class]) + { + background = [UIImage imageNamed:kAlertViewBackground]; + background = + [[background stretchableImageWithLeftCapWidth:0 + topCapHeight:kAlertViewBackgroundCapHeight] retain]; + + backgroundlandscape = [UIImage imageNamed:kAlertViewBackgroundLandscape]; + backgroundlandscape = [[backgroundlandscape + stretchableImageWithLeftCapWidth:0 + topCapHeight:kAlertViewBackgroundCapHeight] retain]; + + titleFont = [kAlertViewTitleFont retain]; + messageFont = [kAlertViewMessageFont retain]; + buttonFont = [kAlertViewButtonFont retain]; + } +} + ++ (BlockAlertView *)alertWithTitle:(NSString *)title message:(NSString *)message +{ + return [[[BlockAlertView alloc] initWithTitle:title message:message] autorelease]; +} + ++ (void)showInfoAlertWithTitle:(NSString *)title message:(NSString *)message +{ + BlockAlertView *alert = [[BlockAlertView alloc] initWithTitle:title message:message]; + [alert setCancelButtonWithTitle:NSLocalizedString(@"Dismiss", nil) block:nil]; + [alert show]; + [alert release]; +} + ++ (void)showErrorAlert:(NSError *)error +{ + BlockAlertView *alert = [[BlockAlertView alloc] + initWithTitle:NSLocalizedString(@"Operation Failed", nil) + message:[NSString + stringWithFormat:NSLocalizedString( + @"The operation did not complete successfully: %@", + nil), + error]]; + [alert setCancelButtonWithTitle:@"Dismiss" block:nil]; + [alert show]; + [alert release]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - NSObject + +- (void)addComponents:(CGRect)frame +{ + if (_title) + { + CGSize size = [_title sizeWithFont:titleFont + constrainedToSize:CGSizeMake(frame.size.width - kAlertViewBorder * 2, 1000) + lineBreakMode:NSLineBreakByWordWrapping]; + + UILabel *labelView = [[UILabel alloc] + initWithFrame:CGRectMake(kAlertViewBorder, _height, + frame.size.width - kAlertViewBorder * 2, size.height)]; + labelView.font = titleFont; + labelView.numberOfLines = 0; + labelView.lineBreakMode = NSLineBreakByWordWrapping; + labelView.textColor = kAlertViewTitleTextColor; + labelView.backgroundColor = [UIColor clearColor]; + labelView.textAlignment = NSTextAlignmentCenter; + labelView.shadowColor = kAlertViewTitleShadowColor; + labelView.shadowOffset = kAlertViewTitleShadowOffset; + labelView.text = _title; + [_view addSubview:labelView]; + [labelView release]; + + _height += size.height + kAlertViewBorder; + } + + if (_message) + { + CGSize size = + [_message sizeWithFont:messageFont + constrainedToSize:CGSizeMake(frame.size.width - kAlertViewBorder * 2, 1000) + lineBreakMode:NSLineBreakByWordWrapping]; + + UILabel *labelView = [[UILabel alloc] + initWithFrame:CGRectMake(kAlertViewBorder, _height, + frame.size.width - kAlertViewBorder * 2, size.height)]; + labelView.font = messageFont; + labelView.numberOfLines = 0; + labelView.lineBreakMode = NSLineBreakByWordWrapping; + labelView.textColor = kAlertViewMessageTextColor; + labelView.backgroundColor = [UIColor clearColor]; + labelView.textAlignment = NSTextAlignmentCenter; + labelView.shadowColor = kAlertViewMessageShadowColor; + labelView.shadowOffset = kAlertViewMessageShadowOffset; + labelView.text = _message; + [_view addSubview:labelView]; + [labelView release]; + + _height += size.height + kAlertViewBorder; + } +} + +- (void)setupDisplay +{ + [[_view subviews] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + [obj removeFromSuperview]; + }]; + + UIWindow *parentView = [BlockBackground sharedInstance]; + CGRect frame = parentView.bounds; + frame.origin.x = floorf((frame.size.width - background.size.width) * 0.5); + frame.size.width = background.size.width; + + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; + if (UIInterfaceOrientationIsLandscape(orientation)) + { + frame.size.width += 150; + frame.origin.x -= 75; + } + + _view.frame = frame; + + _height = kAlertViewBorder + 15; + + if (NeedsLandscapePhoneTweaks) + { + _height -= 15; // landscape phones need to trimmed a bit + } + + [self addComponents:frame]; + + if (_shown) + [self show]; +} + +- (id)initWithTitle:(NSString *)title message:(NSString *)message +{ + self = [super init]; + + if (self) + { + _title = [title copy]; + _message = [message copy]; + + _view = [[UIView alloc] init]; + + _view.autoresizingMask = + UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin | + UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; + + _blocks = [[NSMutableArray alloc] init]; + + [[NSNotificationCenter defaultCenter] + addObserver:self + selector:@selector(setupDisplay) + name:UIApplicationDidChangeStatusBarOrientationNotification + object:nil]; + + if ([self class] == [BlockAlertView class]) + [self setupDisplay]; + + _vignetteBackground = NO; + } + + return self; +} + +- (void)dealloc +{ + [_title release]; + [_message release]; + [_backgroundImage release]; + [_view release]; + [_blocks release]; + [super dealloc]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - Public + +- (void)addButtonWithTitle:(NSString *)title color:(NSString *)color block:(void (^)())block +{ + [_blocks addObject:[NSArray arrayWithObjects:block ? [[block copy] autorelease] : [NSNull null], + title, color, nil]]; +} + +- (void)addButtonWithTitle:(NSString *)title block:(void (^)())block +{ + [self addButtonWithTitle:title color:@"gray" block:block]; +} + +- (void)setCancelButtonWithTitle:(NSString *)title block:(void (^)())block +{ + [self addButtonWithTitle:title color:@"black" block:block]; +} + +- (void)setDestructiveButtonWithTitle:(NSString *)title block:(void (^)())block +{ + [self addButtonWithTitle:title color:@"red" block:block]; +} + +- (void)show +{ + _shown = YES; + + BOOL isSecondButton = NO; + NSUInteger index = 0; + for (NSUInteger i = 0; i < _blocks.count; i++) + { + NSArray *block = [_blocks objectAtIndex:i]; + NSString *title = [block objectAtIndex:1]; + NSString *color = [block objectAtIndex:2]; + + UIImage *image = + [UIImage imageNamed:[NSString stringWithFormat:@"alert-%@-button.png", color]]; + image = [image stretchableImageWithLeftCapWidth:(int)(image.size.width + 1) >> 1 + topCapHeight:0]; + + CGFloat maxHalfWidth = floorf((_view.bounds.size.width - kAlertViewBorder * 3) * 0.5); + CGFloat width = _view.bounds.size.width - kAlertViewBorder * 2; + CGFloat xOffset = kAlertViewBorder; + if (isSecondButton) + { + width = maxHalfWidth; + xOffset = width + kAlertViewBorder * 2; + isSecondButton = NO; + } + else if (i + 1 < _blocks.count) + { + // In this case there's another button. + // Let's check if they fit on the same line. + CGSize size = [title sizeWithFont:buttonFont + minFontSize:10 + actualFontSize:nil + forWidth:_view.bounds.size.width - kAlertViewBorder * 2 + lineBreakMode:NSLineBreakByClipping]; + + if (size.width < maxHalfWidth - kAlertViewBorder) + { + // It might fit. Check the next Button + NSArray *block2 = [_blocks objectAtIndex:i + 1]; + NSString *title2 = [block2 objectAtIndex:1]; + size = [title2 sizeWithFont:buttonFont + minFontSize:10 + actualFontSize:nil + forWidth:_view.bounds.size.width - kAlertViewBorder * 2 + lineBreakMode:NSLineBreakByClipping]; + + if (size.width < maxHalfWidth - kAlertViewBorder) + { + // They'll fit! + isSecondButton = YES; // For the next iteration + width = maxHalfWidth; + } + } + } + else if (_blocks.count == 1) + { + // In this case this is the only button. We'll size according to the text + CGSize size = [title sizeWithFont:buttonFont + minFontSize:10 + actualFontSize:nil + forWidth:_view.bounds.size.width - kAlertViewBorder * 2 + lineBreakMode:UILineBreakModeClip]; + + size.width = MAX(size.width, 80); + if (size.width + 2 * kAlertViewBorder < width) + { + width = size.width + 2 * kAlertViewBorder; + xOffset = floorf((_view.bounds.size.width - width) * 0.5); + } + } + + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; + button.frame = CGRectMake(xOffset, _height, width, kAlertButtonHeight); + button.titleLabel.font = buttonFont; + if (IOS_LESS_THAN_6) + { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + button.titleLabel.minimumFontSize = 10; +#pragma clang diagnostic pop + } + else + { + button.titleLabel.adjustsFontSizeToFitWidth = YES; + button.titleLabel.adjustsLetterSpacingToFitWidth = YES; + button.titleLabel.minimumScaleFactor = 0.1; + } + button.titleLabel.textAlignment = NSTextAlignmentCenter; + button.titleLabel.shadowOffset = kAlertViewButtonShadowOffset; + button.backgroundColor = [UIColor clearColor]; + button.tag = i + 1; + + [button setBackgroundImage:image forState:UIControlStateNormal]; + [button setTitleColor:kAlertViewButtonTextColor forState:UIControlStateNormal]; + [button setTitleShadowColor:kAlertViewButtonShadowColor forState:UIControlStateNormal]; + [button setTitle:title forState:UIControlStateNormal]; + button.accessibilityLabel = title; + + [button addTarget:self + action:@selector(buttonClicked:) + forControlEvents:UIControlEventTouchUpInside]; + + [_view addSubview:button]; + + if (!isSecondButton) + _height += kAlertButtonHeight + kAlertViewBorder; + + index++; + } + + _height += 10; // Margin for the shadow + + if (_height < background.size.height) + { + CGFloat offset = background.size.height - _height; + _height = background.size.height; + CGRect frame; + for (NSUInteger i = 0; i < _blocks.count; i++) + { + UIButton *btn = (UIButton *)[_view viewWithTag:i + 1]; + frame = btn.frame; + frame.origin.y += offset; + btn.frame = frame; + } + } + + CGRect frame = _view.frame; + frame.origin.y = -_height; + frame.size.height = _height; + _view.frame = frame; + + UIImageView *modalBackground = [[UIImageView alloc] initWithFrame:_view.bounds]; + + if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) + modalBackground.image = backgroundlandscape; + else + modalBackground.image = background; + + modalBackground.contentMode = UIViewContentModeScaleToFill; + modalBackground.autoresizingMask = + UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + [_view insertSubview:modalBackground atIndex:0]; + [modalBackground release]; + + if (_backgroundImage) + { + [BlockBackground sharedInstance].backgroundImage = _backgroundImage; + [_backgroundImage release]; + _backgroundImage = nil; + } + + [BlockBackground sharedInstance].vignetteBackground = _vignetteBackground; + [[BlockBackground sharedInstance] addToMainWindow:_view]; + + __block CGPoint center = _view.center; + center.y = floorf([BlockBackground sharedInstance].bounds.size.height * 0.5) + kAlertViewBounce; + + _cancelBounce = NO; + + [UIView animateWithDuration:0.4 + delay:0.0 + options:UIViewAnimationCurveEaseOut + animations:^{ + [BlockBackground sharedInstance].alpha = 1.0f; + _view.center = center; + } + completion:^(BOOL finished) { + if (_cancelBounce) + return; + + [UIView animateWithDuration:0.1 + delay:0.0 + options:0 + animations:^{ + center.y -= kAlertViewBounce; + _view.center = center; + } + completion:^(BOOL finished) { + [[NSNotificationCenter defaultCenter] + postNotificationName:@"AlertViewFinishedAnimations" + object:nil]; + }]; + }]; + + [self retain]; +} + +- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated +{ + _shown = NO; + + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + if (buttonIndex >= 0 && buttonIndex < [_blocks count]) + { + id obj = [[_blocks objectAtIndex:buttonIndex] objectAtIndex:0]; + if (![obj isEqual:[NSNull null]]) + { + ((void (^)())obj)(); + } + } + + if (animated) + { + [UIView animateWithDuration:0.1 + delay:0.0 + options:0 + animations:^{ + CGPoint center = _view.center; + center.y += 20; + _view.center = center; + } + completion:^(BOOL finished) { + [UIView animateWithDuration:0.4 + delay:0.0 + options:UIViewAnimationCurveEaseIn + animations:^{ + CGRect frame = _view.frame; + frame.origin.y = -frame.size.height; + _view.frame = frame; + [[BlockBackground sharedInstance] reduceAlphaIfEmpty]; + } + completion:^(BOOL finished) { + [[BlockBackground sharedInstance] removeView:_view]; + [_view release]; + _view = nil; + [self autorelease]; + }]; + }]; + } + else + { + [[BlockBackground sharedInstance] removeView:_view]; + [_view release]; + _view = nil; + [self autorelease]; + } +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - Action + +- (void)buttonClicked:(id)sender +{ + /* Run the button's block */ + int buttonIndex = [sender tag] - 1; + [self dismissWithClickedButtonIndex:buttonIndex animated:YES]; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BlockBackground.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BlockBackground.m new file mode 100644 index 0000000000000000000000000000000000000000..f1f9422dd473021fa3a22796b968c49fa393c5c8 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BlockBackground.m @@ -0,0 +1,238 @@ +// +// BlockBackground.m +// arrived +// +// Created by Gustavo Ambrozio on 29/11/11. +// Copyright (c) 2011 N/A. All rights reserved. +// + +#import "BlockBackground.h" + +@implementation BlockBackground + +@synthesize backgroundImage = _backgroundImage; +@synthesize vignetteBackground = _vignetteBackground; + +static BlockBackground *_sharedInstance = nil; + ++ (BlockBackground *)sharedInstance +{ + if (_sharedInstance != nil) + { + return _sharedInstance; + } + + @synchronized(self) + { + if (_sharedInstance == nil) + { + [[[self alloc] init] autorelease]; + } + } + + return _sharedInstance; +} + ++ (id)allocWithZone:(NSZone *)zone +{ + @synchronized(self) + { + if (_sharedInstance == nil) + { + _sharedInstance = [super allocWithZone:zone]; + return _sharedInstance; + } + } + NSAssert(NO, @ "[BlockBackground alloc] explicitly called on singleton class."); + return nil; +} + +- (id)copyWithZone:(NSZone *)zone +{ + return self; +} + +- (id)retain +{ + return self; +} + +- (unsigned)retainCount +{ + return UINT_MAX; +} + +- (oneway void)release +{ +} + +- (id)autorelease +{ + return self; +} + +- (void)setRotation:(NSNotification *)notification +{ + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; + + CGRect orientationFrame = [UIScreen mainScreen].bounds; + + if ((UIInterfaceOrientationIsLandscape(orientation) && + orientationFrame.size.height > orientationFrame.size.width) || + (UIInterfaceOrientationIsPortrait(orientation) && + orientationFrame.size.width > orientationFrame.size.height)) + { + float temp = orientationFrame.size.width; + orientationFrame.size.width = orientationFrame.size.height; + orientationFrame.size.height = temp; + } + + self.transform = CGAffineTransformIdentity; + self.frame = orientationFrame; + + CGFloat posY = orientationFrame.size.height / 2; + CGFloat posX = orientationFrame.size.width / 2; + + CGPoint newCenter; + CGFloat rotateAngle; + + switch (orientation) + { + case UIInterfaceOrientationPortraitUpsideDown: + rotateAngle = M_PI; + newCenter = CGPointMake(posX, orientationFrame.size.height - posY); + break; + case UIInterfaceOrientationLandscapeLeft: + rotateAngle = -M_PI / 2.0f; + newCenter = CGPointMake(posY, posX); + break; + case UIInterfaceOrientationLandscapeRight: + rotateAngle = M_PI / 2.0f; + newCenter = CGPointMake(orientationFrame.size.height - posY, posX); + break; + default: // UIInterfaceOrientationPortrait + rotateAngle = 0.0; + newCenter = CGPointMake(posX, posY); + break; + } + + self.transform = CGAffineTransformMakeRotation(rotateAngle); + self.center = newCenter; + + [self setNeedsLayout]; + [self layoutSubviews]; +} + +- (id)init +{ + self = [super initWithFrame:[[UIScreen mainScreen] bounds]]; + if (self) + { + self.windowLevel = UIWindowLevelStatusBar; + self.hidden = YES; + self.userInteractionEnabled = NO; + self.backgroundColor = [UIColor colorWithWhite:0.4 alpha:0.5f]; + self.vignetteBackground = NO; + + [[NSNotificationCenter defaultCenter] + addObserver:self + selector:@selector(setRotation:) + name:UIApplicationDidChangeStatusBarOrientationNotification + object:nil]; + [self setRotation:nil]; + } + return self; +} + +- (void)addToMainWindow:(UIView *)view +{ + [self setRotation:nil]; + + if ([self.subviews containsObject:view]) + return; + + if (self.hidden) + { + _previousKeyWindow = [[[UIApplication sharedApplication] keyWindow] retain]; + self.alpha = 0.0f; + self.hidden = NO; + self.userInteractionEnabled = YES; + [self makeKeyWindow]; + } + + if (self.subviews.count > 0) + { + ((UIView *)[self.subviews lastObject]).userInteractionEnabled = NO; + } + + if (_backgroundImage) + { + UIImageView *backgroundView = [[UIImageView alloc] initWithImage:_backgroundImage]; + backgroundView.frame = self.bounds; + backgroundView.contentMode = UIViewContentModeScaleToFill; + [self addSubview:backgroundView]; + [backgroundView release]; + [_backgroundImage release]; + _backgroundImage = nil; + } + + [self addSubview:view]; +} + +- (void)reduceAlphaIfEmpty +{ + if (self.subviews.count == 1 || + (self.subviews.count == 2 && + [[self.subviews objectAtIndex:0] isKindOfClass:[UIImageView class]])) + { + self.alpha = 0.0f; + self.userInteractionEnabled = NO; + } +} + +- (void)removeView:(UIView *)view +{ + [view removeFromSuperview]; + + UIView *topView = [self.subviews lastObject]; + if ([topView isKindOfClass:[UIImageView class]]) + { + // It's a background. Remove it too + [topView removeFromSuperview]; + } + + if (self.subviews.count == 0) + { + self.hidden = YES; + [_previousKeyWindow makeKeyWindow]; + [_previousKeyWindow release]; + _previousKeyWindow = nil; + } + else + { + ((UIView *)[self.subviews lastObject]).userInteractionEnabled = YES; + } +} + +- (void)drawRect:(CGRect)rect +{ + if (_backgroundImage || !_vignetteBackground) + return; + CGContextRef context = UIGraphicsGetCurrentContext(); + + size_t locationsCount = 2; + CGFloat locations[2] = { 0.0f, 1.0f }; + CGFloat colors[8] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.75f }; + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGGradientRef gradient = + CGGradientCreateWithColorComponents(colorSpace, colors, locations, locationsCount); + CGColorSpaceRelease(colorSpace); + + CGPoint center = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2); + float radius = MIN(self.bounds.size.width, self.bounds.size.height); + CGContextDrawRadialGradient(context, gradient, center, 0, center, radius, + kCGGradientDrawsAfterEndLocation); + CGGradientRelease(gradient); +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BlockUI.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BlockUI.h new file mode 100644 index 0000000000000000000000000000000000000000..a88323edb77583bc1b217f26edbbcfe740bdf2a6 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BlockUI.h @@ -0,0 +1,74 @@ +// +// BlockUI.h +// +// Created by Gustavo Ambrozio on 14/2/12. +// + +#ifndef BlockUI_h +#define BlockUI_h + +#if __IPHONE_OS_VERSION_MAX_ALLOWED < 60000 +#define NSTextAlignmentCenter UITextAlignmentCenter +#define NSLineBreakByWordWrapping UILineBreakModeWordWrap +#define NSLineBreakByClipping UILineBreakModeClip + +#endif + +#ifndef IOS_LESS_THAN_6 +#define IOS_LESS_THAN_6 \ + !([[[UIDevice currentDevice] systemVersion] compare:@"6.0" \ + options:NSNumericSearch] != NSOrderedAscending) + +#endif + +#define NeedsLandscapePhoneTweaks \ + (UIInterfaceOrientationIsLandscape( \ + [[UIApplication sharedApplication] statusBarOrientation]) && \ + UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) + +// Action Sheet constants + +#define kActionSheetBounce 10 +#define kActionSheetBorder 10 +#define kActionSheetButtonHeight 45 +#define kActionSheetTopMargin 15 + +#define kActionSheetTitleFont [UIFont systemFontOfSize:18] +#define kActionSheetTitleTextColor [UIColor whiteColor] +#define kActionSheetTitleShadowColor [UIColor blackColor] +#define kActionSheetTitleShadowOffset CGSizeMake(0, -1) + +#define kActionSheetButtonFont [UIFont boldSystemFontOfSize:20] +#define kActionSheetButtonTextColor [UIColor whiteColor] +#define kActionSheetButtonShadowColor [UIColor blackColor] +#define kActionSheetButtonShadowOffset CGSizeMake(0, -1) + +#define kActionSheetBackground @"action-sheet-panel.png" +#define kActionSheetBackgroundCapHeight 30 + +// Alert View constants + +#define kAlertViewBounce 20 +#define kAlertViewBorder (NeedsLandscapePhoneTweaks ? 5 : 10) +#define kAlertButtonHeight (NeedsLandscapePhoneTweaks ? 35 : 44) + +#define kAlertViewTitleFont [UIFont boldSystemFontOfSize:20] +#define kAlertViewTitleTextColor [UIColor colorWithWhite:244.0 / 255.0 alpha:1.0] +#define kAlertViewTitleShadowColor [UIColor blackColor] +#define kAlertViewTitleShadowOffset CGSizeMake(0, -1) + +#define kAlertViewMessageFont [UIFont systemFontOfSize:18] +#define kAlertViewMessageTextColor [UIColor colorWithWhite:244.0 / 255.0 alpha:1.0] +#define kAlertViewMessageShadowColor [UIColor blackColor] +#define kAlertViewMessageShadowOffset CGSizeMake(0, -1) + +#define kAlertViewButtonFont [UIFont boldSystemFontOfSize:18] +#define kAlertViewButtonTextColor [UIColor whiteColor] +#define kAlertViewButtonShadowColor [UIColor blackColor] +#define kAlertViewButtonShadowOffset CGSizeMake(0, -1) + +#define kAlertViewBackground @"alert-window.png" +#define kAlertViewBackgroundLandscape @"alert-window-landscape.png" +#define kAlertViewBackgroundCapHeight 38 + +#endif diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BookmarkTableCell.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BookmarkTableCell.h new file mode 100644 index 0000000000000000000000000000000000000000..544e4e541741d430f07768b89a10ed65a6317d1a --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BookmarkTableCell.h @@ -0,0 +1,24 @@ +/* + Custom bookmark table cell + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import + +@interface BookmarkTableCell : UITableViewCell +{ + IBOutlet UILabel *_title; + IBOutlet UILabel *_sub_title; + IBOutlet UIImageView *_connection_state_icon; +} + +@property(retain, nonatomic) UILabel *title; +@property(retain, nonatomic) UILabel *subTitle; +@property(retain, nonatomic) UIImageView *connectionStateIcon; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BookmarkTableCell.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BookmarkTableCell.m new file mode 100644 index 0000000000000000000000000000000000000000..cb93af4a9d03ac952bea0017f4090822dcc7b059 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/BookmarkTableCell.m @@ -0,0 +1,39 @@ +/* + Custom bookmark table cell + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "BookmarkTableCell.h" + +@implementation BookmarkTableCell + +@synthesize title = _title, subTitle = _sub_title, connectionStateIcon = _connection_state_icon; + +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) + { + // Initialization code + } + return self; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +- (void)dealloc +{ + [super dealloc]; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditButtonTableViewCell.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditButtonTableViewCell.h new file mode 100644 index 0000000000000000000000000000000000000000..3a39d12fc5b38cca7e6b1aa8ee649fd5a10b9b02 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditButtonTableViewCell.h @@ -0,0 +1,22 @@ +/* + Custom table cell with a button + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import + +@interface EditButtonTableViewCell : UITableViewCell +{ + IBOutlet UILabel *_label; + IBOutlet UIButton *_button; +} + +@property(retain, nonatomic) UILabel *label; +@property(retain, nonatomic) UIButton *button; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditFlagTableViewCell.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditFlagTableViewCell.m new file mode 100644 index 0000000000000000000000000000000000000000..e27a0c6c25fc56a0dc60240520eb2060d38e015c --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditFlagTableViewCell.m @@ -0,0 +1,34 @@ +/* + Custom table cell with toggle switch + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "EditFlagTableViewCell.h" + +@implementation EditFlagTableViewCell + +@synthesize label = _label, toggle = _toggle; + +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) + { + // Initialization code + } + return self; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSecretTextTableViewCell.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSecretTextTableViewCell.h new file mode 100644 index 0000000000000000000000000000000000000000..2bc90c7df5c67fd83b9a4ceace21a656bc211e8b --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSecretTextTableViewCell.h @@ -0,0 +1,25 @@ +/* + Custom table cell with secret edit text field + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import + +@interface EditSecretTextTableViewCell : UITableViewCell +{ + IBOutlet UILabel *_label; + IBOutlet UITextField *_textfield; + IBOutlet UIButton *_unhide_button; +} + +@property(retain, nonatomic) UILabel *label; +@property(retain, nonatomic) UITextField *textfield; + +- (void)setEnabled:(BOOL)enabled; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSecretTextTableViewCell.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSecretTextTableViewCell.m new file mode 100644 index 0000000000000000000000000000000000000000..2c2617320aecdd387af274389d9def0de3020035 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSecretTextTableViewCell.m @@ -0,0 +1,61 @@ +/* + Custom table cell with secret edit text field + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "EditSecretTextTableViewCell.h" + +@implementation EditSecretTextTableViewCell + +@synthesize label = _label, textfield = _textfield; + +- (void)awakeFromNib +{ + [super awakeFromNib]; + [_unhide_button setTitle:NSLocalizedString(@"Unhide", @"Button title 'Unhide'") + forState:UIControlStateNormal]; + [_unhide_button addTarget:self + action:@selector(togglePasswordMode:) + forControlEvents:UIControlEventTouchUpInside]; +} + +- (void)setEnabled:(BOOL)enabled +{ + [_label setEnabled:enabled]; + [_textfield setEnabled:enabled]; + [_unhide_button setEnabled:enabled]; +} + +#pragma mark - action handlers +- (void)togglePasswordMode:(id)sender +{ + BOOL isSecure = [_textfield isSecureTextEntry]; + + if (isSecure) + { + [_unhide_button setTitle:NSLocalizedString(@"Hide", @"Button title 'Hide'") + forState:UIControlStateNormal]; + [_textfield setSecureTextEntry:NO]; + } + else + { + BOOL first_responder = [_textfield isFirstResponder]; + // little trick to make non-secure to secure transition working - this seems to be an ios + // bug: + // http://stackoverflow.com/questions/6710019/uitextfield-securetextentry-works-going-from-yes-to-no-but-changing-back-to-y + [_textfield setEnabled:NO]; + [_unhide_button setTitle:NSLocalizedString(@"Unhide", @"Button title 'Unhide'") + forState:UIControlStateNormal]; + [_textfield setSecureTextEntry:YES]; + [_textfield setEnabled:YES]; + if (first_responder) + [_textfield becomeFirstResponder]; + } +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSelectionTableViewCell.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSelectionTableViewCell.h new file mode 100644 index 0000000000000000000000000000000000000000..22ddb55fe3e12ad177807176e60d824f9dada84f --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSelectionTableViewCell.h @@ -0,0 +1,22 @@ +/* + Custom table cell with a label on the right, showing the current selection + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import + +@interface EditSelectionTableViewCell : UITableViewCell +{ + IBOutlet UILabel *_label; + IBOutlet UILabel *_selection; +} + +@property(retain, nonatomic) UILabel *label; +@property(retain, nonatomic) UILabel *selection; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSelectionTableViewCell.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSelectionTableViewCell.m new file mode 100644 index 0000000000000000000000000000000000000000..969b8fe1493b447fefc9060d03a520a43d6d3cf0 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSelectionTableViewCell.m @@ -0,0 +1,34 @@ +/* + Custom table cell with a label on the right, showing the current selection + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "EditSelectionTableViewCell.h" + +@implementation EditSelectionTableViewCell + +@synthesize label = _label, selection = _selection; + +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) + { + // Initialization code + } + return self; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSubEditTableViewCell.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSubEditTableViewCell.h new file mode 100644 index 0000000000000000000000000000000000000000..276827363ef302b5d94e53120d2ab1b8c692cd1b --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSubEditTableViewCell.h @@ -0,0 +1,20 @@ +/* + Custom table cell indicating a switch to a sub-view + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import + +@interface EditSubEditTableViewCell : UITableViewCell +{ + IBOutlet UILabel *_label; +} + +@property(retain, nonatomic) UILabel *label; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSubEditTableViewCell.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSubEditTableViewCell.m new file mode 100644 index 0000000000000000000000000000000000000000..5e5b682592545fd53917d571b8c46e6f5a9aad6c --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditSubEditTableViewCell.m @@ -0,0 +1,34 @@ +/* + Custom table cell indicating a switch to a sub-view + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "EditSubEditTableViewCell.h" + +@implementation EditSubEditTableViewCell + +@synthesize label = _label; + +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) + { + // Initialization code + } + return self; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditTextTableViewCell.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditTextTableViewCell.h new file mode 100644 index 0000000000000000000000000000000000000000..baf8bc8b55a54ffb09a0bce191e3694f9b85855a --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/EditTextTableViewCell.h @@ -0,0 +1,22 @@ +/* + Custom table cell with edit text field + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import + +@interface EditTextTableViewCell : UITableViewCell +{ + IBOutlet UILabel *_label; + IBOutlet UITextField *_textfield; +} + +@property(retain, nonatomic) UILabel *label; +@property(retain, nonatomic) UITextField *textfield; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/RDPSessionView.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/RDPSessionView.h new file mode 100644 index 0000000000000000000000000000000000000000..dbe9b4230c9fadd46bc9cdc674425680a48ae577 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/RDPSessionView.h @@ -0,0 +1,21 @@ +/* + RDP Session View + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import +#import "RDPSession.h" + +@interface RDPSessionView : UIView +{ + RDPSession *_session; +} + +- (void)setSession:(RDPSession *)session; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/SessionTableCell.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/SessionTableCell.m new file mode 100644 index 0000000000000000000000000000000000000000..d506439bbd3d00ff162054ebc524383ad1516365 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/SessionTableCell.m @@ -0,0 +1,42 @@ +/* + Custom session table cell + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "SessionTableCell.h" + +@implementation SessionTableCell + +@synthesize title = _title, server = _server, username = _username, screenshot = _screenshot, + disconnectButton = _disconnect_button; + +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) + { + // Initialization code. + } + return self; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state. +} + +- (void)dealloc +{ + [super dealloc]; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/TouchPointerView.h b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/TouchPointerView.h new file mode 100644 index 0000000000000000000000000000000000000000..2dcb054cfea3b554b9ced74a86235440538e66c7 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/TouchPointerView.h @@ -0,0 +1,75 @@ +/* + RDP Touch Pointer View + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import + +// protocol for touch pointer callbacks +@protocol TouchPointerDelegate +// callback if touch pointer should be closed +- (void)touchPointerClose; +// callback for a left click action +- (void)touchPointerLeftClick:(CGPoint)pos down:(BOOL)down; +// callback for a right click action +- (void)touchPointerRightClick:(CGPoint)pos down:(BOOL)down; +// callback for pointer move action +- (void)touchPointerMove:(CGPoint)pos; +// callback if scrolling is performed +- (void)touchPointerScrollDown:(BOOL)down; +// callback for toggling the standard keyboard +- (void)touchPointerToggleKeyboard; +// callback for toggling the extended keyboard +- (void)touchPointerToggleExtendedKeyboard; +// callback for reset session view +- (void)touchPointerResetSessionView; +@end + +@interface TouchPointerView : UIView +{ + // transformation and image currently drawn + CGAffineTransform _pointer_transformation; + UIImage *_cur_pointer_img; + + // action images + UIImage *_default_pointer_img; + UIImage *_active_pointer_img; + UIImage *_lclick_pointer_img; + UIImage *_rclick_pointer_img; + UIImage *_scroll_pointer_img; + UIImage *_extkeyboard_pointer_img; + UIImage *_keyboard_pointer_img; + UIImage *_reset_pointer_img; + + // predefined areas for all actions + CGRect _pointer_areas[9]; + + // scroll/drag n drop handling + CGPoint _prev_touch_location; + BOOL _pointer_moving; + BOOL _pointer_scrolling; + + NSObject *_delegate; +} + +@property(assign) IBOutlet NSObject *delegate; + +// positions the pointer on screen if it got offscreen after an orentation change or after +// displaying the keyboard +- (void)ensurePointerIsVisible; + +// returns the extent required for the scrollview to use the touch pointer near the edges of the +// session view +- (UIEdgeInsets)getEdgeInsets; + +// return pointer dimension and position information +- (CGPoint)getPointerPosition; +- (int)getPointerWidth; +- (int)getPointerHeight; + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/TouchPointerView.m b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/TouchPointerView.m new file mode 100644 index 0000000000000000000000000000000000000000..c299593f4a77b872dd04233d1ad9b032d759fc0a --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/Views/TouchPointerView.m @@ -0,0 +1,358 @@ +/* + RDP Touch Pointer View + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at + http://mozilla.org/MPL/2.0/. + */ + +#import "TouchPointerView.h" +#import "Utils.h" + +#define RESET_DEFAULT_POINTER_IMAGE_DELAY 0.15 + +#define POINTER_ACTION_CURSOR 0 +#define POINTER_ACTION_CLOSE 3 +#define POINTER_ACTION_RCLICK 2 +#define POINTER_ACTION_LCLICK 4 +#define POINTER_ACTION_MOVE 4 +#define POINTER_ACTION_SCROLL 5 +#define POINTER_ACTION_KEYBOARD 7 +#define POINTER_ACTION_EXTKEYBOARD 8 +#define POINTER_ACTION_RESET 6 + +@interface TouchPointerView (Private) +- (void)setCurrentPointerImage:(UIImage *)image; +- (void)displayPointerActionImage:(UIImage *)image; +- (BOOL)pointInsidePointer:(CGPoint)point; +- (BOOL)pointInsidePointerArea:(int)area point:(CGPoint)point; +- (CGPoint)getCursorPosition; +- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event; +- (void)handleSingleTap:(UITapGestureRecognizer *)gesture; +- (void)handlerForGesture:(UIGestureRecognizer *)gesture sendClick:(BOOL)sendClick; +@end + +@implementation TouchPointerView + +@synthesize delegate = _delegate; + +- (void)awakeFromNib +{ + [super awakeFromNib]; + + // set content mode when rotating (keep aspect ratio) + [self setContentMode:UIViewContentModeTopLeft]; + + // load touchPointerImage + _default_pointer_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_default" + ofType:@"png"]] retain]; + _active_pointer_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_active" + ofType:@"png"]] retain]; + _lclick_pointer_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_lclick" + ofType:@"png"]] retain]; + _rclick_pointer_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_rclick" + ofType:@"png"]] retain]; + _scroll_pointer_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_scroll" + ofType:@"png"]] retain]; + _extkeyboard_pointer_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_ext_keyboard" + ofType:@"png"]] retain]; + _keyboard_pointer_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_keyboard" + ofType:@"png"]] retain]; + _reset_pointer_img = [[UIImage + imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"touch_pointer_reset" + ofType:@"png"]] retain]; + _cur_pointer_img = _default_pointer_img; + _pointer_transformation = CGAffineTransformMake(1, 0, 0, 1, 0, 0); + + // init flags + _pointer_moving = NO; + _pointer_scrolling = NO; + + // create areas array + CGFloat area_width = [_cur_pointer_img size].width / 3.0f; + CGFloat area_height = [_cur_pointer_img size].height / 3.0f; + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 3; j++) + { + _pointer_areas[j + i * 3] = + CGRectMake(j * area_width, i * area_height, area_width, area_height); + } + } + + // init gesture recognizers + UITapGestureRecognizer *singleTapRecognizer = + [[[UITapGestureRecognizer alloc] initWithTarget:self + action:@selector(handleSingleTap:)] autorelease]; + [singleTapRecognizer setNumberOfTouchesRequired:1]; + [singleTapRecognizer setNumberOfTapsRequired:1]; + + UILongPressGestureRecognizer *dragDropRecognizer = [[[UILongPressGestureRecognizer alloc] + initWithTarget:self + action:@selector(handleDragDrop:)] autorelease]; + dragDropRecognizer.minimumPressDuration = 0.4; + // dragDropRecognizer.allowableMovement = 1000.0; + + UILongPressGestureRecognizer *pointerMoveScrollRecognizer = + [[[UILongPressGestureRecognizer alloc] initWithTarget:self + action:@selector(handlePointerMoveScroll:)] + autorelease]; + pointerMoveScrollRecognizer.minimumPressDuration = 0.15; + pointerMoveScrollRecognizer.allowableMovement = 1000.0; + [pointerMoveScrollRecognizer requireGestureRecognizerToFail:dragDropRecognizer]; + + [self addGestureRecognizer:singleTapRecognizer]; + [self addGestureRecognizer:dragDropRecognizer]; + [self addGestureRecognizer:pointerMoveScrollRecognizer]; +} + +- (void)dealloc +{ + [super dealloc]; + [_default_pointer_img autorelease]; + [_active_pointer_img autorelease]; + [_lclick_pointer_img autorelease]; + [_rclick_pointer_img autorelease]; + [_scroll_pointer_img autorelease]; + [_extkeyboard_pointer_img autorelease]; + [_keyboard_pointer_img autorelease]; + [_reset_pointer_img autorelease]; +} + +#pragma mark - Public interface + +// positions the pointer on screen if it got offscreen after an orentation change +- (void)ensurePointerIsVisible +{ + CGRect bounds = [self bounds]; + if (_pointer_transformation.tx > (bounds.size.width - _cur_pointer_img.size.width)) + _pointer_transformation.tx = bounds.size.width - _cur_pointer_img.size.width; + if (_pointer_transformation.ty > (bounds.size.height - _cur_pointer_img.size.height)) + _pointer_transformation.ty = bounds.size.height - _cur_pointer_img.size.height; + [self setNeedsDisplay]; +} + +// show/hides the touch pointer +- (void)setHidden:(BOOL)hidden +{ + [super setHidden:hidden]; + + // if shown center pointer in view + if (!hidden) + { + _pointer_transformation = CGAffineTransformMakeTranslation( + ([self bounds].size.width - [_cur_pointer_img size].width) / 2, + ([self bounds].size.height - [_cur_pointer_img size].height) / 2); + [self setNeedsDisplay]; + } +} + +- (UIEdgeInsets)getEdgeInsets +{ + return UIEdgeInsetsMake(0, 0, [_cur_pointer_img size].width, [_cur_pointer_img size].height); +} + +- (CGPoint)getPointerPosition +{ + return CGPointMake(_pointer_transformation.tx, _pointer_transformation.ty); +} + +- (int)getPointerWidth +{ + return [_cur_pointer_img size].width; +} + +- (int)getPointerHeight +{ + return [_cur_pointer_img size].height; +} + +@end + +@implementation TouchPointerView (Private) + +- (void)setCurrentPointerImage:(UIImage *)image +{ + _cur_pointer_img = image; + [self setNeedsDisplay]; +} + +- (void)displayPointerActionImage:(UIImage *)image +{ + [self setCurrentPointerImage:image]; + [self performSelector:@selector(setCurrentPointerImage:) + withObject:_default_pointer_img + afterDelay:RESET_DEFAULT_POINTER_IMAGE_DELAY]; +} + +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect +{ + // Drawing code + CGContextRef context = UIGraphicsGetCurrentContext(); + CGContextSaveGState(context); + CGContextConcatCTM(context, _pointer_transformation); + CGContextDrawImage( + context, CGRectMake(0, 0, [_cur_pointer_img size].width, [_cur_pointer_img size].height), + [_cur_pointer_img CGImage]); + CGContextRestoreGState(context); +} + +// helper that returns YES if the given point is within the pointer +- (BOOL)pointInsidePointer:(CGPoint)point +{ + CGRect rec = CGRectMake(0, 0, [_cur_pointer_img size].width, [_cur_pointer_img size].height); + return CGRectContainsPoint(CGRectApplyAffineTransform(rec, _pointer_transformation), point); +} + +// helper that returns YES if the given point is within the given pointer area +- (BOOL)pointInsidePointerArea:(int)area point:(CGPoint)point +{ + CGRect rec = _pointer_areas[area]; + return CGRectContainsPoint(CGRectApplyAffineTransform(rec, _pointer_transformation), point); +} + +// returns the position of the cursor +- (CGPoint)getCursorPosition +{ + CGRect transPointerArea = + CGRectApplyAffineTransform(_pointer_areas[POINTER_ACTION_CURSOR], _pointer_transformation); + return CGPointMake(CGRectGetMidX(transPointerArea), CGRectGetMidY(transPointerArea)); +} + +// this filters events - if the pointer was clicked the scrollview won't get any events +- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event +{ + return [self pointInsidePointer:point]; +} + +#pragma mark - Action handlers + +// handles single tap gestures, returns YES if the event was handled by the pointer, NO otherwise +- (void)handleSingleTap:(UITapGestureRecognizer *)gesture +{ + // get touch position within our view + CGPoint touchPos = [gesture locationInView:self]; + + // look if pointer was in one of our action areas + if ([self pointInsidePointerArea:POINTER_ACTION_CLOSE point:touchPos]) + [[self delegate] touchPointerClose]; + else if ([self pointInsidePointerArea:POINTER_ACTION_LCLICK point:touchPos]) + { + [self displayPointerActionImage:_lclick_pointer_img]; + [[self delegate] touchPointerLeftClick:[self getCursorPosition] down:YES]; + [[self delegate] touchPointerLeftClick:[self getCursorPosition] down:NO]; + } + else if ([self pointInsidePointerArea:POINTER_ACTION_RCLICK point:touchPos]) + { + [self displayPointerActionImage:_rclick_pointer_img]; + [[self delegate] touchPointerRightClick:[self getCursorPosition] down:YES]; + [[self delegate] touchPointerRightClick:[self getCursorPosition] down:NO]; + } + else if ([self pointInsidePointerArea:POINTER_ACTION_KEYBOARD point:touchPos]) + { + [self displayPointerActionImage:_keyboard_pointer_img]; + [[self delegate] touchPointerToggleKeyboard]; + } + else if ([self pointInsidePointerArea:POINTER_ACTION_EXTKEYBOARD point:touchPos]) + { + [self displayPointerActionImage:_extkeyboard_pointer_img]; + [[self delegate] touchPointerToggleExtendedKeyboard]; + } + else if ([self pointInsidePointerArea:POINTER_ACTION_RESET point:touchPos]) + { + [self displayPointerActionImage:_reset_pointer_img]; + [[self delegate] touchPointerResetSessionView]; + } +} + +- (void)handlerForGesture:(UIGestureRecognizer *)gesture sendClick:(BOOL)sendClick +{ + if ([gesture state] == UIGestureRecognizerStateBegan) + { + CGPoint touchPos = [gesture locationInView:self]; + if ([self pointInsidePointerArea:POINTER_ACTION_LCLICK point:touchPos]) + { + _prev_touch_location = touchPos; + _pointer_moving = YES; + if (sendClick == YES) + { + [[self delegate] touchPointerLeftClick:[self getCursorPosition] down:YES]; + [self setCurrentPointerImage:_active_pointer_img]; + } + } + else if ([self pointInsidePointerArea:POINTER_ACTION_SCROLL point:touchPos]) + { + [self setCurrentPointerImage:_scroll_pointer_img]; + _prev_touch_location = touchPos; + _pointer_scrolling = YES; + } + } + else if ([gesture state] == UIGestureRecognizerStateChanged) + { + if (_pointer_moving) + { + CGPoint touchPos = [gesture locationInView:self]; + _pointer_transformation = CGAffineTransformTranslate( + _pointer_transformation, touchPos.x - _prev_touch_location.x, + touchPos.y - _prev_touch_location.y); + [[self delegate] touchPointerMove:[self getCursorPosition]]; + _prev_touch_location = touchPos; + [self setNeedsDisplay]; + } + else if (_pointer_scrolling) + { + CGPoint touchPos = [gesture locationInView:self]; + float delta = touchPos.y - _prev_touch_location.y; + if (delta > GetScrollGestureDelta()) + { + [[self delegate] touchPointerScrollDown:YES]; + _prev_touch_location = touchPos; + } + else if (delta < -GetScrollGestureDelta()) + { + [[self delegate] touchPointerScrollDown:NO]; + _prev_touch_location = touchPos; + } + } + } + else if ([gesture state] == UIGestureRecognizerStateEnded) + { + if (_pointer_moving) + { + if (sendClick == YES) + [[self delegate] touchPointerLeftClick:[self getCursorPosition] down:NO]; + _pointer_moving = NO; + [self setCurrentPointerImage:_default_pointer_img]; + } + + if (_pointer_scrolling) + { + [self setCurrentPointerImage:_default_pointer_img]; + _pointer_scrolling = NO; + } + } +} + +// handles long press gestures +- (void)handleDragDrop:(UILongPressGestureRecognizer *)gesture +{ + [self handlerForGesture:gesture sendClick:YES]; +} + +- (void)handlePointerMoveScroll:(UILongPressGestureRecognizer *)gesture +{ + [self handlerForGesture:gesture sendClick:NO]; +} + +@end diff --git a/local-test-freerdp-full-01/afc-freerdp/client/iOS/iFreeRDP-Prefix.pch b/local-test-freerdp-full-01/afc-freerdp/client/iOS/iFreeRDP-Prefix.pch new file mode 100644 index 0000000000000000000000000000000000000000..171160a36540852e31ec7fb7b50ca8415f2675e4 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/client/iOS/iFreeRDP-Prefix.pch @@ -0,0 +1,23 @@ +/* + PCH + + Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +// +// Prefix header for all source files of the 'iFreeRDP' target in the 'iFreeRDP' project +// + +#import + +#ifndef __IPHONE_3_0 +#warning "This project uses features only available in iPhone SDK 3.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/AddFuzzerTest.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/AddFuzzerTest.cmake new file mode 100644 index 0000000000000000000000000000000000000000..382d04dea444636d4cbc079e0d2cb57d85018552 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/AddFuzzerTest.cmake @@ -0,0 +1,15 @@ +macro(add_fuzzer_test FILES LINK_LIBS) + if(BUILD_FUZZERS) + string(REPLACE " " ";" LOCAL_LINK_LIBS ${LINK_LIBS}) + list(APPEND LOCAL_LINK_LIBS fuzzer_config) + foreach(test ${FILES}) + get_filename_component(TestName ${test} NAME_WE) + add_executable(${TestName} ${test}) + # Use PUBLIC to force 'fuzzer_config' for all dependent targets. + target_link_libraries(${TestName} PUBLIC ${LOCAL_LINK_LIBS}) + add_test(${TestName} ${TESTING_OUTPUT_DIRECTORY}/${MODULE_NAME} ${TestName}) + set_target_properties(${TestName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}") + add_dependencies(fuzzers ${TestName}) + endforeach() + endif(BUILD_FUZZERS) +endmacro() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/AddTargetWithResourceFile.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/AddTargetWithResourceFile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..91cdd0e616edc7c98e96a050c0ed4849f061bf71 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/AddTargetWithResourceFile.cmake @@ -0,0 +1,94 @@ +set(add_resource_macro_internal_dir ${CMAKE_CURRENT_LIST_DIR} CACHE INTERNAL "") + +include(CleaningConfigureFile) + +macro(AddTargetWithResourceFile nameAndTarget is_exe version sources) + list(LENGTH ${nameAndTarget} target_length) + if(target_length GREATER 1) + list(GET ${nameAndTarget} 1 name) + list(GET ${nameAndTarget} 0 target) + else() + set(name ${nameAndTarget}) + set(target ${nameAndTarget}) + endif() + + set(VERSIONING OFF) + set(IS_EXE OFF) + if("${is_exe}" MATCHES "TRUE") + set(IS_EXE ON) + elseif("${is_exe}" MATCHES "WIN32") + set(IS_EXE ON) + set(exe_options "WIN32") + elseif("${is_exe}" MATCHES "SHARED") + set(lib_options "SHARED") + elseif("${is_exe}" MATCHES "STATIC") + set(lib_options "STATIC") + endif() + + if(IS_EXE AND WITH_BINARY_VERSIONING) + set(VERSIONING ON) + elseif(NOT IS_EXE AND WITH_LIBRARY_VERSIONING) + set(VERSIONING ON) + endif() + if(${ARGC} GREATER 4) + set(VERSIONING ${ARGV5}) + endif() + + string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*" RC_PROGRAM_VERSION_MATCH ${version}) + set(RC_VERSION_MAJOR ${CMAKE_MATCH_1}) + set(RC_VERSION_MINOR ${CMAKE_MATCH_2}) + set(RC_VERSION_BUILD ${CMAKE_MATCH_3}) + + if(WIN32) + if(IS_EXE) + if(VERSIONING) + set(RC_VERSION_FILE "${name}${RC_VERSION_MAJOR}${CMAKE_EXECUTABLE_SUFFIX}") + else() + set(RC_VERSION_FILE "${name}${CMAKE_EXECUTABLE_SUFFIX}") + endif() + else() + if(VERSIONING) + set(RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${name}${RC_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}") + else() + set(RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${name}${CMAKE_SHARED_LIBRARY_SUFFIX}") + endif() + endif() + + cleaning_configure_file( + ${add_resource_macro_internal_dir}/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY + ) + + list(APPEND ${sources} ${CMAKE_CURRENT_BINARY_DIR}/version.rc) + endif() + + set(OUTPUT_FILENAME "${name}") + if(VERSIONING) + string(APPEND OUTPUT_FILENAME "${RC_VERSION_MAJOR}") + endif() + + if(IS_EXE) + message("add_executable(${target}) [${exe_options}]") + add_executable(${target} ${exe_options} ${${sources}}) + + set_target_properties(${target} PROPERTIES OUTPUT_NAME ${OUTPUT_FILENAME}) + string(APPEND OUTPUT_FILENAME "${CMAKE_EXECUTABLE_SUFFIX}") + else() + message("add_library(${target}) [${lib_options}]") + add_library(${target} ${lib_options} ${${sources}}) + + if(VERSIONING) + set_target_properties(${target} PROPERTIES VERSION ${version} SOVERSION ${RC_VERSION_MAJOR}) + else() + set_target_properties(${target} PROPERTIES PREFIX "") + endif() + + set_target_properties(${target} PROPERTIES OUTPUT_NAME ${OUTPUT_FILENAME}) + set(OUTPUT_FILENAME "${CMAKE_SHARED_LIBRARY_PREFIX}${OUTPUT_FILENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}") + endif() + + if(WITH_DEBUG_SYMBOLS AND MSVC AND (is_exe OR BUILD_SHARED_LIBS)) + message("add PDB for ${OUTPUT_FILENAME}") + set_target_properties(${target} PROPERTIES PDB_NAME ${OUTPUT_FILENAME}) + install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols) + endif() +endmacro() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/CFlagsToVar.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/CFlagsToVar.cmake new file mode 100644 index 0000000000000000000000000000000000000000..c6e9999e6776a7729afe075dd18bb081659a3893 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/CFlagsToVar.cmake @@ -0,0 +1,12 @@ +function(CFlagsToVar NAME CFG) + string(TOUPPER "${CFG}" UCFG) + set(C_FLAGS ${CMAKE_C_FLAGS}) + string(REPLACE "${CMAKE_SOURCE_DIR}" "" C_FLAGS "${C_FLAGS}") + string(REPLACE "${CMAKE_BINARY_DIR}" "" C_FLAGS "${C_FLAGS}") + + string(APPEND C_FLAGS " ${CMAKE_C_FLAGS_${UCFG}}") + + string(REPLACE "\$" "\\\$" C_FLAGS "${C_FLAGS}") + string(REPLACE "\"" "\\\"" C_FLAGS "${C_FLAGS}") + set(${NAME} ${C_FLAGS} PARENT_SCOPE) +endfunction() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/CXXCompilerFlags.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/CXXCompilerFlags.cmake new file mode 100644 index 0000000000000000000000000000000000000000..cc71f1861c65f7c7736ff0e92799740e6adbb363 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/CXXCompilerFlags.cmake @@ -0,0 +1,58 @@ +include(CheckCXXCompilerFlag) +include(CommonCompilerFlags) + +macro(checkCXXFlag FLAG) + check_cxx_compiler_flag("${FLAG}" CXXFLAG${FLAG}) + if(CXXFLAG${FLAG}) + string(APPEND CMAKE_CXX_FLAGS " ${FLAG}") + else() + message(WARNING "compiler does not support ${FLAG}") + endif() +endmacro() + +if(ENABLE_WARNING_VERBOSE) + if(MSVC) + # Remove previous warning definitions, + # NMake is otherwise complaining. + foreach(flags_var_to_scrub CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_MINSIZEREL + ) + string(REGEX REPLACE "(^| )[/-]W[ ]*[1-9]" " " "${flags_var_to_scrub}" "${${flags_var_to_scrub}}") + endforeach() + else() + list( + APPEND + COMMON_COMPILER_FLAGS + -Wno-declaration-after-statement + -Wno-ctad-maybe-unsupported + -Wno-c++98-compat + -Wno-c++98-compat-pedantic + -Wno-pre-c++17-compat + -Wno-exit-time-destructors + -Wno-gnu-zero-variadic-macro-arguments + ) + endif() +endif() + +foreach(FLAG ${COMMON_COMPILER_FLAGS}) + checkcxxflag(${FLAG}) +endforeach() + +# https://stackoverflow.com/questions/4913922/possible-problems-with-nominmax-on-visual-c +if(WIN32) + add_compile_definitions($<$:NOMINMAX>) +endif() + +if(MSVC) + add_compile_options(/Gd) + + add_compile_options("$<$:/Zi>") + add_compile_definitions(_CRT_NONSTDC_NO_DEPRECATE) +endif() + +set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "default CXXFLAGS") +message("Using CXXFLAGS ${CMAKE_CXX_FLAGS}") +message("Using CXXFLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE}") +message("Using CXXFLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}") +message("Using CXXFLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL}") +message("Using CXXFLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/CheckAndSetFlag.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/CheckAndSetFlag.cmake new file mode 100644 index 0000000000000000000000000000000000000000..5cf000a02737cf803d4dac77584c7d53f26be3dc --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/CheckAndSetFlag.cmake @@ -0,0 +1,28 @@ +include(CheckCCompilerFlag) +include(CheckCXXCompilerFlag) + +macro(CheckAndSetFlag FLAG) + if(FLAG) + get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES) + + unset(C_FLAG) + unset(CXX_FLAG) + if("C" IN_LIST languages) + check_c_compiler_flag("${FLAG}" C_FLAG) + if(C_FLAG) + string(APPEND CMAKE_C_FLAGS " ${FLAG}") + endif() + endif() + + if("CXX" IN_LIST languages) + check_cxx_compiler_flag("${FLAG}" CXX_FLAG) + if(CXX_FLAG) + string(APPEND CMAKE_CXX_FLAGS " ${FLAG}") + endif() + endif() + + if(NOT C_FLAG AND NOT CXX_FLAG) + message(WARNING "compiler does not support ${FLAG}") + endif() + endif() +endmacro() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/CheckCmakeCompat.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/CheckCmakeCompat.cmake new file mode 100644 index 0000000000000000000000000000000000000000..1f5e69348b133cace28967e431181823229c0841 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/CheckCmakeCompat.cmake @@ -0,0 +1,26 @@ +# Central location to check for cmake (version) requirements +# +#============================================================================= +# Copyright 2012 Bernhard Miklautz +# +# 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. +#============================================================================= + +macro(enable_cmake_compat CMVERSION) + if(${CMAKE_VERSION} VERSION_LESS ${CMVERSION}) + list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/compat_${CMVERSION}/") + endif() +endmacro() + +# Compatibility includes - order does matter! +enable_cmake_compat(3.7.0) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/ClangDetectTool.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/ClangDetectTool.cmake new file mode 100644 index 0000000000000000000000000000000000000000..3be4736989c51d2da16b73fd8a72f02a5a179976 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/ClangDetectTool.cmake @@ -0,0 +1,42 @@ +function(clang_detect_tool VAR NAME OPTS) + set(NAMES "") + foreach(CNT RANGE 12 22) + list(APPEND NAMES "${NAME}-${CNT}") + endforeach() + list(REVERSE NAMES) + list(APPEND NAMES ${NAME}) + + find_program(${VAR} NAMES ${NAMES} ${OPTS}) + if(NOT ${VAR}) + message(WARNING "clang tool ${NAME} (${VAR}) not detected, skipping") + unset(${VAR}) + return() + endif() + + execute_process( + COMMAND ${${VAR}} "--version" OUTPUT_VARIABLE _CLANG_TOOL_VERSION RESULT_VARIABLE _CLANG_TOOL_VERSION_FAILED + ) + + if(_CLANG_TOOL_VERSION_FAILED) + message(WARNING "A problem was encountered with ${${VAR}}") + message(WARNING "${_CLANG_TOOL_VERSION_FAILED}") + unset(${VAR}) + return() + endif() + + string(REGEX MATCH "([7-9]|[1-9][0-9])\\.[0-9]\\.[0-9]" CLANG_TOOL_VERSION "${_CLANG_TOOL_VERSION}") + + if(NOT CLANG_TOOL_VERSION) + message(WARNING "problem parsing ${NAME} version for ${${VAR}}") + unset(${VAR}) + return() + endif() + + set(_CLANG_TOOL_MINIMUM_VERSION "12.0.0") + if(${CLANG_TOOL_VERSION} VERSION_LESS ${_CLANG_TOOL_MINIMUM_VERSION}) + message(WARNING "clang-format version ${CLANG_TOOL_VERSION} not supported") + message(WARNING "Minimum version required: ${_CLANG_TOOL_MINIMUM_VERSION}") + unset(${VAR}) + return() + endif() +endfunction() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/ClangFormat.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/ClangFormat.cmake new file mode 100644 index 0000000000000000000000000000000000000000..0f56dafa7cf89763d87e97d86cecced6b336dd49 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/ClangFormat.cmake @@ -0,0 +1,19 @@ +# get all project files +file( + GLOB_RECURSE + ALL_SOURCE_FILES + *.cpp + *.c + *.h + *.m + *.java +) + +include(ClangDetectTool) +clang_detect_tool(CLANG_FORMAT clang-format "") + +if(NOT CLANG_FORMAT) + message(WARNING "clang-format not found in path! code format target not available.") +else() + add_custom_target(clangformat COMMAND ${CLANG_FORMAT} -style=file -i ${ALL_SOURCE_FILES}) +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/ClangTidy.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/ClangTidy.cmake new file mode 100644 index 0000000000000000000000000000000000000000..d6b504d459f5278a88428605626771cf6a0cba67 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/ClangTidy.cmake @@ -0,0 +1,16 @@ +option(BUILD_WITH_CLANG_TIDY "Build with clang-tidy for extra warnings" OFF) + +if(BUILD_WITH_CLANG_TIDY) + include(ClangDetectTool) + clang_detect_tool(CLANG_TIDY_EXE clang-tidy REQUIRED) + + set(CLANG_TIDY_COMMAND "${CLANG_TIDY_EXE}") + + set(CMAKE_C_CLANG_TIDY "${CLANG_TIDY_COMMAND}" --extra-arg=-std=gnu11) + set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}" --extra-arg=-std=gnu++17) + set(CMAKE_OBJC_CLANG_TIDY "${CLANG_TIDY_COMMAND}") +else() + unset(CMAKE_C_CLANG_TIDY) + unset(CMAKE_CXX_CLANG_TIDY) + unset(CMAKE_OBJC_CLANG_TIDY) +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/ClangToolchain.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/ClangToolchain.cmake new file mode 100644 index 0000000000000000000000000000000000000000..1450e1973a98c032a538bfe27cad26a93468e648 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/ClangToolchain.cmake @@ -0,0 +1,19 @@ +if($ENV{CLANG_VERSION}) + set(CLANG_VERSION "-$ENV{CLANG_VERSION}") +endif() + +set(CLANG_WARNINGS + "-pedantic -Weverything -Wno-padded -Wno-covered-switch-default -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-cast-align" +) + +set(CMAKE_C_COMPILER "/usr/bin/clang${CLANG_VERSION}" CACHE PATH "") +set(CMAKE_C_FLAGS ${CLANG_WARNINGS} CACHE STRING "") + +set(CMAKE_CXX_COMPILER "/usr/bin/clang++${CLANG_VERSION}" CACHE PATH "") +set(CMAKE_CXX_FLAGS ${CLANG_WARNINGS} CACHE STRING "") + +set(CMAKE_AR "/usr/bin/llvm-ar${CLANG_VERSION}" CACHE PATH "") +set(CMAKE_LINKER "/usr/bin/llvm-link${CLANG_VERSION}" CACHE PATH "") +set(CMAKE_NM "/usr/bin/llvm-nm${CLANG_VERSION}" CACHE PATH "") +set(CMAKE_OBJDUMP "/usr/bin/llvm-objdump${CLANG_VERSION}" CACHE PATH "") +set(CMAKE_RANLIB "/usr/bin/llvm-ranlib${CLANG_VERSION}" CACHE PATH "") diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/CleaningConfigureFile.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/CleaningConfigureFile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..cf168c3d26b62394d17ab59e75d109a6d503bb33 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/CleaningConfigureFile.cmake @@ -0,0 +1,70 @@ +# Little helper that adds the generated file to the +# files to be cleaned in the current directory. +# +# Handy if the generated files might have changed +# + +include(CFlagsToVar) + +function(cleaning_configure_file RSRC RDST) + get_filename_component(SRC "${RSRC}" ABSOLUTE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + get_filename_component(DST "${RDST}" ABSOLUTE BASE_DIR ${CMAKE_CURRENT_BINARY_DIR}) + get_filename_component(DST_DIR "${DST}" DIRECTORY) + get_filename_component(DST_NAME ${DST} NAME) + + # ensure the temporary configuration files are in a different directory + set(CFG_DIR "${CMAKE_CURRENT_BINARY_DIR}/cfg") + file(MAKE_DIRECTORY "${CFG_DIR}") + + # Generate the temporary configuration files + if(CMAKE_CONFIGURATION_TYPES) + foreach(CFG ${CMAKE_CONFIGURATION_TYPES}) + set(CURRENT_BUILD_CONFIG ${CFG}) + if(NOT SOURCE_CFG_INIT) + set(SOURCE_CFG_INIT "${CFG_DIR}/${DST_NAME}_${CFG}") + endif() + cflagstovar(CURRENT_C_FLAGS ${CURRENT_BUILD_CONFIG}) + configure_file(${SRC} "${CFG_DIR}/${DST_NAME}_${CFG}" ${ARGN}) + unset(CURRENT_BUILD_CONFIG) + unset(CURRENT_C_FLAGS) + endforeach() + set(SOURCE_CFG "${CFG_DIR}/${DST_NAME}_$") + else() + # We call this also from CMake scripts without a CMAKE_BUILD_TYPE + # Fall back to an explicitly unsupported build type to point out something is wrong + # if this variable is used during such a call + if(CMAKE_BUILD_TYPE) + set(CURRENT_BUILD_CONFIG ${CMAKE_BUILD_TYPE}) + else() + set(CURRENT_BUILD_CONFIG "InvalidBuildType") + endif() + cflagstovar(CURRENT_C_FLAGS ${CURRENT_BUILD_CONFIG}) + set(SOURCE_CFG "${CFG_DIR}/${DST_NAME}_${CMAKE_BUILD_TYPE}") + set(SOURCE_CFG_INIT "${SOURCE_CFG}") + configure_file(${SRC} "${SOURCE_CFG}" ${ARGN}) + unset(CURRENT_BUILD_CONFIG) + unset(CURRENT_C_FLAGS) + endif() + + # Fallback for older CMake: we want to copy only if the destination is different. + # First do an initial copy during configuration + file(MAKE_DIRECTORY "${DST_DIR}") + if(CMAKE_VERSION VERSION_LESS "3.21.0") + get_filename_component(CFG_VAR ${SOURCE_CFG_INIT} NAME) + file(COPY ${SOURCE_CFG_INIT} DESTINATION ${DST_DIR}) + set(CFG_VAR_ABS "${DST_DIR}/${CFG_VAR}") + file(RENAME ${CFG_VAR_ABS} ${DST}) + else() + file(COPY_FILE ${SOURCE_CFG_INIT} ${DST} ONLY_IF_DIFFERENT) + endif() + + # Create a target to recreate the configuration file if something changes. + string(SHA256 DST_HASH "${DST}") + string(SUBSTRING "${DST_HASH}" 0 8 DST_HASH) + if(NOT TARGET ct-${DST_HASH}) + add_custom_target( + ct-${DST_HASH} COMMAND ${CMAKE_COMMAND} "-E" "make_directory" "${DST_DIR}" + COMMAND ${CMAKE_COMMAND} "-E" "copy_if_different" "${SOURCE_CFG}" "${DST}" DEPENDS ${SOURCE_CFG} ${DST} + ) + endif() +endfunction() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/CommonCompilerFlags.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/CommonCompilerFlags.cmake new file mode 100644 index 0000000000000000000000000000000000000000..d755cf37b52c71eb049041f732f6325bfc41df0a --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/CommonCompilerFlags.cmake @@ -0,0 +1,46 @@ +include(CheckAndSetFlag) + +option(ENABLE_WARNING_VERBOSE "enable -Weveryting (and some exceptions) for compile" OFF) +option(ENABLE_WARNING_ERROR "enable -Werror for compile" OFF) + +set(COMMON_COMPILER_FLAGS "") +if(ENABLE_WARNING_VERBOSE) + if(MSVC) + list(APPEND COMMON_COMPILER_FLAGS /W4 /wo4324) + else() + list( + APPEND + COMMON_COMPILER_FLAGS + -Weverything + -Wall + -Wpedantic + -Wno-padded + -Wno-switch-enum + -Wno-cast-align + -Wno-unsafe-buffer-usage + -Wno-reserved-identifier + -Wno-covered-switch-default + -Wno-disabled-macro-expansion + ) + endif() +endif() + +if(ENABLE_WARNING_ERROR) + list(APPEND COMMON_COMPILER_FLAGS -Werror) +endif() + +list(APPEND COMMON_COMPILER_FLAGS -fno-omit-frame-pointer -Wredundant-decls) + +include(ExportAllSymbols) +include(CompilerSanitizerOptions) + +if(CMAKE_C_COMPILER_ID MATCHES ".*Clang.*" OR (CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION + VERSION_GREATER_EQUAL 10) +) + add_compile_options($<$>:-fdebug-prefix-map=${CMAKE_SOURCE_DIR}=.>) + add_compile_options($<$>:-fmacro-prefix-map=${CMAKE_SOURCE_DIR}=.>) + add_compile_options($<$>:-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.>) + add_compile_options($<$>:-fdebug-prefix-map=${CMAKE_BINARY_DIR}=./build>) + add_compile_options($<$>:-fmacro-prefix-map=${CMAKE_BINARY_DIR}=./build>) + add_compile_options($<$>:-ffile-prefix-map=${CMAKE_BINARY_DIR}=./build>) +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/CommonConfigOptions.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/CommonConfigOptions.cmake new file mode 100644 index 0000000000000000000000000000000000000000..31a2ef3a6ec34902089870e8abf6d5109b06ee98 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/CommonConfigOptions.cmake @@ -0,0 +1,64 @@ +option(CMAKE_COLOR_MAKEFILE "colorful CMake makefile" ON) +option(CMAKE_VERBOSE_MAKEFILE "verbose CMake makefile" ON) +option(CMAKE_POSITION_INDEPENDENT_CODE "build with position independent code (-fPIC or -fPIE)" ON) +option(WITH_LIBRARY_VERSIONING "Use library version triplet" ON) +option(WITH_BINARY_VERSIONING "Use binary versioning" OFF) +option(WITH_RESOURCE_VERSIONING "Use resource versioning" OFF) +option(BUILD_SHARED_LIBS "Build shared libraries" ON) + +# We want to control the winpr assert for the whole project +option(WITH_VERBOSE_WINPR_ASSERT "Compile with verbose WINPR_ASSERT." ON) +if(WITH_VERBOSE_WINPR_ASSERT) + add_compile_definitions(WITH_VERBOSE_WINPR_ASSERT) +endif() + +# known issue on android, thus disabled until we support newer CMake +# https://github.com/android/ndk/issues/1444 +if(NOT ANDROID) + if(POLICY CMP0069) + cmake_policy(SET CMP0069 NEW) + endif() + if(POLICY CMP0138) + cmake_policy(SET CMP0138 NEW) + endif() + include(CheckIPOSupported) + check_ipo_supported(RESULT supported OUTPUT error) + if(NOT supported) + message(WARNING "LTO not supported, got ${error}") + endif() + + option(CMAKE_INTERPROCEDURAL_OPTIMIZATION "build with link time optimization" ${supported}) +endif() + +set(SUPPORTED_BUILD_TYPES "Debug" "Release" "MinSizeRel" "RelWithDebInfo") + +# Default to release build type +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + # Set a default build type if none was specified + set(default_build_type "Release") + + message(STATUS "Setting build type to '${default_build_type}' as none was specified.") + set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE) + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${SUPPORTED_BUILD_TYPES}) +endif() + +if(CMAKE_BUILD_TYPE) + if(NOT "${CMAKE_BUILD_TYPE}" IN_LIST SUPPORTED_BUILD_TYPES) + message(FATAL_ERROR "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} not supported. Set to any of ${SUPPORTED_BUILD_TYPES}") + endif() +endif() + +if(CMAKE_CONFIGURATION_TYPES) + set(CMAKE_CONFIGURATION_TYPES "Release;Debug;MinSizeRel;RelWithDebInfo" CACHE INTERNAL "freerdp default") +endif() + +include(PlatformDefaults) +include(PreventInSourceBuilds) +include(GNUInstallDirsWrapper) +include(MSVCRuntime) +include(ConfigureRPATH) +include(ClangTidy) +include(AddTargetWithResourceFile) +include(DisableCompilerWarnings) +include(CleaningConfigureFile) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/CompilerDetect.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/CompilerDetect.cmake new file mode 100644 index 0000000000000000000000000000000000000000..2f86539a45db3d58e7eabf743d3a54c1b2c26b61 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/CompilerDetect.cmake @@ -0,0 +1,3 @@ +if(CMAKE_C_COMPILER_ID MATCHES ".*Clang.*" OR CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*") + set(CMAKE_COMPILER_IS_CLANG 1) +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/CompilerFlags.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/CompilerFlags.cmake new file mode 100644 index 0000000000000000000000000000000000000000..af814c2fd9843aa4d92c5627ca8e3c2ffa6681c1 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/CompilerFlags.cmake @@ -0,0 +1,49 @@ +include(CheckCCompilerFlag) +include(CommonCompilerFlags) + +macro(checkCFlag FLAG) + check_c_compiler_flag("${FLAG}" CFLAG${FLAG}) + if(CFLAG${FLAG}) + string(APPEND CMAKE_C_FLAGS " ${FLAG}") + else() + message(WARNING "compiler does not support ${FLAG}") + endif() +endmacro() + +if(ENABLE_WARNING_VERBOSE) + if(MSVC) + # Remove previous warning definitions, + # NMake is otherwise complaining. + foreach(flags_var_to_scrub CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_C_FLAGS_MINSIZEREL + ) + string(REGEX REPLACE "(^| )[/-]W[ ]*[1-9]" " " "${flags_var_to_scrub}" "${${flags_var_to_scrub}}") + endforeach() + else() + list(APPEND COMMON_COMPILER_FLAGS -Wno-declaration-after-statement -Wno-pre-c11-compat + -Wno-gnu-zero-variadic-macro-arguments + ) + endif() +endif() + +list(APPEND COMMON_COMPILER_FLAGS -Wimplicit-function-declaration) + +foreach(FLAG ${COMMON_COMPILER_FLAGS}) + checkcflag(${FLAG}) +endforeach() + +# Android profiling +if(ANDROID) + if(WITH_GPROF) + checkandsetflag(-pg) + set(PROFILER_LIBRARIES "${FREERDP_EXTERNAL_PROFILER_PATH}/obj/local/${ANDROID_ABI}/libandroid-ndk-profiler.a") + include_directories(SYSTEM "${FREERDP_EXTERNAL_PROFILER_PATH}") + endif() +endif() + +set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "default CFLAGS") +message("Using CFLAGS ${CMAKE_C_FLAGS}") +message("Using CFLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}") +message("Using CFLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}") +message("Using CFLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL}") +message("Using CFLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO}") diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/CompilerSanitizerOptions.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/CompilerSanitizerOptions.cmake new file mode 100644 index 0000000000000000000000000000000000000000..b128cd8b7ff69b67010e6102aae93f58623849a8 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/CompilerSanitizerOptions.cmake @@ -0,0 +1,48 @@ +include(CMakeDependentOption) + +cmake_dependent_option( + WITH_VALGRIND_MEMCHECK "Compile with valgrind helpers." OFF + "NOT WITH_SANITIZE_ADDRESS; NOT WITH_SANITIZE_MEMORY; NOT WITH_SANITIZE_THREAD" OFF +) +cmake_dependent_option( + WITH_SANITIZE_ADDRESS "Compile with gcc/clang address sanitizer." OFF + "NOT WITH_VALGRIND_MEMCHECK; NOT WITH_SANITIZE_MEMORY; NOT WITH_SANITIZE_THREAD" OFF +) +cmake_dependent_option( + WITH_SANITIZE_MEMORY "Compile with gcc/clang memory sanitizer." OFF + "NOT WITH_VALGRIND_MEMCHECK; NOT WITH_SANITIZE_ADDRESS; NOT WITH_SANITIZE_THREAD" OFF +) +cmake_dependent_option( + WITH_SANITIZE_THREAD "Compile with gcc/clang thread sanitizer." OFF + "NOT WITH_VALGRIND_MEMCHECK; NOT WITH_SANITIZE_ADDRESS; NOT WITH_SANITIZE_MEMORY" OFF +) + +if(WITH_VALGRIND_MEMCHECK) + check_include_files(valgrind/memcheck.h FREERDP_HAVE_VALGRIND_MEMCHECK_H) +else() + unset(FREERDP_HAVE_VALGRIND_MEMCHECK_H CACHE) +endif() + +# Enable address sanitizer, where supported and when required +if(CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_REQUIRED_LINK_OPTIONS_SAVED ${CMAKE_REQUIRED_LINK_OPTIONS}) + file(WRITE ${PROJECT_BINARY_DIR}/foo.txt "") + if(WITH_SANITIZE_ADDRESS) + add_compile_options(-fsanitize=address) + add_compile_options(-fsanitize-address-use-after-scope) + add_link_options(-fsanitize=address) + elseif(WITH_SANITIZE_MEMORY) + add_compile_options(-fsanitize=memory) + add_compile_options(-fsanitize-memory-use-after-dtor) + add_compile_options(-fsanitize-memory-track-origins) + add_link_options(-fsanitize=memory) + elseif(WITH_SANITIZE_THREAD) + add_compile_options(-fsanitize=thread) + add_link_options(-fsanitize=thread) + endif() + + option(WITH_NO_UNDEFINED "Add -Wl,--no-undefined" OFF) + if(WITH_NO_UNDEFINED) + add_link_options(-Wl,--no-undefined) + endif() +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/ConfigOptions.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/ConfigOptions.cmake new file mode 100644 index 0000000000000000000000000000000000000000..1feb6c81151c5bfe5e978e9ca97448691a278fdd --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/ConfigOptions.cmake @@ -0,0 +1,244 @@ +include(CMakeDependentOption) + +if((CMAKE_SYSTEM_PROCESSOR MATCHES "i386|i686|x86|AMD64") AND (CMAKE_SIZEOF_VOID_P EQUAL 4)) + set(TARGET_ARCH "x86") +elseif((CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64") AND (CMAKE_SIZEOF_VOID_P EQUAL 8)) + set(TARGET_ARCH "x64") +elseif((CMAKE_SYSTEM_PROCESSOR MATCHES "i386") AND (CMAKE_SIZEOF_VOID_P EQUAL 8) AND (APPLE)) + # Mac is weird like that. + set(TARGET_ARCH "x64") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm*") + set(TARGET_ARCH "ARM") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "sparc") + set(TARGET_ARCH "sparc") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "e2k") + set(TARGET_ARCH "e2k") +endif() + +if(NOT OPENBSD AND NOT WIN32) + set(MANPAGE_DEF ON) +endif() +option(WITH_MANPAGES "Generate manpages." ${MANPAGE_DEF}) +option(WITH_PROFILER "Compile profiler." OFF) +option(WITH_GPROF "Compile with GProf profiler." OFF) + +option(WITH_JPEG "Use JPEG decoding." OFF) + +include(CompilerDetect) + +if(WIN32) + if(NOT UWP) + option(WITH_MEDIA_FOUNDATION "Enable H264 media foundation decoder." OFF) + endif() +endif() + +if(WIN32 AND NOT UWP) + option(WITH_WINMM "Use Windows Multimedia" ON) + option(WITH_WIN8 "Use Windows 8 libraries" OFF) +endif() + +option(BUILD_BENCHMARK "Build benchmark tools (for debugging and development only)" OFF) +option(BUILD_TESTING "Build unit tests (compatible with packaging)" OFF) +cmake_dependent_option( + BUILD_TESTING_INTERNAL "Build unit tests (CI only, not for packaging!)" OFF "NOT BUILD_TESTING" OFF +) +cmake_dependent_option( + BUILD_TESTING_NO_H264 "Skip building h264 unit tests (no implementation during packaging)" OFF + "BUILD_TESTING OR BUILD_TESTING_INTERNAL" OFF +) +cmake_dependent_option(TESTS_WTSAPI_EXTRA "Build extra WTSAPI tests (interactive)" OFF "BUILD_TESTING_INTERNAL" OFF) +cmake_dependent_option(BUILD_COMM_TESTS "Build comm related tests (require comm port)" OFF "BUILD_TESTING_INTERNAL" OFF) + +option(WITH_SAMPLE "Build sample code" ON) + +option(WITH_CLIENT_COMMON "Build client common library" ON) +cmake_dependent_option(WITH_CLIENT "Build client binaries" ON "WITH_CLIENT_COMMON" OFF) +cmake_dependent_option(WITH_CLIENT_SDL "[experimental] Build SDL client " ON "WITH_CLIENT" OFF) + +option(WITH_SERVER "Build server binaries" ON) + +option(WITH_CHANNELS "Build virtual channel plugins" ON) + +option(FREERDP_UNIFIED_BUILD "Build WinPR, uwac, RdTk and FreeRDP in one go" ON) + +cmake_dependent_option(WITH_CLIENT_CHANNELS "Build virtual channel plugins" ON "WITH_CLIENT_COMMON;WITH_CHANNELS" OFF) + +cmake_dependent_option(WITH_MACAUDIO "Enable OSX sound backend" ON "APPLE;NOT IOS" OFF) + +if(WITH_SERVER AND WITH_CHANNELS) + option(WITH_SERVER_CHANNELS "Build virtual channel plugins" ON) +endif() + +option(WITH_THIRD_PARTY "Build third-party components" OFF) + +option(WITH_CLIENT_INTERFACE "Build clients as a library with an interface" OFF) +cmake_dependent_option( + CLIENT_INTERFACE_SHARED "Build clients as a shared library with an interface" OFF "WITH_CLIENT_INTERFACE" OFF +) +option(WITH_SERVER_INTERFACE "Build servers as a library with an interface" ON) + +option(WITH_DEBUG_ALL "Print all debug messages." OFF) + +if(WITH_DEBUG_ALL) + message( + WARNING + "WITH_DEBUG_ALL=ON, the build will be slow and might leak sensitive information, do not use with release builds!" + ) + set(DEFAULT_DEBUG_OPTION ON CACHE INTERNAL "debug default") +else() + set(DEFAULT_DEBUG_OPTION OFF CACHE INTERNAL "debug default") +endif() + +option(WITH_DEBUG_CERTIFICATE "Print certificate related debug messages." ${DEFAULT_DEBUG_OPTION}) +if(WITH_DEBUG_CERTIFICATE) + message( + WARNING "WITH_DEBUG_CERTIFICATE=ON, the build might leak sensitive information, do not use with release builds!" + ) +endif() +option(WITH_DEBUG_CAPABILITIES "Print capability negotiation debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_CHANNELS "Print channel manager debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_CLIPRDR "Print clipboard redirection debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_CODECS "Print codec debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_RDPGFX "Print RDPGFX debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_DVC "Print dynamic virtual channel debug messages." ${DEFAULT_DEBUG_OPTION}) +cmake_dependent_option( + WITH_DEBUG_TSMF "Print TSMF virtual channel debug messages." ${DEFAULT_DEBUG_OPTION} "CHANNEL_TSMF" OFF +) +option(WITH_DEBUG_KBD "Print keyboard related debug messages." ${DEFAULT_DEBUG_OPTION}) +if(WITH_DEBUG_KBD) + message(WARNING "WITH_DEBUG_KBD=ON, the build might leak sensitive information, do not use with release builds!") +endif() +option(WITH_DEBUG_LICENSE "Print license debug messages." ${DEFAULT_DEBUG_OPTION}) +if(WITH_DEBUG_LICENSE) + message(WARNING "WITH_DEBUG_LICENSE=ON, the build might leak sensitive information, do not use with release builds!") +endif() +option(WITH_DEBUG_NEGO "Print negotiation related debug messages." ${DEFAULT_DEBUG_OPTION}) +if(WITH_DEBUG_NEGO) + message(WARNING "WITH_DEBUG_NEGO=ON, the build might leak sensitive information, do not use with release builds!") +endif() +option(WITH_DEBUG_NLA "Print authentication related debug messages." ${DEFAULT_DEBUG_OPTION}) +if(WITH_DEBUG_NLA) + message(WARNING "WITH_DEBUG_NLA=ON, the build might leak sensitive information, do not use with release builds!") +endif() +option(WITH_DEBUG_TSG "Print Terminal Server Gateway debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_RAIL "Print RemoteApp debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_RDP "Print RDP debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_RDPEI "Print input virtual channel debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_REDIR "Redirection debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_RDPDR "Rdpdr debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_RFX "Print RemoteFX debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_SCARD "Print smartcard debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_SND "Print rdpsnd debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_SVC "Print static virtual channel debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_TRANSPORT "Print transport debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_TIMEZONE "Print timezone debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_WND "Print window order debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_X11_LOCAL_MOVESIZE "Print X11 Client local movesize debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_X11 "Print X11 Client debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_XV "Print XVideo debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_RINGBUFFER "Enable Ringbuffer debug messages" ${DEFAULT_DEBUG_OPTION}) + +option(WITH_DEBUG_SYMBOLS "Pack debug symbols to installer" OFF) +option(WITH_CCACHE "Use ccache support if available" ON) +option(WITH_CLANG_FORMAT "Detect clang-format. run 'cmake --build . --target clangformat' to format." ON) + +option(WITH_DSP_EXPERIMENTAL "Enable experimental sound encoder/decoder formats" OFF) + +option(WITH_FFMPEG "Enable FFMPEG for audio/video encoding/decoding" ON) +cmake_dependent_option(WITH_DSP_FFMPEG "Use FFMPEG for audio encoding/decoding" ON "WITH_FFMPEG" OFF) +cmake_dependent_option(WITH_VIDEO_FFMPEG "Use FFMPEG for video encoding/decoding" ON "WITH_FFMPEG" OFF) +cmake_dependent_option(WITH_VAAPI "Use FFMPEG VAAPI" OFF "WITH_VIDEO_FFMPEG" OFF) +cmake_dependent_option(WITH_VAAPI_H264_ENCODING "Use FFMPEG VAAPI hardware H264 encoding" ON "WITH_VIDEO_FFMPEG" OFF) +if(WITH_VAAPI_H264_ENCODING) + add_definitions("-DWITH_VAAPI_H264_ENCODING") +endif() + +option(USE_VERSION_FROM_GIT_TAG "Extract FreeRDP version from git tag." ON) + +option(WITH_CAIRO "Use CAIRO image library for screen resizing" OFF) +option(WITH_SWSCALE "Use SWScale image library for screen resizing" ON) + +if(ANDROID) + include(ConfigOptionsAndroid) +endif(ANDROID) + +if(IOS) + include(ConfigOptionsiOS) +endif(IOS) + +if(UNIX AND NOT APPLE) + find_package(ALSA) + find_package(PulseAudio) + find_package(OSS) + option(WITH_ALSA "use alsa for sound" ${ALSA_FOUND}) + option(WITH_PULSE "use alsa for sound" ${PULSE_FOUND}) + option(WITH_OSS "use alsa for sound" ${OSS_FOUND}) +endif() + +if(OPENBSD) + find_package(SNDIO) + option(WITH_SNDIO "use SNDIO for sound" ${SNDIO_FOUND # OpenBSD + endif () } + ) +endif() + +option(BUILD_FUZZERS "Use BUILD_FUZZERS to build fuzzing tests" OFF) + +if(BUILD_FUZZERS) + if(NOT OSS_FUZZ) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=fuzzer-no-link") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=fuzzer-no-link") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=fuzzer-no-link") + endif() + + if(OSS_FUZZ AND NOT DEFINED ENV{LIB_FUZZING_ENGINE}) + message(SEND_ERROR "OSS-Fuzz builds require the environment variable " + "LIB_FUZZING_ENGINE to be set. If you are seeing this " + "warning, it points to a deeper problem in the ossfuzz " "build setup." + ) + endif() + + if(CMAKE_COMPILER_IS_GNUCC) + message(FATAL_ERROR "\n" "Fuzzing is unsupported with GCC compiler. Use Clang:\n" + " $ CC=clang CXX=clang++ cmake . <...> -DBUILD_FUZZERS=ON && make -j\n" "\n" + ) + endif() + + set(BUILD_TESTING_INTERNAL ON CACHE BOOL "fuzzer default" FORCE) + + if(BUILD_SHARED_LIBS STREQUAL "OFF") + set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") + set(CMAKE_CXX_FLAGS "-static ${CMAKE_CXX_FLAGS}") + endif() + + # A special target with fuzzer and sanitizer flags. + add_library(fuzzer_config INTERFACE) + + target_compile_options( + fuzzer_config + INTERFACE $<$>: + -fsanitize=fuzzer + > + $<$: + ${CXX} + ${CXXFLAGS} + > + ) + target_link_libraries( + fuzzer_config INTERFACE $<$>: -fsanitize=fuzzer > $<$: + $ENV{LIB_FUZZING_ENGINE} > + ) +endif() + +option( + WITH_FULL_CONFIG_PATH + "Use /Vendor/Product instead of /product (lowercase, only if vendor equals product) as config directory" + OFF +) + +# Configuration settings for manpages +if(NOT WITH_FULL_CONFIG_PATH AND "${VENDOR}" STREQUAL "${PRODUCT}") + string(TOLOWER "${VENDOR}" VENDOR_PRODUCT) +else() + set(VENDOR_PRODUCT "${VENDOR}/${PRODUCT}") +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/ConfigOptionsAndroid.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/ConfigOptionsAndroid.cmake new file mode 100644 index 0000000000000000000000000000000000000000..ea0a3ddea526e7f4456f22681174865ab1ceaa7d --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/ConfigOptionsAndroid.cmake @@ -0,0 +1,22 @@ +# FreeRDP cmake android options +# +# Copyright 2013 Thincast Technologies GmbH +# Copyright 2013 Bernhard Miklautz +# +# 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. + +option(WITH_OPENSLES "Enable sound and microphone redirection using OpenSLES" ON) + +set(ANDROID_APP_TARGET_SDK 21 CACHE STRING "Application target android SDK") +set(ANDROID_APP_MIN_SDK 14 CACHE STRING "Application minimum android SDK requirement") +option(WITH_MEDIACODEC "[experimental] Use MediaCodec API (currently no fallback if no device support)" OFF) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/ConfigOptionsiOS.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/ConfigOptionsiOS.cmake new file mode 100644 index 0000000000000000000000000000000000000000..a167a10bc6df97dca0c706f95180aa0d3211c188 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/ConfigOptionsiOS.cmake @@ -0,0 +1,25 @@ +# FreeRDP cmake ios options +# +# Copyright 2013 Thincast Technologies GmbH +# Copyright 2013 Martin Fleisz +# +# 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. + +if(NOT FREERDP_IOS_EXTERNAL_SSL_PATH) + set(FREERDP_IOS_EXTERNAL_SSL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external/openssl") +endif() +mark_as_advanced(FREERDP_IOS_EXTERNAL_SSL_PATH) + +if(NOT DEFINED IOS_TARGET_SDK) + set(IOS_TARGET_SDK 12.0 CACHE STRING "Application target iOS SDK") +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/ConfigureFreeRDP.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/ConfigureFreeRDP.cmake new file mode 100644 index 0000000000000000000000000000000000000000..7b8ef8285dfe018dc81c277954e080d6dff3ed84 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/ConfigureFreeRDP.cmake @@ -0,0 +1,10 @@ +if(NOT FREERDP_UNIFIED_BUILD) + find_package(WinPR 3 REQUIRED) + include_directories(SYSTEM ${WinPR_INCLUDE_DIR}) + + find_package(FreeRDP 3 REQUIRED) + include_directories(SYSTEM ${FreeRDP_INCLUDE_DIR}) + + find_package(FreeRDP-Client 3 REQUIRED) + include_directories(SYSTEM ${FreeRDP-Client_INCLUDE_DIR}) +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/ConfigureRPATH.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/ConfigureRPATH.cmake new file mode 100644 index 0000000000000000000000000000000000000000..0082d13deb3318adcc4e1b65db70353b2f309b8a --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/ConfigureRPATH.cmake @@ -0,0 +1,27 @@ +# RPATH configuration +option(CMAKE_SKIP_BUILD_RPATH "skip build RPATH" OFF) +option(CMAKE_BUILD_WITH_INSTALL_RPATH "build with install RPATH" OFF) +option(CMAKE_INSTALL_RPATH_USE_LINK_PATH "build with link RPATH" OFF) + +if(APPLE) + if(BUILD_SHARED_LIBS) + option(CMAKE_MACOSX_RPATH "MacOSX RPATH" ON) + endif() + + file(RELATIVE_PATH FRAMEWORK_PATH ${CMAKE_INSTALL_FULL_BINDIR} ${CMAKE_INSTALL_FULL_LIBDIR}) + set(CFG_INSTALL_RPATH "@loader_path/${FRAMEWORK_PATH}") +elseif(NOT WIN32) + if(NOT FREEBSD) + option(WITH_ADD_PLUGIN_TO_RPATH "Add extension and plugin path to RPATH" OFF) + if(WITH_ADD_PLUGIN_TO_RPATH) + set(CFG_INSTALL_RPATH + "\$ORIGIN/../${FREERDP_EXTENSION_REL_PATH}:\$ORIGIN/../${FREERDP_PLUGIN_PATH}:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/.." + ) + else() + set(CFG_INSTALL_RPATH "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/..") + endif() + endif() +endif(APPLE) + +set(CMAKE_INSTALL_RPATH ${CFG_INSTALL_RPATH} CACHE INTERNAL "ConfigureRPATH") +message("Configured RPATH=${CMAKE_INSTALL_RPATH}") diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/ConvertFileToHexArray.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/ConvertFileToHexArray.cmake new file mode 100644 index 0000000000000000000000000000000000000000..48c47f11317a2927ee966dfc6b2da8c0b1d83076 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/ConvertFileToHexArray.cmake @@ -0,0 +1,16 @@ +function(file_to_hex_array FILE DATA) + # Read the ASCII file as hex. + file(READ "${FILE}" HEX_CONTENTS HEX) + + # Separate into individual bytes. + string(REGEX MATCHALL "([A-Za-z0-9][A-Za-z0-9])" SEPARATED_HEX "${HEX_CONTENTS}") + + # Append the "0x" to each byte. + list(JOIN SEPARATED_HEX ", 0x" FORMATTED_HEX) + + # JOIN misses the first byte's "0x", so add it here. + string(PREPEND FORMATTED_HEX "0x") + + # Set the variable named by DATA argument to the formatted hex string. + set(${DATA} ${FORMATTED_HEX} PARENT_SCOPE) +endfunction() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/DetectIntrinsicSupport.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/DetectIntrinsicSupport.cmake new file mode 100644 index 0000000000000000000000000000000000000000..80d8c9f51e4e83c817b84fdd5b3f96f6d1c57604 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/DetectIntrinsicSupport.cmake @@ -0,0 +1,106 @@ +option(WITH_SIMD "Enable best platform specific vector instruction support" ON) +cmake_dependent_option(WITH_AVX2 "Compile AVX2 optimizations." ON "WITH_SIMD" OFF) + +if(WITH_SSE2) + message(WARNING "WITH_SSE2 is deprecated, use WITH_SIMD instead") + set(WITH_SIMD ON CACHE BOOL "WITH_SSE2") +endif() +if(WITH_NEON) + message(WARNING "WITH_NEON is deprecated, use WITH_SIMD instead") + set(WITH_SIMD ON CACHE BOOL "WITH_NEON") +endif() + +macro(set_simd_source_file_properties INTRINSIC_TYPE) + if(ARGC LESS_EQUAL 1) + message(FATAL_ERROR "set_simd_source_file_properties called with invalid arguments: [${ARGC}] {${ARGN}") + endif() + + # see https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html + set(GCC_CLANG_NAMES "AppleClang;Clang;CrayClang;FujitsuClang;GNU;IntelLLVM;TIClang;XLClang;IBMClang") + + set(SSE_X86_LIST "i686;x86") + set(SSE_LIST "x86_64;ia64;x64;amd64;ia64;em64t;${SSE_X86_LIST}") + set(NEON_LIST "arm;armv7;armv8b;armv8l") + set(SUPPORTED_INTRINSICS_LIST "neon;sse2;sse3;ssse3;sse4.1;sse4.2;avx2") + + string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSTEM_PROCESSOR) + + if(NOT "${INTRINSIC_TYPE}" IN_LIST SUPPORTED_INTRINSICS_LIST) + message(WARNING "Intrinsic type ${INTRINSIC_TYPE} not supported, only ${SUPPORTED_INTRINSICS_LIST} are available") + else() + set(SIMD_LINK_ARG "") + if(MSVC) + # https://learn.microsoft.com/en-us/cpp/build/reference/arch-x64?view=msvc-140 + if("${SYSTEM_PROCESSOR}" IN_LIST SSE_LIST) + if("${SYSTEM_PROCESSOR}" IN_LIST SSE_X86_LIST) + # /arch:SSE2 is the default, so do nothing + set(SIMD_LINK_ARG "ignore") + if("${INTRINSIC_TYPE}" STREQUAL "avx2") + set(SIMD_LINK_ARG "/arch:AVX2") + endif() + else() + # /arch:SSE2 is the default, so do nothing + set(SIMD_LINK_ARG "ignore") + if("${INTRINSIC_TYPE}" STREQUAL "sse4.2") + set(SIMD_LINK_ARG "/arch:SSE4.2") + elseif("${INTRINSIC_TYPE}" STREQUAL "avx2") + set(SIMD_LINK_ARG "/arch:AVX2") + endif() + endif() + endif() + elseif("${CMAKE_C_COMPILER_ID}" IN_LIST GCC_CLANG_NAMES) + set(HAVE_SSE_AVX OFF) + foreach(ARCH ${CMAKE_OSX_ARCHITECTURES}) + if("${ARCH}" IN_LIST SSE_LIST) + set(HAVE_SSE_AVX ON) + endif() + endforeach() + if("${SYSTEM_PROCESSOR}" IN_LIST SSE_LIST OR HAVE_SSE_AVX) + if("${INTRINSIC_TYPE}" STREQUAL "sse2") + set(SIMD_LINK_ARG "-msse2") + elseif("${INTRINSIC_TYPE}" STREQUAL "sse3") + set(SIMD_LINK_ARG "-msse3") + elseif("${INTRINSIC_TYPE}" STREQUAL "ssse3") + set(SIMD_LINK_ARG "-mssse3") + elseif("${INTRINSIC_TYPE}" STREQUAL "sse4.1") + set(SIMD_LINK_ARG "-msse4.1") + elseif("${INTRINSIC_TYPE}" STREQUAL "sse4.2") + set(SIMD_LINK_ARG "-msse4.2") + elseif("${INTRINSIC_TYPE}" STREQUAL "avx2") + set(SIMD_LINK_ARG "-mavx2") + endif() + endif() + else() + message(WARNING "[SIMD] Unsupported compiler ${CMAKE_C_COMPILER_ID}, ignoring") + endif() + + if("${INTRINSIC_TYPE}" STREQUAL "neon") + set(HAVE_NEON OFF) + foreach(ARCH ${CMAKE_OSX_ARCHITECTURES}) + if("${ARCH}" IN_LIST NEON_LIST) + set(HAVE_NEON ON) + endif() + endforeach() + if("${SYSTEM_PROCESSOR}" IN_LIST NEON_LIST OR HAVE_NEON) + if(MSVC) + set(SIMD_LINK_ARG "/arch:VFPv4") + elseif("${CMAKE_C_COMPILER_ID}" IN_LIST GCC_CLANG_NAMES) + set(SIMD_LINK_ARG "-mfpu=neon") + else() + message(WARNING "[SIMD] Unsupported compiler ${CMAKE_C_COMPILER_ID}, ignoring") + endif() + endif() + endif() + + if(SIMD_LINK_ARG STREQUAL "") + message(NOTICE "INTRINSIC_TYPE=${INTRINSIC_TYPE}: not supported on target platform, ignoring") + elseif(SIMD_LINK_ARG STREQUAL "ignore") + message(NOTICE "INTRINSIC_TYPE=${INTRINSIC_TYPE}: does not require linker flags, enabled by default") + else() + message("[SIMD] linking ${INTRINSIC_TYPE} [${SIMD_LINK_ARG}]: ${ARGN}") + foreach(src ${ARGN}) + set_source_files_properties(${src} PROPERTIES COMPILE_FLAGS "${SIMD_LINK_ARG}") + endforeach() + endif() + endif() +endmacro() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/DisableCompilerWarnings.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/DisableCompilerWarnings.cmake new file mode 100644 index 0000000000000000000000000000000000000000..d08b721f861b774be21540b619646a39aced6ede --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/DisableCompilerWarnings.cmake @@ -0,0 +1,18 @@ +if(MSVC) + set(COMPILE_WARN_OPTS "/W0") +else() + set(COMPILE_WARN_OPTS "-w") +endif() +set(COMPILE_WARN_OPTS "${COMPILE_WARN_OPTS}" CACHE STRING "cached value") + +function(disable_warnings_for_directory dir) + if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.19.0") + set_property(DIRECTORY "${dir}" PROPERTY COMPILE_OPTIONS ${COMPILE_WARN_OPTS}) + endif() + + file(MAKE_DIRECTORY "${dir}") + set(ctidy "${dir}/.clang-tidy") + file(WRITE ${ctidy} "Checks: '-*,misc-definitions-in-headers'\n") + file(APPEND ${ctidy} "CheckOptions:\n") + file(APPEND ${ctidy} "\t- { key: HeaderFileExtensions, value: \"x\" }\n") +endfunction() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/Doxygen.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/Doxygen.cmake new file mode 100644 index 0000000000000000000000000000000000000000..0e1888ef32af0ea3f30e5100238ffb0770a9e54b --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/Doxygen.cmake @@ -0,0 +1,21 @@ +option(WITH_DOCUMENTATION "Add target to build doxygen documentation" OFF) + +if(WITH_DOCUMENTATION) + if(CMAKE_VERSION VERSION_LESS "3.27") + message(WARNING "Building with CMake ${CMAKE_VERSION} but >= 3.27 required for doxygen target") + else() + include(FindDoxygen) + find_package(Doxygen REQUIRED dot OPTIONAL_COMPONENTS mscgen dia) + + set(DOXYGEN_PROJECT_NAME ${PROJECT_NAME}) + set(DOXYGEN_PROJECT_NUMBER ${PROJECT_VERSION}) + set(DOXYGEN_EXCLUDE_PATTERNS "*/uwac/protocols/*") + set(DOXYGEN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/docs") + + doxygen_add_docs( + docs "${CMAKE_SOURCE_DIR}" ALL COMMENT "Generate doxygen docs" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/docs" CONFIG_FILE "${CMAKE_SOURCE_DIR}/docs/Doxyfile" + ) + install(DIRECTORY "${CMAKE_SOURCE_DIR}/docs/api" DESTINATION ${CMAKE_INSTALL_DOCDIR}) + endif() +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/DumpVariables.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/DumpVariables.cmake new file mode 100644 index 0000000000000000000000000000000000000000..6d5e121209f34add6c7c4d669cc510edda2cb308 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/DumpVariables.cmake @@ -0,0 +1,9 @@ +function(dump_cmake_variables) + get_cmake_property(_variableNames VARIABLES) + list(SORT _variableNames) + foreach(_variableName ${_variableNames}) + if((NOT DEFINED ARGV0) OR _variableName MATCHES ${ARGV0}) + message(STATUS "${_variableName}=${${_variableName}}") + endif() + endforeach() +endfunction() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/EchoTarget.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/EchoTarget.cmake new file mode 100644 index 0000000000000000000000000000000000000000..1daa877f2921b7df889ee7fc596a8e26ed0c0e97 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/EchoTarget.cmake @@ -0,0 +1,177 @@ +function(echo_target_property tgt prop) + # v for value, d for defined, s for set + get_property(v TARGET ${tgt} PROPERTY ${prop}) + get_property(d TARGET ${tgt} PROPERTY ${prop} DEFINED) + get_property(s TARGET ${tgt} PROPERTY ${prop} SET) + + # only produce output for values that are set + if(s) + message("tgt='${tgt}' prop='${prop}'") + message(" value='${v}'") + message(" defined='${d}'") + message(" set='${s}'") + message("") + endif() +endfunction() + +function(echo_target tgt) + if(NOT TARGET ${tgt}) + message("There is no target named '${tgt}'") + return() + endif() + + set(props + DEBUG_OUTPUT_NAME + RELEASE_OUTPUT_NAME + DEBUG_POSTFIX + RELEASE_POSTFIX + ARCHIVE_OUTPUT_DIRECTORY + ARCHIVE_OUTPUT_DIRECTORY_DEBUG + ARCHIVE_OUTPUT_DIRECTORY_RELEASE + ARCHIVE_OUTPUT_NAME + ARCHIVE_OUTPUT_NAME_DEBUG + ARCHIVE_OUTPUT_NAME_RELEASE + AUTOMOC + AUTOMOC_MOC_OPTIONS + BUILD_WITH_INSTALL_RPATH + BUNDLE + BUNDLE_EXTENSION + COMPILE_DEFINITIONS + COMPILE_DEFINITIONS_DEBUG + COMPILE_DEFINITIONS_RELEASE + COMPILE_FLAGS + DEBUG_POSTFIX + DEFINE_SYMBOL + ENABLE_EXPORTS + EXCLUDE_FROM_ALL + EchoString + FOLDER + FRAMEWORK + Fortran_FORMAT + Fortran_MODULE_DIRECTORY + GENERATOR_FILE_NAME + GNUtoMS + HAS_CXX + IMPLICIT_DEPENDS_INCLUDE_TRANSFORM + IMPORTED + IMPORTED_CONFIGURATIONS + IMPORTED_IMPLIB + IMPORTED_IMPLIB_RELEASE + IMPORTED_IMPLIB_RELEASE + IMPORTED_LINK_DEPENDENT_LIBRARIES + IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBUG + IMPORTED_LINK_DEPENDENT_LIBRARIES_RELEASE + IMPORTED_LINK_INTERFACE_LANGUAGES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE + IMPORTED_LINK_INTERFACE_LIBRARIES + IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG + IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE + IMPORTED_LINK_INTERFACE_MULTIPLICITY + IMPORTED_LINK_INTERFACE_MULTIPLICITY_DEBUG + IMPORTED_LINK_INTERFACE_MULTIPLICITY_RELEASE + IMPORTED_LOCATION + IMPORTED_LOCATION_DEBUG + IMPORTED_LOCATION_RELEASE + IMPORTED_NO_SONAME + IMPORTED_NO_SONAME_DEBUG + IMPORTED_NO_SONAME_RELEASE + IMPORTED_SONAME + IMPORTED_SONAME_DEBUG + IMPORTED_SONAME_RELEASE + IMPORT_PREFIX + IMPORT_SUFFIX + INCLUDE_DIRECTORIES + INSTALL_NAME_DIR + INSTALL_RPATH + INSTALL_RPATH_USE_LINK_PATH + INTERPROCEDURAL_OPTIMIZATION + INTERPROCEDURAL_OPTIMIZATION_DEBUG + INTERPROCEDURAL_OPTIMIZATION_RELEASE + LABELS + LIBRARY_OUTPUT_DIRECTORY + LIBRARY_OUTPUT_DIRECTORY_DEBUG + LIBRARY_OUTPUT_DIRECTORY_RELEASE + LIBRARY_OUTPUT_NAME + LIBRARY_OUTPUT_NAME_DEBUG + LIBRARY_OUTPUT_NAME_RELEASE + LINKER_LANGUAGE + LINK_DEPENDS + LINK_LIBRARIES + LINK_FLAGS + LINK_FLAGS_DEBUG + LINK_FLAGS_RELEASE + LINK_INTERFACE_LIBRARIES + LINK_INTERFACE_LIBRARIES_DEBUG + LINK_INTERFACE_LIBRARIES_RELEASE + LINK_INTERFACE_MULTIPLICITY + LINK_INTERFACE_MULTIPLICITY_DEBUG + LINK_INTERFACE_MULTIPLICITY_RELEASE + LINK_SEARCH_END_STATIC + LINK_SEARCH_START_STATIC + LOCATION + LOCATION_DEBUG + LOCATION_RELEASE + MACOSX_BUNDLE + MACOSX_BUNDLE_INFO_PLIST + MACOSX_FRAMEWORK_INFO_PLIST + MAP_IMPORTED_CONFIG_DEBUG + MAP_IMPORTED_CONFIG_RELEASE + OSX_ARCHITECTURES + OSX_ARCHITECTURES_DEBUG + OSX_ARCHITECTURES_RELEASE + OUTPUT_NAME + OUTPUT_NAME_DEBUG + OUTPUT_NAME_RELEASE + POST_INSTALL_SCRIPT + PREFIX + PRE_INSTALL_SCRIPT + PRIVATE_HEADER + PROJECT_LABEL + PUBLIC_HEADER + RESOURCE + RULE_LAUNCH_COMPILE + RULE_LAUNCH_CUSTOM + RULE_LAUNCH_LINK + RUNTIME_OUTPUT_DIRECTORY + RUNTIME_OUTPUT_DIRECTORY_DEBUG + RUNTIME_OUTPUT_DIRECTORY_RELEASE + RUNTIME_OUTPUT_NAME + RUNTIME_OUTPUT_NAME_DEBUG + RUNTIME_OUTPUT_NAME_RELEASE + SKIP_BUILD_RPATH + SOURCES + SOVERSION + STATIC_LIBRARY_FLAGS + STATIC_LIBRARY_FLAGS_DEBUG + STATIC_LIBRARY_FLAGS_RELEASE + SUFFIX + TYPE + VERSION + VS_DOTNET_REFERENCES + VS_GLOBAL_KEYWORD + VS_GLOBAL_PROJECT_TYPES + VS_KEYWORD + VS_SCC_AUXPATH + VS_SCC_LOCALPATH + VS_SCC_PROJECTNAME + VS_SCC_PROVIDER + VS_WINRT_EXTENSIONS + VS_WINRT_REFERENCES + WIN32_EXECUTABLE + ) + + message("======================== ${tgt} ========================") + foreach(p ${props}) + echo_target_property("${tgt}" "${p}") + endforeach() + message("") + +endfunction() + +function(echo_targets) + set(tgts ${ARGV}) + foreach(t ${tgts}) + echo_target("${t}") + endforeach() +endfunction() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/ExportAllSymbols.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/ExportAllSymbols.cmake new file mode 100644 index 0000000000000000000000000000000000000000..76a543daf256388d88f74529cd700d6fc50bfeaf --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/ExportAllSymbols.cmake @@ -0,0 +1,11 @@ +include(CheckAndSetFlag) + +option(EXPORT_ALL_SYMBOLS "Export all symbols form library" OFF) + +if(EXPORT_ALL_SYMBOLS) + add_compile_definitions(EXPORT_ALL_SYMBOLS) +else() + message(STATUS "${} default symbol visibility: hidden") + + checkandsetflag(-fvisibility=hidden) +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindCairo.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindCairo.cmake new file mode 100644 index 0000000000000000000000000000000000000000..c9ec7f0727e6fb42b93669d1754d059a60d9862c --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindCairo.cmake @@ -0,0 +1,107 @@ +# - Try to find the CAIRO library +# Once done this will define +# +# CAIRO_ROOT_DIR - Set this variable to the root installation of CAIRO +# +# Read-Only variables: +# CAIRO_FOUND - system has the CAIRO library +# CAIRO_INCLUDE_DIR - the CAIRO include directory +# CAIRO_LIBRARIES - The libraries needed to use CAIRO +# CAIRO_VERSION - This is set to $major.$minor.$revision (eg. 0.9.8) + +#============================================================================= +# Copyright 2012 Dmitry Baryshnikov +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +find_package(PkgConfig) + +if(PKG_CONFIG_FOUND) + pkg_check_modules(_CAIRO cairo) +endif(PKG_CONFIG_FOUND) + +set(_CAIRO_ROOT_HINTS $ENV{CAIRO} ${CAIRO_ROOT_DIR}) +set(_CAIRO_ROOT_PATHS $ENV{CAIRO}/src /usr /usr/local) +set(_CAIRO_ROOT_HINTS_AND_PATHS HINTS ${_CAIRO_ROOT_HINTS} PATHS ${_CAIRO_ROOT_PATHS}) + +find_path(CAIRO_INCLUDE_DIR NAMES cairo.h HINTS ${_CAIRO_INCLUDEDIR} ${_CAIRO_ROOT_HINTS_AND_PATHS} + PATH_SUFFIXES include "include/cairo" +) + +if(NOT PKGCONFIG_FOUND AND WIN32 AND NOT CYGWIN) + # MINGW should go here too + if(MSVC) + # Implementation details: + # We are using the libraries located in the VC subdir instead of the parent directory even though : + find_library(CAIRO_DEBUG NAMES cairod ${_CAIRO_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES "lib" "VC" "lib/VC") + + find_library(CAIRO_RELEASE NAMES cairo ${_CAIRO_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES "lib" "VC" "lib/VC") + + if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + if(NOT CAIRO_DEBUG) + set(CAIRO_DEBUG ${CAIRO_RELEASE}) + endif(NOT CAIRO_DEBUG) + set(CAIRO_LIBRARIES optimized ${CAIRO_RELEASE} debug ${CAIRO_DEBUG}) + else() + set(CAIRO_LIBRARIES ${CAIRO_RELEASE}) + endif() + mark_as_advanced(CAIRO_DEBUG CAIRO_RELEASE) + elseif(MINGW) + # same player, for MingW + find_library(CAIRO NAMES cairo ${_CAIRO_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES "lib" "lib/MinGW") + + mark_as_advanced(CAIRO) + set(CAIRO_LIBRARIES ${CAIRO}) + else(MSVC) + # Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues: + find_library(CAIRO NAMES cairo HINTS ${_CAIRO_LIBDIR} ${_CAIRO_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES lib) + + mark_as_advanced(CAIRO) + set(CAIRO_LIBRARIES ${CAIRO}) + endif(MSVC) +else() + + find_library( + CAIRO_LIBRARY NAMES cairo HINTS ${_CAIRO_LIBDIR} ${_CAIRO_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES "lib" "local/lib" + ) + + mark_as_advanced(CAIRO_LIBRARY) + + # compat defines + set(CAIRO_LIBRARIES ${CAIRO_LIBRARY}) + +endif() + +#message( STATUS "Cairo_FIND_VERSION=${Cairo_FIND_VERSION}.") +#message( STATUS "CAIRO_INCLUDE_DIR=${CAIRO_INCLUDE_DIR}.") + +# Fetch version from cairo-version.h if a version was requested by find_package() +if(CAIRO_INCLUDE_DIR AND Cairo_FIND_VERSION) + file(READ "${CAIRO_INCLUDE_DIR}/cairo-version.h" _CAIRO_VERSION_H_CONTENTS) + string(REGEX REPLACE "^(.*\n)?#define[ \t]+CAIRO_VERSION_MAJOR[ \t]+([0-9]+).*" "\\2" CAIRO_VERSION_MAJOR + ${_CAIRO_VERSION_H_CONTENTS} + ) + string(REGEX REPLACE "^(.*\n)?#define[ \t]+CAIRO_VERSION_MINOR[ \t]+([0-9]+).*" "\\2" CAIRO_VERSION_MINOR + ${_CAIRO_VERSION_H_CONTENTS} + ) + string(REGEX REPLACE "^(.*\n)?#define[ \t]+CAIRO_VERSION_MICRO[ \t]+([0-9]+).*" "\\2" CAIRO_VERSION_MICRO + ${_CAIRO_VERSION_H_CONTENTS} + ) + set(CAIRO_VERSION ${CAIRO_VERSION_MAJOR}.${CAIRO_VERSION_MINOR}.${CAIRO_VERSION_MICRO} + CACHE INTERNAL "The version number for Cairo libraries" + ) +endif() + +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args(Cairo REQUIRED_VARS CAIRO_LIBRARIES CAIRO_INCLUDE_DIR VERSION_VAR CAIRO_VERSION) + +mark_as_advanced(CAIRO_INCLUDE_DIR CAIRO_LIBRARIES) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindFAAC.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindFAAC.cmake new file mode 100644 index 0000000000000000000000000000000000000000..0f2d262d7313c72c1ff0515b4539611857f30f4b --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindFAAC.cmake @@ -0,0 +1,12 @@ +find_path(FAAC_INCLUDE_DIR faac.h) + +find_library(FAAC_LIBRARY faac) + +find_package_handle_standard_args(FAAC DEFAULT_MSG FAAC_INCLUDE_DIR FAAC_LIBRARY) + +if(FAAC_FOUND) + set(FAAC_LIBRARIES ${FAAC_LIBRARY}) + set(FAAC_INCLUDE_DIRS ${FAAC_INCLUDE_DIR}) +endif() + +mark_as_advanced(FAAC_INCLUDE_DIR FAAC_LIBRARY) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindFAAD2.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindFAAD2.cmake new file mode 100644 index 0000000000000000000000000000000000000000..125d328e5fbe650629425d0b8629af224b33c67f --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindFAAD2.cmake @@ -0,0 +1,12 @@ +find_path(FAAD2_INCLUDE_DIR faad.h) + +find_library(FAAD2_LIBRARY faad) + +find_package_handle_standard_args(FAAD2 DEFAULT_MSG FAAD2_INCLUDE_DIR FAAD2_LIBRARY) + +if(FAAD2_FOUND) + set(FAAD2_LIBRARIES ${FAAD2_LIBRARY}) + set(FAAD2_INCLUDE_DIRS ${FAAD2_INCLUDE_DIR}) +endif() + +mark_as_advanced(FAAD2_INCLUDE_DIR FAAD2_LIBRARY) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindFFmpeg.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindFFmpeg.cmake new file mode 100644 index 0000000000000000000000000000000000000000..0e5f7bec7c7a39c5c1b2bd38407c100d74243843 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindFFmpeg.cmake @@ -0,0 +1,208 @@ +# vim: ts=2 sw=2 +# - Try to find the required ffmpeg components(default: AVFORMAT, AVUTIL, AVCODEC) +# +# Once done this will define +# FFMPEG_FOUND - System has the all required components. +# FFMPEG_INCLUDE_DIRS - Include directory necessary for using the required components headers. +# FFMPEG_LIBRARIES - Link these to use the required ffmpeg components. +# FFMPEG_DEFINITIONS - Compiler switches required for using the required ffmpeg components. +# +# For each of the components +# - AVCODEC +# - AVDEVICE +# - AVFORMAT +# - AVFILTER +# - AVUTIL +# - POSTPROCESS +# - SWSCALE +# - SWRESAMPLE +# the following variables will be defined: +# _FOUND - System has +# _INCLUDE_DIRS - Include directory necessary for using the headers +# _LIBRARIES - Link these to use +# _DEFINITIONS - Compiler switches required for using +# _VERSION - The components version +# +# As the versions of the various FFmpeg components differ for a given release, +# and CMake supports only one common version for all components, use the +# following to specify required versions for multiple components: +# +# find_package(FFmpeg 57.48 COMPONENTS AVCODEC) +# find_package(FFmpeg 57.40 COMPONENTS AVFORMAT) +# find_package(FFmpeg 55.27 COMPONENTS AVUTIL) +# +# SPDX-FileCopyrightText: 2006 Matthias Kretz +# SPDX-FileCopyrightText: 2008 Alexander Neundorf +# SPDX-FileCopyrightText: 2011 Michael Jansen +# SPDX-FileCopyrightText: 2021 Stefan Brüns +# SPDX-FileCopyrightText: 2024 Armin Novak +# SPDX-License-Identifier: BSD-3-Clause + +include(FindPackageHandleStandardArgs) + +if(NOT FFmpeg_FIND_COMPONENTS) + # The default components were taken from a survey over other FindFFMPEG.cmake files + set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL) +endif() + +list(LENGTH FFmpeg_FIND_COMPONENTS _numComponents) + +if((${_numComponents} GREATER 1) AND DEFINED ${FFmpeg_FIND_VERSION}) + message(WARNING "Using a required version in combination with multiple COMPONENTS is not supported") + set(_FFmpeg_REQUIRED_VERSION 0) +elseif(DEFINED FFmpeg_FIND_VERSION) + set(_FFmpeg_REQUIRED_VERSION ${FFmpeg_FIND_VERSION}) +else() + set(_FFmpeg_REQUIRED_VERSION 0) +endif() + +set(_FFmpeg_ALL_COMPONENTS + AVCODEC + AVDEVICE + AVFORMAT + AVFILTER + AVUTIL + POSTPROCESS + SWSCALE + SWRESAMPLE +) + +# +# ## Macro: set_component_found +# +# Marks the given component as found if both *_LIBRARIES AND *_INCLUDE_DIRS is present. +# +macro(set_component_found _component) + if(${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS) + set(${_component}_FOUND TRUE) + set(FFmpeg_${_component}_FOUND TRUE) + endif() +endmacro() + +# +# ## Macro: find_component +# +# Checks for the given component by invoking pkgconfig and then looking up the libraries and +# include directories. +# +macro(find_component _component _pkgconfig _library _header) + if(NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + + if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_${_component} QUIET ${_pkgconfig}) + endif() + endif(NOT WIN32) + + find_path(${_component}_INCLUDE_DIRS ${_header} HINTS ${PC_LIB${_component}_INCLUDEDIR} + ${PC_LIB${_component}_INCLUDE_DIRS} PATH_SUFFIXES ffmpeg + ) + + find_library( + ${_component}_LIBRARIES NAMES ${_library} HINTS ${PC_LIB${_component}_LIBDIR} ${PC_LIB${_component}_LIBRARY_DIRS} + ) + + set(${_component}_DEFINITIONS ${PC_${_component}_CFLAGS_OTHER} CACHE STRING "The ${_component} CFLAGS.") + + # Fallback version detection: + # Read version.h (and version_major.h if it exists) and try to extract the version + if("${PC_${_component}_VERSION}_" STREQUAL "_") + get_filename_component(${_component}_suffix "${_header}" DIRECTORY) + find_file(${_component}_hdr_version_major NAMES version_major.h PATH_SUFFIXES ${${_component}_suffix} + HINTS ${${_component}_INCLUDE_DIRS} + ) + find_file(${_component}_hdr_version NAMES version.h PATH_SUFFIXES ${${_component}_suffix} + HINTS ${${_component}_INCLUDE_DIRS} + ) + if(NOT ${${_component}_hdr_version} MATCHES ".*-NOTFOUND") + file(READ "${${_component}_hdr_version}" ${_component}_version_text) + endif() + if(NOT ${${_component}_hdr_version_major} MATCHES ".*-NOTFOUND") + file(READ "${${_component}_hdr_version_major}" ${_component}_version_major_text) + else() + set(${_component}_version_major_text "${${_component}_version_text}") + endif() + + string(REGEX MATCH "#define[ \t]+.*_VERSION_MAJOR[ \t]+([0-9]+)" _ "${${_component}_version_major_text}") + set(${_component}_version_major ${CMAKE_MATCH_1}) + string(REGEX MATCH "#define[ \t]+.*_VERSION_MINOR[ \t]+([0-9]+)" _ "${${_component}_version_text}") + set(${_component}_version_minor ${CMAKE_MATCH_1}) + string(REGEX MATCH "#define[ \t]+.*_VERSION_MICRO[ \t]+([0-9]+)" _ "${${_component}_version_text}") + set(${_component}_version_micro ${CMAKE_MATCH_1}) + + set(${_component}_VERSION + "${${_component}_version_major}.${${_component}_version_minor}.${${_component}_version_micro}" + CACHE STRING "The ${_component} version number." + ) + else() + set(${_component}_VERSION ${PC_${_component}_VERSION} CACHE STRING "The ${_component} version number.") + endif() + + set_component_found(${_component}) + + mark_as_advanced(${_component}_INCLUDE_DIRS ${_component}_LIBRARIES ${_component}_DEFINITIONS ${_component}_VERSION) +endmacro() + +# Check for cached results. If there are skip the costly part. +if(NOT FFMPEG_LIBRARIES) + # Check for all possible component. + find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h) + find_component(AVFORMAT libavformat avformat libavformat/avformat.h) + find_component(AVFILTER libavfilter avfilter libavfilter/avfilter.h) + find_component(AVDEVICE libavdevice avdevice libavdevice/avdevice.h) + find_component(AVUTIL libavutil avutil libavutil/avutil.h) + find_component(SWSCALE libswscale swscale libswscale/swscale.h) + find_component(SWRESAMPLE libswresample swresample libswresample/swresample.h) + find_component(POSTPROCESS libpostproc postproc libpostproc/postprocess.h) + + # Check if the required components were found and add their stuff to the FFMPEG_* vars. + foreach(_component ${_FFmpeg_ALL_COMPONENTS}) + if(${_component}_FOUND) + set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${_component}_LIBRARIES}) + set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${_component}_DEFINITIONS}) + list(APPEND FFMPEG_INCLUDE_DIRS ${${_component}_INCLUDE_DIRS}) + endif() + endforeach() + + # Build the include path with duplicates removed. + if(FFMPEG_INCLUDE_DIRS) + list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS) + endif() + + # cache the vars. + set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "The FFmpeg include directories." FORCE) + set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "The FFmpeg libraries." FORCE) + set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} CACHE STRING "The FFmpeg cflags." FORCE) + + mark_as_advanced(FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES FFMPEG_DEFINITIONS) + +else() + # Set the noncached _FOUND vars for the components. + foreach(_component ${_FFmpeg_ALL_COMPONENTS}) + set_component_found(${_component}) + endforeach() +endif() + +# Compile the list of required vars +unset(_FFmpeg_REQUIRED_VARS) +set(_FFmpeg_FOUND_LIBRARIES "") + +foreach(_component ${FFmpeg_FIND_COMPONENTS}) + if(${_component}_FOUND) + if(${_component}_VERSION VERSION_LESS _FFmpeg_REQUIRED_VERSION) + message(STATUS "${_component}: ${${_component}_VERSION} < ${_FFmpeg_REQUIRED_VERSION}") + unset(${_component}_FOUND) + endif() + + list(APPEND _FFmpeg_FOUND_LIBRARIES ${${_component}_LIBRARIES}) + endif() + + list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS ${_component}_FOUND) +endforeach() + +list(INSERT _FFmpeg_REQUIRED_VARS 0 _FFmpeg_FOUND_LIBRARIES) + +# Give a nice error message if some of the required vars are missing. +find_package_handle_standard_args(FFmpeg REQUIRED_VARS ${_FFmpeg_REQUIRED_VARS} HANDLE_COMPONENTS) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindFeature.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindFeature.cmake new file mode 100644 index 0000000000000000000000000000000000000000..11bd9f1b1f4210670902d46c2dc772b45fba8d39 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindFeature.cmake @@ -0,0 +1,64 @@ +include(FeatureSummary) + +# types: DISABLED < RUNTIME < OPTIONAL < RECOMMENDED < REQUIRED + +macro(find_feature _feature _type _purpose _description) + + string(TOUPPER ${_feature} _feature_upper) + string(TOLOWER ${_type} _type_lower) + + if(${_type} STREQUAL "DISABLED") + set(_feature_default "OFF") + message(STATUS "Skipping ${_type_lower} feature ${_feature} for ${_purpose} (${_description})") + else() + if(${_type} STREQUAL "REQUIRED") + set(_feature_default "ON") + message(STATUS "Finding ${_type_lower} feature ${_feature} for ${_purpose} (${_description})") + find_package(${_feature} REQUIRED) + elseif(${_type} STREQUAL "RECOMMENDED") + if(NOT ${WITH_${_feature_upper}}) + set(_feature_default "OFF") + message(STATUS "Skipping ${_type_lower} feature ${_feature} for ${_purpose} (${_description})") + else() + set(_feature_default "ON") + message(STATUS "Finding ${_type_lower} feature ${_feature} for ${_purpose} (${_description})") + message(STATUS " Disable feature ${_feature} using \"-DWITH_${_feature_upper}=OFF\"") + find_package(${_feature}) + if(NOT ${_feature}_FOUND) + set(_feature_default "OFF") + message( + STATUS "Not detected ${_type_lower} feature ${_feature} for ${_purpose} (${_description}), feature disabled" + ) + endif() + endif() + elseif(${_type} STREQUAL "OPTIONAL") + if(${WITH_${_feature_upper}}) + set(_feature_default "ON") + message(STATUS "Finding ${_type_lower} feature ${_feature} for ${_purpose} (${_description})") + find_package(${_feature} REQUIRED) + else() + set(_feature_default "OFF") + message(STATUS "Skipping ${_type_lower} feature ${_feature} for ${_purpose} (${_description})") + message(STATUS " Enable feature ${_feature} using \"-DWITH_${_feature_upper}=ON\"") + endif() + else() + set(_feature_default "ON") + message(STATUS "Finding ${_type_lower} feature ${_feature} for ${_purpose} (${_description})") + find_package(${_feature}) + endif() + + if(NOT ${${_feature}_FOUND}) + if(${_feature_default}) + message( + WARNING + " feature ${_feature} was requested but could not be found! ${_feature_default} / ${${_feature}_FOUND}" + ) + endif() + set(_feature_default "OFF") + endif() + + option(WITH_${_feature_upper} "Enable feature ${_feature} for ${_purpose}" ${_feature_default}) + + set_package_properties(${_feature} PROPERTIES TYPE ${_type} PURPOSE "${_purpose}" DESCRIPTION "${_description}") + endif() +endmacro(find_feature) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindGSM.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindGSM.cmake new file mode 100644 index 0000000000000000000000000000000000000000..c2078fd44e066c8c9d07bd0f1fb29aa871cf2c1f --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindGSM.cmake @@ -0,0 +1,12 @@ +find_path(GSM_INCLUDE_DIR gsm/gsm.h) + +find_library(GSM_LIBRARY gsm) + +find_package_handle_standard_args(GSM DEFAULT_MSG GSM_INCLUDE_DIR GSM_LIBRARY) + +if(GSM_FOUND) + set(GSM_LIBRARIES ${GSM_LIBRARY}) + set(GSM_INCLUDE_DIRS ${GSM_INCLUDE_DIR}) +endif() + +mark_as_advanced(GSM_INCLUDE_DIR GSM_LIBRARY) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindJSONC.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindJSONC.cmake new file mode 100644 index 0000000000000000000000000000000000000000..68ccc7359dfbab682e8cb00ad9799a6298bf125a --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindJSONC.cmake @@ -0,0 +1,24 @@ +# - Try to find JSON-C +# Once done this will define +# +# JSONC_FOUND - JSON-C was found +# JSONC_INCLUDE_DIRS - JSON-C include directories +# JSONC_LIBRARIES - libraries needed for linking + +find_package(PkgConfig) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_JSONC json-c) +endif() + +find_path(JSONC_INCLUDE_DIR NAMES json.h HINTS ${PC_JSONC_INCLUDE_DIRS} PATH_SUFFIXES json-c) +find_library(JSONC_LIBRARY NAMES json-c HINTS ${PC_JSONC_LIBRARY_DIRS}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(JSONC DEFAULT_MSG JSONC_LIBRARY JSONC_INCLUDE_DIR) + +if(JSONC_FOUND) + set(JSONC_LIBRARIES ${JSONC_LIBRARY}) + set(JSONC_INCLUDE_DIRS ${JSONC_INCLUDE_DIR}) +endif() + +mark_as_advanced(JSONC_LIBRARY JSONC_INCLUDE_DIR) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindLAME.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindLAME.cmake new file mode 100644 index 0000000000000000000000000000000000000000..9ba4225a006b8af9ed28a4300550c9b98816231a --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindLAME.cmake @@ -0,0 +1,12 @@ +find_path(LAME_INCLUDE_DIR lame/lame.h) + +find_library(LAME_LIBRARY NAMES lame mp3lame) + +find_package_handle_standard_args(LAME DEFAULT_MSG LAME_INCLUDE_DIR LAME_LIBRARY) + +if(LAME_FOUND) + set(LAME_LIBRARIES ${LAME_LIBRARY}) + set(LAME_INCLUDE_DIRS ${LAME_INCLUDE_DIR}) +endif() + +mark_as_advanced(LAME_INCLUDE_DIR LAME_LIBRARY) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindMbedTLS.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindMbedTLS.cmake new file mode 100644 index 0000000000000000000000000000000000000000..8d57768de5e65f2db0015fb136c4bbe39371b461 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindMbedTLS.cmake @@ -0,0 +1,24 @@ +find_path(MBEDTLS_INCLUDE_DIR NAMES mbedtls/ssl.h PATH_SUFFIXES include HINTS ${MBEDTLS_ROOT}) + +find_library(MBEDTLS_LIBRARY NAMES mbedtls PATH_SUFFIXES lib HINTS ${MBEDTLS_ROOT}) + +find_library(MBEDCRYPTO_LIBRARY NAMES mbedcrypto PATH_SUFFIXES lib HINTS ${MBEDTLS_ROOT}) + +find_library(MBEDX509_LIBRARY NAMES mbedx509 PATH_SUFFIXES lib HINTS ${MBEDTLS_ROOT}) + +if(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARY) + set(MBEDTLS_FOUND TRUE) + set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDCRYPTO_LIBRARY} ${MBEDX509_LIBRARY}) +endif() + +if(MBEDTLS_FOUND) + if(NOT MBEDTLS_FIND_QUIETLY) + message(STATUS "Found mbed TLS: ${MBEDTLS_LIBRARIES}") + endif() +else() + if(MBEDTLS_FIND_REQUIRED) + message(FATAL_ERROR "mbed TLS was not found") + endif() +endif() + +mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindOSS.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindOSS.cmake new file mode 100644 index 0000000000000000000000000000000000000000..e582540488a6e461ace23688fe120ea2cd5e88b9 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindOSS.cmake @@ -0,0 +1,34 @@ +# +# Find OSS include header for Unix platforms. +# used by FQTerm to detect the availability of OSS. + +if(UNIX) + if(CMAKE_SYSTEM_NAME MATCHES "Linux") + set(PLATFORM_PREFIX "linux/") + elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + set(PLATFORM_PREFIX "sys/") + elseif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") + set(PLATFORM_PREFIX "machine/") + endif() +endif(UNIX) + +set(OSS_HDR_NAME "${PLATFORM_PREFIX}soundcard.h" CACHE STRING "oss header include file name") +find_path(OSS_INCLUDE_DIRS ${OSS_HDR_NAME} PATHS "/usr/local/include" PATH_SUFFIXES ${PLATFORM_SUFFIX}) + +if(OSS_INCLUDE_DIRS) + set(OSS_FOUND ON CACHE BOOL "oss detection status") +else(OSS_INCLUDE_DIRS) + set(OSS_FOUND OFF CACHE BOOL "oss detection status") +endif(OSS_INCLUDE_DIRS) + +if(OSS_FOUND) + message(STATUS "Found OSS Audio") +else(OSS_FOUND) + if(OSS_FIND_REQUIRED) + message(FATAL_ERROR "FAILED to found Audio - REQUIRED") + else(OSS_FIND_REQUIRED) + message(STATUS "Audio Disabled") + endif(OSS_FIND_REQUIRED) +endif(OSS_FOUND) + +mark_as_advanced(OSS_FOUND OSS_HDR_NAME OSS_INCLUDE_DIRS) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindOpenH264.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindOpenH264.cmake new file mode 100644 index 0000000000000000000000000000000000000000..51b5a63329b2029ab878a55f66ba87cc991574c7 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindOpenH264.cmake @@ -0,0 +1,45 @@ +# - Try to find the OpenH264 library +# Once done this will define +# +# OPENH264_ROOT - A list of search hints +# +# OPENH264_FOUND - system has OpenH264 +# OPENH264_INCLUDE_DIR - the OpenH264 include directory +# OPENH264_LIBRARIES - libopenh264 library + +if(UNIX AND NOT ANDROID) + find_package(PkgConfig QUIET) + pkg_check_modules(PC_OPENH264 QUIET openh264) +endif(UNIX AND NOT ANDROID) + +if(OPENH264_INCLUDE_DIR AND OPENH264_LIBRARY) + set(OPENH264_FIND_QUIETLY TRUE) +endif(OPENH264_INCLUDE_DIR AND OPENH264_LIBRARY) + +find_path(OPENH264_INCLUDE_DIR NAMES wels/codec_api.h wels/codec_app_def.h wels/codec_def.h PATH_SUFFIXES include + HINTS ${OPENH264_ROOT} ${PC_OPENH264_INCLUDE_DIRS} +) +find_library( + OPENH264_LIBRARY NAMES openh264_dll openh264 welsdec PATH_SUFFIXES lib HINTS ${OPENH264_ROOT} + ${PC_OPENH264_LIBRARY_DIRS} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OpenH264 DEFAULT_MSG OPENH264_LIBRARY OPENH264_INCLUDE_DIR) + +if(OPENH264_INCLUDE_DIR AND OPENH264_LIBRARY) + set(OPENH264_FOUND TRUE) + set(OPENH264_LIBRARIES ${OPENH264_LIBRARY}) +endif(OPENH264_INCLUDE_DIR AND OPENH264_LIBRARY) + +if(OPENH264_FOUND) + if(NOT OPENH264_FIND_QUIETLY) + message(STATUS "Found OpenH264: ${OPENH264_LIBRARIES}") + endif(NOT OPENH264_FIND_QUIETLY) +else(OPENH264_FOUND) + if(OPENH264_FIND_REQUIRED) + message(FATAL_ERROR "OpenH264 was not found") + endif(OPENH264_FIND_REQUIRED) +endif(OPENH264_FOUND) + +mark_as_advanced(OPENH264_INCLUDE_DIR OPENH264_LIBRARY) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindOpenSLES.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindOpenSLES.cmake new file mode 100644 index 0000000000000000000000000000000000000000..466dcbbe9e92a0b0b1e0961061597080e8724369 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindOpenSLES.cmake @@ -0,0 +1,29 @@ +# - Find OpenSLES +# Find the OpenSLES includes and libraries +# +# OpenSLES_INCLUDE_DIR - where to find dsound.h +# OpenSLES_LIBRARIES - List of libraries when using dsound. +# OpenSLES_FOUND - True if dsound found. + +get_property(_FIND_LIBRARY_USE_LIB64_PATHS GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) +set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS 1) + +find_path(OpenSLES_INCLUDE_DIR SLES/OpenSLES.h) + +find_library(OpenSLES_LIBRARY NAMES OpenSLES) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OpenSLES DEFAULT_MSG OpenSLES_INCLUDE_DIR OpenSLES_LIBRARY) + +if(OpenSLES_FOUND) + set(OpenSLES_INCLUDE_DIRS ${OpenSLES_INCLUDE_DIR}) + set(OpenSLES_LIBRARIES ${OpenSLES_LIBRARY}) +else(OpenSLES_FOUND) + if(OpenSLES_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find OpenSLES") + endif() +endif(OpenSLES_FOUND) + +mark_as_advanced(OpenSLES_INCLUDE_DIR OpenSLES_LIBRARY) + +set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ${_FIND_LIBRARY_USE_LIB64_PATHS}) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindPAM.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindPAM.cmake new file mode 100644 index 0000000000000000000000000000000000000000..5ce7b23b1d90b9e80b59fe2e02d0ba2eb44d906d --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindPAM.cmake @@ -0,0 +1,39 @@ +# - Try to find the PAM libraries +# Once done this will define +# +# PAM_FOUND - system has pam +# PAM_INCLUDE_DIR - the pam include directory +# PAM_LIBRARIES - libpam library + +if(PAM_INCLUDE_DIR AND PAM_LIBRARY) + set(PAM_FIND_QUIETLY TRUE) +endif(PAM_INCLUDE_DIR AND PAM_LIBRARY) + +find_path(PAM_INCLUDE_DIR NAMES security/pam_appl.h pam/pam_appl.h) +find_library(PAM_LIBRARY pam) +find_library(DL_LIBRARY dl) + +if(PAM_INCLUDE_DIR AND PAM_LIBRARY) + set(PAM_FOUND TRUE) + if(DL_LIBRARY) + set(PAM_LIBRARIES ${PAM_LIBRARY} ${DL_LIBRARY}) + else(DL_LIBRARY) + set(PAM_LIBRARIES ${PAM_LIBRARY}) + endif(DL_LIBRARY) + + if(EXISTS ${PAM_INCLUDE_DIR}/pam/pam_appl.h) + set(HAVE_PAM_PAM_APPL_H 1) + endif(EXISTS ${PAM_INCLUDE_DIR}/pam/pam_appl.h) +endif(PAM_INCLUDE_DIR AND PAM_LIBRARY) + +if(PAM_FOUND) + if(NOT PAM_FIND_QUIETLY) + message(STATUS "Found PAM: ${PAM_LIBRARIES}") + endif(NOT PAM_FIND_QUIETLY) +else(PAM_FOUND) + if(PAM_FIND_REQUIRED) + message(FATAL_ERROR "PAM was not found") + endif(PAM_FIND_REQUIRED) +endif(PAM_FOUND) + +mark_as_advanced(PAM_INCLUDE_DIR PAM_LIBRARY DL_LIBRARY) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindPCSC.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindPCSC.cmake new file mode 100644 index 0000000000000000000000000000000000000000..5309581f29e4a07b02e43b516815c00ae3287b52 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindPCSC.cmake @@ -0,0 +1,23 @@ +# - Try to find PCSC +# Once done this will define +# PCSC_FOUND - pcsc was found +# PCSC_INCLUDE_DIRS - pcsc include directories +# PCSC_LIBRARIES - libraries needed for linking + +find_package(PkgConfig) + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_PCSC QUIET libpcsclite) +endif() + +find_path(PCSC_INCLUDE_DIR pcsclite.h WinSCard.h HINTS ${PC_PCSC_INCLUDEDIR} ${PC_PCSC_INCLUDE_DIRS} PATH_SUFFIXES PCSC) + +find_library(PCSC_LIBRARY NAMES PCSC WinSCard pcsclite HINTS ${PC_PCSC_LIBDIR} ${PC_PCSC_LIBRARY_DIRS}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PCSC DEFAULT_MSG PCSC_LIBRARY PCSC_INCLUDE_DIR) + +set(PCSC_LIBRARIES ${PCSC_LIBRARY}) +set(PCSC_INCLUDE_DIRS ${PCSC_INCLUDE_DIR}) + +mark_as_advanced(PCSC_INCLUDE_DIR PCSC_LIBRARY) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindPCSCWinPR.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindPCSCWinPR.cmake new file mode 100644 index 0000000000000000000000000000000000000000..acc6e60092e308d9ade543acd3627852dc48b902 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindPCSCWinPR.cmake @@ -0,0 +1,8 @@ +find_library(PCSC_WINPR_LIBRARY NAMES libpcsc-winpr.a PATHS /opt/lib /usr/lib /usr/local/lib) + +if(NOT ${PCSC_WINPR_LIBRARY} MATCHES ".*-NOTFOUND") + set(PCSC_WINPR_FOUND 1) + message(STATUS "Found PCSC-WinPR: ${PCSC_WINPR_LIBRARY}") +endif() + +mark_as_advanced(PCSC_WINPR_LIBRARY) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindPixman.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindPixman.cmake new file mode 100644 index 0000000000000000000000000000000000000000..372c5018dfa013358c0d420707af91e93593777e --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindPixman.cmake @@ -0,0 +1,41 @@ +# - Find Pixman +# Find the Pixman libraries +# +# This module defines the following variables: +# PIXMAN_FOUND - true if PIXMAN_INCLUDE_DIR & PIXMAN_LIBRARY are found +# PIXMAN_LIBRARIES - Set when PIXMAN_LIBRARY is found +# PIXMAN_INCLUDE_DIRS - Set when PIXMAN_INCLUDE_DIR is found +# +# PIXMAN_INCLUDE_DIR - where to find pixman.h, etc. +# PIXMAN_LIBRARY - the Pixman library +# + +#============================================================================= +# Copyright 2013 Marc-Andre Moreau +# +# 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. +#============================================================================= + +find_path(PIXMAN_INCLUDE_DIR NAMES pixman.h PATH_SUFFIXES pixman-1) + +find_library(PIXMAN_LIBRARY NAMES pixman-1) + +find_package_handle_standard_args(Pixman DEFAULT_MSG PIXMAN_LIBRARY PIXMAN_INCLUDE_DIR) + +if(Pixman_FOUND) + set(PIXMAN_FOUND ON) + set(PIXMAN_LIBRARIES ${PIXMAN_LIBRARY}) + set(PIXMAN_INCLUDE_DIRS ${PIXMAN_INCLUDE_DIR}) +endif() + +mark_as_advanced(PIXMAN_INCLUDE_DIR PIXMAN_LIBRARY) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindV4L.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindV4L.cmake new file mode 100644 index 0000000000000000000000000000000000000000..0003fe84fdaad3d68fe51c51ca8e6e764eafd2e2 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindV4L.cmake @@ -0,0 +1,99 @@ +############################################################################ +# FindV4L.cmake +# Copyright (C) 2014-2023 Belledonne Communications, Grenoble France +# +############################################################################ +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +############################################################################ +# +# Find the v4l library. +# +# Targets +# ^^^^^^^ +# +# The following targets may be defined: +# +# v4l1 - If the v4l1 library has been found +# v4l2 - If the v4l2 library has been found +# v4lconvert - If the v4lconvert library has been found +# +# +# Result variables +# ^^^^^^^^^^^^^^^^ +# +# This module will set the following variables in your project: +# +# V4L_FOUND - The v4l library has been found +# V4L_TARGETS - The list of the names of the CMake targets for the v4l libraries +# V4L_TARGET - The name of the CMake target for the v4l library +# V4L_convert_TARGET - The name of the CMake target for the v4lconvert library +# HAVE_LINUX_VIDEODEV_H - If the v4l library provides the linux/videodev.h header file +# HAVE_LINUX_VIDEODEV2_H - If the v4l library provides the linux/videodev2.h header file + +set(_V4L_REQUIRED_VARS V4L_TARGETS V4L_TARGET V4L_convert_TARGET) +set(_V4L_CACHE_VARS ${_V4L_REQUIRED_VARS} HAVE_LINUX_VIDEODEV_H HAVE_LINUX_VIDEODEV2_H) + +set(_V4L_ROOT_PATHS ${CMAKE_INSTALL_PREFIX}) + +find_path(_V4L1_INCLUDE_DIRS NAMES linux/videodev.h HINTS _V4L_ROOT_PATHS PATH_SUFFIXES include) +if(_V4L1_INCLUDE_DIRS) + set(HAVE_LINUX_VIDEODEV_H 1) +endif() +find_path(_V4L2_INCLUDE_DIRS NAMES linux/videodev2.h HINTS _V4L_ROOT_PATHS PATH_SUFFIXES include) +if(_V4L2_INCLUDE_DIRS) + set(HAVE_LINUX_VIDEODEV2_H 1) +endif() + +if(_V4L1_INCLUDE_DIRS OR _V4L2_INCLUDE_DIRS) + find_library(_V4L1_LIBRARY NAMES v4l1 HINTS _V4L_ROOT_PATHS PATH_SUFFIXES bin lib) + find_library(_V4L2_LIBRARY NAMES v4l2 HINTS _V4L_ROOT_PATHS PATH_SUFFIXES bin lib) + find_library(_V4LCONVERT_LIBRARY NAMES v4lconvert HINTS _V4L_ROOT_PATHS PATH_SUFFIXES bin lib) +endif() + +if(_V4L1_LIBRARY OR _V4L2_LIBRARY OR _V4LCONVERT_LIBRARY) + set(V4L_TARGETS) + if(_V4L2_LIBRARY) + add_library(v4l2 UNKNOWN IMPORTED) + set_target_properties( + v4l2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_V4L2_INCLUDE_DIRS}" IMPORTED_LOCATION "${_V4L2_LIBRARY}" + ) + set(V4L_TARGET v4l2) + list(APPEND V4L_TARGETS v4l2) + set(_V4L_INCLUDE_DIRS "${_V4L2_INCLUDE_DIRS}") + elseif(_V4L1_LIBRARY) + add_library(v4l1 UNKNOWN IMPORTED) + set_target_properties( + v4l1 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_V4L1_INCLUDE_DIRS}" IMPORTED_LOCATION "${_V4L1_LIBRARY}" + ) + set(V4L_TARGET v4l1) + list(APPEND V4L_TARGETS v4l1) + set(_V4L_INCLUDE_DIRS "${_V4L1_INCLUDE_DIRS}") + endif() + if(_V4LCONVERT_LIBRARY) + add_library(v4lconvert UNKNOWN IMPORTED) + set_target_properties( + v4lconvert PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_V4L_INCLUDE_DIRS}" IMPORTED_LOCATION + "${_V4LCONVERT_LIBRARY}" + ) + set(V4L_convert_TARGET v4lconvert) + list(APPEND V4L_TARGETS v4lconvert) + endif() +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(V4L REQUIRED_VARS ${_V4L_REQUIRED_VARS}) +mark_as_advanced(${_V4L_CACHE_VARS}) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/FindWayland.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/FindWayland.cmake new file mode 100644 index 0000000000000000000000000000000000000000..a9eca7480640e584a65a2ac81da128a333cfef57 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/FindWayland.cmake @@ -0,0 +1,68 @@ +# - Finds Wayland +# Find the Wayland libraries that are needed for UWAC +# +# This module defines the following variables: +# WAYLAND_FOUND - true if UWAC has been found +# WAYLAND_LIBS - Set to the full path to wayland client libraries +# WAYLAND_INCLUDE_DIR - Set to the include directories for wayland +# XKBCOMMON_LIBS - Set to the full path to xkbcommon libraries +# XKBCOMMON_INCLUDE_DIR - Set to the include directories for xkbcommon +# + +#============================================================================= +# Copyright 2015 David Fort +# +# 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. +#============================================================================= + +find_package(PkgConfig) + +if(PKG_CONFIG_FOUND) + pkg_check_modules(WAYLAND_SCANNER_PC wayland-scanner) + pkg_check_modules(WAYLAND_CLIENT_PC wayland-client) + pkg_check_modules(WAYLAND_CURSOR_PC wayland-cursor) + pkg_check_modules(XKBCOMMON_PC xkbcommon) +endif() + +find_program(WAYLAND_SCANNER wayland-scanner HINTS "${WAYLAND_SCANNER_PC_PREFIX}/bin") + +find_path(WAYLAND_INCLUDE_DIR wayland-client.h HINTS ${WAYLAND_CLIENT_PC_INCLUDE_DIRS}) + +find_library(WAYLAND_CLIENT_LIB NAMES "wayland-client" HINTS "${WAYLAND_CLIENT_PC_LIBRARY_DIRS}") + +find_library(WAYLAND_CURSOR_LIB NAMES "wayland-cursor" HINTS "${WAYLAND_CURSOR_PC_LIBRARY_DIRS}") + +if(WAYLAND_CLIENT_LIB AND WAYLAND_CURSOR_LIB) + list(APPEND WAYLAND_LIBS ${WAYLAND_CLIENT_LIB} ${WAYLAND_CURSOR_LIB}) +endif(WAYLAND_CLIENT_LIB AND WAYLAND_CURSOR_LIB) + +find_path(XKBCOMMON_INCLUDE_DIR xkbcommon/xkbcommon.h HINTS ${XKBCOMMON_PC_INCLUDE_DIRS}) + +find_library(XKBCOMMON_LIBS NAMES xkbcommon HINTS "${XKBCOMMON_PC_LIBRARY_DIRS}") + +set(Wayland_SCANNER ${WAYLAND_SCANNER}) +set(Wayland_INCLUDE_DIR ${WAYLAND_INCLUDE_DIR}) +set(Wayland_LIBS ${WAYLAND_LIBS}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + Wayland + DEFAULT_MSG + Wayland_SCANNER + Wayland_INCLUDE_DIR + Wayland_LIBS + XKBCOMMON_INCLUDE_DIR + XKBCOMMON_LIBS +) + +set(WAYLAND_FOUND ${Wayland_FOUND}) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/Findlibsystemd.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/Findlibsystemd.cmake new file mode 100644 index 0000000000000000000000000000000000000000..dde8f48f59e6695581ac7442e6930877c3cdd766 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/Findlibsystemd.cmake @@ -0,0 +1,37 @@ +# Module defines +# LIBSYSTEMD_FOUND - libsystemd libraries and includes found +# LIBSYSTEMD_INCLUDE_DIRS - the libsystemd include directories +# LIBSYSTEMD_LIBRARIES - the libsystemd libraries +# +# Cache entries: +# LIBSYSTEMD_LIBRARY - detected libsystemd library +# LIBSYSTEMD_INCLUDE_DIR - detected libsystemd include dir(s) +# + +if(LIBSYSTEMD_INCLUDE_DIR AND LIBSYSTEMD_LIBRARY) + # in cache already + set(LIBSYSTEMD_FOUND TRUE) + set(LIBSYSTEMD_LIBRARIES ${LIBSYSTEMD_LIBRARY}) + set(LIBSYSTEMD_INCLUDE_DIRS ${LIBSYSTEMD_INCLUDE_DIR}) +else() + + find_package(PkgConfig) + if(PKG_CONFIG_FOUND) + pkg_check_modules(_LIBSYSTEMD_PC QUIET "libsystemd") + endif(PKG_CONFIG_FOUND) + + find_path(LIBSYSTEMD_INCLUDE_DIR systemd/sd-journal.h ${_LIBSYSTEMD_PC_INCLUDE_DIRS} /usr/include /usr/local/include) + mark_as_advanced(LIBSYSTEMD_INCLUDE_DIR) + + find_library(LIBSYSTEMD_LIBRARY NAMES systemd PATHS ${_LIBSYSTEMD_PC_LIBDIR}) + mark_as_advanced(LIBSYSTEMD_LIBRARY) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(libsystemd DEFAULT_MSG LIBSYSTEMD_LIBRARY LIBSYSTEMD_INCLUDE_DIR) + + if(libsystemd_FOUND) + set(LIBSYSTEMD_LIBRARIES ${LIBSYSTEMD_LIBRARY}) + set(LIBSYSTEMD_INCLUDE_DIRS ${LIBSYSTEMD_INCLUDE_DIR}) + endif() + +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/Findlibusb-1.0.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/Findlibusb-1.0.cmake new file mode 100644 index 0000000000000000000000000000000000000000..35b135168a6126c0efd118386adde5f0e36b9ff6 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/Findlibusb-1.0.cmake @@ -0,0 +1,77 @@ +# - Try to find libusb-1.0 +# Once done this will define +# +# LIBUSB_1_FOUND - system has libusb +# LIBUSB_1_INCLUDE_DIRS - the libusb include directory +# LIBUSB_1_LIBRARIES - Link these to use libusb +# LIBUSB_1_DEFINITIONS - Compiler switches required for using libusb +# +# Adapted from cmake-modules Google Code project +# +# Copyright (c) 2006 Andreas Schneider +# +# (Changes for libusb) Copyright (c) 2008 Kyle Machulis +# +# Redistribution and use is allowed according to the terms of the New BSD license. +# +# CMake-Modules Project New BSD License +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the name of the CMake-Modules Project 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. +# + +if(LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS) + # in cache already + set(LIBUSB_FOUND TRUE) +else(LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS) + find_path(LIBUSB_1_INCLUDE_DIR NAMES libusb.h PATHS /usr/include /usr/local/include /sw/include + PATH_SUFFIXES libusb-1.0 + ) + + find_library(LIBUSB_1_LIBRARY NAMES libusb-1.0 usb-1.0 usb PATHS /usr/lib /usr/local/lib /sw/lib) + + set(LIBUSB_1_INCLUDE_DIRS ${LIBUSB_1_INCLUDE_DIR}) + set(LIBUSB_1_LIBRARIES ${LIBUSB_1_LIBRARY}) + + if(LIBUSB_1_INCLUDE_DIRS AND LIBUSB_1_LIBRARIES) + set(LIBUSB_1_FOUND TRUE) + endif(LIBUSB_1_INCLUDE_DIRS AND LIBUSB_1_LIBRARIES) + + if(LIBUSB_1_FOUND) + if(NOT libusb_1_FIND_QUIETLY) + message(STATUS "Found libusb-1.0:") + message(STATUS " - Includes: ${LIBUSB_1_INCLUDE_DIRS}") + message(STATUS " - Libraries: ${LIBUSB_1_LIBRARIES}") + endif(NOT libusb_1_FIND_QUIETLY) + else(LIBUSB_1_FOUND) + if(libusb_1_FIND_REQUIRED) + message(FATAL_ERROR "Could not find libusb") + endif(libusb_1_FIND_REQUIRED) + endif(LIBUSB_1_FOUND) + + # show the LIBUSB_1_INCLUDE_DIRS and LIBUSB_1_LIBRARIES variables only in the advanced view + mark_as_advanced(LIBUSB_1_INCLUDE_DIRS LIBUSB_1_LIBRARIES) + +endif(LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/Findlodepng.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/Findlodepng.cmake new file mode 100644 index 0000000000000000000000000000000000000000..2c3e147910285727c1e0fabe5ae9b9ef20c1d8a3 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/Findlodepng.cmake @@ -0,0 +1,17 @@ +# - Try to find lodepng +# Once done this will define +# lodepng_FOUND - lodepng was found +# lodepng_INCLUDE_DIRS - lodepng include directories +# lodepng_LIBRARIES - lodepng libraries for linking + +find_path(lodepng_INCLUDE_DIR NAMES lodepng.h) + +find_library(lodepng_LIBRARY NAMES lodepng) + +if(lodepng_INCLUDE_DIR AND lodepng_LIBRARY) + set(lodepng_FOUND ON) + set(lodepng_INCLUDE_DIRS ${lodepng_INCLUDE_DIR}) + set(lodepng_LIBRARIES ${lodepng_LIBRARY}) +endif() + +mark_as_advanced(lodepng_INCLUDE_DIRS lodepng_LIBRARIES) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/Findsoxr.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/Findsoxr.cmake new file mode 100644 index 0000000000000000000000000000000000000000..f8953057e523b8e5f952268268f2072cdc0a943f --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/Findsoxr.cmake @@ -0,0 +1,56 @@ +# Try to find the soxr library +# +# Copyright 2018 Thincast Technologies GmbH +# Copyright 2018 Armin Novak +# +# 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 +# +# Once done this will define +# +# SOXR_ROOT - A list of search hints +# +# SOXR_FOUND - system has soxr +# SOXR_INCLUDE_DIR - the soxr include directory +# SOXR_LIBRARIES - libsoxr library + +if(UNIX AND NOT ANDROID) + find_package(PkgConfig QUIET) + pkg_check_modules(PC_SOXR QUIET soxr) +endif(UNIX AND NOT ANDROID) + +if(SOXR_INCLUDE_DIR AND SOXR_LIBRARY) + set(SOXR_FIND_QUIETLY TRUE) +endif(SOXR_INCLUDE_DIR AND SOXR_LIBRARY) + +find_path(SOXR_INCLUDE_DIR NAMES soxr.h PATH_SUFFIXES include HINTS ${SOXR_ROOT} ${PC_SOXR_INCLUDE_DIRS}) +find_library(SOXR_LIBRARY NAMES soxr PATH_SUFFIXES lib HINTS ${SOXR_ROOT} ${PC_SOXR_LIBRARY_DIRS}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(soxr DEFAULT_MSG SOXR_LIBRARY SOXR_INCLUDE_DIR) + +if(SOXR_INCLUDE_DIR AND SOXR_LIBRARY) + set(SOXR_FOUND TRUE) + set(SOXR_INCLUDE_DIRS ${SOXR_INCLUDE_DIR}) + set(SOXR_LIBRARIES ${SOXR_LIBRARY}) +endif(SOXR_INCLUDE_DIR AND SOXR_LIBRARY) + +if(SOXR_FOUND) + if(NOT SOXR_FIND_QUIETLY) + message(STATUS "Found soxr: ${SOXR_LIBRARIES}") + endif(NOT SOXR_FIND_QUIETLY) +else(SOXR_FOUND) + if(SOXR_FIND_REQUIRED) + message(FATAL_ERROR "soxr was not found") + endif(SOXR_FIND_REQUIRED) +endif(SOXR_FOUND) + +mark_as_advanced(SOXR_INCLUDE_DIR SOXR_LIBRARY) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/GNUInstallDirsWrapper.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/GNUInstallDirsWrapper.cmake new file mode 100644 index 0000000000000000000000000000000000000000..a79484b6a853db51b2388b7c77a4988ae78288ca --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/GNUInstallDirsWrapper.cmake @@ -0,0 +1,21 @@ +# GNUInstallDirs is a relatively new cmake module, so wrap it to avoid errors +include(GNUInstallDirs OPTIONAL RESULT_VARIABLE GID_PATH) +if(GID_PATH STREQUAL "NOTFOUND") + if(NOT DEFINED CMAKE_INSTALL_BINDIR) + set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)") + endif() + + if(NOT DEFINED CMAKE_INSTALL_LIBDIR) + set(CMAKE_INSTALL_LIBDIR "lib${LIB_SUFFIX}" CACHE PATH "object code libraries (lib)") + endif() + + foreach(dir BINDIR LIBDIR) + if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}}) + set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}") + else() + set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}") + endif() + endforeach() + + mark_as_advanced(CMAKE_INSTALL_BINDIR CMAKE_INSTALL_LIBDIR) +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/GenerateManpages.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/GenerateManpages.cmake new file mode 100644 index 0000000000000000000000000000000000000000..c41634a2c18b58ea1aecf8bd48a003f51cd8cef8 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/GenerateManpages.cmake @@ -0,0 +1,46 @@ +get_filename_component(GENERATE_MANPAGES_SCRIPT_DIR "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE) +list(APPEND CMAKE_MODULE_PATH ${GENERATE_MANPAGES_SCRIPT_DIR}) + +set(SRC "${CURRENT_SOURCE_DIR}/${target}.${section}.in") +configure_file(${SRC} ${manpage}.tmp @ONLY IMMEDIATE) + +# write header (aka name of the manpage), truncate existing +file(READ ${CURRENT_BINARY_DIR}/${manpage}.tmp CONTENTS) +file(WRITE ${CURRENT_BINARY_DIR}/${manpage} "${CONTENTS}") + +string(REPLACE " " ";" DEPS ${dependencies}) +foreach(DEP IN LISTS DEPS) + get_filename_component(DNAME "${DEP}" NAME) + set(SRC_IN ${CURRENT_SOURCE_DIR}/${DEP}.in) + set(DST_IN ${CURRENT_BINARY_DIR}/${DEP}.in) + set(SRC ${CURRENT_SOURCE_DIR}/${DEP}) + set(BIN ${CURRENT_BINARY_DIR}/${DEP}) + set(DST ${CURRENT_BINARY_DIR}/${DNAME}) + + if(EXISTS ${SRC_IN}) + message("using generated ${DST} from ${SRC_IN}") + configure_file(${SRC_IN} ${DST} @ONLY IMMEDIATE) + elseif(EXISTS ${DST_IN}) + message("using generated ${DST} from ${DST_IN}") + configure_file(${DST_IN} ${DST} @ONLY IMMEDIATE) + elseif(EXISTS ${SRC}) + set(DST ${SRC}) + message("using ${DST}") + elseif(EXISTS ${BIN}) + set(DST ${BIN}) + message("using ${DST}") + elseif(EXISTS ${DST}) + message("using ${DST}") + else() + message(WARNING "Missing manpage section, considered:") + message(WARNING " ${SRC_IN}") + message(WARNING " ${DST_IN}") + message(WARNING " ${SRC}") + message(WARNING " ${BIN}") + message(WARNING " ${DST}") + message(FATAL_ERROR "Can not continue, terminating") + endif() + + file(READ ${DST} CONTENTS) + file(APPEND ${CURRENT_BINARY_DIR}/${manpage} "${CONTENTS}") +endforeach() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/GetGitRevisionDescription.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/GetGitRevisionDescription.cmake new file mode 100644 index 0000000000000000000000000000000000000000..9d0a052f9c9f173c16db305978715c0512b5e289 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/GetGitRevisionDescription.cmake @@ -0,0 +1,128 @@ +# - Returns a version string from Git +# +# These functions force a re-configure on each git commit so that you can +# trust the values of the variables in your build system. +# +# get_git_head_revision( [ ...]) +# +# Returns the refspec and sha hash of the current head revision +# +# git_describe( [ ...]) +# +# Returns the results of git describe on the source tree, and adjusting +# the output so that it tests false if an error occurs. +# +# git_get_exact_tag( [ ...]) +# +# Returns the results of git describe --exact-match on the source tree, +# and adjusting the output so that it tests false if there was no exact +# matching tag. +# +# Requires CMake 2.6 or newer (uses the 'function' command) +# +# Original Author: +# 2009-2010 Ryan Pavlik +# http://academic.cleardefinition.com +# Iowa State University HCI Graduate Program/VRAC +# +# Copyright Iowa State University 2009-2010. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +if(__get_git_revision_description) + return() +endif() +set(__get_git_revision_description YES) + +# We must run the following at "include" time, not at function call time, +# to find the path to this module rather than the path to a calling list file +get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) + +function(get_git_head_revision _refspecvar _hashvar) + + set(GIT_PARENT_DIR "${PROJECT_SOURCE_DIR}") + set(GIT_DIR "${GIT_PARENT_DIR}/.git") + while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories + set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}") + get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH) + if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT) + # We have reached the root directory, we are not in git + set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE) + set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE) + return() + endif() + set(GIT_DIR "${GIT_PARENT_DIR}/.git") + endwhile() + set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data") + if(NOT EXISTS "${GIT_DATA}") + file(MAKE_DIRECTORY "${GIT_DATA}") + endif() + + if(NOT EXISTS "${GIT_DIR}/HEAD") + return() + endif() + set(HEAD_FILE "${GIT_DATA}/HEAD") + configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY) + + configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in" "${GIT_DATA}/grabRef.cmake" @ONLY) + include("${GIT_DATA}/grabRef.cmake") + + set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE) + set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE) +endfunction() + +function(git_rev_parse _var) + if(NOT GIT_FOUND) + find_package(Git QUIET) + endif() + if(NOT GIT_FOUND) + set(${_var} "n/a" PARENT_SCOPE) + return() + endif() + get_git_head_revision(refspec hash) + if(NOT hash) + set(${_var} "n/a" PARENT_SCOPE) + return() + endif() + + execute_process( + COMMAND "${GIT_EXECUTABLE}" rev-parse ${ARGN} ${hash} WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" RESULT_VARIABLE res + OUTPUT_VARIABLE out ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(NOT res EQUAL 0) + set(out "n/a") + endif() + + set(${_var} "${out}" PARENT_SCOPE) +endfunction() + +function(git_describe _var) + if(NOT GIT_FOUND) + find_package(Git QUIET) + endif() + if(NOT GIT_FOUND) + set(${_var} "n/a" PARENT_SCOPE) + return() + endif() + get_git_head_revision(refspec hash) + if(NOT hash) + set(${_var} "n/a" PARENT_SCOPE) + return() + endif() + + execute_process( + COMMAND "${GIT_EXECUTABLE}" describe ${hash} ${ARGN} WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" RESULT_VARIABLE res + OUTPUT_VARIABLE out ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(NOT res EQUAL 0) + set(out "n/a") + endif() + + set(${_var} "${out}" PARENT_SCOPE) +endfunction() + +function(git_get_exact_tag _var) + git_describe(out --exact-match ${ARGN}) + set(${_var} "${out}" PARENT_SCOPE) +endfunction() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/GetGitRevisionDescription.cmake.in b/local-test-freerdp-full-01/afc-freerdp/cmake/GetGitRevisionDescription.cmake.in new file mode 100644 index 0000000000000000000000000000000000000000..888ce13aaba354f5d7d7946dd661963278dc8fc2 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/GetGitRevisionDescription.cmake.in @@ -0,0 +1,38 @@ +# +# Internal file for GetGitRevisionDescription.cmake +# +# Requires CMake 2.6 or newer (uses the 'function' command) +# +# Original Author: +# 2009-2010 Ryan Pavlik +# http://academic.cleardefinition.com +# Iowa State University HCI Graduate Program/VRAC +# +# Copyright Iowa State University 2009-2010. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +set(HEAD_HASH) + +file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) + +string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) +if(HEAD_CONTENTS MATCHES "ref") + # named branch + string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") + if(EXISTS "@GIT_DIR@/${HEAD_REF}") + configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) + elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}") + configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) + set(HEAD_HASH "${HEAD_REF}") + endif() +else() + # detached HEAD + configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) +endif() + +if(NOT HEAD_HASH) + file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) + string(STRIP "${HEAD_HASH}" HEAD_HASH) +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/InstallFreeRDPDesktop.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/InstallFreeRDPDesktop.cmake new file mode 100644 index 0000000000000000000000000000000000000000..015a6b5ce273da5b1cba420239c9b36e45424942 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/InstallFreeRDPDesktop.cmake @@ -0,0 +1,22 @@ +include(GNUInstallDirs) + +option(WITH_INSTALL_CLIENT_DESKTOP_FILES "Install .desktop files for clients" OFF) + +set(DESKTOP_RESOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../resources" CACHE INTERNAL "") + +function(install_freerdp_desktop name) + if(WITH_INSTALL_CLIENT_DESKTOP_FILES) + get_target_property(FREERDP_APP_NAME ${name} OUTPUT_NAME) + set(FREERDP_BIN_NAME "${CMAKE_INSTALL_FULL_BINDIR}/${FREERDP_APP_NAME}") + set(FREERDP_DESKTOP_NAME "${CMAKE_CURRENT_BINARY_DIR}/${FREERDP_BIN_NAME}.desktop") + set(FREERDP_DESKTOP_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/${FREERDP_BIN_NAME}-file.desktop") + configure_file(${DESKTOP_RESOURCE_DIR}/freerdp.desktop.template ${FREERDP_DESKTOP_NAME} @ONLY) + configure_file(${DESKTOP_RESOURCE_DIR}/freerdp-file.desktop.template ${FREERDP_DESKTOP_FILE_NAME} @ONLY) + install(FILES ${FREERDP_DESKTOP_NAME} ${FREERDP_DESKTOP_FILE_NAME} + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications + ) + install(FILES ${DESKTOP_RESOURCE_DIR}/FreeRDP_Icon.svg + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps RENAME FreeRDP.svg + ) + endif() +endfunction() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/InstallFreeRDPMan.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/InstallFreeRDPMan.cmake new file mode 100644 index 0000000000000000000000000000000000000000..6dba37e8e69c424e21a775ff3e847cbe2612995a --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/InstallFreeRDPMan.cmake @@ -0,0 +1,71 @@ +include(today) +include(GNUInstallDirs) +include(CleaningConfigureFile) + +get_filename_component(INSTALL_FREERDP_MAN_SCRIPT_DIR "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE) + +function(install_freerdp_man manpage section) + if(WITH_MANPAGES) + install(FILES ${manpage} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${section}) + endif() +endfunction() + +function(generate_and_install_freerdp_man_from_template name_base section api) + if(WITH_MANPAGES) + if(WITH_BINARY_VERSIONING) + set(manpage "${CMAKE_CURRENT_BINARY_DIR}/${name_base}${api}.${section}") + else() + set(manpage "${CMAKE_CURRENT_BINARY_DIR}/${name_base}.${section}") + endif() + cleaning_configure_file(${name_base}.${section}.in ${manpage}) + install_freerdp_man(${manpage} ${section}) + endif() +endfunction() + +# Generate an install target for a manpage. +# +# This is not as simple as it looks like: +# +# 1. extract the raw file names (files that require configure_file end with .in, ready to use files +# with .1 or some other manpage related number) +# 2. do the same for every dependency +# 3. create a command to run during build. Add a few defined symbols by default +# 4. add variable names passed to the function to the command +# 5. run CMake -P as custom_target during build. +# * run configure_file for all .in files +# * concatenate all manpage sections to the target manpage +# 6. create the actual install target +function(generate_and_install_freerdp_man_from_xml target section dependencies variable_names) + if(WITH_MANPAGES) + get_target_property(name_base "${target}" OUTPUT_NAME) + set(template "${target}.${section}") + set(MANPAGE_NAME "${name_base}") + set(manpage "${name_base}.${section}") + + # We need the variable ${MAN_TODAY} to contain the current date in ISO + # format to replace it in the cleaning_configure_file step. + include(today) + + today(MAN_TODAY) + + set(GENERATE_COMMAND + -Dtemplate=\"${template}\" -DMANPAGE_NAME=\"${MANPAGE_NAME}\" -Dmanpage=\"${manpage}\" + -DMAN_TODAY=\"${MAN_TODAY}\" -DCURRENT_SOURCE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\" + -DCURRENT_BINARY_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" -Dtarget="${target}" -Dsection="${section}" + -Ddependencies="${dependencies}" + ) + + foreach(var IN ITEMS ${variable_names}) + list(APPEND GENERATE_COMMAND -D${var}=${${var}}) + endforeach() + + list(APPEND GENERATE_COMMAND -P \"${INSTALL_FREERDP_MAN_SCRIPT_DIR}/GenerateManpages.cmake\") + + add_custom_target( + ${manpage}.target ALL COMMAND ${CMAKE_COMMAND} ${GENERATE_COMMAND} DEPENDS generate_argument_manpage.target + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + + install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/${manpage} ${section}) + endif() +endfunction() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/JsonDetect.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/JsonDetect.cmake new file mode 100644 index 0000000000000000000000000000000000000000..af7628d039bf5d360a8bf7b1fcaf7d219af923a2 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/JsonDetect.cmake @@ -0,0 +1,49 @@ +include(CMakeDependentOption) + +option(WITH_JSON_DISABLED "Build without any JSON support" OFF) +cmake_dependent_option(WITH_CJSON_REQUIRED "Build with cJSON (fail if not found)" OFF "NOT WITH_JSON_DISABLED" OFF) +cmake_dependent_option(WITH_JSONC_REQUIRED "Build with JSON-C (fail if not found)" OFF "NOT WITH_JSON_DISABLED" OFF) +if(NOT WITH_JSON_DISABLED) + find_package(cJSON) + + # Fallback detection: + # older ubuntu releases did not ship CMake or pkg-config files + # for cJSON. Be optimistic and try pkg-config and as last resort + # try manual detection + if(NOT CJSON_FOUND) + find_package(PkgConfig) + if(PKG_CONFIG_FOUND) + pkg_check_modules(CJSON libcjson) + endif() + + if(NOT CJSON_FOUND) + find_path(CJSON_INCLUDE_DIRS NAMES cjson/cJSON.h) + find_library(CJSON_LIBRARIES NAMES cjson) + if(NOT "${CJSON_LIBRARIES}" STREQUAL "CJSON_LIBRARIES-NOTFOUND" AND NOT "${CJSON_INCLUDE_DIRS}" STREQUAL + "CJSON_INCLUDE_DIRS-NOTFOUND" + ) + set(CJSON_FOUND ON) + endif() + endif() + endif() + + if(WITH_CJSON_REQUIRED) + if(NOT CJSON_FOUND) + message(FATAL_ERROR "cJSON was requested but not found") + endif() + endif() + + if(WITH_JSONC_REQUIRED) + find_package(JSONC REQUIRED) + else() + find_package(JSONC) + endif() + + if(NOT JSONC_FOUND AND NOT CJSON_FOUND) + set(WITH_WINPR_JSON OFF CACHE INTERNAL "internal") + message("compiling without JSON support. Install cJSON or json-c to enable") + endif() +else() + set(WITH_WINPR_JSON OFF CACHE INTERNAL "internal") + message("forced compile without JSON support. Set -DWITH_JSON_DISABLED=OFF to enable compile time detection") +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/LibFindMacros.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/LibFindMacros.cmake new file mode 100644 index 0000000000000000000000000000000000000000..3350435ffb57f39668c351fdafd3fe56c6017f18 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/LibFindMacros.cmake @@ -0,0 +1,115 @@ +# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments +# used for the current package. For this to work, the first parameter must be the +# prefix of the current package, then the prefix of the new package etc, which are +# passed to find_package. +macro(libfind_package PREFIX) + set(LIBFIND_PACKAGE_ARGS $ {ARGN}) + if($ {PREFIX} _FIND_QUIETLY) + set(LIBFIND_PACKAGE_ARGS $ {LIBFIND_PACKAGE_ARGS} QUIET) + endif($ {PREFIX} _FIND_QUIETLY) + if($ {PREFIX} _FIND_REQUIRED) + set(LIBFIND_PACKAGE_ARGS $ {LIBFIND_PACKAGE_ARGS} REQUIRED) + endif($ {PREFIX} _FIND_REQUIRED) + find_package($ {LIBFIND_PACKAGE_ARGS}) +endmacro(libfind_package) + +# CMake developers made the UsePkgConfig system deprecated in the same release (2.6) +# where they added pkg_check_modules. Consequently I need to support both in my scripts +# to avoid those deprecated warnings. Here's a helper that does just that. +# Works identically to pkg_check_modules, except that no checks are needed prior to use. +macro(libfind_pkg_check_modules PREFIX PKGNAME) + if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) + include(UsePkgConfig) + pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS) + else(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) + find_package(PkgConfig) + if(PKG_CONFIG_FOUND) + pkg_check_modules(${PREFIX} ${PKGNAME}) + endif(PKG_CONFIG_FOUND) + endif(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) +endmacro(libfind_pkg_check_modules) + +# Do the final processing once the paths have been detected. +# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain +# all the variables, each of which contain one include directory. +# Ditto for ${PREFIX}_PROCESS_LIBS and library files. +# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES. +# Also handles errors in case library detection was required, etc. +macro(libfind_process PREFIX) + # Skip processing if already processed during this run + if(NOT ${PREFIX}_FOUND) + # Start with the assumption that the library was found + set(${PREFIX}_FOUND TRUE) + + # Process all includes and set _FOUND to false if any are missing + foreach(i ${${PREFIX}_PROCESS_INCLUDES}) + if(${i}) + set(${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}}) + mark_as_advanced(${i}) + else(${i}) + set(${PREFIX}_FOUND FALSE) + endif(${i}) + endforeach(i) + + # Process all libraries and set _FOUND to false if any are missing + foreach(i ${${PREFIX}_PROCESS_LIBS}) + if(${i}) + set(${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}}) + mark_as_advanced(${i}) + else(${i}) + set(${PREFIX}_FOUND FALSE) + endif(${i}) + endforeach(i) + + # Print message and/or exit on fatal error + if(${PREFIX}_FOUND) + if(NOT ${PREFIX}_FIND_QUIETLY) + message(STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}") + endif(NOT ${PREFIX}_FIND_QUIETLY) + else(${PREFIX}_FOUND) + if(${PREFIX}_FIND_REQUIRED) + foreach(i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS}) + message("${i}=${${i}}") + endforeach(i) + message( + FATAL_ERROR + "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually." + ) + endif(${PREFIX}_FIND_REQUIRED) + endif(${PREFIX}_FOUND) + endif(NOT ${PREFIX}_FOUND) +endmacro(libfind_process) + +macro(libfind_library PREFIX basename) + set(TMP "") + if(MSVC80) + set(TMP -vc80) + endif(MSVC80) + if(MSVC90) + set(TMP -vc90) + endif(MSVC90) + set(${PREFIX}_LIBNAMES ${basename}${TMP}) + if(${ARGC} GREATER 2) + set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2}) + string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES}) + set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP}) + endif(${ARGC} GREATER 2) + find_library(${PREFIX}_LIBRARY NAMES ${${PREFIX}_LIBNAMES} PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS}) +endmacro(libfind_library) + +set(THREE_PART_VERSION_REGEX "[0-9]+\\.[0-9]+\\.[0-9]+") +# Breaks up a string in the form n1.n2.n3 into three parts and stores +# them in major, minor, and patch. version should be a value, not a +# variable, while major, minor and patch should be variables. +macro(THREE_PART_VERSION_TO_VARS version major minor patch) + if(${version} MATCHES ${THREE_PART_VERSION_REGEX}) + string(REPLACE "." " " version_list ${version}) + separate_arguments(version_list) + list(GET version_list 0 ${major}) + list(GET version_list 1 ${minor}) + list(GET version_list 2 ${patch}) + else(${version} MATCHES ${THREE_PART_VERSION_REGEX}) + message("MACRO(THREE_PART_VERSION_TO_VARS ${version} ${major} ${minor} ${patch}") + message(FATAL_ERROR "Problem parsing version string, I can't parse it properly.") + endif(${version} MATCHES ${THREE_PART_VERSION_REGEX}) +endmacro(THREE_PART_VERSION_TO_VARS) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/ListTargetProperties.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/ListTargetProperties.cmake new file mode 100644 index 0000000000000000000000000000000000000000..e38bd3d32205776496fdcabaf72bcc7409b1cbfe --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/ListTargetProperties.cmake @@ -0,0 +1,35 @@ +# Get all properties that cmake supports +if(NOT CMAKE_PROPERTY_LIST) + execute_process(COMMAND cmake --help-property-list OUTPUT_VARIABLE CMAKE_PROPERTY_LIST) + + # Convert command output into a CMake list + string(REGEX REPLACE ";" "\\\\;" CMAKE_PROPERTY_LIST "${CMAKE_PROPERTY_LIST}") + string(REGEX REPLACE "\n" ";" CMAKE_PROPERTY_LIST "${CMAKE_PROPERTY_LIST}") + list(REMOVE_DUPLICATES CMAKE_PROPERTY_LIST) +endif() + +function(print_properties) + message("CMAKE_PROPERTY_LIST = ${CMAKE_PROPERTY_LIST}") +endfunction() + +function(list_target_properties target) + if(NOT TARGET ${target}) + message(STATUS "There is no target named '${target}'") + return() + endif() + + foreach(property ${CMAKE_PROPERTY_LIST}) + string(REPLACE "" "${CMAKE_BUILD_TYPE}" property ${property}) + + # Fix https://stackoverflow.com/questions/32197663/how-can-i-remove-the-the-location-property-may-not-be-read-from-target-error-i + if(property STREQUAL "LOCATION" OR property MATCHES "^LOCATION_" OR property MATCHES "_LOCATION$") + continue() + endif() + + get_property(was_set TARGET ${target} PROPERTY ${property} SET) + if(was_set) + get_target_property(value ${target} ${property}) + message("${target} ${property} = ${value}") + endif() + endforeach() +endfunction() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/MSVCRuntime.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/MSVCRuntime.cmake new file mode 100644 index 0000000000000000000000000000000000000000..2aafd7255f7eee820b63df961f8b91f5939c9ee7 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/MSVCRuntime.cmake @@ -0,0 +1,47 @@ +if(MSVC) + if(CMAKE_VERSION VERSION_LESS 3.15.0) + message(FATAL_ERROR "windows builds require CMake >= 3.15") + endif() + if(NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY) + if(MSVC_RUNTIME STREQUAL "dynamic") + set(MSVC_DEFAULT_RUNTIME "MultiThreadedDLL") + elseif(MSVC_RUNTIME STREQUAL "static") + set(MSVC_DEFAULT_RUNTIME "MultiThreaded") + else() + message(WARNING "invalid MSVC_RUNTIME (deprecated) value '${MSVC_RUNTIME}', ignoring") + endif() + + if(MSVC_DEFAULT_RUNTIME) + message( + "Using CMAKE_MSVC_RUNTIME_LIBRARY=${MSVC_DEFAULT_RUNTIME} (derived from MSVC_RUNTIME (deprecated) value '${MSVC_RUNTIME}')" + ) + else() + set(MSVC_DEFAULT_RUNTIME "MultiThreaded") + + string(APPEND MSVC_DEFAULT_RUNTIME "$<$:Debug>") + + if(BUILD_SHARED_LIBS) + string(APPEND MSVC_DEFAULT_RUNTIME "DLL") + endif() + message("Using CMAKE_MSVC_RUNTIME_LIBRARY=${MSVC_DEFAULT_RUNTIME}") + endif() + + set(CMAKE_MSVC_RUNTIME_LIBRARY ${MSVC_DEFAULT_RUNTIME} CACHE STRING "MSVC runtime") + endif() + + message("build is using MSVC runtime ${CMAKE_MSVC_RUNTIME_LIBRARY}") + + string(FIND ${CMAKE_MSVC_RUNTIME_LIBRARY} "DLL" IS_SHARED) + if(IS_SHARED STREQUAL "-1") + if(BUILD_SHARED_LIBS) + message(FATAL_ERROR "Static CRT is only supported in a fully static build") + endif() + message(STATUS "Use the MSVC static runtime option carefully!") + message(STATUS "OpenSSL uses /MD by default, and is very picky") + message(STATUS "Random freeing errors are a common sign of runtime issues") + endif() + + if(NOT DEFINED CMAKE_SUPPRESS_REGENERATION) + set(CMAKE_SUPPRESS_REGENERATION ON) + endif() +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/MergeStaticLibs.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/MergeStaticLibs.cmake new file mode 100644 index 0000000000000000000000000000000000000000..b803ba37610bbdf1b17d723eaf27c86701658b57 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/MergeStaticLibs.cmake @@ -0,0 +1,151 @@ +# Copyright (C) 2012 Modelon AB + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the BSD style license. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# FMILIB_License.txt file for more details. + +# You should have received a copy of the FMILIB_License.txt file +# along with this program. If not, contact Modelon AB . + +# Merge_static_libs(output_library lib1 lib2 ... libn) merges a number of static +# libs into a single static library +function(merge_static_libs output_library) + set(output_target "${output_library}") + string(REGEX REPLACE "-" "_" output_library ${output_library}) + set(libs ${ARGV}) + list(REMOVE_AT libs 0) + + # Create a dummy file that the target will depend on + set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/${output_library}_dummy.c) + file(WRITE ${dummyfile} "const char * dummy = \"${dummyfile}\";") + + add_library(${output_target} STATIC ${dummyfile}) + + if("${CMAKE_CFG_INTDIR}" STREQUAL ".") + set(multiconfig FALSE) + else() + set(multiconfig TRUE) + endif() + + # First get the file names of the libraries to be merged + foreach(lib ${libs}) + get_target_property(libtype ${lib} TYPE) + if(NOT libtype STREQUAL "STATIC_LIBRARY") + message(FATAL_ERROR "Merge_static_libs can only process static libraries") + endif() + if(multiconfig) + foreach(CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES}) + get_target_property("libfile_${CONFIG_TYPE}" ${lib} "LOCATION_${CONFIG_TYPE}") + list(APPEND libfiles_${CONFIG_TYPE} ${libfile_${CONFIG_TYPE}}) + endforeach() + else() + get_target_property(libfile ${lib} LOCATION) + list(APPEND libfiles "${libfile}") + endif(multiconfig) + endforeach() + + # Just to be sure: cleanup from duplicates + if(multiconfig) + foreach(CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES}) + list(REMOVE_DUPLICATES libfiles_${CONFIG_TYPE}) + set(libfiles ${libfiles} ${libfiles_${CONFIG_TYPE}}) + endforeach() + endif() + list(REMOVE_DUPLICATES libfiles) + + # Now the easy part for MSVC and for MAC + if(MSVC) + # lib.exe does the merging of libraries just need to convert the list into string + foreach(CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES}) + set(flags "") + foreach(lib ${libfiles_${CONFIG_TYPE}}) + set(flags "${flags} ${lib}") + endforeach() + string(TOUPPER "STATIC_LIBRARY_FLAGS_${CONFIG_TYPE}" PROPNAME) + set_target_properties(${output_target} PROPERTIES ${PROPNAME} "${flags}") + endforeach() + + elseif(APPLE) + # Use OSX's libtool to merge archives + if(multiconfig) + message(FATAL_ERROR "Multiple configurations are not supported") + endif() + get_target_property(outfile ${output_target} LOCATION) + add_custom_command( + TARGET ${output_target} POST_BUILD COMMAND rm ${outfile} COMMAND /usr/bin/libtool -static -o ${outfile} + ${libfiles} + ) + else() + # general UNIX - need to "ar -x" and then "ar -ru" + if(multiconfig) + message(FATAL_ERROR "Multiple configurations are not supported") + endif() + get_target_property(outfile ${output_target} LOCATION) + message(STATUS "output file location is ${outfile}") + foreach(lib ${libfiles}) + # objlistfile will contain the list of object files for the library + set(objlistfile ${lib}.objlist) + set(objdir ${lib}.objdir) + set(objlistcmake ${objlistfile}.cmake) + get_filename_component(libname ${lib} NAME_WE) + + if(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/cmake.check_cache IS_NEWER_THAN ${objlistcmake}) + + file( + WRITE ${objlistcmake} + " + # delete previous object files + message(STATUS \"Removing previous object files from ${lib}\") + EXECUTE_PROCESS(COMMAND ls . + WORKING_DIRECTORY ${objdir} + COMMAND xargs -I {} rm {} + WORKING_DIRECTORY ${objdir}) + # Extract object files from the library + message(STATUS \"Extracting object files from ${lib}\") + EXECUTE_PROCESS(COMMAND ${CMAKE_AR} -x ${lib} + WORKING_DIRECTORY ${objdir}) + # Prefixing object files to avoid conflicts + message(STATUS \"Prefixing object files to avoid conflicts\") + EXECUTE_PROCESS(COMMAND ls . + WORKING_DIRECTORY ${objdir} + COMMAND xargs -I {} mv {} ${libname}_{} + WORKING_DIRECTORY ${objdir}) + # save the list of object files + EXECUTE_PROCESS(COMMAND ls . + OUTPUT_FILE ${objlistfile} + WORKING_DIRECTORY ${objdir}) + " + ) + + file(MAKE_DIRECTORY ${objdir}) + + add_custom_command(OUTPUT ${objlistfile} COMMAND ${CMAKE_COMMAND} -P ${objlistcmake} DEPENDS ${lib}) + + endif() + + list(APPEND extrafiles "${objlistfile}") + # relative path is needed by ar under MSYS + file(RELATIVE_PATH objlistfilerpath ${objdir} ${objlistfile}) + add_custom_command( + TARGET ${output_target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo + "Running: ${CMAKE_AR} ru ${outfile} @${objlistfilerpath}" + COMMAND ${CMAKE_AR} ru "${outfile}" @"${objlistfilerpath}" + #COMMAND ld -r -static -o "${outfile}" --whole-archive @"${objlistfilerpath}" + WORKING_DIRECTORY ${objdir} + ) + endforeach() + add_custom_command( + TARGET ${output_target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo "Running: ${CMAKE_RANLIB} ${outfile}" + COMMAND ${CMAKE_RANLIB} ${outfile} + ) + endif() + file(WRITE ${dummyfile}.base "const char* ${output_library}_sublibs=\"${libs}\";") + add_custom_command( + OUTPUT ${dummyfile} COMMAND ${CMAKE_COMMAND} -E copy ${dummyfile}.base ${dummyfile} DEPENDS ${libs} ${extrafiles} + ) + +endfunction() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/PlatformDefaults.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/PlatformDefaults.cmake new file mode 100644 index 0000000000000000000000000000000000000000..b3d4356db303bfe8217d94dfa02374ae6ea0ccda --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/PlatformDefaults.cmake @@ -0,0 +1,110 @@ +# This option allows deactivating FreeRDP supplied platform defaults to replace these with +# user supplied values. +# +# Compilation will fail without a replacement defining the symbols, but that can be +# done by supplying a TOOLCHAIN_FILE defining these. +option(USE_PLATFORM_DEFAULT + "Use this configuration file for platform defaults. Supply -DCMAKE_TOOLCHAIN_FILE=." ON +) +if(USE_PLATFORM_DEFAULT) + # default defines or other required preferences per platform + if((CMAKE_SYSTEM_NAME MATCHES "WindowsStore") AND (CMAKE_SYSTEM_VERSION MATCHES "10.0")) + set(UWP 1 CACHE BOOL "platform default") + add_compile_definitions("_UWP") + set(CMAKE_WINDOWS_VERSION "WIN10" CACHE STRING "platform default") + endif() + + if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") + # Linux already does define _POSIX_C_SOURCE by default, nothing to do + add_compile_definitions("_FILE_OFFSET_BITS=64") + set(WINPR_TIMEZONE_FILE "/etc/timezone") + endif() + + if("${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD") + set(BSD TRUE CACHE INTERNAL "platform default") + set(FREEBSD TRUE CACHE INTERNAL "platform default") + # we want POSIX 2008. FreeBSD 14 does only support 2001 fully, but the subset we require from 2008 + # is implemented, so ignore _POSIX_VERSION from unistd.h + add_compile_definitions("_POSIX_C_SOURCE=200809L") + # TODO: FreeBSD allows mixing POSIX and BSD API calls if we do not set + # _POSIX_C_SOURCE but lack a macro to re-enable the BSD calls... + add_compile_definitions("__BSD_VISIBLE") + + # There are some symbols only visible for XOpen standard + add_compile_definitions("_XOPEN_SOURCE=700") + add_compile_definitions("_FILE_OFFSET_BITS=64") + set(WINPR_TIMEZONE_FILE "/var/db/zoneinfo") + endif() + + if("${CMAKE_SYSTEM_NAME}" MATCHES "SunOS") + # TODO: Does somebody still use this? please show yourself and + # tell us if this still works. + add_compile_definitions("_POSIX_PTHREAD_SEMANTICS") + list(APPEND CMAKE_STANDARD_LIBRARIES rt) + set(CMAKE_STANDARD_LIBRARIES ${CMAKE_STANDARD_LIBRARIES} CACHE STRING "platform default") + set(WITH_SUN true CACHE BOOL "platform default") + endif() + + if("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") + # we want POSIX 2008. MacOS does only support 2001 fully, but the subset we require from 2008 + # is implemented, so ignore _POSIX_VERSION from unistd.h + add_compile_definitions("_POSIX_C_SOURCE=200809L") + + # as _POSIX_C_SOURCE sets a fully POSIX confirmant environment re-enable + # MacOS API visibility by defining the following feature test macro + add_compile_definitions("_DARWIN_C_SOURCE") + endif() + + if(${CMAKE_SYSTEM_NAME} MATCHES "kFreeBSD") + set(BSD TRUE CACHE INTERNAL "platform default") + set(KFREEBSD TRUE CACHE INTERNAL "platform default") + add_compile_definitions(KFREEBSD) + add_compile_definitions("_GNU_SOURCE") + endif() + + if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") + set(BSD TRUE CACHE INTERNAL "platform default") + set(OPENBSD TRUE CACHE INTERNAL "platform default") + endif() + + if(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly") + set(BSD TRUE CACHE INTERNAL "platform default") + set(FREEBSD TRUE CACHE INTERNAL "platform default") + + # we want POSIX 2008. FreeBSD 14 does only support 2001 fully, but the subset we require from 2008 + # is implemented, so ignore _POSIX_VERSION from unistd.h + add_compile_definitions("_POSIX_C_SOURCE=200809L") + # TODO: FreeBSD allows mixing POSIX and BSD API calls if we do not set + # _POSIX_C_SOURCE but lack a macro to re-enable the BSD calls... + add_compile_definitions("__BSD_VISIBLE") + + # There are some symbols only visible for XOpen standard + add_compile_definitions("_XOPEN_SOURCE=700") + add_compile_definitions("_FILE_OFFSET_BITS=64") + set(WINPR_TIMEZONE_FILE "/var/db/zoneinfo") + endif() + + if(BSD) + if(IS_DIRECTORY /usr/local/include) + include_directories(SYSTEM /usr/local/include) + link_directories(/usr/local/lib) + endif() + if(OPENBSD) + if(IS_DIRECTORY /usr/X11R6/include) + include_directories(SYSTEM /usr/X11R6/include) + endif() + endif() + endif() + + # define a fallback for systems that do not support a timezone file or we did not yet test. + # since most of these are BSD try a sensible default + if(NOT WINPR_TIMEZONE_FILE) + set(WINPR_TIMEZONE_FILE "/var/db/zoneinfo") + endif() + add_compile_definitions("WINPR_TIMEZONE_FILE=\"${WINPR_TIMEZONE_FILE}\"") + + if(FREEBSD) + find_path(EPOLLSHIM_INCLUDE_DIR NAMES sys/epoll.h sys/timerfd.h HINTS /usr/local/include/libepoll-shim) + find_library(EPOLLSHIM_LIBS NAMES epoll-shim libepoll-shim HINTS /usr/local/lib) + endif() +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/PreventInSourceBuilds.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/PreventInSourceBuilds.cmake new file mode 100644 index 0000000000000000000000000000000000000000..5fe93d86597c3d66a58b3c1b5ab7349dd756d61e --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/PreventInSourceBuilds.cmake @@ -0,0 +1,61 @@ +# PreventInSourceBuilds +# --------------------- +# +# Prevent in-source builds +# +# It is generally acknowledged that it is preferable to run CMake out of source, +# in a dedicated build directory. To prevent users from accidentally running +# CMake in the source directory, just include this module. + +option(ALLOW_IN_SOURCE_BUILD "[deprecated] Allow building in source tree" OFF) + +if(ALLOW_IN_SOURCE_BUILD) + set(CMAKE_DISABLE_SOURCE_CHANGES OFF CACHE INTERNAL "policy") + set(CMAKE_DISABLE_IN_SOURCE_BUILD OFF CACHE INTERNAL "policy") + if("${srcdir}" STREQUAL "${bindir}") + message(WARNING "Running in-source-tree build [ALLOW_IN_SOURCE_BUILD=ON]") + endif() +else() + set(CMAKE_DISABLE_SOURCE_CHANGES ON CACHE INTERNAL "policy") + set(CMAKE_DISABLE_IN_SOURCE_BUILD ON CACHE INTERNAL "policy") + + # make sure the user doesn't play dirty with symlinks + get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH) + get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH) + + # disallow in-source builds + if("${srcdir}" STREQUAL "${bindir}") + message( + FATAL_ERROR + "\ + +CMake must not to be run in the source directory. \ +Rather create a dedicated build directory and run CMake there. \ +CMake now already created some files, to clean up after this aborted in-source compilation: + rm -r CMakeCache.txt CMakeFiles +or + git clean -xdf + +If you happen to require in-source-tree builds for some reason rerun with -DALLOW_IN_SOURCE_BUILD=ON +" + ) + endif() + + # Check for remnants of in source builds + if(EXISTS "${CMAKE_SOURCE_DIR}/CMakeCache.txt" OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeFiles") + message( + FATAL_ERROR + " \ + +Remnants of in source CMake run detected, aborting! + +To clean up after this aborted in-source compilation: + rm -r CMakeCache.txt CMakeFiles +or + git clean -xdf + +If you happen to require in-source-tree builds for some reason rerun with -DALLOW_IN_SOURCE_BUILD=ON +" + ) + endif() +endif() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/SetFreeRDPCMakeInstallDir.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/SetFreeRDPCMakeInstallDir.cmake new file mode 100644 index 0000000000000000000000000000000000000000..7c4ac2cb30f4c5d72d194e3a8565c31afd4098b1 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/SetFreeRDPCMakeInstallDir.cmake @@ -0,0 +1,3 @@ +function(SetFreeRDPCMakeInstallDir SETVAR subdir) + set(${SETVAR} "${CMAKE_INSTALL_LIBDIR}/cmake/${subdir}" PARENT_SCOPE) +endfunction() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/ShowCMakeVars.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/ShowCMakeVars.cmake new file mode 100644 index 0000000000000000000000000000000000000000..045a0b5da4ff55b5e0c25a21871da820168af306 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/ShowCMakeVars.cmake @@ -0,0 +1,14 @@ +function(ShowCMakeVars) + get_cmake_property(_variableNames VARIABLES) + list(SORT _variableNames) + foreach(_variableName ${_variableNames}) + if(ARGV0) + unset(MATCHED) + string(REGEX MATCH ${ARGV0} MATCHED ${_variableName}) + if(NOT MATCHED) + continue() + endif() + endif() + message(STATUS "${_variableName}=${${_variableName}}") + endforeach() +endfunction() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/WarnUnmaintained.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/WarnUnmaintained.cmake new file mode 100644 index 0000000000000000000000000000000000000000..62ff5eae4b00aaed00768c24ef756e2e047e91ff --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/WarnUnmaintained.cmake @@ -0,0 +1,14 @@ +macro(warn_unmaintained name) + message(WARNING "[unmaintained] ${name} is unmaintained!") + message(WARNING "[unmaintained] use at your own risk!") + message( + WARNING + "[unmaintained] If problems occur please check https://github.com/FreeRDP/FreeRDP/issues for known issues, but be prepared to fix them on your own!" + ) + message(WARNING "[unmaintained] Developers hang out in https://matrix.to/#/#FreeRDP:matrix.org?via=matrix.org") + message( + WARNING + "[unmaintained] - dont hesitate to ask some questions. (replies might take some time depending on your timezone)" + ) + message(WARNING "[unmaintained] - if you intend using this component write us a message") +endmacro() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/WebView2.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/WebView2.cmake new file mode 100644 index 0000000000000000000000000000000000000000..52f012b62e3e6febba0e642798c8c32f922d3830 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/WebView2.cmake @@ -0,0 +1,41 @@ +if(WIN32) + # WebView2 SDK + set(WEBVIEW2_VERSION "1.0.2535.41") + set(WEBVIEW2_URL "https://www.nuget.org/api/v2/package/Microsoft.Web.WebView2/${WEBVIEW2_VERSION}") + set(WEBVIEW2_SHA256 "c9c5518e4d7efa9079ad87bafb64f3c8e8edca0e95d34df878034b880a7af56b") + set(WEBVIEW2_DEFAULT_PACKAGE_DIR "${CMAKE_CURRENT_BINARY_DIR}/packages/Microsoft.Web.WebView2.${WEBVIEW2_VERSION}") + + if(NOT EXISTS ${WEBVIEW2_PACKAGE_DIR}) + unset(WEBVIEW2_PACKAGE_DIR CACHE) + endif() + find_path(WEBVIEW2_PACKAGE_DIR NAMES "build/native/include/WebView2.h" + NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH # dont prepend CMAKE_PREFIX + ) + if(NOT WEBVIEW2_PACKAGE_DIR) + message(WARNING "WebView2 SDK not found locally, downloading ${WEBVIEW2_VERSION} ...") + set(WEBVIEW2_PACKAGE_DIR ${WEBVIEW2_DEFAULT_PACKAGE_DIR} CACHE PATH "WebView2 SDK PATH" FORCE) + file(DOWNLOAD ${WEBVIEW2_URL} ${CMAKE_CURRENT_BINARY_DIR}/webview2.nuget EXPECTED_HASH SHA256=${WEBVIEW2_SHA256}) + file(MAKE_DIRECTORY ${WEBVIEW2_PACKAGE_DIR}) + execute_process( + COMMAND "${CMAKE_COMMAND}" -E tar x "${CMAKE_CURRENT_BINARY_DIR}/webview2.nuget" + WORKING_DIRECTORY "${WEBVIEW2_PACKAGE_DIR}" + ) + endif() + set(WEBVIEW2_PACKAGE_DIR ${WEBVIEW2_PACKAGE_DIR} CACHE INTERNAL "" FORCE) +endif() + +function(target_link_webview2 target) + if(WIN32) + if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID) + set(ARCH ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}) + elseif(CMAKE_C_COMPILER_ARCHITECTURE_ID) + set(ARCH ${CMAKE_C_COMPILER_ARCHITECTURE_ID}) + else() + message(FATAL_ERROR "Unknown CMAKE__COMPILER_ARCHITECTURE_ID") + endif() + target_include_directories(${target} PRIVATE "${WEBVIEW2_PACKAGE_DIR}/build/native/include") + target_link_libraries( + ${target} PRIVATE shlwapi version "${WEBVIEW2_PACKAGE_DIR}/build/native/${ARCH}/WebView2LoaderStatic.lib" + ) + endif() +endfunction() diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/WindowsDLLVersion.rc.in b/local-test-freerdp-full-01/afc-freerdp/cmake/WindowsDLLVersion.rc.in new file mode 100644 index 0000000000000000000000000000000000000000..5a0da5eae4799179f705ab39fc39593361401531 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/WindowsDLLVersion.rc.in @@ -0,0 +1,35 @@ +#include + +VS_VERSION_INFO VERSIONINFO + FILEVERSION @RC_VERSION_MAJOR@,@RC_VERSION_MINOR@,@RC_VERSION_BUILD@,@RC_VERSION_PATCH@ + PRODUCTVERSION @RC_VERSION_MAJOR@,@RC_VERSION_MINOR@,@RC_VERSION_BUILD@,@RC_VERSION_PATCH@ + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "@RC_VERSION_VENDOR@" + VALUE "FileDescription", "@RC_VERSION_DESCRIPTION@" + VALUE "FileVersion", "@RC_VERSION_MAJOR@,@RC_VERSION_MINOR@,@RC_VERSION_PATCH@,@RC_VERSION_BUILD@" + VALUE "InternalName", "@RC_VERSION_FILE@" + VALUE "LegalCopyright", "Copyright (C) 2011-@RC_VERSION_YEAR@" + VALUE "OriginalFilename", "@RC_VERSION_FILE@" + VALUE "ProductName", "@RC_VERSION_PRODUCT@" + VALUE "ProductVersion", "@RC_VERSION_MAJOR@,@RC_VERSION_MINOR@,@RC_VERSION_BUILD@,@RC_VERSION_PATCH@" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/ios.toolchain.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/ios.toolchain.cmake new file mode 100644 index 0000000000000000000000000000000000000000..36ace3783558ed3b57ceacfdc069c599525302de --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/ios.toolchain.cmake @@ -0,0 +1,977 @@ +# This file is part of the ios-cmake project. It was retrieved from +# https://github.com/leetal/ios-cmake.git, which is a fork of +# https://github.com/gerstrong/ios-cmake.git, which is a fork of +# https://github.com/cristeab/ios-cmake.git, which is a fork of +# https://code.google.com/p/ios-cmake/. Which in turn is based off of +# the Platform/Darwin.cmake and Platform/UnixPaths.cmake files which +# are included with CMake 2.8.4 +# +# The ios-cmake project is licensed under the new BSD license. +# +# Copyright (c) 2014, Bogdan Cristea and LTE Engineering Software, +# Kitware, Inc., Insight Software Consortium. All rights reserved. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# This file is based off of the Platform/Darwin.cmake and +# Platform/UnixPaths.cmake files which are included with CMake 2.8.4 +# It has been altered for iOS development. +# +# Updated by Alex Stewart (alexs.mac@gmail.com) +# +# ***************************************************************************** +# Now maintained by Alexander Widerberg (widerbergaren [at] gmail.com) +# under the BSD-3-Clause license +# https://github.com/leetal/ios-cmake +# ***************************************************************************** +# +# INFORMATION / HELP +# +# The following options control the behaviour of this toolchain: +# +# PLATFORM: (default "OS64") +# OS = Build for iPhoneOS. +# OS64 = Build for arm64 iphoneOS. +# OS64COMBINED = Build for arm64 x86_64 iphoneOS. Combined into FAT STATIC lib (supported on 3.14+ of CMakewith "-G Xcode" argument ONLY) +# SIMULATOR = Build for x86 i386 iphoneOS Simulator. +# SIMULATOR64 = Build for x86_64 iphoneOS Simulator. +# SIMULATORARM64 = Build for arm64 iphoneOS Simulator. +# TVOS = Build for arm64 tvOS. +# TVOSCOMBINED = Build for arm64 x86_64 tvOS. Combined into FAT STATIC lib (supported on 3.14+ of CMake with "-G Xcode" argument ONLY) +# SIMULATOR_TVOS = Build for x86_64 tvOS Simulator. +# WATCHOS = Build for armv7k arm64_32 for watchOS. +# WATCHOSCOMBINED = Build for armv7k arm64_32 x86_64 watchOS. Combined into FAT STATIC lib (supported on 3.14+ of CMake with "-G Xcode" argument ONLY) +# SIMULATOR_WATCHOS = Build for x86_64 for watchOS Simulator. +# MAC = Build for x86_64 macOS. +# MAC_ARM64 = Build for Apple Silicon macOS. +# MAC_CATALYST = Build for x86_64 macOS with Catalyst support (iOS toolchain on macOS). +# Note: The build argument "MACOSX_DEPLOYMENT_TARGET" can be used to control min-version of macOS +# MAC_CATALYST_ARM64 = Build for Apple Silicon macOS with Catalyst support (iOS toolchain on macOS). +# Note: The build argument "MACOSX_DEPLOYMENT_TARGET" can be used to control min-version of macOS +# +# CMAKE_OSX_SYSROOT: Path to the SDK to use. By default this is +# automatically determined from PLATFORM and xcodebuild, but +# can also be manually specified (although this should not be required). +# +# CMAKE_DEVELOPER_ROOT: Path to the Developer directory for the platform +# being compiled for. By default this is automatically determined from +# CMAKE_OSX_SYSROOT, but can also be manually specified (although this should +# not be required). +# +# DEPLOYMENT_TARGET: Minimum SDK version to target. Default 2.0 on watchOS and 9.0 on tvOS+iOS +# +# ENABLE_BITCODE: (1|0) Enables or disables bitcode support. Default 1 (true) +# +# ENABLE_ARC: (1|0) Enables or disables ARC support. Default 1 (true, ARC enabled by default) +# +# ENABLE_VISIBILITY: (1|0) Enables or disables symbol visibility support. Default 0 (false, visibility hidden by default) +# +# ENABLE_STRICT_TRY_COMPILE: (1|0) Enables or disables strict try_compile() on all Check* directives (will run linker +# to actually check if linking is possible). Default 0 (false, will set CMAKE_TRY_COMPILE_TARGET_TYPE to STATIC_LIBRARY) +# +# ARCHS: (armv7 armv7s armv7k arm64 arm64_32 i386 x86_64) If specified, will override the default architectures for the given PLATFORM +# OS = armv7 armv7s arm64 (if applicable) +# OS64 = arm64 (if applicable) +# SIMULATOR = i386 +# SIMULATOR64 = x86_64 +# SIMULATORARM64 = arm64 +# TVOS = arm64 +# SIMULATOR_TVOS = x86_64 (i386 has since long been deprecated) +# WATCHOS = armv7k arm64_32 (if applicable) +# SIMULATOR_WATCHOS = x86_64 (i386 has since long been deprecated) +# MAC = x86_64 +# MAC_ARM64 = arm64 +# MAC_CATALYST = x86_64 +# MAC_CATALYST_ARM64 = arm64 +# +# This toolchain defines the following properties (available via get_property()) for use externally: +# +# PLATFORM: The currently targeted platform. +# XCODE_VERSION: Version number (not including Build version) of Xcode detected. +# SDK_VERSION: Version of SDK being used. +# OSX_ARCHITECTURES: Architectures being compiled for (generated from PLATFORM). +# APPLE_TARGET_TRIPLE: Used by autoconf build systems. NOTE: If "ARCHS" are overridden, this will *NOT* be set! +# +# This toolchain defines the following macros for use externally: +# +# set_xcode_property (TARGET XCODE_PROPERTY XCODE_VALUE XCODE_VARIANT) +# A convenience macro for setting xcode specific properties on targets. +# Available variants are: All, Release, RelWithDebInfo, Debug, MinSizeRel +# example: set_xcode_property (myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1" "all"). +# +# find_host_package (PROGRAM ARGS) +# A macro used to find executable programs on the host system, not within the +# environment. Thanks to the android-cmake project for providing the +# command. +# + +cmake_minimum_required(VERSION 3.13) + +# CMake invokes the toolchain file twice during the first build, but only once during subsequent rebuilds. +if(DEFINED ENV{_IOS_TOOLCHAIN_HAS_RUN}) + return() +endif() +set(ENV{_IOS_TOOLCHAIN_HAS_RUN} true) + +############################################################################### +# OPTIONS # +############################################################################### + +option(DROP_32_BIT "Drops the 32-bit targets universally." YES) + +############################################################################### +# END OPTIONS # +############################################################################### + +# List of supported platform values +list( + APPEND + _supported_platforms + "OS" + "OS64" + "OS64COMBINED" + "SIMULATOR" + "SIMULATOR64" + "SIMULATORARM64" + "TVOS" + "TVOSCOMBINED" + "SIMULATOR_TVOS" + "WATCHOS" + "WATCHOSCOMBINED" + "SIMULATOR_WATCHOS" + "MAC" + "MAC_ARM64" + "MAC_CATALYST" + "MAC_CATALYST_ARM64" +) + +# Cache what generator is used +set(USED_CMAKE_GENERATOR "${CMAKE_GENERATOR}") + +# Check if using a CMake version capable of building combined FAT builds (simulator and target slices combined in one static lib) +if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14") + set(MODERN_CMAKE YES) +endif() + +# Get the Xcode version being used. +# Problem: CMake runs toolchain files multiple times, but can't read cache variables on some runs. +# Workaround: On first run (in which cache variables are always accessible), set an intermediary environment variable. +# +# NOTE: This pattern is used i many places in this toolchain to speed up checks of all sorts +if(DEFINED XCODE_VERSION_INT) + # Environment variables are always preserved. + set(ENV{_XCODE_VERSION_INT} "${XCODE_VERSION_INT}") +elseif(DEFINED ENV{_XCODE_VERSION_INT}) + set(XCODE_VERSION_INT "$ENV{_XCODE_VERSION_INT}") +elseif(NOT DEFINED XCODE_VERSION_INT) + find_program(XCODEBUILD_EXECUTABLE xcodebuild) + if(NOT XCODEBUILD_EXECUTABLE) + message(FATAL_ERROR "xcodebuild not found. Please install either the standalone commandline tools or Xcode.") + endif() + execute_process( + COMMAND ${XCODEBUILD_EXECUTABLE} -version OUTPUT_VARIABLE XCODE_VERSION_INT ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + string(REGEX MATCH "Xcode [0-9\\.]+" XCODE_VERSION_INT "${XCODE_VERSION_INT}") + string(REGEX REPLACE "Xcode ([0-9\\.]+)" "\\1" XCODE_VERSION_INT "${XCODE_VERSION_INT}") + set(XCODE_VERSION_INT "${XCODE_VERSION_INT}" CACHE INTERNAL "") +endif() + +# Assuming that xcode 12.0 is installed you most probably have ios sdk 14.0 or later installed (tested on Big Sur) +# if you don't set a deployment target it will be set the way you only get 64-bit builds +if(NOT DEFINED DEPLOYMENT_TARGET AND XCODE_VERSION_INT VERSION_GREATER 12.0) + # Temporarily fix the arm64 issues in CMake install-combined by excluding arm64 for simulator builds (needed for Apple Silicon...) + set(CMAKE_XCODE_ATTRIBUTE_EXCLUDED_ARCHS[sdk=iphonesimulator*] "arm64") +endif() + +# Check if the platform variable is set +if(DEFINED PLATFORM) + # Environment variables are always preserved. + set(ENV{_PLATFORM} "${PLATFORM}") +elseif(DEFINED ENV{_PLATFORM}) + set(PLATFORM "$ENV{_PLATFORM}") +elseif(NOT DEFINED PLATFORM) + message( + FATAL_ERROR "PLATFORM argument not set. Bailing configure since I don't know what target you want to build for!" + ) +endif() + +if(PLATFORM MATCHES ".*COMBINED" AND NOT CMAKE_GENERATOR MATCHES "Xcode") + message( + FATAL_ERROR + "The combined builds support requires Xcode to be used as generator via '-G Xcode' command-line argument in CMake" + ) +endif() + +# Safeguard that the platform value is set and is one of the supported values +list(FIND _supported_platforms ${PLATFORM} contains_PLATFORM) +if("${contains_PLATFORM}" EQUAL "-1") + string(REPLACE ";" "\n * " _supported_platforms_formatted "${_supported_platforms}") + message(FATAL_ERROR " Invalid PLATFORM specified! Current value: ${PLATFORM}.\n" + " Supported PLATFORM values: \n * ${_supported_platforms_formatted}" + ) +endif() + +# Check if Apple Silicon is supported +if(PLATFORM MATCHES "^(MAC_ARM64)$|^(MAC_CATALYST_ARM64)$" AND ${CMAKE_VERSION} VERSION_LESS "3.19.5") + message(FATAL_ERROR "Apple Silicon builds requires a minimum of CMake 3.19.5") +endif() + +# Touch toolchain variable to suppress "unused variable" warning. +# This happens if CMake is invoked with the same command line the second time. +if(CMAKE_TOOLCHAIN_FILE) + +endif() + +# Fix for PThread library not in path +set(CMAKE_THREAD_LIBS_INIT "-lpthread") +set(CMAKE_HAVE_THREADS_LIBRARY 1) +set(CMAKE_USE_WIN32_THREADS_INIT 0) +set(CMAKE_USE_PTHREADS_INIT 1) + +# Specify minimum version of deployment target. +if(NOT DEFINED DEPLOYMENT_TARGET) + if(PLATFORM MATCHES "WATCHOS") + # Unless specified, SDK version 4.0 is used by default as minimum target version (watchOS). + set(DEPLOYMENT_TARGET "4.0") + elseif(PLATFORM STREQUAL "MAC") + # Unless specified, SDK version 10.13 (High sierra) is used by default as minimum target version (macos). + set(DEPLOYMENT_TARGET "10.13") + elseif(PLATFORM STREQUAL "MAC_ARM64") + # Unless specified, SDK version 11.0 (Big Sur) is used by default as minimum target version (macos on arm). + set(DEPLOYMENT_TARGET "11.0") + elseif(PLATFORM STREQUAL "MAC_CATALYST" OR PLATFORM STREQUAL "MAC_CATALYST_ARM64") + # Unless specified, SDK version 13.0 is used by default as minimum target version (mac catalyst minimum requirement). + set(DEPLOYMENT_TARGET "13.0") + else() + # Unless specified, SDK version 11.0 is used by default as minimum target version (iOS, tvOS). + set(DEPLOYMENT_TARGET "11.0") + endif() + message(STATUS "[DEFAULTS] Using the default min-version since DEPLOYMENT_TARGET not provided!") +elseif(DEFINED DEPLOYMENT_TARGET AND PLATFORM MATCHES "^MAC_CATALYST" AND ${DEPLOYMENT_TARGET} VERSION_LESS "13.0") + message(FATAL_ERROR "Mac Catalyst builds requires a minimum deployment target of 13.0!") +endif() + +# Store the DEPLOYMENT_TARGET in the cache +set(DEPLOYMENT_TARGET "${DEPLOYMENT_TARGET}" CACHE INTERNAL "") + +# Handle the case where we are targeting iOS and a version above 10.3.4 (32-bit support dropped officially) +if(PLATFORM STREQUAL "OS" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.4) + set(PLATFORM "OS64") + message(STATUS "Targeting minimum SDK version ${DEPLOYMENT_TARGET}. Dropping 32-bit support.") +elseif(PLATFORM STREQUAL "SIMULATOR" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.4) + set(PLATFORM "SIMULATOR64") + message(STATUS "Targeting minimum SDK version ${DEPLOYMENT_TARGET}. Dropping 32-bit support.") +endif() + +set(PLATFORM_INT "${PLATFORM}") + +if(DEFINED ARCHS) + string(REPLACE ";" "-" ARCHS_SPLIT "${ARCHS}") +endif() + +# Determine the platform name and architectures for use in xcodebuild commands +# from the specified PLATFORM_INT name. +if(PLATFORM_INT STREQUAL "OS") + set(SDK_NAME iphoneos) + if(NOT ARCHS) + set(ARCHS armv7 armv7s arm64) + set(APPLE_TARGET_TRIPLE_INT arm-apple-ios$${DEPLOYMENT_TARGET}) + else() + set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-ios${DEPLOYMENT_TARGET}) + endif() +elseif(PLATFORM_INT STREQUAL "OS64") + set(SDK_NAME iphoneos) + if(NOT ARCHS) + if(XCODE_VERSION_INT VERSION_GREATER 10.0) + set(ARCHS arm64) + + # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missung bitcode markers for example + else() + set(ARCHS arm64) + endif() + set(APPLE_TARGET_TRIPLE_INT aarch64-apple-ios${DEPLOYMENT_TARGET}) + else() + set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-ios${DEPLOYMENT_TARGET}) + endif() +elseif(PLATFORM_INT STREQUAL "OS64COMBINED") + set(SDK_NAME iphoneos) + if(MODERN_CMAKE) + if(NOT ARCHS) + if(XCODE_VERSION_INT VERSION_GREATER 10.0) + set(ARCHS arm64 x86_64) + + # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missung bitcode markers for example + set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "arm64") + set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "x86_64") + set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "arm64") + set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "x86_64") + else() + set(ARCHS arm64 x86_64) + set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "arm64") + set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "x86_64") + set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "arm64") + set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "x86_64") + endif() + set(APPLE_TARGET_TRIPLE_INT aarch64-x86_64-apple-ios${DEPLOYMENT_TARGET}) + else() + set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-ios${DEPLOYMENT_TARGET}) + endif() + else() + message(FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the OS64COMBINED setting work") + endif() +elseif(PLATFORM_INT STREQUAL "SIMULATOR") + set(SDK_NAME iphonesimulator) + if(NOT ARCHS) + set(ARCHS i386) + set(APPLE_TARGET_TRIPLE_INT i386-apple-ios${DEPLOYMENT_TARGET}-simulator) + else() + set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-ios${DEPLOYMENT_TARGET}-simulator) + endif() + message(DEPRECATION "SIMULATOR IS DEPRECATED. Consider using SIMULATOR64 instead.") +elseif(PLATFORM_INT STREQUAL "SIMULATOR64") + set(SDK_NAME iphonesimulator) + if(NOT ARCHS) + set(ARCHS x86_64) + set(APPLE_TARGET_TRIPLE_INT x86_64-apple-ios${DEPLOYMENT_TARGET}-simulator) + else() + set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-ios${DEPLOYMENT_TARGET}-simulator) + endif() +elseif(PLATFORM_INT STREQUAL "SIMULATORARM64") + set(SDK_NAME iphonesimulator) + if(NOT ARCHS) + set(ARCHS arm64) + set(APPLE_TARGET_TRIPLE_INT aarch64-apple-ios${DEPLOYMENT_TARGET}-simulator) + else() + set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-ios${DEPLOYMENT_TARGET}-simulator) + endif() +elseif(PLATFORM_INT STREQUAL "TVOS") + set(SDK_NAME appletvos) + if(NOT ARCHS) + set(ARCHS arm64) + set(APPLE_TARGET_TRIPLE_INT aarch64-apple-tvos${DEPLOYMENT_TARGET}) + else() + set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-tvos${DEPLOYMENT_TARGET}) + endif() +elseif(PLATFORM_INT STREQUAL "TVOSCOMBINED") + set(SDK_NAME appletvos) + if(MODERN_CMAKE) + if(NOT ARCHS) + set(ARCHS arm64 x86_64) + set(APPLE_TARGET_TRIPLE_INT aarch64-x86_64-apple-tvos${DEPLOYMENT_TARGET}) + set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=appletvos*] "arm64") + set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=appletvsimulator*] "x86_64") + set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=appletvos*] "arm64") + set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=appletvsimulator*] "x86_64") + else() + set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-tvos${DEPLOYMENT_TARGET}) + endif() + else() + message(FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the TVOSCOMBINED setting work") + endif() +elseif(PLATFORM_INT STREQUAL "SIMULATOR_TVOS") + set(SDK_NAME appletvsimulator) + if(NOT ARCHS) + set(ARCHS x86_64) + set(APPLE_TARGET_TRIPLE_INT x86_64-apple-tvos${DEPLOYMENT_TARGET}-simulator) + else() + set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-tvos${DEPLOYMENT_TARGET}-simulator) + endif() +elseif(PLATFORM_INT STREQUAL "WATCHOS") + set(SDK_NAME watchos) + if(NOT ARCHS) + if(XCODE_VERSION_INT VERSION_GREATER 10.0) + set(ARCHS armv7k arm64_32) + set(APPLE_TARGET_TRIPLE_INT aarch64_32-apple-watchos${DEPLOYMENT_TARGET}) + else() + set(ARCHS armv7k) + set(APPLE_TARGET_TRIPLE_INT arm-apple-watchos${DEPLOYMENT_TARGET}) + endif() + else() + set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-watchos${DEPLOYMENT_TARGET}) + endif() +elseif(PLATFORM_INT STREQUAL "WATCHOSCOMBINED") + set(SDK_NAME watchos) + if(MODERN_CMAKE) + if(NOT ARCHS) + if(XCODE_VERSION_INT VERSION_GREATER 10.0) + set(ARCHS armv7k arm64_32 i386) + set(APPLE_TARGET_TRIPLE_INT aarch64_32-i386-apple-watchos${DEPLOYMENT_TARGET}) + set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=watchos*] "armv7k arm64_32") + set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=watchsimulator*] "i386") + set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=watchos*] "armv7k arm64_32") + set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=watchsimulator*] "i386") + else() + set(ARCHS armv7k i386) + set(APPLE_TARGET_TRIPLE_INT arm-i386-apple-watchos${DEPLOYMENT_TARGET}) + set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=watchos*] "armv7k") + set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=watchsimulator*] "i386") + set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=watchos*] "armv7k") + set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=watchsimulator*] "i386") + endif() + else() + set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-watchos${DEPLOYMENT_TARGET}) + endif() + else() + message(FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the WATCHOSCOMBINED setting work") + endif() +elseif(PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS") + set(SDK_NAME watchsimulator) + if(NOT ARCHS) + set(ARCHS i386) + set(APPLE_TARGET_TRIPLE_INT i386-apple-watchos${DEPLOYMENT_TARGET}-simulator) + else() + set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-watchos${DEPLOYMENT_TARGET}-simulator) + endif() +elseif(PLATFORM_INT STREQUAL "MAC" OR PLATFORM_INT STREQUAL "MAC_CATALYST") + set(SDK_NAME macosx) + if(NOT ARCHS) + set(ARCHS x86_64) + endif() + string(REPLACE ";" "-" ARCHS_SPLIT "${ARCHS}") + if(PLATFORM_INT STREQUAL "MAC") + set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-macosx${DEPLOYMENT_TARGET}) + elseif(PLATFORM_INT STREQUAL "MAC_CATALYST") + set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-ios${DEPLOYMENT_TARGET}-macabi) + endif() +elseif(PLATFORM_INT MATCHES "^(MAC_ARM64)$|^(MAC_CATALYST_ARM64)$") + set(SDK_NAME macosx) + if(NOT ARCHS) + set(ARCHS arm64) + endif() + string(REPLACE ";" "-" ARCHS_SPLIT "${ARCHS}") + if(PLATFORM_INT STREQUAL "MAC_ARM64") + set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-macosx${DEPLOYMENT_TARGET}) + elseif(PLATFORM_INT STREQUAL "MAC_CATALYST_ARM64") + set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-ios${DEPLOYMENT_TARGET}-macabi) + endif() +else() + message(FATAL_ERROR "Invalid PLATFORM: ${PLATFORM_INT}") +endif() + +if(MODERN_CMAKE AND PLATFORM_INT MATCHES ".*COMBINED" AND NOT CMAKE_GENERATOR MATCHES "Xcode") + message(FATAL_ERROR "The COMBINED options only work with Xcode generator, -G Xcode") +endif() + +if(CMAKE_GENERATOR MATCHES "Xcode" AND PLATFORM_INT MATCHES "^MAC_CATALYST") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") + set(CMAKE_XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS "macosx") + set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-maccatalyst") + if(NOT DEFINED MACOSX_DEPLOYMENT_TARGET) + set(CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET "10.15") + else() + set(CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET "${MACOSX_DEPLOYMENT_TARGET}") + endif() +elseif(CMAKE_GENERATOR MATCHES "Xcode") + set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${DEPLOYMENT_TARGET}") + if(NOT PLATFORM_INT MATCHES ".*COMBINED") + set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=${SDK_NAME}*] "${ARCHS}") + set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=${SDK_NAME}*] "${ARCHS}") + endif() +endif() + +# If user did not specify the SDK root to use, then query xcodebuild for it. +if(DEFINED CMAKE_OSX_SYSROOT_INT) + # Environment variables are always preserved. + set(ENV{_CMAKE_OSX_SYSROOT_INT} "${CMAKE_OSX_SYSROOT_INT}") +elseif(DEFINED ENV{_CMAKE_OSX_SYSROOT_INT}) + set(CMAKE_OSX_SYSROOT_INT "$ENV{_CMAKE_OSX_SYSROOT_INT}") +elseif(NOT DEFINED CMAKE_OSX_SYSROOT_INT) + execute_process( + COMMAND ${XCODEBUILD_EXECUTABLE} -version -sdk ${SDK_NAME} Path OUTPUT_VARIABLE CMAKE_OSX_SYSROOT_INT + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE + ) +endif() + +if(NOT DEFINED CMAKE_OSX_SYSROOT_INT AND NOT DEFINED CMAKE_OSX_SYSROOT) + message(SEND_ERROR "Please make sure that Xcode is installed and that the toolchain" + "is pointing to the correct path. Please run:" + "sudo xcode-select -s /Applications/Xcode.app/Contents/Developer" + "and see if that fixes the problem for you." + ) + message(FATAL_ERROR "Invalid CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT} " "does not exist.") +elseif(DEFINED CMAKE_OSX_SYSROOT_INT) + set(CMAKE_OSX_SYSROOT_INT "${CMAKE_OSX_SYSROOT_INT}" CACHE INTERNAL "") + # Specify the location or name of the platform SDK to be used in CMAKE_OSX_SYSROOT. + set(CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT_INT}" CACHE INTERNAL "") +endif() + +# Use bitcode or not +if(NOT DEFINED ENABLE_BITCODE AND NOT ARCHS MATCHES "((^|;|, )(i386|x86_64))+") + # Unless specified, enable bitcode support by default + message(STATUS "[DEFAULTS] Enabling bitcode support by default. ENABLE_BITCODE not provided!") + set(ENABLE_BITCODE TRUE) +elseif(NOT DEFINED ENABLE_BITCODE) + message( + STATUS "[DEFAULTS] Disabling bitcode support by default on simulators. ENABLE_BITCODE not provided for override!" + ) + set(ENABLE_BITCODE FALSE) +endif() +set(ENABLE_BITCODE_INT ${ENABLE_BITCODE} CACHE BOOL "Whether or not to enable bitcode" FORCE) +# Use ARC or not +if(NOT DEFINED ENABLE_ARC) + # Unless specified, enable ARC support by default + set(ENABLE_ARC TRUE) + message(STATUS "[DEFAULTS] Enabling ARC support by default. ENABLE_ARC not provided!") +endif() +set(ENABLE_ARC_INT ${ENABLE_ARC} CACHE BOOL "Whether or not to enable ARC" FORCE) +# Use hidden visibility or not +if(NOT DEFINED ENABLE_VISIBILITY) + # Unless specified, disable symbols visibility by default + set(ENABLE_VISIBILITY FALSE) + message(STATUS "[DEFAULTS] Hiding symbols visibility by default. ENABLE_VISIBILITY not provided!") +endif() +set(ENABLE_VISIBILITY_INT ${ENABLE_VISIBILITY} + CACHE BOOL "Whether or not to hide symbols from the dynamic linker (-fvisibility=hidden)" FORCE +) +# Set strict compiler checks or not +if(NOT DEFINED ENABLE_STRICT_TRY_COMPILE) + # Unless specified, disable strict try_compile() + set(ENABLE_STRICT_TRY_COMPILE FALSE) + message(STATUS "[DEFAULTS] Using NON-strict compiler checks by default. ENABLE_STRICT_TRY_COMPILE not provided!") +endif() +set(ENABLE_STRICT_TRY_COMPILE_INT ${ENABLE_STRICT_TRY_COMPILE} + CACHE BOOL "Whether or not to use strict compiler checks" FORCE +) + +# Get the SDK version information. +if(DEFINED SDK_VERSION) + # Environment variables are always preserved. + set(ENV{_SDK_VERSION} "${SDK_VERSION}") +elseif(DEFINED ENV{_SDK_VERSION}) + set(SDK_VERSION "$ENV{_SDK_VERSION}") +elseif(NOT DEFINED SDK_VERSION) + execute_process( + COMMAND ${XCODEBUILD_EXECUTABLE} -sdk ${CMAKE_OSX_SYSROOT_INT} -version SDKVersion OUTPUT_VARIABLE SDK_VERSION + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE + ) +endif() + +# Find the Developer root for the specific iOS platform being compiled for +# from CMAKE_OSX_SYSROOT. Should be ../../ from SDK specified in +# CMAKE_OSX_SYSROOT. There does not appear to be a direct way to obtain +# this information from xcrun or xcodebuild. +if(NOT DEFINED CMAKE_DEVELOPER_ROOT AND NOT CMAKE_GENERATOR MATCHES "Xcode") + get_filename_component(PLATFORM_SDK_DIR ${CMAKE_OSX_SYSROOT_INT} PATH) + get_filename_component(CMAKE_DEVELOPER_ROOT ${PLATFORM_SDK_DIR} PATH) + if(NOT EXISTS "${CMAKE_DEVELOPER_ROOT}") + message(FATAL_ERROR "Invalid CMAKE_DEVELOPER_ROOT: ${CMAKE_DEVELOPER_ROOT} does not exist.") + endif() +endif() + +# Find the C & C++ compilers for the specified SDK. +if(DEFINED CMAKE_C_COMPILER) + # Environment variables are always preserved. + set(ENV{_CMAKE_C_COMPILER} "${CMAKE_C_COMPILER}") +elseif(DEFINED ENV{_CMAKE_C_COMPILER}) + set(CMAKE_C_COMPILER "$ENV{_CMAKE_C_COMPILER}") + set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) +elseif(NOT DEFINED CMAKE_C_COMPILER) + execute_process( + COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT_INT} -find clang OUTPUT_VARIABLE CMAKE_C_COMPILER + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE + ) + set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) +endif() +if(DEFINED CMAKE_CXX_COMPILER) + # Environment variables are always preserved. + set(ENV{_CMAKE_CXX_COMPILER} "${CMAKE_CXX_COMPILER}") +elseif(DEFINED ENV{_CMAKE_CXX_COMPILER}) + set(CMAKE_CXX_COMPILER "$ENV{_CMAKE_CXX_COMPILER}") +elseif(NOT DEFINED CMAKE_CXX_COMPILER) + execute_process( + COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT_INT} -find clang++ OUTPUT_VARIABLE CMAKE_CXX_COMPILER + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE + ) +endif() +# Find (Apple's) libtool. +if(DEFINED BUILD_LIBTOOL) + # Environment variables are always preserved. + set(ENV{_BUILD_LIBTOOL} "${BUILD_LIBTOOL}") +elseif(DEFINED ENV{_BUILD_LIBTOOL}) + set(BUILD_LIBTOOL "$ENV{_BUILD_LIBTOOL}") +elseif(NOT DEFINED BUILD_LIBTOOL) + execute_process( + COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT_INT} -find libtool OUTPUT_VARIABLE BUILD_LIBTOOL + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE + ) +endif() +# Find the toolchain's provided install_name_tool if none is found on the host +if(DEFINED CMAKE_INSTALL_NAME_TOOL) + # Environment variables are always preserved. + set(ENV{_CMAKE_INSTALL_NAME_TOOL} "${CMAKE_INSTALL_NAME_TOOL}") +elseif(DEFINED ENV{_CMAKE_INSTALL_NAME_TOOL}) + set(CMAKE_INSTALL_NAME_TOOL "$ENV{_CMAKE_INSTALL_NAME_TOOL}") +elseif(NOT DEFINED CMAKE_INSTALL_NAME_TOOL) + execute_process( + COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT_INT} -find install_name_tool OUTPUT_VARIABLE CMAKE_INSTALL_NAME_TOOL_INT + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE + ) + set(CMAKE_INSTALL_NAME_TOOL ${CMAKE_INSTALL_NAME_TOOL_INT} CACHE INTERNAL "") +endif() + +# Configure libtool to be used instead of ar + ranlib to build static libraries. +# This is required on Xcode 7+, but should also work on previous versions of +# Xcode. +get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES) +foreach(lang ${languages}) + set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "${BUILD_LIBTOOL} -static -o " CACHE INTERNAL + "" + ) +endforeach() + +# CMake 3.14+ support building for iOS, watchOS and tvOS out of the box. +if(MODERN_CMAKE) + if(SDK_NAME MATCHES "iphone") + set(CMAKE_SYSTEM_NAME iOS) + elseif(SDK_NAME MATCHES "macosx") + set(CMAKE_SYSTEM_NAME Darwin) + elseif(SDK_NAME MATCHES "appletv") + set(CMAKE_SYSTEM_NAME tvOS) + elseif(SDK_NAME MATCHES "watch") + set(CMAKE_SYSTEM_NAME watchOS) + endif() + # Provide flags for a combined FAT library build on newer CMake versions + if(PLATFORM_INT MATCHES ".*COMBINED") + set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO") + set(CMAKE_IOS_INSTALL_COMBINED YES) + message(STATUS "Will combine built (static) artifacts into FAT lib...") + endif() +elseif(NOT DEFINED CMAKE_SYSTEM_NAME AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.10") + # Legacy code path prior to CMake 3.14 or fallback if no CMAKE_SYSTEM_NAME specified + set(CMAKE_SYSTEM_NAME iOS) +elseif(NOT DEFINED CMAKE_SYSTEM_NAME) + # Legacy code path prior to CMake 3.14 or fallback if no CMAKE_SYSTEM_NAME specified + set(CMAKE_SYSTEM_NAME Darwin) +endif() +# Standard settings. +set(CMAKE_SYSTEM_VERSION ${SDK_VERSION} CACHE INTERNAL "") +set(UNIX TRUE CACHE BOOL "") +set(APPLE TRUE CACHE BOOL "") +if(PLATFORM STREQUAL "MAC" OR PLATFORM STREQUAL "MAC_ARM64") + set(IOS FALSE CACHE BOOL "") + set(MACOS TRUE CACHE BOOL "") +elseif(PLATFORM STREQUAL "MAC_CATALYST" OR PLATFORM STREQUAL "MAC_CATALYST_ARM64") + set(IOS TRUE CACHE BOOL "") + set(MACOS TRUE CACHE BOOL "") +else() + set(IOS TRUE CACHE BOOL "") +endif() +set(CMAKE_AR ar CACHE FILEPATH "" FORCE) +set(CMAKE_RANLIB ranlib CACHE FILEPATH "" FORCE) +set(CMAKE_STRIP strip CACHE FILEPATH "" FORCE) +# Set the architectures for which to build. +set(CMAKE_OSX_ARCHITECTURES ${ARCHS} CACHE INTERNAL "") +# Change the type of target generated for try_compile() so it'll work when cross-compiling, weak compiler checks +if(NOT ENABLE_STRICT_TRY_COMPILE_INT) + set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) +endif() +# All iOS/Darwin specific settings - some may be redundant. +set(CMAKE_MACOSX_BUNDLE YES) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") +set(CMAKE_SHARED_LIBRARY_PREFIX "lib") +set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib") +set(CMAKE_SHARED_MODULE_PREFIX "lib") +set(CMAKE_SHARED_MODULE_SUFFIX ".so") +set(CMAKE_C_COMPILER_ABI ELF) +set(CMAKE_CXX_COMPILER_ABI ELF) +set(CMAKE_C_HAS_ISYSROOT 1) +set(CMAKE_CXX_HAS_ISYSROOT 1) +set(CMAKE_MODULE_EXISTS 1) +set(CMAKE_DL_LIBS "") +set(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ") +set(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ") +set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}") +set(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}") + +if(ARCHS MATCHES "((^|;|, )(arm64|arm64e|x86_64))+") + set(CMAKE_C_SIZEOF_DATA_PTR 8) + set(CMAKE_CXX_SIZEOF_DATA_PTR 8) + if(ARCHS MATCHES "((^|;|, )(arm64|arm64e))+") + set(CMAKE_SYSTEM_PROCESSOR "aarch64") + else() + set(CMAKE_SYSTEM_PROCESSOR "x86_64") + endif() +else() + set(CMAKE_C_SIZEOF_DATA_PTR 4) + set(CMAKE_CXX_SIZEOF_DATA_PTR 4) + set(CMAKE_SYSTEM_PROCESSOR "arm") +endif() + +# Note that only Xcode 7+ supports the newer more specific: +# -m${SDK_NAME}-version-min flags, older versions of Xcode use: +# -m(ios/ios-simulator)-version-min instead. +if(${CMAKE_VERSION} VERSION_LESS "3.11") + if(PLATFORM_INT STREQUAL "OS" OR PLATFORM_INT STREQUAL "OS64") + if(XCODE_VERSION_INT VERSION_LESS 7.0) + set(SDK_NAME_VERSION_FLAGS "-mios-version-min=${DEPLOYMENT_TARGET}") + else() + # Xcode 7.0+ uses flags we can build directly from SDK_NAME. + set(SDK_NAME_VERSION_FLAGS "-m${SDK_NAME}-version-min=${DEPLOYMENT_TARGET}") + endif() + elseif(PLATFORM_INT STREQUAL "TVOS") + set(SDK_NAME_VERSION_FLAGS "-mtvos-version-min=${DEPLOYMENT_TARGET}") + elseif(PLATFORM_INT STREQUAL "SIMULATOR_TVOS") + set(SDK_NAME_VERSION_FLAGS "-mtvos-simulator-version-min=${DEPLOYMENT_TARGET}") + elseif(PLATFORM_INT STREQUAL "WATCHOS") + set(SDK_NAME_VERSION_FLAGS "-mwatchos-version-min=${DEPLOYMENT_TARGET}") + elseif(PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS") + set(SDK_NAME_VERSION_FLAGS "-mwatchos-simulator-version-min=${DEPLOYMENT_TARGET}") + elseif(PLATFORM_INT STREQUAL "MAC") + set(SDK_NAME_VERSION_FLAGS "-mmacosx-version-min=${DEPLOYMENT_TARGET}") + else() + # SIMULATOR or SIMULATOR64 both use -mios-simulator-version-min. + set(SDK_NAME_VERSION_FLAGS "-mios-simulator-version-min=${DEPLOYMENT_TARGET}") + endif() +elseif(NOT PLATFORM_INT MATCHES "^MAC_CATALYST") + # Newer versions of CMake sets the version min flags correctly, skip this for Mac Catalyst targets + set(CMAKE_OSX_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET}) +endif() + +if(DEFINED APPLE_TARGET_TRIPLE_INT) + set(APPLE_TARGET_TRIPLE ${APPLE_TARGET_TRIPLE_INT} CACHE INTERNAL "") + set(CMAKE_C_COMPILER_TARGET ${APPLE_TARGET_TRIPLE}) + set(CMAKE_CXX_COMPILER_TARGET ${APPLE_TARGET_TRIPLE}) + set(CMAKE_ASM_COMPILER_TARGET ${APPLE_TARGET_TRIPLE}) +endif() + +if(PLATFORM_INT MATCHES "^MAC_CATALYST") + set(C_TARGET_FLAGS + "-isystem ${CMAKE_OSX_SYSROOT_INT}/System/iOSSupport/usr/include -iframework ${CMAKE_OSX_SYSROOT_INT}/System/iOSSupport/System/Library/Frameworks" + ) +endif() + +if(ENABLE_BITCODE_INT) + set(BITCODE "-fembed-bitcode") + set(CMAKE_XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE "bitcode") + set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES") +else() + set(BITCODE "") + set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") +endif() + +if(ENABLE_ARC_INT) + set(FOBJC_ARC "-fobjc-arc") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "YES") +else() + set(FOBJC_ARC "-fno-objc-arc") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "NO") +endif() + +if(NOT ENABLE_VISIBILITY_INT) + foreach(lang ${languages}) + set(CMAKE_${lang}_VISIBILITY_PRESET "hidden" CACHE INTERNAL "") + endforeach() + set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN "YES") + set(VISIBILITY "-fvisibility=hidden -fvisibility-inlines-hidden") +else() + foreach(lang ${languages}) + set(CMAKE_${lang}_VISIBILITY_PRESET "default" CACHE INTERNAL "") + endforeach() + set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN "NO") + set(VISIBILITY "-fvisibility=default") +endif() + +if(DEFINED APPLE_TARGET_TRIPLE) + set(APPLE_TARGET_TRIPLE_FLAG "-target ${APPLE_TARGET_TRIPLE}") +endif() + +#Check if Xcode generator is used, since that will handle these flags automagically +if(CMAKE_GENERATOR MATCHES "Xcode") + message(STATUS "Not setting any manual command-line buildflags, since Xcode is selected as generator.") +else() + # Hidden visibility is required for C++ on iOS. + set(CMAKE_C_FLAGS + "${C_TARGET_FLAGS} ${APPLE_TARGET_TRIPLE_FLAG} ${SDK_NAME_VERSION_FLAGS} ${BITCODE} -fobjc-abi-version=2 ${FOBJC_ARC} ${CMAKE_C_FLAGS}" + ) + set(CMAKE_CXX_FLAGS + "${C_TARGET_FLAGS} ${APPLE_TARGET_TRIPLE_FLAG} ${SDK_NAME_VERSION_FLAGS} ${BITCODE} ${VISIBILITY} -fobjc-abi-version=2 ${FOBJC_ARC} ${CMAKE_CXX_FLAGS}" + ) + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -O0 -g ${CMAKE_CXX_FLAGS_DEBUG}") + set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DNDEBUG -Os -ffast-math ${CMAKE_CXX_FLAGS_MINSIZEREL}") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -DNDEBUG -O2 -g -ffast-math ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DNDEBUG -O3 -ffast-math ${CMAKE_CXX_FLAGS_RELEASE}") + set(CMAKE_C_LINK_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}") + set(CMAKE_CXX_LINK_FLAGS + "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}" + ) + set(CMAKE_ASM_FLAGS + "${CMAKE_C_FLAGS} -x assembler-with-cpp -arch ${CMAKE_OSX_ARCHITECTURES} ${APPLE_TARGET_TRIPLE_FLAG}" + ) +endif() + +## Print status messages to inform of the current state +message(STATUS "Configuring ${SDK_NAME} build for platform: ${PLATFORM_INT}, architecture(s): ${ARCHS}") +message(STATUS "Using SDK: ${CMAKE_OSX_SYSROOT_INT}") +message(STATUS "Using C compiler: ${CMAKE_C_COMPILER}") +message(STATUS "Using CXX compiler: ${CMAKE_CXX_COMPILER}") +message(STATUS "Using libtool: ${BUILD_LIBTOOL}") +message(STATUS "Using install name tool: ${CMAKE_INSTALL_NAME_TOOL}") +if(DEFINED APPLE_TARGET_TRIPLE) + message(STATUS "Autoconf target triple: ${APPLE_TARGET_TRIPLE}") +endif() +message(STATUS "Using minimum deployment version: ${DEPLOYMENT_TARGET}" " (SDK version: ${SDK_VERSION})") +if(MODERN_CMAKE) + message(STATUS "Merging integrated CMake 3.14+ iOS,tvOS,watchOS,macOS toolchain(s) with this toolchain!") +endif() +if(CMAKE_GENERATOR MATCHES "Xcode") + message(STATUS "Using Xcode version: ${XCODE_VERSION_INT}") +endif() +message(STATUS "CMake version: ${CMAKE_VERSION}") +if(DEFINED SDK_NAME_VERSION_FLAGS) + message(STATUS "Using version flags: ${SDK_NAME_VERSION_FLAGS}") +endif() +message(STATUS "Using a data_ptr size of: ${CMAKE_CXX_SIZEOF_DATA_PTR}") +if(ENABLE_BITCODE_INT) + message(STATUS "Bitcode: Enabled") +else() + message(STATUS "Bitcode: Disabled") +endif() + +if(ENABLE_ARC_INT) + message(STATUS "ARC: Enabled") +else() + message(STATUS "ARC: Disabled") +endif() + +if(ENABLE_VISIBILITY_INT) + message(STATUS "Hiding symbols: Disabled") +else() + message(STATUS "Hiding symbols: Enabled") +endif() + +# Set global properties +set_property(GLOBAL PROPERTY PLATFORM "${PLATFORM}") +set_property(GLOBAL PROPERTY APPLE_TARGET_TRIPLE "${APPLE_TARGET_TRIPLE_INT}") +set_property(GLOBAL PROPERTY SDK_VERSION "${SDK_VERSION}") +set_property(GLOBAL PROPERTY XCODE_VERSION "${XCODE_VERSION_INT}") +set_property(GLOBAL PROPERTY OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}") + +# Export configurable variables for the try_compile() command. +set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES + PLATFORM + XCODE_VERSION_INT + SDK_VERSION + DEPLOYMENT_TARGET + CMAKE_DEVELOPER_ROOT + CMAKE_OSX_SYSROOT_INT + ENABLE_BITCODE + ENABLE_ARC + CMAKE_ASM_COMPILER + CMAKE_C_COMPILER + CMAKE_C_COMPILER_TARGET + CMAKE_CXX_COMPILER + CMAKE_CXX_COMPILER_TARGET + BUILD_LIBTOOL + CMAKE_INSTALL_NAME_TOOL + CMAKE_C_FLAGS + CMAKE_CXX_FLAGS + CMAKE_CXX_FLAGS_DEBUG + CMAKE_CXX_FLAGS_MINSIZEREL + CMAKE_CXX_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS_RELEASE + CMAKE_C_LINK_FLAGS + CMAKE_CXX_LINK_FLAGS + CMAKE_ASM_FLAGS +) + +set(CMAKE_PLATFORM_HAS_INSTALLNAME 1) +set(CMAKE_SHARED_LINKER_FLAGS "-rpath @executable_path/Frameworks -rpath @loader_path/Frameworks") +set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names") +set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names") +set(CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,") +set(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,") +set(CMAKE_FIND_LIBRARY_SUFFIXES ".tbd" ".dylib" ".so" ".a") +set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name") + +# Set the find root to the SDK developer roots. +# Note: CMAKE_FIND_ROOT_PATH is only useful when cross-compiling. Thus, do not set on macOS builds. +if(NOT PLATFORM_INT STREQUAL "MAC" AND NOT PLATFORM_INT STREQUAL "MAC_ARM64") + list(APPEND CMAKE_FIND_ROOT_PATH "${CMAKE_OSX_SYSROOT_INT}" CACHE INTERNAL "") + set(CMAKE_IGNORE_PATH "/System/Library/Frameworks;/usr/local/lib" CACHE INTERNAL "") +endif() + +# Default to searching for frameworks first. +set(CMAKE_FIND_FRAMEWORK FIRST) + +# Set up the default search directories for frameworks. +if(PLATFORM_INT MATCHES "^MAC_CATALYST") + set(CMAKE_FRAMEWORK_PATH + ${CMAKE_DEVELOPER_ROOT}/Library/PrivateFrameworks ${CMAKE_OSX_SYSROOT_INT}/System/Library/Frameworks + ${CMAKE_OSX_SYSROOT_INT}/System/iOSSupport/System/Library/Frameworks ${CMAKE_FRAMEWORK_PATH} CACHE INTERNAL "" + ) +else() + set(CMAKE_FRAMEWORK_PATH ${CMAKE_DEVELOPER_ROOT}/Library/PrivateFrameworks + ${CMAKE_OSX_SYSROOT_INT}/System/Library/Frameworks ${CMAKE_FRAMEWORK_PATH} CACHE INTERNAL "" + ) +endif() + +# By default, search both the specified iOS SDK and the remainder of the host filesystem. +if(NOT CMAKE_FIND_ROOT_PATH_MODE_PROGRAM) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH CACHE INTERNAL "") +endif() +if(NOT CMAKE_FIND_ROOT_PATH_MODE_LIBRARY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH CACHE INTERNAL "") +endif() +if(NOT CMAKE_FIND_ROOT_PATH_MODE_INCLUDE) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH CACHE INTERNAL "") +endif() +if(NOT CMAKE_FIND_ROOT_PATH_MODE_PACKAGE) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH CACHE INTERNAL "") +endif() + +# +# Some helper-macros below to simplify and beautify the CMakeFile +# + +# This little macro lets you set any Xcode specific property. +macro(set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE XCODE_RELVERSION) + set(XCODE_RELVERSION_I "${XCODE_RELVERSION}") + if(XCODE_RELVERSION_I STREQUAL "All") + set_property(TARGET ${TARGET} PROPERTY XCODE_ATTRIBUTE_${XCODE_PROPERTY} "${XCODE_VALUE}") + else() + set_property( + TARGET ${TARGET} PROPERTY XCODE_ATTRIBUTE_${XCODE_PROPERTY}[variant=${XCODE_RELVERSION_I}] "${XCODE_VALUE}" + ) + endif() +endmacro(set_xcode_property) + +# This macro lets you find executable programs on the host system. +macro(find_host_package) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER) + set(_TOOLCHAIN_IOS ${IOS}) + set(IOS FALSE) + find_package(${ARGN}) + set(IOS ${_TOOLCHAIN_IOS}) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) +endmacro(find_host_package) diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/oss-includes.h.in b/local-test-freerdp-full-01/afc-freerdp/cmake/oss-includes.h.in new file mode 100644 index 0000000000000000000000000000000000000000..f3fb673515f784e939e5d623210289ddeacf4302 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/oss-includes.h.in @@ -0,0 +1,6 @@ +#ifndef OSS_INCLUDES_H_ +#define OSS_INCLUDES_H_ + +#include <@OSS_HDR_NAME@> + +#endif /* OSS_INCLUDES_H_ */ diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/pkg-config-install-prefix.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/pkg-config-install-prefix.cmake new file mode 100644 index 0000000000000000000000000000000000000000..cac331c1dbb6582fba1dfb8a8b501babfaa3f4f2 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/pkg-config-install-prefix.cmake @@ -0,0 +1,13 @@ +option(PKG_CONFIG_RELOCATABLE "Generate relocatable pkg-config files" ON) +if(PKG_CONFIG_RELOCATABLE) + file(RELATIVE_PATH PKG_CONFIG_INSTALL_REL ${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig ${CMAKE_INSTALL_PREFIX}) + if(PKG_CONFIG_INSTALL_REL MATCHES "/$") + string(LENGTH ${PKG_CONFIG_INSTALL_REL} PKG_CONFIG_INSTALL_REL_LEN) + math(EXPR PKG_CONFIG_INSTALL_REL_LEN "${PKG_CONFIG_INSTALL_REL_LEN} - 1") + string(SUBSTRING ${PKG_CONFIG_INSTALL_REL} 0 ${PKG_CONFIG_INSTALL_REL_LEN} PKG_CONFIG_INSTALL_REL) + endif() + set(PKG_CONFIG_INSTALL_PREFIX "\${pcfiledir}/${PKG_CONFIG_INSTALL_REL}") +else() + set(PKG_CONFIG_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) +endif() +set(PKG_CONFIG_PC_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig") diff --git a/local-test-freerdp-full-01/afc-freerdp/cmake/today.cmake b/local-test-freerdp-full-01/afc-freerdp/cmake/today.cmake new file mode 100644 index 0000000000000000000000000000000000000000..09049773089c6055f3b8fd27c1caebad27cd3079 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/cmake/today.cmake @@ -0,0 +1,14 @@ +# This script returns the current date in ISO format +# +# YYYY-MM-DD +# +macro(TODAY RESULT) + if(DEFINED ENV{SOURCE_DATE_EPOCH} AND NOT WIN32) + execute_process( + COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT} + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + else() + string(TIMESTAMP ${RESULT} "%Y-%m-%d" UTC) + endif() +endmacro(TODAY) diff --git a/local-test-freerdp-full-01/afc-freerdp/docs/README.mingw b/local-test-freerdp-full-01/afc-freerdp/docs/README.mingw new file mode 100644 index 0000000000000000000000000000000000000000..4c4c55b748c6949cb682323a59136ee81bac101a --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/docs/README.mingw @@ -0,0 +1,9 @@ +Overview +======== + +More documentation might be found at https://github.com/FreeRDP/FreeRDP/wiki/Compilation + +FreeRDP can be built for Windows using llvm-mingw (https://github.com/mstorsjo/llvm-mingw) with both msvcrt and ucrt. +MinGW builds are not actively maintained at the moment and every once in a while the build process may stop working. Pull requests to maintain MinGW support are always welcome. + +An example build system for LLVM-MinGW can be found here: https://github.com/FreeRDP/FreeRDP/tree/master/docs/mingw-example diff --git a/local-test-freerdp-full-01/afc-freerdp/docs/README.timezones b/local-test-freerdp-full-01/afc-freerdp/docs/README.timezones new file mode 100644 index 0000000000000000000000000000000000000000..ba0f624264dcee646f821f22d2a8261f8034b6b7 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/docs/README.timezones @@ -0,0 +1,43 @@ +## Timezone related options + +* WITH_TIMEZONE_COMPILED Use compiled in mapping extracted with tzextract (default ON) +* WITH_TIMEZONE_FROM_FILE Use JSON file mapping generated with tzextract (default OFF) +* WITH_TIMEZONE_ICU Use ICU to map IANA to windows timezones (default OFF) +* WITH_TIMEZONE_UPDATER Build the tzextract utility (default OFF) + +### Suggested usage + +* WITH_TIMEZONE_COMPILED is suggested for single binary builds (aka fully static) binaries that + can not rely on external files to exist. +* WITH_TIMEZONE_FROM_FILE is suggested for distribution packages as this allows updating timezone + mappings without a necessary recompile of the FreeRDP binaries. Set WITH_TIMEZONE_COMPILED=OFF + in such cases as both options can be used in combination. (entries from file taking preference + over compiled in versions) +* WITH_TIMEZONE_ICU is suggested if the target is already linked against ICU. This eliminates a + required mapping table generated from WindowsZones.xml. This option is only a fallback if the + compiled in or loaded from file mappings do not match any. + +## Keeping timezone mappings up to date + +On an up to date windows machine run the following binary after a build with -DWITH_TIMEZONE_UPDATER=ON (from build directory): + +tzextract \winpr\libwinpr\timezone + +After running the scripts check + * git clang-format -f to eliminate formatting changes + * winpr/libwinpr/timezone/WindowsZones.c +for changes. + +on any machine run the following script from checkout root: + +./scripts/update-windows-zones.py + +After running the scripts check + * git clang-format -f to eliminate formatting changes + * winpr/libwinpr/timezone/WindowsZones.c +for changes. + +Commit if the definitions changed: +1. run `git clang-format -f` on these changed files +2. commit these changes +3. create a pull request at https://github.com/FreeRDP/FreeRDP diff --git a/local-test-freerdp-full-01/afc-freerdp/docs/valgrind.supp b/local-test-freerdp-full-01/afc-freerdp/docs/valgrind.supp new file mode 100644 index 0000000000000000000000000000000000000000..563efe0cc12d242fd6a5b3d95c28132a3f2106dc --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/docs/valgrind.supp @@ -0,0 +1,132 @@ + +{ + ignore glibc getaddrinfo + Memcheck:Param + sendmsg(mmsg[0].msg_hdr) + fun:sendmmsg + fun:__libc_res_nsend + fun:__libc_res_nquery + fun:__libc_res_nsearch + fun:_nss_dns_gethostbyname4_r + fun:gaih_inet + fun:getaddrinfo +} + +{ + ignore pcsc-lite SCardConnect + Memcheck:Param + socketcall.sendto(msg) + fun:send + fun:MessageSend + fun:MessageSendWithHeader + fun:SCardConnect +} + +{ + ignore openssl malloc + Memcheck:Leak + fun:malloc + fun:CRYPTO_malloc + ... + obj:*libcrypto* +} + +{ + ignore openssl realloc + Memcheck:Leak + fun:realloc + fun:CRYPTO_realloc + ... + obj:*libcrypto* +} + +{ + ignore libssl cond + Memcheck:Cond + obj:*libssl* +} + +{ + ignore libssl value + Memcheck:Value4 + obj:*libssl* +} + +{ + ignore ssl3_read_bytes tls1_enc + Memcheck:Cond + fun:tls1_enc + fun:ssl3_read_bytes + obj:*libssl* +} + +{ + ignore ssl3_read_bytes memcpy + Memcheck:Cond + fun:memcpy@@GLIBC_2.14 + fun:ssl3_read_bytes + obj:*libssl* +} + +{ + ignore ssl3_read_bytes value8 + Memcheck:Value8 + fun:memcpy@@GLIBC_2.14 + fun:ssl3_read_bytes + obj:*libssl* +} + +{ + ignore write buf BIO_write + Memcheck:Param + write(buf) + obj:*libpthread* + obj:*libcrypto* + fun:BIO_write + fun:ssl3_write_pending + fun:ssl3_write_bytes +} + +{ + g_type_init + Memcheck:Leak + ... + fun:g_type_init_with_debug_flags +} +{ + gobject_init_ctor + Memcheck:Leak + ... + fun:gobject_init_ctor +} +{ + g_type_register_static + Memcheck:Leak + ... + fun:g_type_register_static +} +{ + g_type_register_fundamental + Memcheck:Leak + ... + fun:g_type_register_fundamental +} +{ + g_type_add_interface_static + Memcheck:Leak + ... + fun:g_type_add_interface_static +} +{ + g_type_class_ref + Memcheck:Leak + ... + fun:g_type_class_ref +} + +{ + XGetDefault + Memcheck:Leak + ... + fun:XGetDefault +} diff --git a/local-test-freerdp-full-01/afc-freerdp/docs/version_detection.md b/local-test-freerdp-full-01/afc-freerdp/docs/version_detection.md new file mode 100644 index 0000000000000000000000000000000000000000..3a00c5d3c0220d4d96dde712b068794984db6ca9 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/docs/version_detection.md @@ -0,0 +1,35 @@ +As FreeRDPs is build on different OS with different build tools and methods the +"version detection" has grown historically. +This document quickly describes how it's currently used. + +When doing a `xfreerdp /version` for example the following is shown + +`This is FreeRDP version 3.0.0-dev (c99c4cecddee4e5b914b122bc1531d47a668bb8e)` + +The first part is the Version as defined in `RAW_VERSION_STRING` and the second part, in braces, +the `GIT_REVISON` of this version. + +`RAW_VERSION_STRING` is very vital as it determines the version used for libraries as well also for +all sub-projects as WinPR. + +As default both variables are equal. + +For nightly or development builds it is often of advantage to have the actual version from git +instead of having the hard coded value set in CMakeLists.txt. For this the cmake variable `USE_VERSION_FROM_GIT_TAG` +can be set. In order for this to work you need a) source checkout and b) git command line utility. +If enabled the information from the last git tag (in the format major.minor.patch-extra like +2.6.0-android12) will be used. + +If you are building FreeRDP and can't use git because it's not available or the source is not in an +git repository - for example when building packages - the files `.source_tag` and `.source_version` +in the top-level source directory can be used. `.source_tag` is equal to `RAW_VERSION_STRING` and +need to contain the version in the same format as the git tag. `.source_version` is used to pre-fill +`GIT_REVISON`. Although mostly used for that it must not contain a git commit or tag - it can be +used to set additional arbitrary information. Our recommendation for packagers is to create +`.source_version` when importing and set it to the upstream commit or tag to simplify issue +tracking. + +As summary the different mechanisms are applied in that order: +* `.source_tag` and `.source_version` if found +* version set from the last git tag if `RAW_VERSION_STRING` is set +* hard coded version in CMakeLists.txt diff --git a/local-test-freerdp-full-01/afc-freerdp/include/CMakeLists.txt b/local-test-freerdp-full-01/afc-freerdp/include/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..7f9a7340a46a8658e93bb01f3dc88831e4e9f836 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/include/CMakeLists.txt @@ -0,0 +1,176 @@ +# FreeRDP: A Remote Desktop Protocol Implementation +# include headers cmake build script +# +# Copyright 2011 O.S. Systems Software Ltda. +# Copyright 2011 Otavio Salvador +# Copyright 2011 Marc-Andre Moreau +# +# 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. + +option(WITH_OPAQUE_SETTINGS "Hide rdpSettings struct definition, only allow getter/setter access" OFF) + +# prepare paths for C +file(TO_NATIVE_PATH "${FREERDP_DATA_PATH}" NATIVE_FREERDP_DATA_PATH) +file(TO_NATIVE_PATH "${FREERDP_KEYMAP_PATH}" NATIVE_FREERDP_KEYMAP_PATH) +file(TO_NATIVE_PATH "${FREERDP_PLUGIN_PATH}" NATIVE_FREERDP_PLUGIN_PATH) +file(TO_NATIVE_PATH "${FREERDP_INSTALL_PREFIX}" NATIVE_FREERDP_INSTALL_PREFIX) +file(TO_NATIVE_PATH "${FREERDP_LIBRARY_PATH}" NATIVE_FREERDP_LIBRARY_PATH) +file(TO_NATIVE_PATH "${FREERDP_ADDIN_PATH}" NATIVE_FREERDP_ADDIN_PATH) +file(TO_NATIVE_PATH "${FREERDP_PROXY_PLUGINDIR}" NATIVE_FREERDP_PROXY_PLUGINDIR) + +if(WIN32) + string(REPLACE "\\" "\\\\" NATIVE_FREERDP_DATA_PATH "${NATIVE_FREERDP_DATA_PATH}") + string(REPLACE "\\" "\\\\" NATIVE_FREERDP_KEYMAP_PATH "${NATIVE_FREERDP_KEYMAP_PATH}") + string(REPLACE "\\" "\\\\" NATIVE_FREERDP_PLUGIN_PATH "${NATIVE_FREERDP_PLUGIN_PATH}") + string(REPLACE "\\" "\\\\" NATIVE_FREERDP_INSTALL_PREFIX "${NATIVE_FREERDP_INSTALL_PREFIX}") + string(REPLACE "\\" "\\\\" NATIVE_FREERDP_LIBRARY_PATH "${NATIVE_FREERDP_LIBRARY_PATH}") + string(REPLACE "\\" "\\\\" NATIVE_FREERDP_ADDIN_PATH "${NATIVE_FREERDP_ADDIN_PATH}") + string(REPLACE "\\" "\\\\" NATIVE_FREERDP_PROXY_PLUGINDIR "${NATIVE_FREERDP_PROXY_PLUGINDIR}") +endif() + +cleaning_configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp/version.h) +cleaning_configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/config/build-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp/build-config.h +) +cleaning_configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp/config.h) +cleaning_configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/config/buildflags.h.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp/buildflags.h +) + +file(STRINGS freerdp/settings_types_private.h SETTINGS_KEYS REGEX "ALIGN64[ \ta-zA-Z0-9]*") + +set(SETTINGS_KEYS_BOOL "") +set(SETTINGS_KEYS_INT16 "") +set(SETTINGS_KEYS_UINT16 "") +set(SETTINGS_KEYS_INT32 "") +set(SETTINGS_KEYS_UINT32 "") +set(SETTINGS_KEYS_INT64 "") +set(SETTINGS_KEYS_UINT64 "") +set(SETTINGS_KEYS_STRING "") +set(SETTINGS_KEYS_POINTER "") + +foreach(KEY ${SETTINGS_KEYS}) + string(STRIP "${KEY}" TRIMMED_KEY) + string(REGEX MATCH "^SETTINGS_DEPRECATED\\(ALIGN64[ \t ]+BOOL[ \t ]+" IS_BOOL "${TRIMMED_KEY}") + string(REGEX MATCH "^SETTINGS_DEPRECATED\\(ALIGN64[ \t ]+INT16[ \t ]+" IS_INT16 "${TRIMMED_KEY}") + string(REGEX MATCH "^SETTINGS_DEPRECATED\\(ALIGN64[ \t ]+UINT16[ \t ]+" IS_UINT16 "${TRIMMED_KEY}") + string(REGEX MATCH "^SETTINGS_DEPRECATED\\(ALIGN64[ \t ]+INT32[ \t ]+" IS_INT32 "${TRIMMED_KEY}") + string(REGEX MATCH "^SETTINGS_DEPRECATED\\(ALIGN64[ \t ]+UINT32[ \t ]+" IS_UINT32 "${TRIMMED_KEY}") + string(REGEX MATCH "^SETTINGS_DEPRECATED\\(ALIGN64[ \t ]+INT64[ \t ]+" IS_INT64 "${TRIMMED_KEY}") + string(REGEX MATCH "^SETTINGS_DEPRECATED\\(ALIGN64[ \t ]+UINT64[ \t ]+" IS_UINT64 "${TRIMMED_KEY}") + string(REGEX MATCH "^SETTINGS_DEPRECATED\\(ALIGN64[ \t ]+(char|CHAR)[ \t ]*\\*[ \t ]+" IS_STRING "${TRIMMED_KEY}") + + string(REGEX REPLACE ".+/\\*" "" index "${TRIMMED_KEY}") + string(REGEX REPLACE "[ \t/\\*]" "" index "${index}") + + if(index MATCHES "^[0-9]+$") + string(REGEX REPLACE "^SETTINGS_DEPRECATED\\(ALIGN64[ \t ]+[a-zA-Z0-9_\\*]+[ \t ]+" "" VALUE ${TRIMMED_KEY}) + string(STRIP "${VALUE}" VALUE) + string(FIND "${VALUE}" ")" SEMICOLON) + string(SUBSTRING "${VALUE}" 0 ${SEMICOLON} KEY_VALUE) + + if(IS_BOOL) + set(KEY_VALUE "FreeRDP_${KEY_VALUE} = ${index}") + list(APPEND SETTINGS_KEYS_BOOL ${KEY_VALUE}) + elseif(IS_INT16) + set(KEY_VALUE "FreeRDP_${KEY_VALUE} = ${index}") + list(APPEND SETTINGS_KEYS_INT16 ${KEY_VALUE}) + elseif(IS_UINT16) + set(KEY_VALUE "FreeRDP_${KEY_VALUE} = ${index}") + list(APPEND SETTINGS_KEYS_UINT16 ${KEY_VALUE}) + elseif(IS_INT32) + set(KEY_VALUE "FreeRDP_${KEY_VALUE} = ${index}") + list(APPEND SETTINGS_KEYS_INT32 ${KEY_VALUE}) + elseif(IS_UINT32) + set(KEY_VALUE "FreeRDP_${KEY_VALUE} = ${index}") + list(APPEND SETTINGS_KEYS_UINT32 ${KEY_VALUE}) + elseif(IS_INT64) + set(KEY_VALUE "FreeRDP_${KEY_VALUE} = ${index}") + list(APPEND SETTINGS_KEYS_INT64 ${KEY_VALUE}) + elseif(IS_UINT64) + set(KEY_VALUE "FreeRDP_${KEY_VALUE} = ${index}") + list(APPEND SETTINGS_KEYS_UINT64 ${KEY_VALUE}) + elseif(IS_STRING) + string(SUBSTRING "${VALUE}" 0 ${SEMICOLON} KEY_VALUE) + set(KEY_VALUE "FreeRDP_${KEY_VALUE} = ${index}") + list(APPEND SETTINGS_KEYS_STRING ${KEY_VALUE}) + else() + set(KEY_VALUE "FreeRDP_${KEY_VALUE} = ${index}") + list(APPEND SETTINGS_KEYS_POINTER ${KEY_VALUE}) + endif() + endif() +endforeach() + +list(APPEND SETTINGS_KEYS_BOOL "FreeRDP_BOOL_UNUSED = -1") +list(APPEND SETTINGS_KEYS_INT16 "FreeRDP_INT16_UNUSED = -1") +list(APPEND SETTINGS_KEYS_UINT16 "FreeRDP_UINT16_UNUSED = -1") +list(APPEND SETTINGS_KEYS_INT32 "FreeRDP_INT32_UNUSED = -1") +list(APPEND SETTINGS_KEYS_UINT32 "FreeRDP_UINT32_UNUSED = -1") +list(APPEND SETTINGS_KEYS_INT64 "FreeRDP_INT64_UNUSED = -1") +list(APPEND SETTINGS_KEYS_UINT64 "FreeRDP_UINT64_UNUSED = -1") +list(APPEND SETTINGS_KEYS_STRING "FreeRDP_STRING_UNUSED = -1") +list(APPEND SETTINGS_KEYS_POINTER "FreeRDP_POINTER_UNUSED = -1") + +string(REPLACE ";" ",\n\t" SETTINGS_KEYS_BOOL "${SETTINGS_KEYS_BOOL}") +string(REPLACE ";" ",\n\t" SETTINGS_KEYS_INT16 "${SETTINGS_KEYS_INT16}") +string(REPLACE ";" ",\n\t" SETTINGS_KEYS_UINT16 "${SETTINGS_KEYS_UINT16}") +string(REPLACE ";" ",\n\t" SETTINGS_KEYS_INT32 "${SETTINGS_KEYS_INT32}") +string(REPLACE ";" ",\n\t" SETTINGS_KEYS_UINT32 "${SETTINGS_KEYS_UINT32}") +string(REPLACE ";" ",\n\t" SETTINGS_KEYS_INT64 "${SETTINGS_KEYS_INT64}") +string(REPLACE ";" ",\n\t" SETTINGS_KEYS_UINT64 "${SETTINGS_KEYS_UINT64}") +string(REPLACE ";" ",\n\t" SETTINGS_KEYS_STRING "${SETTINGS_KEYS_STRING}") +string(REPLACE ";" ",\n\t" SETTINGS_KEYS_POINTER "${SETTINGS_KEYS_POINTER}") + +cleaning_configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/config/settings_keys.h.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp/settings_keys.h +) + +file(GLOB_RECURSE PUBLIC_COMMON_HEADERS LIST_DIRECTORIES false "freerdp/*.h") +file(GLOB_RECURSE PUBLIC_COMMON_BIN_HEADERS LIST_DIRECTORIES false "${CMAKE_CURRENT_BINARY_DIR}/freerdp/*.h") +list(SORT PUBLIC_COMMON_HEADERS) + +if(WITH_SERVER) + set(PUBLIC_SERVER_HEADERS ${PUBLIC_COMMON_HEADERS}) + list(FILTER PUBLIC_SERVER_HEADERS INCLUDE REGEX ".*freerdp/server.*") + + set(PUBLIC_PROXY_HEADERS ${PUBLIC_SERVER_HEADERS}) + list(FILTER PUBLIC_SERVER_HEADERS EXCLUDE REGEX ".*freerdp/server/proxy.*") + list(FILTER PUBLIC_PROXY_HEADERS INCLUDE REGEX ".*freerdp/server/proxy.*") + if(WITH_SERVER) + set_property(TARGET freerdp-server APPEND PROPERTY SOURCES ${PUBLIC_SERVER_HEADERS}) + endif() + if(WITH_PROXY) + set_property(TARGET freerdp-server-proxy APPEND PROPERTY SOURCES ${PUBLIC_PROXY_HEADERS}) + endif() +endif() + +if(WITH_CLIENT_COMMON) + set(PUBLIC_CLIENT_HEADERS ${PUBLIC_COMMON_HEADERS}) + list(FILTER PUBLIC_CLIENT_HEADERS INCLUDE REGEX ".*freerdp/client.*") + set_property(TARGET freerdp-client APPEND PROPERTY SOURCES ${PUBLIC_CLIENT_HEADERS}) +endif() + +if(WITH_SERVER) + list(FILTER PUBLIC_COMMON_HEADERS EXCLUDE REGEX ".*freerdp/server.*") +endif() + +list(FILTER PUBLIC_COMMON_HEADERS EXCLUDE REGEX ".*freerdp/client.*") +list(APPEND PUBLIC_COMMON_HEADERS ${PUBLIC_COMMON_BIN_HEADERS}) +set_property(TARGET freerdp APPEND PROPERTY SOURCES ${PUBLIC_COMMON_HEADERS}) + +add_library(freerdp-headers INTERFACE) +target_sources(freerdp-headers INTERFACE ${PUBLIC_COMMON_HEADERS}) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/freerdp DESTINATION ${FREERDP_INCLUDE_DIR} FILES_MATCHING PATTERN "*.h") + +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/freerdp DESTINATION ${FREERDP_INCLUDE_DIR} FILES_MATCHING PATTERN "*.h") diff --git a/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP-fav.ico b/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP-fav.ico new file mode 100644 index 0000000000000000000000000000000000000000..258c083037b8589305b6b0274a1a5dd5f0fd8e0d Binary files /dev/null and b/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP-fav.ico differ diff --git a/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP_Icon.svg b/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP_Icon.svg new file mode 100644 index 0000000000000000000000000000000000000000..4adae477d95d4f85c0e25e1d046c6b04935127ab --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP_Icon.svg @@ -0,0 +1,120 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP_Icon_256px.h b/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP_Icon_256px.h new file mode 100644 index 0000000000000000000000000000000000000000..44736f3575a25804b1391bda396c996a55300518 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP_Icon_256px.h @@ -0,0 +1,9365 @@ +static unsigned long FreeRDP_Icon_256px_prop[] = { + 256, 256, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 541756835u, 1615498659u, 2152369571u, 2940898723u, 3209334179u, + 3209334179u, 3209334179u, 2940898723u, 2152369571u, 1078627747u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 541756835u, 2152369571u, 3746205091u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 3746205091u, 1883934115u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 541756835u, 2672463267u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 2940898723u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 541756835u, 2672463267u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 2672463267u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2152369571u, 4014640547u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 1078627747u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 810192291u, 3477769635u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 2940898723u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4014640547u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 273321379u, 3209334179u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 810192291u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 810192291u, + 4014640547u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 1078627747u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1615498659u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 1078627747u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 2404027811u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 1078627747u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2672463267u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 1078627747u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 273321379u, 3477769635u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 1078627747u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 273321379u, + 3477769635u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 541756835u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 273321379u, 3477769635u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 273321379u, 3477769635u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 3209334179u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 273321379u, 3477769635u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 2404027811u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 273321379u, 3477769635u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 1615498659u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 273321379u, 3477769635u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 541756835u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 273321379u, 3477769635u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 3477769635u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 273321379u, + 3477769635u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 2404027811u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2940898723u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 810192291u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 2672463267u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 3746205091u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 2404027811u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 2404027811u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1615498659u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 810192291u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 1347063203u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 3746205091u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 810192291u, 4014640547u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 1883934115u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 273321379u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 273321379u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 3477769635u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 2672463267u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2672463267u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 1078627747u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 1883934115u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 3746205091u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1078627747u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 1615498659u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 541756835u, 4014640547u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4014640547u, 273321379u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 3477769635u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 2152369571u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 2672463267u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 273321379u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1615498659u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 2672463267u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 810192291u, 4014640547u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 810192291u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 273321379u, 3477769635u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 3477769635u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2672463267u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 1615498659u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 1615498659u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 273321379u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 541756835u, 4014640547u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 2940898723u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 3477769635u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 1347063203u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2404027811u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 273321379u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 1078627747u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 2940898723u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 273321379u, + 4014640547u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 1615498659u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2940898723u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 541756835u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1615498659u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 3477769635u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 541756835u, 4014640547u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 2404027811u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 3209334179u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 1347063203u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1883934115u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 273321379u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 541756835u, 4014640547u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 3477769635u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 3209334179u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 2404027811u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1883934115u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 1347063203u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 541756835u, 4014640547u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 541756835u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 3209334179u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 3746205091u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 1615498659u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 2940898723u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 273321379u, 4014640547u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 2152369571u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2940898723u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 1078627747u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 1078627747u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 273321379u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 273321379u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4014640547u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 3209334179u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 810192291u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 2404027811u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 3209334179u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 1883934115u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 1615498659u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 1078627747u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 273321379u, 4014640547u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 273321379u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2404027811u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 3211638728u, 3211638728u, 3211638728u, 2154674120u, + 275625928u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 810192291u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283668652u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, 1617803208u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 3209334179u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283800239u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 1349367752u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 1347063203u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4284261046u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4016945096u, 275625928u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 3746205091u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4284392888u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4284788159u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4016945096u, 544061384u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 273321379u, + 4014640547u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4284919745u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 2674767816u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2672463267u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 544061384u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 541756835u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 3211638728u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3209334179u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283536810u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 1080932296u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1078627747u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283668652u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3748509640u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3209334179u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283800239u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1347063203u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283800238u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, + 275625928u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4280836731u, 4284524473u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1615498659u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4280573046u, 4280309360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 1080932296u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4279716967u, 4278597203u, + 4282417045u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3480074184u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1615498659u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4279716967u, 4278597203u, 4278992474u, 4284524473u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1886238664u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4279716967u, + 4278597203u, 4278597203u, 4280309360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4016945096u, 275625928u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1615498659u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4278860632u, 4278597203u, 4278597203u, 4278597203u, + 4283273123u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2674767816u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278992474u, 4284985281u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1080932296u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1615498659u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 3748509640u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4283668395u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1615498659u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279453282u, 4284985281u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4016945096u, 544061384u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4282219924u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 2943203272u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1078627747u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4284129202u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1349367752u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3209334179u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280309360u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 3748509640u, 275625928u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 810192291u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282417045u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2672463267u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278992474u, + 4284985281u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 812496840u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 541756835u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280704632u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 3211638728u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4283668395u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 1617803208u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 3746205091u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279453282u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, 275625928u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 1615498659u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 3209334179u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278992474u, 4284524473u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 1080932296u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 541756835u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280309360u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3480074184u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283668395u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 3746205091u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4279453282u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4016945096u, 544061384u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 1078627747u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282021774u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3211638728u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2672463267u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278992474u, 4284985281u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 1349367752u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 4014640547u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 3748509640u, 275625928u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 1347063203u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4284524473u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2404027811u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4280309360u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 544061384u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 3746205091u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4283668395u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 3211638728u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 810192291u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280309360u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1349367752u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1883934115u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4282219924u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4284129202u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 3748509640u, 275625928u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 2940898723u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 2154674120u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 4014640547u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4284524473u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, 275625928u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 810192291u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1615498659u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279453282u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, + 275625928u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2672463267u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4278860632u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283273123u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1886238664u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 3477769635u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4279716967u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4280704632u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 3748509640u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4279716967u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4284985281u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1080932296u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 1078627747u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4279716967u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 1615498659u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4280309617u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4280704632u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4016945096u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2404027811u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4280836731u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4284985281u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1080932296u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 3209334179u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4280836731u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2406332360u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 3746205091u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281429125u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281165439u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3480074184u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278992474u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1078627747u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4284129202u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 1080932296u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1347063203u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4282812574u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282417045u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1886238664u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2406332360u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2404027811u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4278860632u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279848553u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3211638728u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 3209334179u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4279716967u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 3480074184u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 3477769635u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4279716967u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4284129202u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4280836731u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283668395u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4280836731u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1078627747u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4281956239u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282021774u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1078627747u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4281956239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1347063203u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4280309360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4278860632u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280309360u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4279716967u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4280309360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2404027811u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4280309617u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280309360u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 3209334179u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283207845u, 4283668652u, 4283800239u, 4284261046u, 4284261046u, 4284524474u, 4284788159u, + 4284788159u, 4284788159u, 4284788159u, 4285117123u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4284524473u, 4283668395u, 4283668395u, 4283668395u, 4283668395u, 4282417045u, + 4282021774u, 4282021774u, 4280309360u, 4280309360u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 3211638728u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 3209334179u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283536810u, 4283800239u, + 4284261046u, 4284656316u, 4284919745u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4284985281u, 4283668395u, 4282417045u, 4281560710u, 4280309360u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282021774u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2943203272u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 3209334179u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283207845u, 4283800239u, 4284392888u, + 4284788159u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284129202u, 4282417045u, + 4280704632u, 4278992474u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283207845u, 4283800239u, 4284392888u, + 4285117123u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284129202u, + 4284524473u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1349367752u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283339432u, 4284063667u, + 4284788159u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 544061384u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283536810u, + 4284392888u, 4285117123u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3748509640u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283339432u, 4284063667u, 4284919745u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 541756835u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283800239u, 4284656316u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 1349367752u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 1078627747u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283207845u, 4284261046u, 4285117123u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3748509640u, 1617803208u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 1078627747u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283339432u, 4284524474u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 3748509640u, 1617803208u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1078627747u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283668652u, 4284788159u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 3211638728u, 1080932296u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1078627747u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283668652u, 4284788159u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 2674767816u, 275625928u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1078627747u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283668652u, 4284788159u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, + 1349367752u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 1615498659u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283339432u, + 4284524474u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2943203272u, 275625928u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283207845u, 4284261046u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4016945096u, 1349367752u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283800239u, 4285117123u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2406332360u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283339432u, + 4284788159u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 3480074184u, 275625928u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 2152369571u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4284261046u, 4285248710u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, 812496840u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283536810u, 4284919745u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4016945096u, 1617803208u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 2152369571u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4284063667u, 4285248710u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 1617803208u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283207845u, 4284788159u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 2674767816u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283668652u, 4285248710u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4284261046u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283207845u, 4284656316u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 2674767816u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 2152369571u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283536810u, + 4284919745u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283668652u, 4285248710u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1617803208u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 2152369571u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283932081u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 1080932296u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4284261046u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, + 812496840u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4284524474u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3480074184u, 275625928u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4284524474u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2943203272u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4284524474u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 1886238664u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 2152369571u, 4283076003u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4284524474u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 812496840u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4283076003u, 4284524474u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 3748509640u, 275625928u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 2152369571u, + 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4283076003u, 4284524474u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 2406332360u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, 4283076003u, + 4283076003u, 4284524474u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1080932296u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 2152369571u, 4283076003u, 4283076003u, 4283076003u, 4283932081u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 3748509640u, 275625928u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2152369571u, 4283076003u, 4283076003u, + 4283932081u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 2154674120u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2152369571u, 4283076003u, 4283536810u, 4285248710u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 544061384u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1078627747u, 4283207845u, + 4285248710u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 3211638728u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1078627747u, 4284919745u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 1080932296u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 2406332360u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3748509640u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1617803208u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 1617803208u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 544061384u, 4016945096u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3748509640u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 3480074184u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1617803208u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 2154674120u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 3748509640u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 812496840u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1617803208u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 3480074184u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 3480074184u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2154674120u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 1080932296u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 544061384u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 3211638728u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284985281u, 4282021774u, 4281560710u, + 4280309360u, 4280309360u, 4280309360u, 4280309360u, 4280309360u, 4280309360u, 4280309360u, + 4280309360u, 4282021774u, 4282417045u, 540702606u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 1349367752u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4280704632u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4010161747u, 805713491u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 3748509640u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 3473290835u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2154674120u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4280309360u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 1611019859u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 275625928u, 4016945096u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 3204855379u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2154674120u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4281165439u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 268842579u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 275625928u, 4016945096u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4282812316u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 1342584403u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2154674120u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4278992474u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 2147890771u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 275625928u, 4016945096u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4283273123u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 2667984467u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2154674120u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4284985281u, 4283668395u, 4282812316u, 4282021774u, 4282021774u, 4282021774u, 4282021774u, + 4282021774u, 4282021774u, 4282021774u, 4282812316u, 4283668395u, 4284985281u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4282021774u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 3204855379u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 3748509640u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4284985281u, 4282812316u, 4281165439u, 4279453282u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278992474u, 4280704632u, 4282417045u, 4284524473u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284524473u, 4281165439u, + 4279453282u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278992474u, 2402578311u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 1617803208u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4284985281u, 4282812316u, 4280309360u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279848553u, 4282417045u, 4284985281u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284985281u, 4283668395u, + 4283273123u, 4282021774u, 4282021774u, 4282021774u, 4282021774u, 4283668395u, 4284129202u, + 4285380552u, 3748509640u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 3211638728u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4284524473u, 4282021774u, 4278992474u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281165439u, 4284524473u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 544061384u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 544061384u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284985281u, 4282021774u, + 4278992474u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4281165439u, 4284524473u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 1886238664u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2406332360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4283273123u, 4278992474u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278992474u, 4282021774u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 2943203272u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 4016945096u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4284985281u, 4280704632u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4279848553u, 4284524473u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4016945096u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 1349367752u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284129202u, + 4278992474u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278992474u, 4283273123u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 812496840u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 2674767816u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4282812316u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1617803208u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 4016945096u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4282812316u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282673278u, 4282673278u, 4284711316u, 4286815145u, + 4286815145u, 4283725193u, 4282673278u, 4282673278u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1349367752u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4282812316u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4279649118u, 4284711316u, 4288853183u, 4292929258u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4292929258u, 4288853183u, 4284711316u, 4279649118u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 3480074184u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 2674767816u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4282812316u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283725193u, 4289839305u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4289839305u, 4282673278u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281560710u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 3748509640u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4283668395u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4284711316u, + 4292929258u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967033u, 4294901234u, + 4294900973u, 4294900972u, 4292863195u, 4284711052u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 1080932296u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 812496840u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4284985281u, 4278992474u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4281687155u, 4290891220u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294901235u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4291876815u, 4280635239u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4284129202u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1886238664u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1886238664u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4280309360u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4285763230u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967031u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4293914854u, + 4285763230u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279453282u, 4284985281u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2674767816u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 2943203272u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4282417045u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, + 4289839305u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294900974u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294967033u, 4288853183u, 4279649118u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4281560710u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 3211638728u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 4016945096u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284524473u, + 4278992474u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4279649118u, 4291877343u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4288853183u, 4283724934u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294901235u, 4294967295u, 4291877343u, 4279649118u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4283668395u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 812496840u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4281165439u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, 4291877343u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4292929258u, 4282673278u, + 4278597203u, 4282673273u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4291876817u, 4288853183u, + 4294967295u, 4291877343u, 4279649118u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279848553u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 544061384u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 1617803208u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284524473u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4279649118u, 4291877343u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4291877343u, 4279649118u, 4278597203u, 4278597203u, 4280635238u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4290825158u, 4278597203u, 4284711316u, 4294967295u, 4291877343u, + 4279649118u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1080932296u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2674767816u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4281165439u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4289839305u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4291877343u, 4279649118u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4291876815u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4287800745u, + 4278597203u, 4278597203u, 4284711316u, 4294967295u, 4288853183u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4279453282u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 3211638728u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284524473u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4285763230u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4293915380u, 4279649118u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4283724931u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4280635238u, 4278597203u, 4278597203u, 4278597203u, + 4288853183u, 4294967295u, 4285763230u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283668395u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 2674767816u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4282021774u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281687155u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4284711316u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4286749088u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4284711052u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, 4293915380u, 4293915380u, + 4280635241u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4280704632u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3211638728u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 812496840u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4279453282u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4290891220u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4292929258u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4283724931u, 4291876815u, 4294900972u, 4294900972u, + 4294900972u, 4290825158u, 4282673273u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4285763230u, 4294967295u, 4290891220u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4284985281u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4016945096u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1080932296u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4284129202u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283725193u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4285763230u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282673273u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, + 4294967295u, 4294967295u, 4282673278u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 2154674120u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4282021774u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4291877343u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4280635241u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4290891220u, 4294967295u, 4290891220u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4280704632u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 1080932296u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 2406332360u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282673278u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4293915380u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4286815145u, 4294967295u, 4294967295u, 4282673278u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278992474u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 1617803208u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3211638728u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4288853183u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4290891220u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4284711316u, 4294967295u, + 4294967295u, 4288853183u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4284129202u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 3211638728u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4283668395u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4290891220u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282673278u, 4294967295u, 4294967295u, 4293915380u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4282812316u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 2674767816u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4282812316u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4283725193u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4290891220u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283725193u, + 4294967295u, 4294967295u, 4294967295u, 4283725193u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3211638728u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4282021774u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4287801268u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4291877343u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4286815145u, 4294967295u, 4294967295u, 4294967295u, + 4287801268u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4280309360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4016945096u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4281560710u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4291877343u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4279649118u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4288853183u, 4294967295u, 4294967295u, 4294967295u, 4290891220u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280309360u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 1080932296u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4283725193u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4292929258u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4280309360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 812496840u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1080932296u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4280309360u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4280635241u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4288853183u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4282673278u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278992474u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 1080932296u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1080932296u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4280309360u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282673278u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4280635241u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4290891220u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4282673278u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1617803208u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1080932296u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282673278u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4290891220u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4283725193u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4282673278u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278992474u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 1080932296u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4280309360u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4282673278u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4285763230u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4280635241u, 4293915380u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4282673278u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280309360u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 1080932296u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4281560710u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282673278u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4284711316u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, + 4291877343u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4282673278u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4280309360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 3211638728u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 1080932296u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4282021774u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4282673278u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4286815145u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4281687155u, 4293915380u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4282673278u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280704632u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 3211638728u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 1080932296u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4282812316u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282673278u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4291877343u, + 4282673278u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, 4287801268u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4280635241u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3748509640u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1080932296u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4283668395u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4291877343u, 4285763230u, + 4281687155u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280635241u, 4283725193u, + 4288853183u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282812316u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1080932296u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4292929258u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4291877343u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4284129202u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 1080932296u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4289839305u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4288853183u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278992474u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4283668395u, 4283668395u, 4282021774u, 4282021774u, + 4282021774u, 4282021774u, 4282021774u, 4282021774u, 4282021774u, 4282021774u, 4282021774u, + 4282417045u, 4283668395u, 4283668395u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 544061384u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 1080932296u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4282021774u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4285763230u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4284711316u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4280704632u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4284524473u, 4282812316u, 4281165439u, 4279848553u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4280635238u, 4282673273u, 4286749088u, 4286749088u, + 4286749088u, 4286749088u, 4285762966u, 4282673273u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4279453282u, 4281165439u, 4284985281u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 1080932296u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 812496840u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284129202u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280635241u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4280635241u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4282812316u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4284985281u, 4282417045u, 4279848553u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279648861u, 4286749088u, 4292862937u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4293914850u, 4287800745u, 4279648861u, 4278597203u, 4278597203u, 4278597203u, + 4279848553u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1080932296u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4279453282u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4291877343u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4291877343u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4284985281u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284524473u, 4281165439u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4281686896u, 4293914850u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4289838780u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283273123u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 1080932296u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4282021774u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4285763230u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4284711316u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4284524473u, 4281165439u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4292862937u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4290825158u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282021774u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 1617803208u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 4016945096u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284524473u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, 4293915380u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4293915380u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283668395u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4282021774u, 4278992474u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4292862937u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4293914850u, 4283724931u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282812316u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 3211638728u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4281165439u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4286815145u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4286815145u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4279848553u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284524473u, 4280309360u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281686896u, 4291876815u, + 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, 4294900972u, + 4294900972u, 4294900972u, 4293914850u, 4288787123u, 4280635238u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4284524473u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 3211638728u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4284524473u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, + 4293915380u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4292929258u, 4279649118u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4284129202u, 4278992474u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281686896u, 4285762966u, 4287800745u, + 4290825158u, 4290825158u, 4290825158u, 4287800745u, 4286749088u, 4282673273u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279848553u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 2154674120u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4281165439u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4284711316u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4283725193u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4280309360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4282812316u, 4278992474u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 2154674120u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2154674120u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4284985281u, 4278992474u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4290891220u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4289839305u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4283668395u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4284129202u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281165439u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1080932296u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4282417045u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279649118u, + 4293915380u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4292929258u, + 4279649118u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4281560710u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4284524473u, 4278992474u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4279848553u, 4284985281u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 812496840u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281687155u, 4293915380u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4293915380u, 4281687155u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4279453282u, 4284985281u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4281560710u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279848553u, 4284985281u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2943203272u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4284985281u, 4278992474u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4284711316u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4283725193u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4284129202u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4279848553u, 4284985281u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 3211638728u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 3480074184u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4284129202u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4284711316u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4284711316u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4280309360u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4279453282u, 4284985281u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 3211638728u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2674767816u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4282812316u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282673278u, 4293915380u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4293915380u, 4281687155u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281560710u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4280309360u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278992474u, 4284129202u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 3211638728u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1886238664u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4282812316u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4281687155u, 4291877343u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4291877343u, 4280635241u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4281165439u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4282021774u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278992474u, 4284129202u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 3211638728u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 1080932296u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4282812316u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4286815145u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4286815145u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4281165439u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4280309360u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278992474u, + 4284129202u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2406332360u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4282812316u, + 4278992474u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4281687155u, 4290891220u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4290891220u, 4280635241u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4282417045u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4282812316u, 4279453282u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4283668395u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 3480074184u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284129202u, 4279453282u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282673278u, + 4289839305u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4288853183u, 4282673278u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278992474u, 4283273123u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284129202u, 4281165439u, 4278992474u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282812316u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 2406332360u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4284985281u, 4280704632u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280635241u, 4285763230u, + 4290891220u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, 4294967295u, + 4294967295u, 4290891220u, 4285763230u, 4279649118u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4280309360u, + 4284524473u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4283273123u, 4281165439u, 4278992474u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4282812316u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 2154674120u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 1617803208u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4283273123u, 4279453282u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282673278u, + 4285763230u, 4287801268u, 4290891220u, 4290891220u, 4290891220u, 4290891220u, 4290891220u, + 4290891220u, 4286815145u, 4285763230u, 4282673278u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278992474u, 4282417045u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4284129202u, 4281560710u, 4279453282u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, + 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4278597203u, 4282812316u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, + 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 4285380552u, 2154674120u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u, 0u, 0u, 0u, + 0u, 0u, 0u, 0u +}; diff --git a/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP_Icon_96px.ico b/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP_Icon_96px.ico new file mode 100644 index 0000000000000000000000000000000000000000..21e095fe9795148f88cdf4e45acbc23706072eef Binary files /dev/null and b/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP_Icon_96px.ico differ diff --git a/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP_Logo.svg b/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP_Logo.svg new file mode 100644 index 0000000000000000000000000000000000000000..46685bb3f8ee6a8f6125784c99bad70d709dec73 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP_Logo.svg @@ -0,0 +1,157 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP_OSX.icns b/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP_OSX.icns new file mode 100644 index 0000000000000000000000000000000000000000..88bd44ca05621268824d56bc4e14371c27402c52 Binary files /dev/null and b/local-test-freerdp-full-01/afc-freerdp/resources/FreeRDP_OSX.icns differ diff --git a/local-test-freerdp-full-01/afc-freerdp/resources/conv_to_ewm_prop.py b/local-test-freerdp-full-01/afc-freerdp/resources/conv_to_ewm_prop.py new file mode 100644 index 0000000000000000000000000000000000000000..292c0e32e680c1b80c0a05b5e313fcf8d3a0a11a --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/resources/conv_to_ewm_prop.py @@ -0,0 +1,64 @@ +#!/usr/bin/python + +# Copyright 2011 Anthony Tong + +# 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. + +""" +tool to preconvert an icon file to a x11 property as expected +by ewm hints spec: +width, length, [argb pixels] +""" + +import PIL +import PIL.Image + +import os +import sys + +def usage(): + print "convert_to_ewm_prop " + return 1 + +def main(argv): + if len(argv) != 3: + return usage() + + im = PIL.Image.open(argv[1]) + fp = open(argv[2], 'w') + + var_name = os.path.basename(argv[2]) + if var_name.endswith('.h'): + var_name = var_name[:-2] + + fp.write("static unsigned long %s_prop [] = {\n" % var_name) + fp.write(" %d, %d\n" % im.size) + + i = 0 + for pixel in im.getdata(): + r,g,b,a = pixel + pixel = b + pixel |= g << 8 + pixel |= r << 16 + pixel |= a << 24 + fp.write(" , %du" % pixel) + + i += 1 + if i % 8 == 0: + fp.write("\n") + + fp.write("};\n") + +if __name__ == '__main__': + sys.exit(main(sys.argv)) + diff --git a/local-test-freerdp-full-01/afc-freerdp/resources/freerdp-file.desktop.template b/local-test-freerdp-full-01/afc-freerdp/resources/freerdp-file.desktop.template new file mode 100644 index 0000000000000000000000000000000000000000..066e1cdc76e6ab5e0514c15475249b0718c50012 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/resources/freerdp-file.desktop.template @@ -0,0 +1,16 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=@FREERDP_APP_NAME@ +Comment=Access remote desktops with FreeRDP +Categories=GTK;GNOME;X-GNOME-NetworkSettings;Network; +Keywords=remote desktop;rdp; +TryExec=@FREERDP_BIN_NAME@ +Exec=@FREERDP_BIN_NAME@ %U +Icon=FreeRDP +MimeType=x-scheme-handler/rdp; +Actions=Edit; +Terminal=true +StartupNotify=true +NoDisplay=true +X-Desktop-File-Install-Version=0.24 diff --git a/local-test-freerdp-full-01/afc-freerdp/resources/icon_error.svg b/local-test-freerdp-full-01/afc-freerdp/resources/icon_error.svg new file mode 100644 index 0000000000000000000000000000000000000000..8935e67e6daafb2ec4dbb1432ab43499b091218b --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/resources/icon_error.svg @@ -0,0 +1 @@ + diff --git a/local-test-freerdp-full-01/afc-freerdp/server/CMakeLists.txt b/local-test-freerdp-full-01/afc-freerdp/server/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..f40d95d17aa48fe3af34765631da5a6be79f5f9e --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/server/CMakeLists.txt @@ -0,0 +1,103 @@ +# FreeRDP: A Remote Desktop Protocol Implementation +# FreeRDP Servers +# +# Copyright 2012 Marc-Andre Moreau +# +# 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. + +# Servers +option(WITH_SHADOW "Compile with shadow server" ON) +option(WITH_PROXY "Compile with proxy server" ON) +option(WITH_PLATFORM_SERVER "Compile with platform server" ON) + +add_subdirectory(common) +if(WITH_SHADOW) + add_subdirectory(shadow) +endif() +if(WITH_PROXY) + add_subdirectory(proxy) +endif() + +if(WITH_SAMPLE) + add_subdirectory(Sample) +endif() + +if(WITH_PLATFORM_SERVER) + if(NOT WIN32) + if(APPLE AND (NOT IOS)) + add_subdirectory(Mac) + endif() + else() + add_subdirectory(Windows) + endif() + + if(NOT DEFINED WITH_FREERDS) + set(WITH_FREERDS 1) + endif() + + if(WITH_FREERDS AND (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/FreeRDS")) + add_subdirectory("FreeRDS") + endif() +endif() + +# Pick up other servers + +set(FILENAME "ModuleOptions.cmake") +file(GLOB FILEPATHS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/${FILENAME}") + +foreach(FILEPATH ${FILEPATHS}) + if(${FILEPATH} MATCHES "^([^/]*)/+${FILENAME}") + string(REGEX REPLACE "^([^/]*)/+${FILENAME}" "\\1" FREERDP_SERVER ${FILEPATH}) + set(FREERDP_SERVER_ENABLED 0) + include(${FILEPATH}) + if(FREERDP_SERVER_ENABLED) + if(NOT (${FREERDP_SERVER_VENDOR} MATCHES "FreeRDP")) + list(APPEND FREERDP_EXTRA_SERVERS ${FREERDP_SERVER}) + endif() + endif() + endif() +endforeach() + +foreach(FREERDP_SERVER ${FREERDP_EXTRA_SERVERS}) + add_subdirectory(${FREERDP_SERVER}) +endforeach() + +include(pkg-config-install-prefix) +cleaning_configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/freerdp-server.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/freerdp-server${FREERDP_VERSION_MAJOR}.pc @ONLY +) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp-server${FREERDP_VERSION_MAJOR}.pc + DESTINATION ${PKG_CONFIG_PC_INSTALL_DIR} +) + +export(PACKAGE freerdp-server) + +setfreerdpcmakeinstalldir(FREERDP_SERVER_CMAKE_INSTALL_DIR "FreeRDP-Server${FREERDP_VERSION_MAJOR}") + +configure_package_config_file( + FreeRDP-ServerConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfig.cmake + INSTALL_DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR} PATH_VARS FREERDP_INCLUDE_DIR +) + +write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfigVersion.cmake VERSION ${FREERDP_VERSION} + COMPATIBILITY SameMajorVersion +) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfigVersion.cmake + DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR} +) + +install(EXPORT FreeRDP-ServerTargets DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR}) diff --git a/local-test-freerdp-full-01/afc-freerdp/server/FreeRDP-ServerConfig.cmake.in b/local-test-freerdp-full-01/afc-freerdp/server/FreeRDP-ServerConfig.cmake.in new file mode 100644 index 0000000000000000000000000000000000000000..db7cb445e1ce35e672d7e530217a4be70a50d45e --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/server/FreeRDP-ServerConfig.cmake.in @@ -0,0 +1,13 @@ +include(CMakeFindDependencyMacro) +find_dependency(WinPR @FREERDP_VERSION@) +find_dependency(FreeRDP @FREERDP_VERSION@) + +@PACKAGE_INIT@ + +set(FreeRDP-Server_VERSION_MAJOR "@FREERDP_VERSION_MAJOR@") +set(FreeRDP-Server_VERSION_MINOR "@FREERDP_VERSION_MINOR@") +set(FreeRDP-Server_VERSION_REVISION "@FREERDP_VERSION_REVISION@") + +set_and_check(FreeRDP-Server_INCLUDE_DIR "@PACKAGE_FREERDP_INCLUDE_DIR@") + +include("${CMAKE_CURRENT_LIST_DIR}/FreeRDP-ServerTargets.cmake") diff --git a/local-test-freerdp-full-01/afc-freerdp/server/freerdp-server.pc.in b/local-test-freerdp-full-01/afc-freerdp/server/freerdp-server.pc.in new file mode 100644 index 0000000000000000000000000000000000000000..d7d662966f16ab3b5c345299a5ced4987ea4b7af --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/server/freerdp-server.pc.in @@ -0,0 +1,15 @@ +prefix=@PKG_CONFIG_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@FREERDP_INCLUDE_DIR@ +libs=-lfreerdp-server@FREERDP_API_VERSION@ + +Name: FreeRDP server +Description: FreeRDP: A Remote Desktop Protocol Implementation +URL: http://www.freerdp.com/ +Version: @FREERDP_VERSION@ +Requires: +Requires.private: @WINPR_PKG_CONFIG_FILENAME@ freerdp@FREERDP_VERSION_MAJOR@ +Libs: -L${libdir} ${libs} +Libs.private: -ldl -lpthread +Cflags: -I${includedir} diff --git a/local-test-freerdp-full-01/afc-freerdp/tools/build-clang.sh b/local-test-freerdp-full-01/afc-freerdp/tools/build-clang.sh new file mode 100644 index 0000000000000000000000000000000000000000..9f83cf58b2a8694491efa9ed7ccec57119f84066 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/tools/build-clang.sh @@ -0,0 +1,30 @@ +#!/bin/bash -xe +SCRIPT_PATH=$(dirname "${BASH_SOURCE[0]}") +SCRIPT_PATH=$(realpath "$SCRIPT_PATH") + +WARN_FLAGS="-Weverything -Wno-padded -Wno-assign-enum -Wno-switch-enum \ + -Wno-declaration-after-statement -Wno-c++98-compat -Wno-c++98-compat-pedantic \ + -Wno-cast-align -Wno-covered-switch-default -Wno-documentation-unknown-command \ + -Wno-documentation -Wno-documentation-html" + +cmake \ + -GNinja \ + -DCMAKE_TOOLCHAIN_FILE="$SCRIPT_PATH/../cmake/ClangToolchain.cmake" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_FIND_LIBRARY_SUFFIXES=".a;.so" \ + -DBUILD_SHARED_LIBS=OFF \ + -Bclang \ + -S"$SCRIPT_PATH/.." \ + -DCMAKE_INSTALL_PREFIX=/tmp/xxx \ + -DWITH_SERVER=ON \ + -DWITH_SAMPLE=ON \ + -DWITH_CAIRO=ON \ + -DWITH_FFMPEG=ON \ + -DWITH_DSP_FFMPEG=ON \ + -DWITH_PKCS11=ON \ + -DWITH_SOZR=ON \ + -DWITH_WAYLAND=ON \ + -DWITH_WEBVIEW=ON \ + -DWITH_SWSCALE=ON \ + -DCMAKE_C_FLAGS="$WARN_FLAGS" \ + -DCMAKE_CXX_FLAGS="$WARN_FLAGS" diff --git a/local-test-freerdp-full-01/afc-freerdp/tools/smartcard-interpreter.py b/local-test-freerdp-full-01/afc-freerdp/tools/smartcard-interpreter.py new file mode 100644 index 0000000000000000000000000000000000000000..5946deb2812ffeaf9440b125940489d25eb6214a --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/tools/smartcard-interpreter.py @@ -0,0 +1,726 @@ +#!/usr/bin/env python3 +# +# Copyright 2022 David Fort +# +# This script is meant to parse some FreeRDP logs in DEBUG mode (WLOG_LEVEL=DEBUG) and interpret the +# smartcard traffic, dissecting the PIV or GIDS commands +# +# usage: +# * live: WLOG_LEVEL=DEBUG xfreerdp | python3 smartcard-interpreter.py +# * on an existing log file: python3 smartcard-interpreter.py +# +import sys +import codecs + + +CMD_NAMES = { + 0x04: "DEACTIVATE FILE", + 0x0C: "ERASE RECORD", + 0x0E: "ERASE BINARY", + 0x0F: "ERASE BINARY", + 0x20: "VERIFY", + 0x21: "VERIFY", + 0x22: "MSE", + 0x24: "CHANGE REFERENCE DATA", + 0x25: "MSE", + 0x26: "DISABLE VERIFICATION REQUIREMENT", + 0x28: "ENABLE VERIFICATION REQUIREMENT", + 0x2A: "PSO", + 0x2C: "RESET RETRY COUNTER", + 0x2D: "RESET RETRY COUNTER", + 0x44: "ACTIVATE FILE", + 0x46: "GENERATE ASYMMETRIC KEY PAIR", + 0x47: "GENERATE ASYMMETRIC KEY PAIR", + 0x84: "GET CHALLENGE", + 0x86: "GENERAL AUTHENTICATE", + 0x87: "GENERAL AUTHENTICATE", + 0x88: "INTERNAL AUTHENTICATE", + 0xA0: "SEARCH BINARY", + 0xA1: "SEARCH BINARY", + 0xA2: "SEARCH RECORD", + 0xA4: "SELECT", + 0xB0: "READ BINARY", + 0xB1: "READ BINARY", + 0xB2: "READ RECORD", + 0xB3: "READ RECORD", + 0xC0: "GET RESPONSE", + 0xC2: "ENVELOPE", + 0xC3: "ENVELOPE", + 0xCA: "GET DATA", + 0xCB: "GET DATA", + 0xD0: "WRITE BINARY", + 0xD1: "WRITE BINARY", + 0xD2: "WRITE RECORD", + 0xD6: "UPDATE BINARY", + 0xD7: "UPDATE BINARY", + 0xDA: "PUT DATA", + 0xDB: "PUT DATA", + 0xDC: "UPDATE RECORD", + 0xDD: "UPDATE RECORD", + 0xE0: "CREATE FILE", + 0xE2: "APPEND RECORD", + 0xE4: "DELETE FILE", + 0xE6: "TERMINATE DF", + 0xE8: "TERMINATE EF", + 0xFE: "TERMINATE CARD USAGE", +} + +AIDs = { + "a00000039742544659": "MsGidsAID", + "a000000308": "PIV", + "a0000003974349445f0100": "SC PNP", + "a0000001510000": "GPC", +} + +FIDs = { + 0x0000: "Current EF", + 0x2F00: "EF.DIR", + 0x2F01: "EF.ATR", + 0x3FFF: "Current application(ADF)", +} + +DOs = { + "df1f": "DO_FILESYSTEMTABLE", + "df20": "DO_CARDID", + "df21": "DO_CARDAPPS", + "df22": "DO_CARDCF", + "df23": "DO_CMAPFILE", + "df24": "DO_KXC00", +} + +ERROR_CODES = { + 0x9000: "success", + 0x6100: "more bytes", + 0x6282: "end of file or record", + 0x6283: "card locked", + 0x63C0: "warning counter 0", + 0x63C1: "warning counter 1", + 0x63C2: "warning counter 2", + 0x63C3: "warning counter 3", + 0x63C4: "warning counter 4", + 0x63C5: "warning counter 5", + 0x63C6: "warning counter 6", + 0x63C7: "warning counter 7", + 0x63C8: "warning counter 8", + 0x63C9: "warning counter 9", + 0x6982: "security status not satisfied", + 0x6882: "Secure messaging not supported", + 0x6985: "condition of use not satisfied", + 0x6A80: "incorrect parameter cmd data field", + 0x6A81: "function not supported", + 0x6A82: "file or application not found", + 0x6A83: "record not found", + 0x6A88: "REFERENCE DATA NOT FOUND", + 0x6D00: "unsupported", +} + +PIV_OIDs = { + "5fc101": "X.509 Certificate for Card Authentication", + "5fc102": "Card Holder Unique Identifier", + "5fc103": "Cardholder Fingerprints", + "5fc105": "X.509 Certificate for PIV Authentication", + "5fc106": "Security Object", + "5fc107": "Card Capability Container", + "5fc108": "Cardholder Facial Image", + "5fc10a": "X.509 Certificate for Digital Signature", + "5fc10b": "X.509 Certificate for Key Management", + "5fc10d": "Retired X.509 Certificate for Key Management 1", + "5fc10e": "Retired X.509 Certificate for Key Management 2", + "5fc10f": "Retired X.509 Certificate for Key Management 3", +} + +class ApplicationDummy(object): + """Base application""" + + def __init__(self, aid): + self.aid = aid + + def getAID(self): + return self.aid + + def selectResult(self, fci, status, body): + return 'selectResult(fci=%s, status=0x%x) = %s\n' %(fci, status, body.hex()) + + def getData(self, fileId, bytes): + return 'getData(status=0x%x) = %s\n' %(fileId, bytes.hex()) + + def getDataResult(self, status, body): + return 'getDataResult(status=0x%x) = %s\n' %(status, body.hex()) + + def mse(self, body): + return body.hex() + + def mseResult(self, status, body): + return body.hex() + + def pso(self, body): + return body.hex() + + def psoResult(self, status, body): + return body.hex() + + def getResponse(self, status, body): + return body.hex() + + def getResponseResult(self, status, body): + return body.hex() + + def verify(self, status, body): + return "verify(%s)" % body.hex() + + def verifyResult(self, status, body): + return "verify(%s)" % body.hex() + + +''' +''' +class ApplicationGpc(object): + """GlobalPlatform application""" + + def __init__(self, aid): + self.aid = aid + self.lastGetData = None + + def getAID(self): + return self.aid + + def selectResult(self, fci, status, body): + return 'selectResult(fci=%s, status=0x%x) = %s\n' %(fci, status, body.hex()) + + def getData(self, fileId, bytes): + tags = { + 0x42: 'Issuer Identification Number', + 0x45: 'Card Image Number', + 0x66: 'Card Data', + 0x67: 'Card Capability Information' # ??? + } + self.lastGetData = fileId + return 'getData(%s)\n' % tags.get(fileId, '' % fileId) + + def getDataResult(self, status, body): + if self.lastGetData == 0x66: + # Card Data + pass + return 'getDataResult(0x%x) = %s\n' %(status, body.hex()) + + def mse(self, body): + return body.hex() + + def mseResult(self, status, body): + return body.hex() + + def pso(self, body): + return body.hex() + + def psoResult(self, status, body): + return body.hex() + + def getResponse(self, status, body): + return body.hex() + + def getResponseResult(self, status, body): + return body.hex() + + +class ApplicationPIV(object): + """PIV application""" + + def __init__(self, aid): + self.lastGet = None + self.aid = aid + + def getAID(self): + return self.aid + + def selectResult(self, selectT, status, body): + ret = '' + appTag = body[0] + appLen = body[1] + + body = body[2:2+appLen] + while len(body) > 2: + tag = body[0] + tagLen = body[1] + if tagLen != 1: + pass + if selectT == "FCI": + if tag == 0x4f: + ret += "\tpiv version: %s\n" % body[2:2 + tagLen].hex() + elif tag == 0x79: + subBody = body[2:2 + tagLen] + + subTag = subBody[0] + subLen = subBody[1] + + content = subBody.hex() + if subTag == 0x4f: + v = content[4:] + if v.startswith('a000000308'): + content = 'NIST RID' + ret += '\tCoexistent tag allocation authority: %s\n' % content + + elif tag == 0x50: + ret += '\tapplication label: %s\n' % body[2:2+tagLen].decode('utf8') + elif tag == 0xac: + ret += '\tCryptographic algorithms supported: %s\n' % body[2:2+tagLen].hex() + else: + rety += '\tunknown tag 0x%x\n' % tag + + else: + ret += "\tTODO: selectType %s\n" % selectT + + body = body[2+tagLen:] + + return ret + + def getData(self, fileId, bytes): + ret = "\tfileId=%s(%0.4x)\n" % (FIDs.get(fileId, ""), fileId) + + if len(bytes) < 7: + return ret + "\t/!\\ too short !!!!" + + lc = bytes[4] + tag = bytes[5] + tagLen = bytes[6] + + if lc == 4: + ret += "\tdoId=%0.4x\n"% (bytes[7] * 256 + bytes[8]) + + elif lc == 0xa: + keyStr = '' + # TLV + i = 7 + tag = bytes[i] + tagLen = bytes[i+1] + keyRef = bytes[i+3] + keyStr = "key(tag=0x%x len=%d ref=0x%x)=" % (tag, tagLen, keyRef) + i = i + 2 + tagLen + + tag = bytes[i] + tagLen = bytes[i+1] + keyStr += "value(tag=0x%x len=%d)" + elif lc == 3: + ret += "\tDiscovery Object\n" + elif lc == 4: + ret += "\tBiometric Information Templates (BIT) Group Template\n" + elif lc == 5: + if tag == 0x5C: + tagStr = bytes[7:10].hex() + ret += '\ttag: %s(%s)\n' % (tagStr, PIV_OIDs.get(tagStr, '')) + self.lastGet = tagStr + else: + ret += "\tunknown key access(lc=0x%x)\n" % lc + + return ret + + def getDataResult(self, status, body): + ret = '' + if not len(body): + return '' + appTag = body[0] + appLen = body[1] + + body = body[2:2+appLen] + while len(body) > 2: + tag = body[0] + tagLen = body[1] + tagBody = body[2:2+tagLen] + + if self.lastGet in ('5fc102',): + # Card holder Unique Identifier + if tag == 0x30: + ret += '\tFASC-N: %s\n' % tagBody.hex() + elif tag == 0x34: + ret += '\tGUID: %s\n' % tagBody.hex() + elif tag == 0x35: + ret += '\texpirationDate: %s\n' % tagBody.decode('utf8') + elif tag == 0x3e: + ret += '\tIssuer Asymmetric Signature: %s\n' % tagBody.hex() + else: + ret += "\tunknown tag=0x%x len=%d content=%s\n" % (tag, tagLen, tagBody.hex()) + + elif self.lastGet in ('5fc107',): + # Card Capability Container + capas = { + 0xf0: "Card Identifier", + 0xf1: "Capability Container version number", + 0xf2: "Capability Grammar version number", + 0xf3: "Applications CardURL", + 0xf4: "PKCS#15", + 0xf5: "Registered Data Model number", + 0xf6: "Access Control Rule Table", + 0xf7: "Card APDUs", + 0xfa: "Redirection Tag", + 0xfb: "Capability Tuples (CTs)", + 0xfc: "Status Tuples (STs)", + 0xfd: "Next CCC", + 0xe3: "Extended Application CardURL", + 0xb4: "Security Object Buffer", + 0xfe: "Error Detection Code" + } + + if tag in capas.keys(): + if tagLen: + ret += "\t%s: len=%d %s\n" % (capas[tag], tagLen, tagBody.hex()) + else: + ret += "\tunknown capa tag 0x%x: %s\n" % (tag, tagBody.hex()) + + elif self.lastGet == '5fc105': + # X.509 Certificate for PIV Authentication + pass + + else: + ret += "\t%s: unimplemented tag=0x%x len=%d content=%s\n" % (self.lastGet, tag, tagLen, tagBody.hex()) + + body = body[2+tagLen:] + + return ret + + def getResponse(self, status, body): + return body.hex() + + def getResponseResult(self, status, body): + return body.hex() + + def mse(self, body): + return body.hex() + + def mseResult(self, status, body): + return body.hex() + + def pso(self, body): + return body.hex() + + def psoResult(self, status, body): + return body.hex() + + def verify(self, status, body): + return "verify(%s)" % body.hex() + + def verifyResult(self, status, body): + return "verify(%s)" % body.hex() + + + + +class ApplicationGids(object): + """GIDS application""" + + def __init__(self, aid): + self.aid = aid + self.lastDo = None + + def getAID(self): + return self.aid + + def parseFcp(self, bytes): + ret = '' + tag = bytes[0] + tagLen = bytes[1] + + body = bytes[2:2+tagLen] + + if tag == 0x62: + ret += '\tFCP\n' + + while len(body) > 2: + tag2 = body[0] + tag2Len = body[1] + tag2Body = body[2:2+tag2Len] + + if tag2 == 0x82: + ret += '\t\tFileDescriptor: %s\n' % tag2Body.hex() + elif tag2 == 0x8a: + ret += '\t\tLifeCycleByte: %s\n' % tag2Body.hex() + elif tag2 == 0x84: + ret += '\t\tDF name: %s\n' % tag2Body.encode('utf8') + elif tag2 == 0x8C: + ret += '\t\tSecurityAttributes: %s\n' % tag2Body.hex() + else: + ret += '\t\tunhandled tag=0x%x body=%s\n' % (tag2, tag2Body.hex()) + + body = body[2+tag2Len:] + + return ret + + def parseFci(self, bytes): + ret = '' + tag = bytes[0] + tagLen = bytes[1] + + body = bytes[2:2+tagLen] + + if tag == 0x61: + ret += '\tFCI\n' + + while len(body) > 2: + tag2 = body[0] + tag2Len = body[1] + tag2Body = body[2:2+tag2Len] + + if tag2 == 0x4F: + ret += '\t\tApplication AID: %s\n' % tag2Body.hex() + + elif tag2 == 0x50: + ret += '\t\tApplication label: %s\n' % tag2Body.encode('utf8') + + elif tag2 == 0x73: + body2 = tag2Body + tokens = [] + while len(body2) > 2: + tag3 = body2[0] + tag3Len = body2[1] + + if tag3 == 0x40: + v = body2[2] + if v & 0x80: + tokens.append('mutualAuthSymAlgo') + if v & 0x40: + tokens.append('extAuthSymAlgo') + if v & 0x20: + tokens.append('keyEstabIntAuthECC') + + + body2 = body2[2+tag3Len:] + + ret += '\t\tDiscretionary data objects: %s\n' % ",".join(tokens) + else: + ret += '\t\tunhandled tag=0x%x body=%s\n' % (tag2, tag2Body.hex()) + + body = body[2+tag2Len:] + + return ret + + + def selectResult(self, selectT, status, body): + if not len(body): + return '' + + if selectT == 'FCP': + return self.parseFcp(body) + elif selectT == 'FCI': + return self.parseFci(body) + else: + return '\tselectResult(fci=%s, status=0x%x) = %s\n' % (selectT, status, body.hex()) + + def getData(self, fileId, bytes): + lc = bytes[4] + tag = bytes[5] + tagLen = bytes[6] + + if tag == 0x5c: + doStr = bytes[7:7+tagLen].hex() + ret = '\tDO=%s\n' % DOs.get(doStr, "<%s>" % doStr) + self.lastDo = doStr + else: + ret = '\tunknown tag=0%x len=%d v=%s' % (tag, tagLen, bytes[7:7+tagLen].hex()) + + return ret + + def getDataResult(self, status, body): + ret = '' + ''' + while len(body) > 2: + tag = body[0] + tagLen = body[1] + + ret += '\ttag=0x%x len=%d content=%s\n' % (tag, tagLen, body[2:2+tagLen].hex()) + + body = body[2+tagLen:] + ''' + return ret + + def mse(self, body): + return body.hex() + + def mseResult(self, status, body): + return body.hex() + + def getResponse(self, status, body): + return body.hex() + + def getResponseResult(self, status, body): + return body.hex() + + def pso(self, body): + return body.hex() + + def psoResult(self, status, body): + return body.hex() + + + +def createAppByAid(aid): + if aid in ("a000000308", 'a00000030800001000',): + return ApplicationPIV(aid) + + elif aid in ('a00000039742544659',): + return ApplicationGids(aid) + + elif aid in ('a0000001510000',): + return ApplicationGpc(aid) + + return ApplicationDummy(aid) + + +def getErrorCode(status): + if status & 0x6100: + return "%d more bytes" % (status & 0xff) + + return ERROR_CODES.get(status, "") + +if __name__ == '__main__': + if len(sys.argv) > 1: + fin = open(sys.argv[1], "r") + else: + fin = sys.stdin + + lineno = 0 + lastCmd = 0 + lastSelect = None + lastSelectFCI = False + lastGetItem = None + currentApp = None + + for l in fin.readlines(): + lineno += 1 + + if not len(l): + continue + + # smartcard loggers have changed + #if l.find("[DEBUG][com.freerdp.channels.smartcard.client]") == -1: + # continue + + body = '' + recvKey = 'pbRecvBuffer: { ' + + pos = l.find(recvKey) + if pos != -1: + toCard = False + + pos += len(recvKey) + pos2 = l.find(' }', pos) + if pos2 == -1: + print("line %d: invalid recvBuffer") + continue + + else: + toCard = True + sendKey = 'pbSendBuffer: { ' + pos = l.find(sendKey) + if pos == -1: + continue + pos += len(sendKey) + + pos2 = l.find(' }', pos) + if pos2 == -1: + print("line %d: invalid sendBuffer") + continue + + body = l[pos:pos2] + + print(l[0:-1]) + bytes = codecs.decode(body, 'hex') + if toCard: + (cla, ins, p1, p2) = bytes[0:4] + cmdName = CMD_NAMES.get(ins, "" % ins) + print(cmdName + ":") + + if cmdName == "SELECT": + lc = bytes[4] + i = 5 + + if p1 == 0x00: + print("\tselectByFID: %0.2x%0.2x" % (bytes[i], bytes[i+1])) + i = i + lc + + elif p1 == 0x4: + aid = bytes[i:i+lc].hex() + lastSelect = AIDs.get(aid, '' % aid) + print("\tselectByAID: %s(%s)" % (aid, lastSelect)) + + if p2 == 0x00: + lastSelectT = "FCI" + print('\tFCI') + elif p2 == 0x04: + print('\tFCP') + lastSelectT = "FCP" + elif p2 == 0x08: + print('\tFMD') + lastSelectT = "FMD" + + if not currentApp or currentApp.getAID() != aid: + currentApp = createAppByAid(aid) + + + elif cmdName == "VERIFY": + lc = bytes[4] + P2_DATA_QUALIFIER = { + 0x00: "Card global password", + 0x01: "RFU", + 0x80: "Application password", + 0x81: "Application resetting password", + 0x82: "Application security status resetting code", + } + + pin='' + if lc: + pin = ", pin='" + bytes[5:5+lc-2].decode('utf8)') + "'" + + print("\t%s%s" % (P2_DATA_QUALIFIER.get(p2, ""), pin)) + + elif cmdName == "GET DATA": + lc = bytes[4] + fileId = p1 * 256 + p2 + + ret = currentApp.getData(fileId, bytes) + print("%s" % ret) + + elif cmdName == "GET RESPONSE": + #lc = bytes[4] + #fileId = p1 * 256 + p2 + + #ret = currentApp.getResponse(fileId, bytes) + #print("%s" % ret) + pass + elif cmdName == "MSE": + ret = currentApp.mse(bytes[5:5+lc]) + print("%s" % ret) + + elif cmdName == "PSO": + ret = currentApp.pso(bytes[5:5+lc]) + print("%s" % ret) + else: + print('handle %s' % cmdName) + + lastCmd = cmdName + + else: + # Responses + if not len(bytes): + continue + + status = bytes[-1] + bytes[-2] * 256 + body = bytes[0:-2] + print("status=0x%0.4x(%s)" % (status, getErrorCode(status))) + + if not len(body): + continue + + ret = '' + if lastCmd == "SELECT": + ret = currentApp.selectResult(lastSelectT, status, body) + elif lastCmd == "GET DATA": + ret = currentApp.getDataResult(status, body) + elif lastCmd == "MSE": + ret = currentApp.mseResult(status, body) + elif lastCmd == "PSO": + ret = currentApp.psoResult(status, body) + elif lastCmd == "GET RESPONSE": + ret = currentApp.getResponseResult(status, body) + elif lastCmd == "VERIFY": + ret = currentApp.verifyResult(status, body) + + if ret: + print("%s" % ret) diff --git a/local-test-freerdp-full-01/afc-freerdp/tools/update-settings-tests b/local-test-freerdp-full-01/afc-freerdp/tools/update-settings-tests new file mode 100644 index 0000000000000000000000000000000000000000..582c88e40da13cdec829e0dda01c270d3ed3c670 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/tools/update-settings-tests @@ -0,0 +1,387 @@ +#!/usr/bin/env python3 +import os +import sys + +def get_values(entry_dict, entry_type): + values = [] + if '*' == entry_type: + for key in list(entry_dict.keys()): + if entry_type in key: + values += entry_dict[key] + entry_dict.pop(key, None) + elif entry_type in dict(entry_dict): + values = entry_dict[entry_type] + entry_dict.pop(entry_type, None) + if values: + return sorted(values) + return values + +def get_keys(entry_dict, entry_type, values): + l = list() + if '*' == entry_type: + dval = dict() + for key in list(entry_dict.keys()): + if entry_type in key: + xval = entry_dict[key] + for val in xval: + dval[val] = key + + for val in list(values): + key = dval[val] + l.append(key) + return l + +def write_entry(f, entry_dict, entry_type, entry_name): + values = get_values(entry_dict, entry_type) + if not values: + return + + f.write('#define have_' + entry_name.lower() + '_list_indices\n') + f.write('static const size_t ' + entry_name.lower() + '_list_indices[] =\n') + f.write('{\n') + + for val in values: + f.write('\tFreeRDP_' + val + ',\n') + + f.write('};\n\n') + +def write_str_case(f, entry_idx, val): + entry_types = ['BOOL', 'UINT16', 'INT16', 'UINT32', 'INT32', 'UINT64', 'INT64', 'STRING', 'POINTER'] + f.write('\t\t{FreeRDP_' + val + ', FREERDP_SETTINGS_TYPE_' + str(entry_types[entry_idx]) + ', "FreeRDP_' + val + '"},\n') + +def write_str(f, entry_dict): + f.write('typedef enum {\n') + f.write('\tFREERDP_SETTINGS_TYPE_BOOL,\n') + f.write('\tFREERDP_SETTINGS_TYPE_UINT16,\n') + f.write('\tFREERDP_SETTINGS_TYPE_INT16,\n') + f.write('\tFREERDP_SETTINGS_TYPE_UINT32,\n') + f.write('\tFREERDP_SETTINGS_TYPE_INT32,\n') + f.write('\tFREERDP_SETTINGS_TYPE_UINT64,\n') + f.write('\tFREERDP_SETTINGS_TYPE_INT64,\n') + f.write('\tFREERDP_SETTINGS_TYPE_STRING,\n') + f.write('\tFREERDP_SETTINGS_TYPE_POINTER\n') + f.write('} FREERDP_SETTINGS_TYPE;\n') + f.write('\n') + f.write('struct settings_str_entry {\n') + f.write('\tSSIZE_T id;\n') + f.write('\tSSIZE_T type;\n') + f.write('\tconst char* str;\n') + f.write('};\n') + f.write('static const struct settings_str_entry settings_map[] =\n') + f.write('{\n') + + entry_types = ['BOOL', 'UINT16', 'INT16', 'UINT32', 'INT32', 'UINT64', 'INT64', 'char*', '*'] + for entry_type in entry_types: + values = get_values(entry_dict, entry_type) + if values: + for val in values: + write_str_case(f, entry_types.index(entry_type), val) + f.write('};\n\n') + f.write('\n') + +def write_getter_case(f, val, cast): + f.write('\t\tcase FreeRDP_' + val + ':\n') + f.write('\t\t\treturn ' + cast + 'settings->' + val + ';\n\n') + +def write_getter_body(f, values, ret, keys, isPointer): + f.write('{\n') + f.write('\tWINPR_ASSERT(settings);\n\n') + f.write('\tswitch (id)\n') + f.write('\t{\n') + if values: + for i in range(len(values)): + val = values[i] + cast = '' + if isPointer and keys: + key = keys[i] + if key != 'void*': + cast = '(void*)' + write_getter_case(f, val, cast) + f.write('\t\tdefault:\n') + f.write('\t\t\tWLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id, freerdp_settings_get_name_for_key(id), freerdp_settings_get_type_name_for_key(id));\n') + f.write('\t\t\tWINPR_ASSERT(FALSE);\n') + f.write('\t\t\treturn ' + ret + ';\n') + f.write('\t}\n') + f.write('}\n\n') + +def write_getter(f, entry_dict, entry_type, entry_name, postfix): + isString = 'string' in entry_name + isPointer = 'pointer' in entry_name + copy = dict(entry_dict) + values = get_values(entry_dict, entry_type) + keys = get_keys(copy, entry_type, values) + + typestr = 'FreeRDP_Settings_Keys_' + entry_name.capitalize() + typestr = typestr.replace('_Uint', '_UInt') + + if isPointer: + f.write('void*') + elif isString: + f.write('const ' + entry_type) + else: + f.write(entry_type) + + if isPointer: + f.write(' freerdp_settings_get_pointer_writable(rdpSettings* settings, ' + typestr + ' id)\n') + else: + f.write(' freerdp_settings_get_' + entry_name.lower() + '(const rdpSettings* settings, ' + typestr + ' id)\n') + if isString or isPointer: + ret = 'NULL'; + elif 'bool' in entry_name: + ret = 'FALSE'; + else: + ret = '0'; + + write_getter_body(f, values, ret, keys, isPointer) + + if isString: + f.write('char* freerdp_settings_get_' + entry_name.lower() + '_writable(rdpSettings* settings, ' + typestr + ' id)\n') + write_getter_body(f, values, ret, keys, isPointer) + +def write_setter_case(f, val, postfix, isPointer, cast): + f.write('\t\tcase FreeRDP_' + val + ':\n') + if isPointer: + f.write('\t\t\tsettings->' + val + ' = ' + cast + ' cnv.v;\n') + f.write('\t\t\tbreak;\n\n') + elif not postfix: + f.write('\t\t\tsettings->' + val + ' = cnv.c;\n') + f.write('\t\t\tbreak;\n\n') + elif len(postfix) <= 1: + f.write('\t\t\treturn update_string' + postfix + '(&settings->' + val + ', cnv.c, len);\n\n') + else: + f.write('\t\t\treturn update_string' + postfix + '(&settings->' + val + ', cnv.cc, len, cleanup);\n\n') + +def write_setter(f, entry_dict, entry_type, entry_name, postfix): + isString = 'string' in entry_name + isPointer = 'pointer' in entry_name + copy = dict(entry_dict) + values = get_values(entry_dict, entry_type) + keys = get_keys(copy, entry_type, values) + + typestr = 'FreeRDP_Settings_Keys_' + entry_name.capitalize() + typestr = typestr.replace('_Uint', '_UInt') + f.write('BOOL freerdp_settings_set_' + entry_name.lower()) + f.write(postfix) + f.write('(rdpSettings* settings, ' + typestr + ' id, ') + if isString or isPointer: + f.write('const ') + if not isPointer: + f.write(entry_type + ' val') + else: + f.write('void* val') + if isString and len(postfix) <= 1: + f.write(', size_t len)\n') + elif isString: + f.write(', size_t len, BOOL cleanup)\n') + else: + f.write(')\n') + f.write('{\n') + f.write('\tunion\n') + f.write('\t{\n') + f.write('\t\tvoid* v;\n') + f.write('\t\tconst void* cv;\n') + if not isPointer: + f.write(' ' + entry_type + ' c;\n') + f.write(' const ' + entry_type + ' cc;\n') + f.write('} cnv;\n') + + f.write('\tWINPR_ASSERT(settings);\n\n') + if isPointer: + f.write('\tcnv.cv = val;\n\n') + elif isString: + f.write('\tcnv.cc = val;\n\n') + else: + f.write('\tcnv.c = val;\n\n') + f.write('\tswitch (id)\n') + f.write('\t{\n') + if values: + count = 0 + for val in values: + index = count + count += 1 + cast = '' + if isPointer: + k = keys[index]; + if k != 'void*' and len(k) > 0: + cast = '(' + k + ')' + write_setter_case(f, val, postfix, isPointer, cast) + f.write('\t\tdefault:\n') + f.write('\t\t\tWLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id, freerdp_settings_get_name_for_key(id), freerdp_settings_get_type_name_for_key(id));\n') + f.write('\t\t\treturn FALSE;\n') + f.write('\t}\n') + f.write('\treturn TRUE;\n') + f.write('}\n\n') + f.write('\n') + if isString and len(postfix) <= 1: + f.write('BOOL freerdp_settings_set_string_len(rdpSettings* settings, FreeRDP_Settings_Keys_String id, const char* val, size_t len)\n') + f.write('{\n') + f.write('\treturn freerdp_settings_set_string_copy_(settings, id, val, len, TRUE);\n') + f.write('}\n') + f.write('\n') + + f.write('BOOL freerdp_settings_set_string(rdpSettings* settings, FreeRDP_Settings_Keys_String id, const char* val)\n') + f.write('{\n') + f.write('\tsize_t len = 0;\n') + f.write('\tif (val) len = strlen(val);\n') + f.write('\treturn freerdp_settings_set_string_copy_(settings, id, val, len, TRUE);\n') + f.write('}\n') + f.write('\n') + +name = os.path.dirname(os.path.realpath(__file__)) +begin = "WARNING: this data structure is carefully padded for ABI stability!" +end = "WARNING: End of ABI stable zone!" + +print('begin parsing settings header') +try: + type_list = dict() + + with open(name + "/../include/freerdp/settings_types_private.h", "r") as f: + lines = f.readlines() + started = False + for line in lines: + if not started: + if begin in line: + started = True + continue + + if end in line: + break + + sline = line.strip() + if not sline: + continue + if sline.startswith('/'): + continue + if sline.startswith('*'): + continue + if 'padding' in sline: + continue + if 'version' in sline: + continue + + if sline.startswith('SETTINGS_DEPRECATED(ALIGN64'): + sline = sline[27:].strip() + + sline = sline[:sline.find(');')] + pair = sline.split() + if pair[0] in type_list: + type_list[pair[0]].append(pair[1]) + else: + type_list[pair[0]] = [pair[1]] + + with open(name + '/../libfreerdp/common/settings_getters.c', 'w+') as f: + f.write('/* Generated by ' + '' + ' */\n\n') + f.write('#include "../core/settings.h"\n\n') + f.write('#include \n') + f.write('#include \n') + f.write('#include \n\n') + f.write('#define TAG FREERDP_TAG("common.settings")\n\n') + + f.write('static void free_string(char** current, BOOL cleanup)\n') + f.write('{\n') + f.write('\tif (cleanup)\n') + f.write('\t{\n') + f.write('\t\tif (*current)\n') + f.write('\t\t\tmemset(*current, 0, strlen(*current));\n') + f.write('\t\tfree(*current);\n') + f.write('\t\t(*current) = NULL;\n') + f.write('\t}\n') + f.write('}\n\n') + + f.write('static BOOL alloc_empty_string(char** current, const char* next, size_t next_len)\n') + f.write('{\n') + f.write('\tif (!next && (next_len > 0))\n') + f.write('\t{\n') + f.write('\t\t*current = calloc(next_len, 1);\n') + f.write('\t\treturn (*current != NULL);\n') + f.write('\t}\n') + f.write('\treturn FALSE;\n') + f.write('}\n\n') + + + f.write('static BOOL update_string_copy_(char** current, const char* next, size_t next_len, BOOL cleanup)\n') + f.write('{\n') + f.write('\tfree_string(current, cleanup);\n') + f.write('\n') + f.write('\tif (alloc_empty_string(current, next, next_len))\n') + f.write('\t\treturn TRUE;\n') + f.write('\n') + f.write('\t*current = (next ? strndup(next, next_len) : NULL);\n') + f.write('\treturn !next || (*current != NULL);\n') + f.write('}\n\n') + + f.write('static BOOL update_string_(char** current, char* next, size_t next_len)\n') + f.write('{\n') + f.write('\tfree_string(current, TRUE);\n') + f.write('\n') + f.write('\tif (alloc_empty_string(current, next, next_len))\n') + f.write('\t\treturn TRUE;\n') + f.write('\n') + f.write('\t*current = next;\n') + f.write('\treturn !next || (*current != NULL);\n') + f.write('}\n\n') + + getter_list = dict(type_list) + setter_list = dict(type_list) + setter_list2 = dict(type_list) + # Compatibility with older 3.x releases where the value was wrongly an unsigned type + getter_list['UINT32'].append('MonitorLocalShiftX') + getter_list['UINT32'].append('MonitorLocalShiftY') + write_getter(f, getter_list, 'BOOL', 'bool', '') + write_setter(f, setter_list, 'BOOL', 'bool', '') + write_getter(f, getter_list, 'UINT16', 'uint16', '') + write_setter(f, setter_list, 'UINT16', 'uint16', '') + write_getter(f, getter_list, 'INT16', 'int16', '') + write_setter(f, setter_list, 'INT16', 'int16', '') + write_getter(f, getter_list, 'UINT32', 'uint32', '') + write_setter(f, setter_list, 'UINT32', 'uint32', '') + write_getter(f, getter_list, 'INT32', 'int32', '') + write_setter(f, setter_list, 'INT32', 'int32', '') + write_getter(f, getter_list, 'UINT64', 'uint64', '') + write_setter(f, setter_list, 'UINT64', 'uint64', '') + write_getter(f, getter_list, 'INT64', 'int64', '') + write_setter(f, setter_list, 'INT64', 'int64', '') + write_getter(f, getter_list, 'char*', 'string', '_') + write_setter(f, setter_list, 'char*', 'string', '_') + write_setter(f, setter_list2, 'char*', 'string', '_copy_') + write_getter(f, getter_list, '*', 'pointer', '') + write_setter(f, setter_list, '*', 'pointer', '') + + f.write('\n') + + with open(name + '/../libfreerdp/common/settings_str.h', 'w+') as f: + f.write('/* Generated by ' + '' + ' */\n\n') + f.write('#ifndef FREERDP_CORE_SETTINGS_STR_H\n') + f.write('#define FREERDP_CORE_SETTINGS_STR_H\n\n') + f.write('#include "../core/settings.h"\n\n') + f.write('#include \n') + f.write('#include \n\n') + f.write('#define TAG FREERDP_TAG("common.settings")\n\n') + + getter_list = dict(type_list) + write_str(f, getter_list) + f.write('#endif\n') + f.write('\n') + + + with open(name + '/../libfreerdp/core/test/settings_property_lists.h', 'w+') as f: + f.write('#ifndef TEST_SETTINGS_PROPERTY_LISTS\n') + f.write('#define TEST_SETTINGS_PROPERTY_LISTS\n\n') + + write_entry(f, type_list, 'BOOL', 'bool') + write_entry(f, type_list, 'UINT16', 'uint16') + write_entry(f, type_list, 'INT16', 'int16') + write_entry(f, type_list, 'UINT32', 'uint32') + write_entry(f, type_list, 'INT32', 'int32') + write_entry(f, type_list, 'UINT64', 'uint64') + write_entry(f, type_list, 'INT64', 'int64') + write_entry(f, type_list, 'char*', 'string') + write_entry(f, type_list, '*', 'pointer') + + f.write('#endif /* TEST_SETTINGS_PROPERTY_LISTS */\n\n') + + print('remaining:\n' + str(type_list)) +except IOError as e: + print('failed to parse settings header ' + str(e)) + sys.exit(-1) +print('ended parsing settings header') diff --git a/local-test-freerdp-full-01/afc-freerdp/uwac/CMakeLists.txt b/local-test-freerdp-full-01/afc-freerdp/uwac/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..c6693bf88dd7a735a93d5f233aefcd351d686c06 --- /dev/null +++ b/local-test-freerdp-full-01/afc-freerdp/uwac/CMakeLists.txt @@ -0,0 +1,96 @@ +# UWAC: Using Wayland As Client +# cmake build script +# +# Copyright 2015 David FORT +# +# 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. + +# Soname versioning +set(UWAC_VERSION_MAJOR "0") +set(UWAC_VERSION_MINOR "2") +set(UWAC_VERSION_REVISION "0") +set(UWAC_VERSION "${UWAC_VERSION_MAJOR}.${UWAC_VERSION_MINOR}.${UWAC_VERSION_REVISION}") +set(UWAC_VERSION_FULL "${UWAC_VERSION}") +set(UWAC_API_VERSION "${UWAC_VERSION_MAJOR}") + +if(NOT FREERDP_UNIFIED_BUILD) + cmake_minimum_required(VERSION 3.13) + project(uwac VERSION ${UWAC_VERSION} LANGUAGES C) + + set(CMAKE_C_STANDARD 11) + set(CMAKE_C_STANDARD_REQUIRED ON) + set(CMAKE_C_EXTENSIONS ON) + + option(BUILD_TESTING_INTERNAL "Build library unit tests" ON) + + include(ExportAllSymbols) +endif() + +option(UWAC_FORCE_STATIC_BUILD "Force UWAC to be build as static library (recommended)" OFF) +option(UWAC_HAVE_PIXMAN_REGION "Use PIXMAN or FreeRDP for region calculations" "NOT FREERDP_UNIFIED_BUILD") + +# Include our extra modules +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/) +include(CommonConfigOptions) + +include(CheckFunctionExists) +check_function_exists(strerror_r UWAC_HAVE_STRERROR_R) + +# Check for cmake compatibility (enable/disable features) +include(FindFeature) + +if(UWAC_FORCE_STATIC_BUILD) + set(BUILD_SHARED_LIBS OFF) +else() + include(SetFreeRDPCMakeInstallDir) + include(CMakePackageConfigHelpers) +endif() + +if(NOT IOS) + include(CheckIncludeFiles) + check_include_files(stdbool.h UWAC_HAVE_STDBOOL_H) + if(NOT UWAC_HAVE_STDBOOL_H) + include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../compat/stdbool) + endif() +endif() + +# Find required libraries +if(UWAC_HAVE_PIXMAN_REGION) + find_package(PkgConfig REQUIRED) + pkg_check_modules(pixman REQUIRED pixman-1) + include_directories(SYSTEM ${pixman_INCLUDE_DIRS}) +elseif(FREERDP_UNIFIED_BUILD) + include_directories(${PROJECT_SOURCE_DIR}/winpr/include) + include_directories(${PROJECT_BINARY_DIR}/winpr/include) + include_directories(${PROJECT_SOURCE_DIR}/include) + include_directories(${PROJECT_BINARY_DIR}/include) +else() + find_package(WinPR 3 REQUIRED) + find_package(FreeRDP 3 REQUIRED) + include_directories(SYSTEM ${WinPR_INCLUDE_DIR}) + include_directories(SYSTEM ${FreeRDP_INCLUDE_DIR}) +endif() + +set(WAYLAND_FEATURE_PURPOSE "Wayland") +set(WAYLAND_FEATURE_DESCRIPTION "Wayland client") +set(WAYLAND_FEATURE_TYPE "REQUIRED") +find_feature(Wayland ${WAYLAND_FEATURE_TYPE} ${WAYLAND_FEATURE_PURPOSE} ${WAYLAND_FEATURE_DESCRIPTION}) + +set(UWAC_INCLUDE_DIR include/uwac${UWAC_API_VERSION}) + +include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include) + +add_subdirectory(libuwac) +add_subdirectory(templates) +add_subdirectory(include) diff --git a/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/canon_makernote_variant_1.jpg b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/canon_makernote_variant_1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..28aa186f233d76a27fa86a82a2cbe16cb2ea9a7d --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/canon_makernote_variant_1.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3383d8eee5db6ba415052d9da7c21ffa3f7e036d8afecd966c2fc7136fc90445 +size 2026 diff --git a/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/fuji_makernote_variant_1.jpg b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/fuji_makernote_variant_1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c70806817e81d15ec8c493b44e73492d854d3ac2 --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/fuji_makernote_variant_1.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8caffc67d783040ebc2767352556e758d615a4bb32f15663a4bf3ef940a22cec +size 3978 diff --git a/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/olympus_makernote_variant_2.jpg b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/olympus_makernote_variant_2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1dcf7d6ab56a77feb6bd859537d5a90745299c4a --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/olympus_makernote_variant_2.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c91015558142356ab12770bbf8b9bd0ea23206f8200e916f796089bf33cb1190 +size 2850 diff --git a/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/olympus_makernote_variant_3.jpg b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/olympus_makernote_variant_3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7bc5527d0a6749a9b0d0c852d61e2f39ba6dff6d --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/olympus_makernote_variant_3.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:984c1586dc7a8d6c656ff298c2f89e534a1f2131ccdec2bb64a045f73341b725 +size 6140 diff --git a/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/olympus_makernote_variant_4.jpg b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/olympus_makernote_variant_4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..788dec77826461546d6d68bac44fd5a8ea6c792f --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/olympus_makernote_variant_4.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ffbfa3118530fd7552c4b95926b4f67e3a2bf200a9d96ff0ba2323c8edb93d55 +size 11458 diff --git a/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/olympus_makernote_variant_5.jpg b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/olympus_makernote_variant_5.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9397c76b3d43a8766e5f3fa3adf856a114d836bd --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/olympus_makernote_variant_5.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f913e1e9d0c10898c5be0cf059f95e0632833841b4aed11cc3c7c61d08b56cb8 +size 9604 diff --git a/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/pentax_makernote_variant_2.jpg b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/pentax_makernote_variant_2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c1a3a3fac42b086a50abb308d4fa0e4b89ea87c8 --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/pentax_makernote_variant_2.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:926bafc88a9eff4d14f5ae78f3b57eba38cf4f84a32708f167eaf988cdb824f2 +size 1346 diff --git a/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/pentax_makernote_variant_3.jpg b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/pentax_makernote_variant_3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..52442c0b5215e644d84c9f8c5338a45d8d8228b7 --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/pentax_makernote_variant_3.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf1ba33ad78dc0e8e54b016687cddeff093e501cbfa09e4aa34baff5bb0b0303 +size 1918 diff --git a/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/pentax_makernote_variant_4.jpg b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/pentax_makernote_variant_4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..95108ede7b2387878aa8f90b7ac391e12fbc0da5 --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/afc-libexif/test/testdata/pentax_makernote_variant_4.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d7741d71a38566fe2255c90400d87f58ea2f16d2f4f336a2c25a68b4e715a03 +size 9132 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/artifacts.png b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/artifacts.png new file mode 100644 index 0000000000000000000000000000000000000000..711e5878eef5d3679fce6f188981d38222e3ceff --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/artifacts.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4403a56cd762e4883e65665c58b5f7d5834fa5128c511c5b60a12a6a7facda3d +size 243893 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/corpus_path.png b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/corpus_path.png new file mode 100644 index 0000000000000000000000000000000000000000..318289768b7d811e5c283d78d87f9f0c8dca8b23 --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/corpus_path.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a75e2bc1358f510868b5466226d046e8861da44ed3a5cf20ecc189ec33804b09 +size 65813 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/crash_stats.png b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/crash_stats.png new file mode 100644 index 0000000000000000000000000000000000000000..f07dec1520736a8b0e811369bc987e3039cfb35b --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/crash_stats.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71efe8feccfd2982289b69e966c191ad89673a8955d5747d41516044df9f79d4 +size 88864 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/expat_performance_analyzer.png b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/expat_performance_analyzer.png new file mode 100644 index 0000000000000000000000000000000000000000..c6d3763d16704c2a12372b1acbd77d7154253e52 --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/expat_performance_analyzer.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e361c7a0e49c26e9b8749abfeca875d7a7d92b16e3f5906899659e23c14d0756 +size 41825 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/freetype_coverage_1.png b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/freetype_coverage_1.png new file mode 100644 index 0000000000000000000000000000000000000000..75d688311b008a070e5e0aafb140276d88850521 --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/freetype_coverage_1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed14e713a268c5e0d115d234c0bc29f840e0362b6bfef04ba3003baa0f750ca3 +size 117934 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/freetype_coverage_2.png b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/freetype_coverage_2.png new file mode 100644 index 0000000000000000000000000000000000000000..e1a7e94c6383d039cb49a22db4ea892d8d6f340f --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/freetype_coverage_2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aed63942130ebabb9a73071997b9265a5a6c3d1f27ee1d4616a910dd8f814920 +size 35094 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/freetype_stats_graphs.png b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/freetype_stats_graphs.png new file mode 100644 index 0000000000000000000000000000000000000000..f135064f6d78befabce9e77e72523cc2761e33fb --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/freetype_stats_graphs.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63e47db4d9faed947f196d69e91c03860c6b7b97f4ca166a3cb5ecac7edfeade +size 424598 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/freetype_stats_table.png b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/freetype_stats_table.png new file mode 100644 index 0000000000000000000000000000000000000000..e6c49d48f138c9967212eb1075ae310c30cce3bd --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/freetype_stats_table.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21cd51a7651f4f4425cb5bdb10761d7450d187c9ebb544da39271c221143a89c +size 51686 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/llm_framework.png b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/llm_framework.png new file mode 100644 index 0000000000000000000000000000000000000000..af1852897b07ba4d51a81ff6a09c55141ba23431 --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/llm_framework.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c58f2f79420fa0fdcb94e0a8c6da10d29389ec2d5037df8d6362c6f4854adc3e +size 112971 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/pcre2_testcase.png b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/pcre2_testcase.png new file mode 100644 index 0000000000000000000000000000000000000000..4556d625e2b5837952dede8e82208f9205aa91ed --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/pcre2_testcase.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43f0d12f5c749ff48a16fcbc462131d40a62c9d0bc65ee97e56c13ff605d9e6b +size 204561 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/process.png b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/process.png new file mode 100644 index 0000000000000000000000000000000000000000..06308a98bc0554e98acc584fab727178d1740749 --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/process.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb982e31d005e1559e46185925c72454748be923ba4cdcf01b7b33fe7db01716 +size 135112 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/punycode.png b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/punycode.png new file mode 100644 index 0000000000000000000000000000000000000000..0522182ec88f5d9583370517cfdf934dfb4335e5 --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/punycode.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6938c5ed85c62639b5768842b05d73c93cfc50f31311c4857dfefb548870db3 +size 314214 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/run_fuzzers.png b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/run_fuzzers.png new file mode 100644 index 0000000000000000000000000000000000000000..4fe5dac98c0dec3739fde653abe1a2f7ab7d157e --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/run_fuzzers.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bedd896eeb6ae7dab276e25bbc83e8123c4e95b2baff74448f5f70f4fc587dee +size 269435 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/tinyxml2_examples.png b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/tinyxml2_examples.png new file mode 100644 index 0000000000000000000000000000000000000000..8ef846244c638e48b03af72ec51b791be1d4c253 --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/tinyxml2_examples.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4685b847be71c3bd8748f6da170543643152a9c215b95dbd3e1836737c676e26 +size 291368 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/viewing_corpus.png b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/viewing_corpus.png new file mode 100644 index 0000000000000000000000000000000000000000..ef7ee507d4471bb5380b1f1ae00f1cfe36fd118b --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/docs/images/viewing_corpus.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f816eede78482e56dd9f2a78834fb5f29bde761420fd6cf47ddb66970c61c18 +size 43612 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/infra/cifuzz/test_data/timeout_fuzzer b/local-test-libexif-delta-01-exif-003/fuzz-tooling/infra/cifuzz/test_data/timeout_fuzzer new file mode 100644 index 0000000000000000000000000000000000000000..09d95e6e3ec57901995ddee89b557848c2e601cc --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/infra/cifuzz/test_data/timeout_fuzzer @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db5f88cd5c9859d1cc240c713202f69a8fd08565d56fb8cb8c071bb441475a4c +size 977648 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/tools/vscode-extension/images/thumbnail.png b/local-test-libexif-delta-01-exif-003/fuzz-tooling/tools/vscode-extension/images/thumbnail.png new file mode 100644 index 0000000000000000000000000000000000000000..604d0119240f55ce028be1a11da47d7eb051bb34 --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/tools/vscode-extension/images/thumbnail.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8c6edb38759bffe8c0c0037ed8b68eaf0eb4fedec1f9b749b1fc5ce567b6c4d +size 6608 diff --git a/local-test-libexif-delta-01-exif-003/fuzz-tooling/tools/vscode-extension/images/workflow-1-s-1.png b/local-test-libexif-delta-01-exif-003/fuzz-tooling/tools/vscode-extension/images/workflow-1-s-1.png new file mode 100644 index 0000000000000000000000000000000000000000..82e795eb671fcc9670478eb7b26330ec13193de1 --- /dev/null +++ b/local-test-libexif-delta-01-exif-003/fuzz-tooling/tools/vscode-extension/images/workflow-1-s-1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54c2ffd06c81730a9e66558b8255b4c84bc20d88d70f20b31dbc15a6332fc263 +size 7344 diff --git a/local-test-libexif-delta-01-exif-005/fuzz-tooling/docs/images/corpus_path.png b/local-test-libexif-delta-01-exif-005/fuzz-tooling/docs/images/corpus_path.png new file mode 100644 index 0000000000000000000000000000000000000000..318289768b7d811e5c283d78d87f9f0c8dca8b23 --- /dev/null +++ b/local-test-libexif-delta-01-exif-005/fuzz-tooling/docs/images/corpus_path.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a75e2bc1358f510868b5466226d046e8861da44ed3a5cf20ecc189ec33804b09 +size 65813 diff --git a/local-test-libexif-delta-01-exif-005/fuzz-tooling/tools/vscode-extension/images/thumbnail.png b/local-test-libexif-delta-01-exif-005/fuzz-tooling/tools/vscode-extension/images/thumbnail.png new file mode 100644 index 0000000000000000000000000000000000000000..604d0119240f55ce028be1a11da47d7eb051bb34 --- /dev/null +++ b/local-test-libexif-delta-01-exif-005/fuzz-tooling/tools/vscode-extension/images/thumbnail.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8c6edb38759bffe8c0c0037ed8b68eaf0eb4fedec1f9b749b1fc5ce567b6c4d +size 6608 diff --git a/local-test-libexif-delta-01-exif-005/fuzz-tooling/tools/vscode-extension/images/workflow-1-s-1.png b/local-test-libexif-delta-01-exif-005/fuzz-tooling/tools/vscode-extension/images/workflow-1-s-1.png new file mode 100644 index 0000000000000000000000000000000000000000..82e795eb671fcc9670478eb7b26330ec13193de1 --- /dev/null +++ b/local-test-libexif-delta-01-exif-005/fuzz-tooling/tools/vscode-extension/images/workflow-1-s-1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54c2ffd06c81730a9e66558b8255b4c84bc20d88d70f20b31dbc15a6332fc263 +size 7344 diff --git a/local-test-libpostal-full-01/afc-libpostal/src/transliteration_data.c b/local-test-libpostal-full-01/afc-libpostal/src/transliteration_data.c new file mode 100644 index 0000000000000000000000000000000000000000..765e81c515e8410b3cba4223472232cd420f97b6 --- /dev/null +++ b/local-test-libpostal-full-01/afc-libpostal/src/transliteration_data.c @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:858dfa21b5ddeb5708edb5ec234e0e4238b758683cce155475757aff49230d49 +size 21266245 diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/art/icon-243x273.gif b/local-test-sqlite3-delta-03/afc-sqlite3/art/icon-243x273.gif new file mode 100644 index 0000000000000000000000000000000000000000..84a6624b05ac287654e63fa2b0481e727b4cd45b --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/art/icon-243x273.gif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8dcab915b60672682f3a5cd85ba82e2ea059f881e26593aa3ff9cd560fda13a +size 24689 diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/art/icon-80x90.gif b/local-test-sqlite3-delta-03/afc-sqlite3/art/icon-80x90.gif new file mode 100644 index 0000000000000000000000000000000000000000..2178b60eb712d5fbddc76a5acff4944bf3330995 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/art/icon-80x90.gif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53b85af069485f02525a8fb80c90fe6f72e7c33b0318487c05d56ee87f809b95 +size 3392 diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/art/sqlite370.jpg b/local-test-sqlite3-delta-03/afc-sqlite3/art/sqlite370.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2f4a156e02fca46b9e03bd9a42e3b00a98ed09a2 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/art/sqlite370.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3cd8f4b85e2bc7b1b684f1311cca87661cce9b4a4a5108c5b90ee434674086fd +size 80726 diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recover_common.tcl b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recover_common.tcl new file mode 100644 index 0000000000000000000000000000000000000000..fdf735ee7597f547799019fc5e1ee77860e685b7 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recover_common.tcl @@ -0,0 +1,14 @@ + + +if {![info exists testdir]} { + set testdir [file join [file dirname [info script]] .. .. test] +} +source $testdir/tester.tcl + +if {[info commands sqlite3_recover_init]==""} { + finish_test + return -code return +} + + + diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoverbuild.test b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoverbuild.test new file mode 100644 index 0000000000000000000000000000000000000000..d119be7fde28625ec06010489239678373e3088d --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoverbuild.test @@ -0,0 +1,42 @@ +# 2023 February 28 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# + +source [file join [file dirname [info script]] recover_common.tcl] +set testprefix recoverbuild + + +# The following tests verify that if the recovery extension is used with +# a build that does not support the sqlite_dbpage table, the error message +# is "no such table: sqlite_dbpage", and not something more generic. +# +reset_db +create_null_module db sqlite_dbpage +do_execsql_test 1.0 { + CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT); + INSERT INTO t1 VALUES(123, 'one hundred and twenty three'); +} + +forcedelete test.db2 +do_test 1.1 { + set R [sqlite3_recover_init db main test.db2] +} {/sqlite_recover.*/} + +do_test 1.2 { + $R run +} {1} + +do_test 1.3 { + list [catch { $R finish } msg] $msg +} {1 {no such table: sqlite_dbpage}} + +finish_test + diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recovercorrupt2.test b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recovercorrupt2.test new file mode 100644 index 0000000000000000000000000000000000000000..ab6c94804def26971bf10235432e4afe5080d3ad --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recovercorrupt2.test @@ -0,0 +1,608 @@ +# 2022 August 28 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# + +source [file join [file dirname [info script]] recover_common.tcl] +set testprefix recovercorrupt2 + +do_execsql_test 1.0 { + PRAGMA page_size = 512; + CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); + INSERT INTO t1 VALUES(1, 2, 3); + INSERT INTO t1 VALUES(2, hex(randomblob(100)), randomblob(200)); + CREATE INDEX i1 ON t1(b, c); + CREATE TABLE t2(a PRIMARY KEY, b, c) WITHOUT ROWID; + INSERT INTO t2 VALUES(1, 2, 3); + INSERT INTO t2 VALUES(2, hex(randomblob(100)), randomblob(200)); + ANALYZE; + PRAGMA writable_schema = 1; + UPDATE sqlite_schema SET sql = 'CREATE INDEX i1 ON o(world)' WHERE name='i1'; + DELETE FROM sqlite_schema WHERE name='sqlite_stat4'; +} + +do_test 1.1 { + set R [sqlite3_recover_init db main test.db2] + $R run + $R finish +} {} + +sqlite3 db2 test.db2 +do_execsql_test -db db2 1.2 { + SELECT sql FROM sqlite_schema +} { + {CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c)} + {CREATE TABLE t2(a PRIMARY KEY, b, c) WITHOUT ROWID} + {CREATE TABLE sqlite_stat1(tbl,idx,stat)} +} +db2 close + +do_execsql_test 1.3 { + PRAGMA writable_schema = 1; + UPDATE sqlite_schema SET sql = 'CREATE TABLE t2 syntax error!' WHERE name='t2'; +} + +do_test 1.4 { + set R [sqlite3_recover_init db main test.db2] + $R run + $R finish +} {} + +sqlite3 db2 test.db2 +do_execsql_test -db db2 1.5 { + SELECT sql FROM sqlite_schema +} { + {CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c)} + {CREATE TABLE sqlite_stat1(tbl,idx,stat)} +} +db2 close + +#------------------------------------------------------------------------- +# +reset_db +do_test 2.0 { + sqlite3 db {} + db deserialize [decode_hexdb { +| size 8192 pagesize 4096 filename x3.db +| page 1 offset 0 +| 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3. +| 16: 10 00 01 01 00 40 20 20 00 00 00 02 00 00 00 02 .....@ ........ +| 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 ................ +| 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................ +| 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ................ +| 96: 00 2e 63 00 0d 00 00 00 01 0f d8 00 0f d8 00 00 ..c............. +| 4048: 00 00 00 00 00 00 00 00 26 01 06 17 11 11 01 39 ........&......9 +| 4064: 74 61 62 6c 65 74 31 74 31 02 43 52 45 41 54 45 tablet1t1.CREATE +| 4080: 20 54 41 42 4c 45 20 74 31 28 61 2c 62 2c 63 29 TABLE t1(a,b,c) +| page 2 offset 4096 +| 0: 0d 00 00 00 01 0f ce 00 0f ce 00 00 00 00 00 00 ................ +| 4032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ..............(. +| 4048: ff ff ff ff ff ff ff 28 04 27 25 23 61 61 61 61 .........'%#aaaa +| 4064: 61 61 61 61 61 61 61 61 61 62 62 62 62 62 62 62 aaaaaaaaabbbbbbb +| 4080: 62 62 62 62 62 63 63 63 63 63 63 63 63 63 63 63 bbbbbccccccccccc +| end x3.db +}]} {} + +do_test 2.1 { + set R [sqlite3_recover_init db main test.db2] + $R run + $R finish +} {} + +sqlite3 db2 test.db2 +do_execsql_test -db db2 2.2 { + SELECT sql FROM sqlite_schema +} { + {CREATE TABLE t1(a,b,c)} +} +do_execsql_test -db db2 2.3 { + SELECT * FROM t1 +} {} +db2 close + +#------------------------------------------------------------------------- +# +reset_db +do_test 3.0 { + sqlite3 db {} + db deserialize [decode_hexdb { + .open --hexdb + | size 4096 pagesize 1024 filename corrupt032.txt.db + | page 1 offset 0 + | 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3. + | 16: 04 00 01 01 08 40 20 20 00 00 00 02 00 00 00 03 .....@ ........ + | 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 ................ + | 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................ + | 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ................ + | 96: 00 2e 24 80 0d 00 00 00 01 03 d4 00 03 d4 00 00 ..$............. + | 976: 00 00 00 00 22 01 06 17 11 11 01 31 74 61 62 6c ...........1tabl + | 992: 65 74 31 74 31 02 43 52 45 41 54 45 20 54 41 42 et1t1.CREATE TAB + | 1008: 4c 45 20 74 31 28 78 29 00 00 00 00 00 00 00 00 LE t1(x)........ + | page 2 offset 1024 + | 0: 0d 00 00 00 01 02 06 00 02 06 00 00 00 00 00 00 ................ + | 512: 00 00 00 00 00 00 8b 60 01 03 97 46 00 00 00 00 .......`...F.... + | 1008: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 00 ................ + | end corrupt032.txt.db +}]} {} + +do_test 3.1 { + set R [sqlite3_recover_init db main test.db2] + $R run + $R finish +} {} + +#------------------------------------------------------------------------- +# +reset_db +do_test 4.0 { + sqlite3 db {} + db deserialize [decode_hexdb { + .open --hexdb + | size 4096 pagesize 4096 filename crash-00f2d3627f1b43.db + | page 1 offset 0 + | 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3. + | 16: 00 01 01 02 00 40 20 20 01 00 ff 00 42 01 10 01 .....@ ....B... + | 32: ef 00 00 87 00 ff ff ff f0 01 01 10 ff ff 00 00 ................ + | end crash-00f2d3627f1b43.db +}]} {} + +do_test 4.1 { + set R [sqlite3_recover_init db main test.db2] + catch { $R run } + list [catch { $R finish } msg] $msg +} {1 {unable to open database file}} + +#------------------------------------------------------------------------- +# +reset_db +do_test 5.0 { + sqlite3 db {} + db deserialize [decode_hexdb { +.open --hexdb +| size 16384 pagesize 4096 filename crash-7b75760a4c5f15.db +| page 1 offset 0 +| 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3. +| 16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 04 .....@ ........ +| 32: 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 00 ................ +| 96: 00 00 00 00 0d 00 00 00 03 0f 4e 00 0f bc 0f 90 ..........N..... +| 112: 0f 4e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .N.............. +| 3904: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 03 ..............@. +| 3920: 06 17 11 11 01 6d 74 61 62 6c 65 74 32 74 32 04 .....mtablet2t2. +| 3936: 43 52 45 41 54 45 20 54 41 42 4c 45 20 74 32 28 CREATE TABLE t2( +| 3952: 78 2c 79 2c 7a 20 50 52 49 4d 41 52 59 20 4b 45 x,y,z PRIMARY KE +| 3968: 59 29 20 57 49 54 48 4f 55 54 20 52 4f 57 49 44 Y) WITHOUT ROWID +| 3984: 2a 02 06 17 13 11 01 3f 69 6e 64 65 78 74 31 61 *......?indext1a +| 4000: 74 31 03 43 52 45 41 54 45 20 49 4e 44 45 58 20 t1.CREATE INDEX +| 4016: 74 31 61 20 4f 4e 20 74 31 28 61 29 42 01 06 17 t1a ON t1(a)B... +| 4032: 11 11 01 71 74 61 62 6c 65 74 31 74 31 02 43 52 ...qtablet1t1.CR +| 4048: 45 41 54 45 20 54 41 42 4c 45 20 74 31 28 61 20 EATE TABLE t1(a +| 4064: 49 4e 54 2c 62 20 54 45 58 54 2c 63 20 42 4c 4f INT,b TEXT,c BLO +| 4080: 42 2c 64 20 52 45 41 4c 29 20 53 54 52 49 43 54 B,d REAL) STRICT +| page 2 offset 4096 +| 0: 0d 00 00 00 14 0c ae 00 0f df 0f bd 0f 9a 0f 76 ...............v +| 16: 0f 51 0f 2b 0f 04 0e dc 0e b3 0e 89 0e 5e 0e 32 .Q.+.........^.2 +| 32: 0e 05 0d 1a 0d a8 0d 78 0d 47 0d 15 0c e2 00 00 .......x.G...... +| 3232: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 32 14 ..............2. +| 3248: 05 06 3f 34 07 15 f4 c9 23 af e2 b3 b6 61 62 63 ..?4....#....abc +| 3264: 30 32 30 78 79 7a 01 00 00 00 00 00 00 00 00 00 020xyz.......... +| 3280: 00 00 00 00 00 00 00 00 00 00 c3 b0 96 7e fb 4e .............~.N +| 3296: c5 4c 31 13 05 06 1f 32 07 dd f2 2a a5 7e b2 4d .L1....2...*.~.M +| 3312: 82 61 62 63 30 31 39 78 79 7a 01 00 00 00 00 00 .abc019xyz...... +| 3328: 00 00 00 00 00 00 00 00 00 00 00 00 00 c3 a3 d6 ................ +| 3344: e9 f1 c2 fd f3 30 12 05 06 1f 30 07 8f 8f f5 c4 .....0....0..... +| 3360: 35 b6 7f 8d 61 62 63 30 31 38 00 00 00 00 00 00 5...abc018...... +| 3376: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 ...............C +| 3392: b2 13 1f 9d 56 8a 47 21 b1 05 06 1f 2e 07 7f 46 ....V.G!.......F +| 3408: 91 03 3f 97 fb f7 61 62 63 30 00 00 00 00 00 00 ..?...abc0...... +| 3440: c3 bb d8 96 86 c2 e8 2b 2e 10 05 06 1f 2c 07 6d .......+.....,.m +| 3456: 85 7b ce d0 32 d2 54 61 62 63 30 00 00 00 00 00 ....2.Tabc0..... +| 3488: 43 a1 eb 44 14 dc 03 7b 2d 0f 05 06 1f 2a 07 d9 C..D....-....*.. +| 3504: ab ec bf 34 51 70 f3 61 62 63 30 31 35 78 79 7a ...4Qp.abc015xyz +| 3520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 c3 ................ +| 3536: b6 3d f4 46 b1 6a af 2c 0e 05 06 1f 28 07 36 75 .=.F.j.,....(.6u +| 3552: e9 a2 bd 05 04 ea 61 62 63 30 31 34 78 79 7a 00 ......abc014xyz. +| 3568: 00 00 00 00 00 00 00 00 00 00 00 00 00 c3 ab 23 ...............# +| 3584: a7 6a 34 ca f8 2b 0d 05 06 1f 26 07 48 45 ab e0 .j4..+....&.HE.. +| 3600: 8c 7c ff 0c 61 62 63 30 31 33 78 79 7a 00 00 00 .|..abc013xyz... +| 3616: 00 00 00 00 0d d0 00 00 00 00 43 b8 d3 93 f4 92 ..........C..... +| 3632: 5b 7a 2a 0c 05 06 1f 24 07 be 6d 1e db 61 5d 80 [z*....$..m..a]. +| 3648: 9f 61 62 63 30 31 32 78 79 7a 00 00 00 00 00 00 .abc012xyz...... +| 3664: 00 00 00 00 00 00 43 b5 a1 a4 af 7b c6 60 29 0b ......C......`). +| 3680: 05 06 1f 22 07 6e a2 a3 64 68 d4 a6 bd 61 62 63 .....n..dh...abc +| 3696: 30 31 31 78 79 7a 00 00 00 00 00 00 00 00 00 00 011xyz.......... +| 3712: 00 c3 c4 1e ff 0f fc e6 ff 28 0a 05 06 1f 20 07 .........(.... . +| 3728: 50 f9 4a bb a5 7a 1e ca 61 62 63 30 31 30 78 79 P.J..z..abc010xy +| 3744: 7a 00 00 00 00 00 00 00 00 00 00 c3 a7 90 ed d9 z............... +| 3760: 5c 2c d5 27 09 05 06 1f 1e 07 90 8e 1d d9 1c 3a .,.'...........: +| 3776: e8 c1 61 62 63 30 30 39 78 79 7a 00 00 00 00 00 ..abc009xyz..... +| 3792: 00 00 00 00 43 a7 97 87 cf b0 ff 79 26 08 05 06 ....C......y&... +| 3808: 1f 1c 07 86 65 f6 7c 50 7a 2c 76 61 62 63 30 30 ....e.|Pz,vabc00 +| 3824: 38 78 79 7a 00 00 00 00 00 00 00 00 c3 b0 e3 4c 8xyz...........L +| 3840: 4f d3 41 b5 25 07 05 06 1f 1a 07 8b 20 e5 68 11 O.A.%....... .h. +| 3856: 13 55 87 61 62 63 30 30 37 78 79 7a 00 00 00 00 .U.abc007xyz.... +| 3872: 00 00 00 c3 b6 a3 74 f1 9c 33 f8 24 06 05 06 1f ......t..3.$.... +| 3888: 18 07 97 3c bc 34 49 94 54 ab 61 62 63 30 30 36 ...<.4I.T.abc006 +| 3904: 78 79 7a 00 00 00 00 00 00 c3 88 00 c2 ca 4c 4d xyz...........LM +| 3920: d3 23 05 05 06 1f 16 07 59 37 11 10 e9 e5 3d d5 .#......Y7....=. +| 3936: 61 62 63 30 30 35 78 79 7a 00 00 00 00 00 c3 c0 abc005xyz....... +| 3952: 15 12 67 ed 4b 79 22 04 05 06 1f 14 07 93 39 01 ..g.Ky........9. +| 3968: 7f b8 c7 99 58 61 62 63 30 30 34 78 79 7a 00 00 ....Xabc004xyz.. +| 3984: 09 c0 43 bf e0 e7 6d 70 fd 61 21 03 05 06 1f 12 ..C...mp.a!..... +| 4000: 07 b6 df 8d 8b 27 08 22 5a 61 62 63 30 30 33 78 .....'..Zabc003x +| 4016: 79 7a 00 00 00 c3 c7 ea 0f dc dd 32 22 20 02 05 yz.........2. .. +| 4032: 06 1f 10 07 2f a6 da 71 df 66 b3 b5 61 62 63 30 ..../..q.f..abc0 +| 4048: 30 32 78 79 7a 00 00 c3 ce d9 8d e9 ec 20 45 1f 02xyz........ E. +| 4064: 01 05 06 1f 0e 07 5a 47 53 20 3b 48 8f c0 61 62 ......ZGS ;H..ab +| 4080: 63 30 30 31 78 79 7a 00 c3 c9 e6 81 f8 d9 24 04 c001xyz.......$. +| page 3 offset 8192 +| 0: 0a 00 00 00 14 0e fd 00 0f f3 0f e6 0f d9 0f cc ................ +| 16: 0f bf 0f b2 0f a5 0f 98 0f 8b 0f 7e 0f 71 0f 64 ...........~.q.d +| 32: 0f 57 0f 4a 0f 3d 0f 30 0f 24 00 00 00 00 00 00 .W.J.=.0.$...... +| 3824: 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 03 06 ................ +| 3840: 01 7f 46 91 03 3f 97 fb f7 11 0c 03 06 01 6e a2 ..F..?........n. +| 3856: a3 64 68 d4 a6 bd 0b 0c 03 06 01 6d 85 7b ce d0 .dh........m.... +| 3872: 32 d2 54 10 0b 03 06 09 5a 47 53 20 3b 48 8f c0 2.T.....ZGS ;H.. +| 3888: 0c 03 06 01 59 37 11 10 e9 e5 3d d5 05 0c 03 06 ....Y7....=..... +| 3904: 01 50 f9 4a bb a5 7a 1e ca 0a 0c 03 06 01 48 45 .P.J..z.......HE +| 3920: ab e0 8c 7c ff 0c 0d 0c 03 06 01 36 75 e9 a2 bd ...|.......6u... +| 3936: 05 04 ea 0e 0c 03 06 01 2f a6 da 71 df 66 b3 b5 ......../..q.f.. +| 3952: 02 0c 03 06 01 15 f4 c9 23 af e2 b3 b6 14 0c 03 ........#....... +| 3968: 06 01 dd f2 2a a5 7e b2 4d 82 13 0c 03 06 01 d9 ....*.~.M....... +| 3984: ab ec bf 34 51 70 f3 0f 0c 03 06 01 be 6d 1e db ...4Qp.......m.. +| 4000: 61 5d 80 9f 0c 0c 03 06 01 b6 df 8d 8b 27 08 22 a]...........'.. +| 4016: 5a 03 0c 03 06 01 97 3c bc 34 49 94 54 ab 06 0c Z......<.4I.T... +| 4032: 03 06 01 93 39 01 7f b8 c7 99 58 04 0c 03 06 01 ....9.....X..... +| 4048: 90 8e 1d d9 1c 3a e8 c1 09 0c 03 06 01 8f 8f f5 .....:.......... +| 4064: c4 35 b6 7f 8d 12 0c 03 06 01 8b 20 e5 68 11 13 .5......... .h.. +| 4080: 55 87 07 0c 03 06 01 86 65 f6 7c 50 7a 2b 06 08 U.......e.|Pz+.. +| page 4 offset 12288 +| 0: 0a 00 00 00 14 0f 62 00 0f 7a 0f a1 0f c9 0f d9 ......b..z...... +| 16: 0f 81 0f d1 0f f1 0f f9 0f e1 0f 89 0e 6a 0f c1 .............j.. +| 32: 0f 91 0f 99 0f b9 0f 72 0f 62 0f e9 0f b1 0f a9 .......r.b...... +| 3936: 00 00 07 04 01 01 01 11 0e 9e 07 04 01 01 01 0b ................ +| 3952: 31 16 07 04 01 01 01 10 37 36 06 04 09 01 01 ab 1.......76...... +| 3968: 58 07 04 01 01 01 05 1c 28 07 04 01 01 01 0a 10 X.......(....... +| 3984: cf 07 04 01 01 01 0d b2 e3 07 04 01 01 01 0e d3 ................ +| 4000: f2 07 04 01 01 01 02 41 ad 07 04 01 01 01 14 3e .......A.......> +| 4016: 22 07 04 01 01 01 13 27 45 07 04 01 01 01 0f ad .......'E....... +| 4032: dd 07 04 01 01 01 0c 2e a1 07 04 01 01 01 03 df ................ +| 4048: e1 07 04 01 01 01 06 59 a7 07 04 01 01 01 04 27 .......Y.......' +| 4064: bd 07 04 01 01 01 09 d0 e0 07 04 01 01 01 12 39 ...............9 +| 4080: 4f 07 04 01 01 01 07 c4 11 06 04 00 00 00 00 00 O............... +| end crash-7b75760a4c5f15.db +}]} {} + +do_test 5.1 { + set R [sqlite3_recover_init db main test.db2] + catch { $R run } + list [catch { $R finish } msg] $msg +} {0 {}} + +#------------------------------------------------------------------------- +# +reset_db +do_test 6.0 { + sqlite3 db {} + db deserialize [decode_hexdb { +| size 8192 pagesize 4096 filename abc.db +| page 1 offset 0 +| 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3. +| 16: 10 00 01 01 00 40 20 20 00 00 00 02 00 00 00 02 .....@ ........ +| 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 ................ +| 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................ +| 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ................ +| 96: 00 2e 6e b8 0d 00 00 00 01 0f dc 00 0f dc 00 00 ..n............. +| 4048: 00 00 00 00 00 00 00 00 00 00 00 00 22 01 06 17 ................ +| 4064: 11 11 01 31 74 61 62 6c 65 74 31 74 31 02 43 52 ...1tablet1t1.CR +| 4080: 45 41 54 45 20 54 41 42 4c 45 20 74 31 28 78 29 EATE TABLE t1(x) +| page 2 offset 4096 +| 0: 0d 00 00 00 01 0f e2 00 0f e2 00 00 00 00 00 00 ................ +| 4064: 00 00 1c 01 02 41 61 62 63 64 65 66 67 68 69 6a .....Aabcdefghij +| 4080: 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a klmnopqrstuvwxyz +| end abc.db +}]} {} +do_test 6.1 { + set R [sqlite3_recover_init db main test.db2] + catch { $R run } + list [catch { $R finish } msg] $msg +} {0 {}} + +reset_db +breakpoint +do_test 6.2 { + sqlite3 db {} + db deserialize [decode_hexdb { +| size 8192 pagesize 4096 filename abc.db +| page 1 offset 0 +| 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3. +| 16: 10 00 01 01 00 40 20 20 00 00 00 02 00 00 00 02 .....@ ........ +| 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 ................ +| 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................ +| 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ................ +| 96: 00 2e 6e b8 0d 00 00 00 01 0f dc 00 0f dc 00 00 ..n............. +| 4048: 00 00 00 00 00 00 00 00 00 00 00 00 22 01 06 17 ................ +| 4064: 11 11 01 31 74 61 62 6c 65 74 31 74 31 02 43 52 ...1tablet1t1.CR +| 4080: 45 41 54 45 20 54 41 42 4c 45 20 74 31 28 78 29 EATE TABLE t1(x) +| page 2 offset 4096 +| 0: 0d 00 00 00 01 0f e2 00 0f e2 00 00 00 00 00 00 ................ +| 4064: 00 00 1c 01 02 8F FF FF FF 7E 65 66 67 68 69 6a .....Aabcdefghij +| 4080: 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a klmnopqrstuvwxyz +| end abc.db +}]} {} +do_test 6.3 { + set R [sqlite3_recover_init db main test.db2] + catch { $R run } + list [catch { $R finish } msg] $msg +} {0 {}} + +reset_db +breakpoint +do_test 7.0 { + sqlite3 db {} + db deserialize [decode_hexdb { +| size 4108 pagesize 4096 filename x1.db +| page 1 offset 0 +| 0: 02 01 00 00 00 00 14 15 40 00 00 00 00 00 00 00 ........@....... +| 16: 33 3a 6d 65 6d 6f 72 79 3a 02 02 02 02 02 02 02 3:memory:....... +| 32: 02 02 02 02 02 02 12 02 02 02 63 6f 6c 6f 72 20 ..........color +| 48: 73 70 61 63 00 f3 a0 81 a1 00 00 a0 02 02 02 02 spac............ +| 64: 69 95 73 6f 36 00 ff 0d 00 97 8c 90 3f 0a 70 02 i.so6.......?.p. +| 80: 02 02 02 02 02 02 02 02 02 02 02 02 02 01 00 00 ................ +| 96: 06 02 02 02 02 5f 02 02 02 2c 02 02 02 02 02 02 ....._...,...... +| 112: 02 02 02 02 02 02 02 02 02 12 02 02 02 63 6f 6c .............col +| 128: 6f 72 20 73 70 61 63 00 f3 a0 81 a1 00 00 a0 02 or spac......... +| 144: 02 02 02 69 95 73 6f 36 00 ff 0d 00 97 8c 90 3f ...i.so6.......? +| 160: 0a 70 02 02 02 02 02 02 02 02 02 02 02 02 02 02 .p.............. +| 176: 01 00 00 06 02 02 02 02 5f 02 02 02 2c 02 02 00 ........_...,... +| 192: 00 01 00 01 00 00 00 01 00 02 fe 00 00 03 00 01 ................ +| 208: 00 00 00 01 c5 04 00 00 00 01 00 01 00 00 00 01 ................ +| 224: 00 fa 02 00 00 00 03 00 01 00 00 00 81 00 04 00 ................ +| 240: 00 00 01 00 01 00 00 00 01 00 02 00 fe 00 03 00 ................ +| 256: 01 00 00 00 01 00 04 00 00 00 01 00 01 00 00 00 ................ +| 272: 01 00 02 00 00 00 03 00 01 00 00 00 01 00 04 00 ................ +| 288: 00 00 01 00 01 00 00 00 01 00 02 00 00 00 03 00 ................ +| 304: 01 00 00 00 01 00 04 00 00 00 01 00 01 00 00 00 ................ +| 320: 01 00 02 00 00 00 03 00 01 00 00 00 40 00 84 00 ............@... +| 336: 84 00 84 00 01 00 00 00 09 00 06 00 f5 00 01 00 ................ +| 352: 08 01 03 00 03 00 62 00 62 00 23 00 01 00 62 00 ......b.b.#...b. +| 368: 04 00 1e 00 62 00 62 00 62 00 01 00 00 00 0a 00 ....b.b.b....... +| 384: 01 00 03 00 01 00 03 00 04 00 02 00 01 00 01 00 ................ +| 400: 08 00 01 00 31 c6 00 03 00 0c 00 12 00 18 00 02 ....1........... +| 416: 00 05 00 08 00 02 00 06 00 08 00 02 00 07 00 08 ................ +| 432: 00 02 00 01 00 01 00 08 00 01 00 0c 00 03 00 16 ................ +| 448: 00 1c 00 22 00 01 00 03 00 05 00 06 00 07 00 02 ................ +| 464: 00 05 00 09 00 02 00 06 00 09 00 02 00 07 00 09 ................ +| 480: 00 00 00 00 01 00 05 00 00 00 01 00 01 00 00 00 ................ +| 496: 01 00 02 00 00 00 03 00 01 00 00 00 01 00 04 00 ................ +| 512: 00 00 01 00 01 00 00 00 01 00 02 00 00 00 03 00 ................ +| 528: 01 00 00 00 01 00 04 00 00 00 01 00 01 00 00 00 ................ +| 544: 01 00 02 00 00 f6 03 00 00 02 00 00 01 00 04 00 ................ +| 560: 00 00 01 00 01 00 00 00 01 00 02 00 00 00 03 00 ................ +| 576: 01 00 00 00 01 00 04 00 00 00 01 00 01 00 00 00 ................ +| 592: 01 00 02 00 00 00 03 00 01 00 00 00 01 00 04 00 ................ +| 608: 00 00 01 00 01 00 00 00 01 00 02 00 00 00 03 00 ................ +| 624: 01 00 00 00 01 00 04 00 00 00 01 00 01 00 00 00 ................ +| 640: 01 3d 02 00 00 00 03 00 06 00 00 00 01 00 01 00 .=.............. +| 656: 00 00 01 00 01 00 00 00 01 00 02 00 00 00 03 00 ................ +| 672: 01 00 00 00 01 00 04 00 00 00 01 00 01 00 00 00 ................ +| 688: 01 00 02 00 00 00 55 52 4c 52 65 71 75 65 73 74 ......URLRequest +| 704: 43 6f 6e 00 00 00 01 01 0e d4 00 04 00 00 00 01 Con............. +| 720: 0e f8 00 04 00 00 00 01 0f 1c 00 04 00 00 00 01 ................ +| 736: 0f 00 00 01 00 00 00 01 0f 86 00 01 00 00 00 01 ................ +| 752: 0f 84 00 01 00 00 00 01 00 00 01 0f c0 00 01 00 ................ +| 768: 00 00 01 0f e8 00 d6 0f 00 01 6f 00 02 0f d6 00 ..........o..... +| 784: 02 34 03 03 03 00 01 00 00 00 01 00 05 00 00 00 .4.............. +| 800: 01 00 01 00 00 00 01 00 02 00 00 00 03 00 01 00 ................ +| 816: 00 00 01 00 04 00 00 00 01 00 01 00 00 00 01 00 ................ +| 832: 02 00 00 00 03 00 01 00 10 00 01 00 04 00 00 00 ................ +| 848: 01 00 01 00 00 00 01 00 02 00 00 00 03 00 00 02 ................ +| 864: 00 00 01 40 04 00 00 03 01 00 01 00 00 00 01 00 ...@............ +| 880: 02 00 00 00 03 00 01 00 00 00 00 00 01 0e f8 00 ................ +| 896: 04 77 4f 46 32 73 40 23 70 00 00 00 70 00 1f 00 .wOF2s@#p...p... +| 912: 00 00 d8 00 00 00 ff ff 00 00 00 00 43 00 00 00 ............C... +| 928: 00 00 ff ff ff ff ff 00 00 a8 00 00 0c 00 00 00 ................ +| 1024: 00 00 00 00 00 00 00 00 00 00 10 22 00 22 0f 00 ................ +| 1040: 00 00 00 00 00 00 10 22 00 00 70 00 1f 00 00 0f ..........p..... +| 1056: d8 00 00 00 00 00 00 00 00 00 03 00 00 00 00 00 ................ +| 1072: 00 01 00 00 00 3f 23 70 00 00 00 01 0f 1c 00 04 .....?#p........ +| 1088: 00 00 00 01 0f 40 00 01 00 00 00 01 0f 86 00 01 .....@.......... +| 1104: 00 00 00 01 0f 84 00 01 00 00 00 01 00 00 01 0f ................ +| 1120: c0 00 01 00 00 00 01 0f e8 00 01 0f d6 00 6f 00 ..............o. +| 1136: 02 0f d6 00 03 02 31 03 2b 03 2a f2 00 0f d4 00 ......1.+.*..... +| 1152: 01 00 08 00 01 00 04 03 2b 00 02 02 32 00 01 0f ........+...2... +| 1168: c8 01 15 00 02 20 c8 00 02 12 ad 02 00 24 06 c0 ..... .......$.. +| 1184: 00 00 00 03 00 00 01 24 00 2a 06 e4 00 00 00 03 .......$.*...... +| 1200: 00 00 01 25 00 38 07 0e 00 00 00 03 00 00 01 26 ...%.8.........& +| 1216: 00 34 07 46 00 00 00 03 00 00 01 27 00 1c 07 7a .4.F.......'...z +| 1232: 00 00 00 03 00 00 01 28 00 2a 07 96 00 00 00 03 .......(.*...... +| 1248: 00 e5 01 29 00 34 07 c0 00 00 00 03 00 00 01 2a ...).4.........* +| 1264: 67 34 07 f4 00 00 00 03 00 00 01 2b 00 22 08 28 g4.........+...( +| 1280: 00 00 00 00 01 00 01 00 00 00 01 00 02 00 00 00 ................ +| 1296: 03 00 01 00 00 00 01 00 00 00 01 00 00 00 01 00 ................ +| 1312: 01 00 00 00 01 00 02 00 00 00 03 00 00 02 00 00 ................ +| 1328: 01 00 04 00 00 00 01 00 01 00 00 00 01 00 02 00 ................ +| 1344: 00 00 03 00 01 00 00 00 01 00 04 00 00 00 01 00 ................ +| 1360: 01 00 00 00 01 00 02 00 00 00 03 00 01 00 00 21 ...............! +| 1376: 04 00 01 00 00 00 00 00 01 00 00 00 01 00 02 00 ................ +| 1392: 00 00 03 00 01 00 00 00 01 00 04 00 00 00 01 00 ................ +| 1408: 01 00 00 00 01 00 02 00 00 00 03 00 01 00 00 00 ................ +| 1424: 01 00 05 00 00 00 01 00 01 00 00 01 00 02 02 02 ................ +| 1440: 12 02 02 02 63 6f 6c 6f 72 20 73 70 61 63 00 f3 ....color spac.. +| 1456: a0 81 a1 00 00 a0 02 02 02 02 69 95 73 6f 36 00 ..........i.so6. +| 1472: ff 0d 00 97 8c 90 3f 0a 70 02 02 02 02 02 02 02 ......?.p....... +| 1488: 02 02 02 02 02 02 02 01 00 00 06 02 02 02 02 5f ..............._ +| 1504: 02 02 02 2c 02 02 00 00 01 00 01 00 00 00 01 00 ...,............ +| 1520: 02 fe 00 00 03 00 01 00 00 00 01 c5 04 00 00 00 ................ +| 1536: 01 00 01 00 00 00 01 00 02 00 00 00 03 00 01 00 ................ +| 1552: 00 00 81 00 04 00 00 00 01 00 01 00 00 00 01 00 ................ +| 1568: 02 00 fe 00 03 00 01 00 00 00 01 00 04 00 00 00 ................ +| 1584: 01 00 01 00 00 00 01 00 02 00 00 00 03 00 01 00 ................ +| 1600: 00 00 01 00 04 00 00 00 01 00 01 00 00 00 01 00 ................ +| 1616: 02 00 00 00 03 00 01 00 00 00 01 00 04 00 00 00 ................ +| 1632: 01 00 01 00 00 00 01 00 02 00 00 00 03 00 01 00 ................ +| 1648: 00 00 40 00 84 00 84 00 84 00 01 00 00 00 09 00 ..@............. +| 1664: 06 00 f5 00 01 00 08 01 03 15 15 15 15 15 15 15 ................ +| 1680: 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ................ +| 1696: 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ................ +| 1712: 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ................ +| 1728: 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ................ +| 1744: 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ................ +| 1760: 15 15 15 15 15 15 15 15 15 15 15 00 03 00 62 00 ..............b. +| 1776: 62 00 23 00 01 00 62 00 04 00 1e 00 62 00 62 00 b.#...b.....b.b. +| 1792: 62 00 01 00 00 00 0a 00 01 00 03 00 01 00 03 00 b............... +| 1808: 04 00 02 00 01 00 01 00 08 00 01 00 31 c6 00 03 ............1... +| 1824: 00 0c 00 12 00 18 00 02 00 05 00 08 00 02 00 06 ................ +| 1840: 00 08 00 02 00 07 00 08 00 02 00 01 00 01 00 08 ................ +| 1856: 00 01 00 0c 00 03 00 16 00 1c 00 22 00 01 00 03 ................ +| 1872: 00 05 00 06 00 07 00 02 00 05 00 09 00 02 00 06 ................ +| 1888: 00 09 00 02 00 07 00 09 00 00 00 00 01 00 05 00 ................ +| 1904: 00 00 01 00 01 00 00 00 01 00 02 00 00 00 03 00 ................ +| 1920: 01 00 00 00 01 00 04 00 00 00 01 00 01 00 00 00 ................ +| 1936: 01 00 02 00 00 00 03 00 01 00 00 00 01 00 04 00 ................ +| 1952: 00 00 01 0f d6 00 02 34 03 03 03 00 01 00 00 00 .......4........ +| 1968: 01 00 05 00 00 00 01 00 01 00 00 00 01 00 02 00 ................ +| 1984: 00 00 03 00 01 00 00 00 01 00 04 00 00 00 01 00 ................ +| 2000: 01 00 00 00 01 00 02 fc 42 dc 19 5c 74 23 18 cd ........B...t#.. +| 2016: b3 a5 a8 7a 90 40 1d 66 12 5d e5 4f 85 00 68 f4 ...z.@.f.].O..h. +| 2032: 05 98 86 25 24 dd bc c2 f6 f6 4e a3 e2 61 d2 c6 ...%$.....N..a.. +| 2048: aa c1 56 50 d4 80 82 35 f1 e2 59 41 50 a6 da 51 ..VP...5..YAP..Q +| 2064: d4 62 9c 19 94 58 aa 31 30 8a 22 c2 5f 33 2b c9 .b...X.10..._3+. +| 2080: b6 e6 b4 11 4e 51 82 c4 d8 b6 d8 b4 06 04 fb 68 ....NQ.........h +| 2096: f4 d2 6f e7 cb 8a a8 82 d5 74 00 00 00 00 00 00 ..o......t...... +| 2368: 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 ................ +| 2432: 00 00 00 00 00 03 00 01 00 10 00 01 00 04 00 00 ................ +| 2448: 00 01 00 01 00 00 00 01 00 02 00 00 00 03 00 00 ................ +| 2464: 02 00 00 01 40 04 00 00 03 01 00 01 00 00 00 01 ....@........... +| 2480: 00 02 00 00 00 03 00 01 00 00 00 00 00 01 0e f8 ................ +| 2496: 00 04 77 4f 46 32 73 40 23 70 00 00 00 70 00 1f ..wOF2s@#p...p.. +| 2512: 00 00 00 d8 00 00 00 ff ff 00 00 00 00 43 00 00 .............C.. +| 2528: 00 00 00 ff ff ff ff ff 00 00 a8 00 00 0c 00 00 ................ +| 2624: 00 00 00 00 00 00 00 00 00 00 00 10 22 00 22 0f ................ +| 2640: 00 00 00 00 00 00 00 10 22 00 00 70 00 1f 00 00 ...........p.... +| 2656: 0f d8 00 00 00 00 00 00 00 00 00 03 00 00 00 00 ................ +| 2672: 00 00 01 00 00 00 3f 23 70 00 00 00 01 0f 1c 00 ......?#p....... +| 2688: 04 00 00 00 01 0f 40 00 01 00 00 00 01 0f 86 00 ......@......... +| 2704: 01 00 00 00 01 0f 84 00 01 00 00 00 01 00 00 01 ................ +| 2720: 0f c0 00 01 00 00 00 01 0f e8 00 01 0f d6 00 6f ...............o +| 2736: 00 02 0f d6 00 03 02 31 03 2b 03 2a f2 00 0f d4 .......1.+.*.... +| 2752: 00 01 00 08 00 01 00 04 03 2b 00 02 02 32 00 01 .........+...2.. +| 2768: 0f c8 01 15 00 02 20 c8 00 02 12 ad 02 00 24 06 ...... .......$. +| 2784: c0 00 00 5a 03 00 00 01 24 00 2a 06 e4 00 00 00 ...Z....$.*..... +| 2800: 03 00 00 01 25 00 38 07 0e 00 00 00 03 00 00 01 ....%.8......... +| 2816: 26 00 34 07 46 00 00 00 03 00 00 01 27 00 1c 07 &.4.F.......'... +| 2832: 7a 00 00 00 03 00 00 01 28 00 2a 07 96 00 00 00 z.......(.*..... +| 2848: 03 00 e5 01 29 00 34 07 c0 00 00 00 03 00 00 01 ....).4......... +| 2864: 2a 67 34 07 f4 00 00 00 03 00 00 01 2b 00 22 08 *g4.........+... +| 2880: 28 00 00 00 00 01 00 01 00 00 00 01 00 02 00 00 (............... +| 2896: 00 03 00 01 00 00 00 01 00 00 00 01 00 00 00 01 ................ +| 2912: 00 01 00 00 00 01 00 02 00 00 00 03 00 00 02 00 ................ +| 2928: 00 01 00 04 00 00 00 01 00 01 00 00 00 00 00 00 ................ +| 2992: 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .H.............. +| 3504: 00 00 00 00 00 00 00 00 00 00 00 97 00 00 00 00 ................ +| 3904: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09 ................ +| 3920: 03 fe 00 00 01 36 00 3c 0a 38 00 00 00 03 00 00 .....6.<.8...... +| 3936: 01 37 00 20 0a 74 00 00 00 fb ff ff 00 38 00 2a .7. .t.......8.* +| 3952: 0a 94 00 00 00 03 00 00 01 39 4f 54 54 4f 00 0e .........9OTTO.. +| 3968: 00 80 00 03 00 60 43 46 46 20 e3 ae 89 2a 00 00 .....`CFF ...*.. +| 3984: 02 b0 00 00 02 76 42 50 4f 53 00 15 00 0a 00 00 .....vBPOS...... +| 4000: 05 28 00 00 00 0c 54 53 55 42 c9 70 c3 06 00 00 .(....TSUB.p.... +| 4016: 05 34 1f 00 40 00 48 00 00 00 00 00 00 00 00 00 .4..@.H......... +| 4064: 00 00 00 00 00 08 00 01 00 01 00 01 00 01 00 06 ................ +| 4080: 00 02 00 08 00 01 00 01 00 01 00 01 00 00 00 00 ................ +| end x1.db +}]} {} +do_test 7.1 { + set R [sqlite3_recover_init db main test.db2] + catch { $R run } + list [catch { $R finish } msg] $msg +} {1 {file is not a database}} + +reset_db +do_test 8.0 { + sqlite3 db {} + db deserialize [decode_hexdb { +| size 8192 pagesize 4096 filename db.sqlite +| page 1 offset 0 +| 0: ac ae b3 76 74 65 20 66 6f 72 6d 61 74 20 33 00 ...vte format 3. +| 16: 10 00 01 01 00 40 20 20 00 00 00 01 00 00 00 02 .....@ ........ +| 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 ................ +| 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................ +| 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ................ +| 96: 00 2e 76 8a 0d ff ff ff 1e 0f cb 00 0f cb 00 00 ..v............. +| 4032: 00 00 00 00 00 00 00 00 00 00 00 33 01 06 17 19 ...........3.... +| 4048: 19 01 43 74 61 62 6c 65 54 61 62 6c 65 30 54 61 ..CtableTable0Ta +| 4064: 62 6c 65 30 02 43 52 45 41 54 45 20 54 41 42 4c ble0.CREATE TABL +| 4080: 45 20 54 61 62 6c 65 30 20 28 43 6f 6c 30 20 29 E Table0 (Col0 ) +| page 2 offset 4096 +| 0: 0d 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 ................ +| end db.sqlite +}]} {} + +do_test 8.1 { + set R [sqlite3_recover_init db main test.db2] + catch { $R run } + list [catch { $R finish } msg] $msg +} {0 {}} + +reset_db +do_test 9.0 { + sqlite3 db {} + db deserialize [decode_hexdb { +| size 16384 pagesize 4096t 0 +| 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 +| 16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 06 ........ +| 32: 00 00 00 0r 00 00 00 00 00 00 00 06 00 00 00 04 .. +| 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ........ +| 96: 00 00 00 00 0d 00 00 00 06 0d e2 00 0f c4 0f 6a .......j +| 112: 0e fc 0e 9d 0e 3d 0d e2 00 00 00 00 00 00 00 00 . +| 3552: 00 00 59 06 06 17 21 21 01 7f 74 61 62 6c 65 74 ..tablet +| 3568: 74 74 5f 63 6f 6e 66 69 67 74 74 74 5f 63 6f 6econ +| 3584: 66 69 67 06 43 52 45 41 54 45 20 54 41 42 4c 45 +| 3616: 50 52 49 4d 41 52 59 20 4b 45 59 2c 20 76 29 20 ) +| 3632: 57 49 54 48 4f 55 54 20 52 4f 57 49 44 5e 05 07 WOWID^.. +| 3648: 17 23 23 01 81 03 74 61 62 6c 65 74 74 74 5f 6tt_d +| 3664: 6f 63 73 69 7a 65 74 74 74 5f 64 6f 63 73 69 7a z +| 3680: 65 05 43 52 45 41 54 45 20 54 41 42 4c 45 20 27 e.ABLE ' +| 3696: 74 74 74 5f 64 6f 63 73 69 7a 65 27 28 69 64 20id +| 3712: 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59 20 +| 3728: 4b 45 59 2c 20 73 7a 20 42 4c 4f 42 29 5d 04 07 KEYB)].. +| 3744: 17 23 23 01 81 B1 74 61 62 6c 65 74 74 74 5f 63 _c +| 3760: 6f 6e 74 65 6e 74 74 74 74 5f 63 6f 6e 74 65 6e o_conten +| 3776: 7 04 01 03 00 011 54 45 20 54 41 42 4c 45 20 27 t.CRLE ' +| 3792: 74 74 74 5f 63 6f 6e 74 65 6e 74 27 28 69 64 20 +| 3808: 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59 20 INIMARY +| 3904: 6f 2c 20 50 52 49 4d 41 52 59 20 4b 45 59 28 7EY(s +| 3920: 65 67 69 64 2c 20 74 65 72 6d 29 29 20 57 49 54 T +| 3936: 48 4f 55 54 20 52 4f 57 49 4 58 58 02 07 17 1d 1d .. +| 3952: 01 81 03 74 61 62 6c 65 74 74 74 5f 64 61 74 61 .tt_data +| 3968: 74 74 74 5f 64 61 74 61 02 43 52 45 41 54 45 2ATE +| 3984: 54 41 42 4c 45 20 27 74 74 74 5f 64 61 74 61 27 ' +| 4000: 28 69 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d (iR PRIM +| 4016: 41 52 59 20 4b 45 59 2c 20 62 6c 6f 63 6b 20 42k B +| 4032: 4c 4f 42 29 3a 01 06 17 13 13 08 5f 74 61 62 6c +| 4048: 65 74 74 74 74 74 74 43 52 45 41 54 45 20 56 49 ettTE VI +| 4064: 52 54 55 41 4c 20 54 41 42 4c 45 20 74 74 74 20 t +| 4080: 55 53 49 4e 47 20 66 74 73 35 28 61 2c 20 62 29 U5(a, b) +| page 4 offset 12288 +| 0: 0a 00 00 00 03 0f ea 00 0f fa 0f f2 0f ea 00 00 ........ +| 4064: 00 00 00 00 00 00 00 00 00 00 07 04 01 01 01 05 .. +| 4080: 06 03 07 04 01 01 01 03 04 02 05 04 09 01 09 02 ........ +| end ro2.t +}]} {} + +do_test 9.1 { + set R [sqlite3_recover_init db main test.db2] + catch { $R run } + list [catch { $R finish } msg] $msg +} {0 {}} + + +finish_test + diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recovercorrupt3.test b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recovercorrupt3.test new file mode 100644 index 0000000000000000000000000000000000000000..9a7c2d09469001ace9c0ce32b0eaf46b13d17639 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recovercorrupt3.test @@ -0,0 +1,549 @@ +# 2024 May 1 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# + +source [file join [file dirname [info script]] recover_common.tcl] +set testprefix recovercorrupt3 + +#| 0: d5 d5 9b d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 ................ +#| 16: 04 00 00 00 1d 00 00 00 00 00 00 00 5f 5f 5f 5f ............____ +#| 32: 5f 5f 5f 5f 5f 5f 5f 5f 71 5f 5f 5f 02 02 02 02 ________q___.... +#| 48: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +#| 64: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +#| 80: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +#| 96: 02 02 02 02 + +#------------------------------------------------------------------------- +reset_db +do_test 1.0 { + sqlite3 db {} + db deserialize [decode_hexdb { +| size 3821 pagesize 1024 filename clusterfuzz-testcase-sql_recovery_fuzzer-5803962339885056 +| page 1 offset 0 +| 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3. +| 16: 10 00 01 01 00 40 20 20 00 00 00 01 00 00 00 02 .....@ ........ +| 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 ................ +| 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................ +| 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ................ +| 96: 00 2e 7a 70 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 112: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 128: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 144: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 160: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 176: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 192: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 208: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 224: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 240: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 256: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 272: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 288: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 304: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 320: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 336: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 352: 02 02 02 02 a0 02 02 02 02 02 02 02 02 02 02 02 ................ +| 368: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 384: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 400: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 416: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 432: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 448: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 29 29 ..............)) +| 464: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 480: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 496: 29 29 29 dd dd dd dd dd dd dd dd dd dd dd dd dd )))............. +| 512: dd dd dd dd dd dd dd dd dd 6e 69 d2 e9 e9 e9 d2 .........ni..... +| 528: d2 d2 d2 d2 dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 544: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 560: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 576: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 592: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 608: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 624: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 640: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 656: dd dd dd dd dd dd dd da dd dd dd dd dd dd dd dd ................ +| 672: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 688: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 704: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 720: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 736: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 752: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 768: dd dd dd dd dd dd dd dd dd dd dd dd dd 29 29 29 .............))) +| 784: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 800: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 816: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 832: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 848: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 864: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 880: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 896: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 912: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 928: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 944: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 960: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 976: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 992: 29 29 29 29 29 29 29 29 29 29 dd dd dd dd dd dd ))))))))))...... +| 1008: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| page 2 offset 1024 +| 0: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 16: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 32: dd dd 6e 69 d2 e9 e9 e9 d2 d2 d2 d2 d2 dd dd dd ..ni............ +| 48: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 64: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 80: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 96: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 112: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 128: dd dd dd dd dd dd 29 29 29 29 29 29 29 29 29 29 ......)))))))))) +| 144: 29 29 29 29 29 29 29 29 29 ad a5 29 29 29 29 00 )))))))))..)))). +| 160: 75 9c 11 00 5b e5 64 28 7c ca 09 69 28 2d 69 00 u...[.d(|..i(-i. +| 176: 85 88 6c 81 48 83 a0 93 c0 c0 82 8b 81 84 85 f9 ..l.H........... +| 192: 88 7a 00 7f 00 96 40 7b 12 4b 84 75 a0 00 99 a0 .z....@..K.u.... +| 208: df a0 7e 81 c6 90 8f 7f 84 85 cc 84 82 90 88 60 ..~............` +| 224: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 240: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 256: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 272: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 288: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 02 02 ................ +| 304: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 320: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 336: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 352: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 368: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 384: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 400: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 416: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 432: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 448: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 464: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 480: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 496: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 512: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 528: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 544: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 560: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 576: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 592: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 608: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 624: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 640: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 656: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 672: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 688: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 704: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 720: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 736: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 752: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 768: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 784: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 800: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 816: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 832: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 848: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 864: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 880: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 896: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 912: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 928: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 944: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 960: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 976: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 992: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 1008: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| page 3 offset 2048 +| 0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 16: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 32: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 48: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 64: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 80: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 96: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 112: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 128: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 144: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 160: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 176: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 192: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 208: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 224: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 240: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 256: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 272: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 288: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 304: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 320: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 336: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 352: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 368: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 384: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 400: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 416: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 432: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 448: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 464: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 480: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 496: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 512: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 528: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 544: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 560: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 576: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 592: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 608: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 624: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 640: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 656: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 672: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 688: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 704: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 720: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 736: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 752: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 768: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 784: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 800: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 816: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 832: 02 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 848: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 864: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 880: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 896: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 912: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 928: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 944: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 960: 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 976: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 992: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 1008: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| page 4 offset 3072 +| 0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 16: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 32: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 48: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 64: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 80: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 96: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 112: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 128: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 144: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 160: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 176: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 192: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 208: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 224: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 240: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 256: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 272: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 288: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 304: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 320: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 336: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 352: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 368: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 384: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 400: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 416: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 432: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 448: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 464: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 480: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 496: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 512: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 528: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 544: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 560: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 576: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 592: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 608: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 624: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 640: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 656: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 672: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 688: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 704: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 720: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 736: 5f 5f 5f 5f 5f 5f 5f 00 d5 fe fe fe 08 00 00 00 _______......... +| end clusterfuzz-testcase-sql_recovery_fuzzer-5803962339885056 +}]} {} + +sqlite3_dbdata_init db +do_execsql_test 1.1 { + PRAGMA writable_schema = 1; +} + +do_test 1.2 { + set R [sqlite3_recover_init db main test.db2] + $R run + $R finish +} {} + +#------------------------------------------------------------------------- +reset_db +do_test 2.0 { + sqlite3 db {} + db deserialize [decode_hexdb { +| size 3821 pagesize 1024 filename clusterfuzz-testcase-sql_recovery_fuzzer-5803962339885056 +| page 1 offset 0 +| 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3. +| 16: 04 00 01 01 00 40 20 20 00 00 00 01 00 00 00 02 .....@ ........ +| 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 ................ +| 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................ +| 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ................ +| 96: 00 2e 7a 70 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 112: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 128: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 144: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 160: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 176: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 192: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 208: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 224: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 240: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 256: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 272: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 288: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 304: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 320: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 336: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 352: 02 02 02 02 a0 02 02 02 02 02 02 02 02 02 02 02 ................ +| 368: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 384: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 400: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 416: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 432: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 448: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 29 29 ..............)) +| 464: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 480: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 496: 29 29 29 dd dd dd dd dd dd dd dd dd dd dd dd dd )))............. +| 512: dd dd dd dd dd dd dd dd dd 6e 69 d2 e9 e9 e9 d2 .........ni..... +| 528: d2 d2 d2 d2 dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 544: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 560: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 576: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 592: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 608: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 624: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 640: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 656: dd dd dd dd dd dd dd da dd dd dd dd dd dd dd dd ................ +| 672: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 688: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 704: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 720: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 736: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 752: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 768: dd dd dd dd dd dd dd dd dd dd dd dd dd 29 29 29 .............))) +| 784: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 800: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 816: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 832: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 848: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 864: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 880: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 896: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 912: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 928: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 944: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 960: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 976: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 )))))))))))))))) +| 992: 29 29 29 29 29 29 29 29 29 29 dd dd dd dd dd dd ))))))))))...... +| 1008: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| page 2 offset 1024 +| 0: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 16: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 32: dd dd 6e 69 d2 e9 e9 e9 d2 d2 d2 d2 d2 dd dd dd ..ni............ +| 48: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 64: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 80: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 96: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 112: dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd ................ +| 128: dd dd dd dd dd dd 29 29 29 29 29 29 29 29 29 29 ......)))))))))) +| 144: 29 29 29 29 29 29 29 29 29 ad a5 29 29 29 29 00 )))))))))..)))). +| 160: 75 9c 11 00 5b e5 64 28 7c ca 09 69 28 2d 69 00 u...[.d(|..i(-i. +| 176: 85 88 6c 81 48 83 a0 93 c0 c0 82 8b 81 84 85 f9 ..l.H........... +| 192: 88 7a 00 7f 00 96 40 7b 12 4b 84 75 a0 00 99 a0 .z....@..K.u.... +| 208: df a0 7e 81 c6 90 8f 7f 84 85 cc 84 82 90 88 60 ..~............` +| 224: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 240: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 256: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 272: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 288: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 02 02 ................ +| 304: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 320: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 336: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 352: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 368: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 384: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 400: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 416: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 432: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 448: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 464: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 480: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 496: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 512: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 528: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 544: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 560: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 576: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 592: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 608: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 624: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 640: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 656: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 672: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 688: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 704: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 720: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 736: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 752: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 768: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 784: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 800: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 816: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 832: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 848: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 864: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 880: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 896: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 912: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 928: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 944: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 960: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 976: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 992: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 1008: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| page 3 offset 2048 +| 0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 16: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 32: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 48: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 64: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 80: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 96: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 112: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 128: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 144: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 160: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 176: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 192: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 208: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 224: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 240: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 256: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 272: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 288: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 304: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 320: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 336: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 352: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 368: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 384: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 400: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 416: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 432: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 448: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 464: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 480: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 496: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 512: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 528: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 544: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 560: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 576: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 592: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 608: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 624: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 640: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 656: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 672: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 688: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 704: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 720: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 736: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 752: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 768: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 784: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 800: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 816: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 832: 02 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 848: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 864: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 880: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 896: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 912: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 928: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 944: 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ................ +| 960: 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 976: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 992: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 1008: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| page 4 offset 3072 +| 0: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 16: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 32: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 48: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 64: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 80: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 96: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 112: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 128: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 144: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 160: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 176: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 192: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 208: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 224: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 240: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 256: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 272: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 288: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 304: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 320: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 336: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 352: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 368: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 384: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 400: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 416: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 432: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 448: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 464: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 480: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 496: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 512: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 528: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 544: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 560: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 576: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 592: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 608: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 624: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 640: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 656: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 672: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 688: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 704: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 720: 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 ................ +| 736: 5f 5f 5f 5f 5f 5f 5f 00 d5 fe fe fe 08 00 00 00 _______......... +| end clusterfuzz-testcase-sql_recovery_fuzzer-5803962339885056 +}]} {} + +sqlite3_dbdata_init db +do_execsql_test 2.1 { + PRAGMA writable_schema = 1; +} + +do_test 2.2 { + set R [sqlite3_recover_init db main test.db2] + $R run + $R finish +} {} + +finish_test + diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoverfault.test b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoverfault.test new file mode 100644 index 0000000000000000000000000000000000000000..30bb65527d708992ba6fd89ff93994365290cdea --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoverfault.test @@ -0,0 +1,84 @@ +# 2022 August 28 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# + +source [file join [file dirname [info script]] recover_common.tcl] +set testprefix recoverfault + + +#-------------------------------------------------------------------------- +proc compare_result {db1 db2 sql} { + set r1 [$db1 eval $sql] + set r2 [$db2 eval $sql] + if {$r1 != $r2} { + puts "r1: $r1" + puts "r2: $r2" + error "mismatch for $sql" + } + return "" +} + +proc compare_dbs {db1 db2} { + compare_result $db1 $db2 "SELECT sql FROM sqlite_master ORDER BY 1" + foreach tbl [$db1 eval {SELECT name FROM sqlite_master WHERE type='table'}] { + compare_result $db1 $db2 "SELECT * FROM $tbl" + } +} +#-------------------------------------------------------------------------- + +do_execsql_test 1.0 { + CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); + INSERT INTO t1 VALUES(1, 2, 3); + INSERT INTO t1 VALUES(2, hex(randomblob(1000)), randomblob(2000)); + CREATE INDEX i1 ON t1(b, c); + ANALYZE; +} +faultsim_save_and_close + +do_faultsim_test 1 -faults oom* -prep { + catch { db2 close } + faultsim_restore_and_reopen +} -body { + set R [sqlite3_recover_init db main test.db2] + $R run + $R finish +} -test { + faultsim_test_result {0 {}} {1 {}} + if {$testrc==0} { + sqlite3 db2 test.db2 + compare_dbs db db2 + db2 close + } +} + +faultsim_restore_and_reopen +do_execsql_test 2.0 { + CREATE TABLE t2(a INTEGER PRIMARY KEY, b, c); + INSERT INTO t2 VALUES(1, 2, 3); + INSERT INTO t2 VALUES(2, hex(randomblob(1000)), hex(randomblob(2000))); + PRAGMA writable_schema = 1; + DELETE FROM sqlite_schema WHERE name='t2'; +} +faultsim_save_and_close + +do_faultsim_test 2 -faults oom* -prep { + faultsim_restore_and_reopen +} -body { + set R [sqlite3_recover_init db main test.db2] + $R config lostandfound lost_and_found + $R run + $R finish +} -test { + faultsim_test_result {0 {}} {1 {}} +} + +finish_test + diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoverold.test b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoverold.test new file mode 100644 index 0000000000000000000000000000000000000000..c6acbb2f42771c61a1e550b8d27918de9c8a5846 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoverold.test @@ -0,0 +1,189 @@ +# 2019 April 23 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# +# + +source [file join [file dirname [info script]] recover_common.tcl] +set testprefix recoverold + +proc compare_result {db1 db2 sql} { + set r1 [$db1 eval $sql] + set r2 [$db2 eval $sql] + if {$r1 != $r2} { + puts "sql: $sql" + puts "r1: $r1" + puts "r2: $r2" + error "mismatch for $sql" + } + return "" +} + +proc compare_dbs {db1 db2} { + compare_result $db1 $db2 "SELECT sql FROM sqlite_master ORDER BY 1" + foreach tbl [$db1 eval {SELECT name FROM sqlite_master WHERE type='table'}] { + compare_result $db1 $db2 "SELECT * FROM $tbl" + } +} + +proc do_recover_test {tn {tsql {}} {res {}}} { + forcedelete test.db2 + forcedelete rstate.db + + set R [sqlite3_recover_init db main test.db2] + $R config lostandfound lost_and_found + $R run + $R finish + + sqlite3 db2 test.db2 + + if {$tsql==""} { + uplevel [list do_test $tn.1 [list compare_dbs db db2] {}] + } else { + uplevel [list do_execsql_test -db db2 $tn.1 $tsql $res] + } + db2 close + + forcedelete test.db2 + forcedelete rstate.db + + set ::sqlhook [list] + set R [sqlite3_recover_init_sql db main my_sql_hook] + $R config lostandfound lost_and_found + $R run + $R finish + + sqlite3 db2 test.db2 + db2 eval [join $::sqlhook ";"] + + + db cache flush + if {$tsql==""} { + compare_dbs db db2 + uplevel [list do_test $tn.sql [list compare_dbs db db2] {}] + } else { + uplevel [list do_execsql_test -db db2 $tn.sql $tsql $res] + } + db2 close +} + +proc my_sql_hook {sql} { + lappend ::sqlhook $sql + return 0 +} + + +set doc { + hello + world +} +do_execsql_test 1.1.1 { + CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); + INSERT INTO t1 VALUES(1, 4, X'1234567800'); + INSERT INTO t1 VALUES(2, 'test', 8.1); + INSERT INTO t1 VALUES(3, $doc, 8.4); +} +do_recover_test 1.1.2 + +do_execsql_test 1.2.1 " + DELETE FROM t1; + INSERT INTO t1 VALUES(13, 'hello\r\nworld', 13); +" +do_recover_test 1.2.2 + +do_execsql_test 1.3.1 " + CREATE TABLE t2(i INTEGER PRIMARY KEY AUTOINCREMENT, b, c); + INSERT INTO t2 VALUES(NULL, 1, 2); + INSERT INTO t2 VALUES(NULL, 3, 4); + INSERT INTO t2 VALUES(NULL, 5, 6); + CREATE TABLE t3(i INTEGER PRIMARY KEY AUTOINCREMENT, b, c); + INSERT INTO t3 VALUES(NULL, 1, 2); + INSERT INTO t3 VALUES(NULL, 3, 4); + INSERT INTO t3 VALUES(NULL, 5, 6); + DELETE FROM t2; +" +do_recover_test 1.3.2 + +#------------------------------------------------------------------------- +reset_db +do_execsql_test 2.1.0 { + PRAGMA auto_vacuum = 0; + CREATE TABLE t1(a, b, c, PRIMARY KEY(b, c)) WITHOUT ROWID; + INSERT INTO t1 VALUES(1, 2, 3); + INSERT INTO t1 VALUES(4, 5, 6); + INSERT INTO t1 VALUES(7, 8, 9); +} + +do_recover_test 2.1.1 + +do_execsql_test 2.2.0 { + PRAGMA writable_schema = 1; + DELETE FROM sqlite_master WHERE name='t1'; +} +do_recover_test 2.2.1 { + SELECT name FROM sqlite_master +} {lost_and_found} + +do_execsql_test 2.3.0 { + CREATE TABLE lost_and_found(a, b, c); +} +do_recover_test 2.3.1 { + SELECT name FROM sqlite_master +} {lost_and_found lost_and_found_0} + +do_execsql_test 2.4.0 { + CREATE TABLE lost_and_found_0(a, b, c); +} +do_recover_test 2.4.1 { + SELECT name FROM sqlite_master; + SELECT * FROM lost_and_found_1; +} {lost_and_found lost_and_found_0 lost_and_found_1 + 2 2 3 {} 2 3 1 + 2 2 3 {} 5 6 4 + 2 2 3 {} 8 9 7 +} + +do_execsql_test 2.5 { + CREATE TABLE x1(a, b, c); + WITH s(i) AS ( + SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<100 + ) + INSERT INTO x1 SELECT i, i, hex(randomblob(500)) FROM s; + DROP TABLE x1; +} +do_recover_test 2.5.1 { + SELECT name FROM sqlite_master; + SELECT * FROM lost_and_found_1; +} {lost_and_found lost_and_found_0 lost_and_found_1 + 2 2 3 {} 2 3 1 + 2 2 3 {} 5 6 4 + 2 2 3 {} 8 9 7 +} + +ifcapable !secure_delete { + do_test 2.6 { + forcedelete test.db2 + set R [sqlite3_recover_init db main test.db2] + $R config lostandfound lost_and_found + $R config freelistcorrupt 1 + $R run + $R finish + sqlite3 db2 test.db2 + execsql { SELECT count(*) FROM lost_and_found_1; } db2 + } {103} + db2 close +} + +#------------------------------------------------------------------------- +breakpoint +reset_db +do_recover_test 3.0 + +finish_test diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoverpgsz.test b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoverpgsz.test new file mode 100644 index 0000000000000000000000000000000000000000..f921a7869254edd1d643aca0441825c883777d50 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoverpgsz.test @@ -0,0 +1,97 @@ +# 2022 October 14 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# + +source [file join [file dirname [info script]] recover_common.tcl] + +db close +sqlite3_test_control_pending_byte 0x1000000 + +set testprefix recoverpgsz + +foreach {pgsz bOverflow} { + 512 0 1024 0 2048 0 4096 0 8192 0 16384 0 32768 0 65536 0 + 512 1 1024 1 2048 1 4096 1 8192 1 16384 1 32768 1 65536 1 +} { + reset_db + execsql "PRAGMA page_size = $pgsz" + execsql "PRAGMA auto_vacuum = 0" + do_execsql_test 1.$pgsz.$bOverflow.1 { + CREATE TABLE t1(a, b, c); + CREATE INDEX i1 ON t1(b, a, c); + INSERT INTO t1(a, b) VALUES(1, 2), (3, 4), (5, 6); + DELETE FROM t1 WHERE a=3; + } + if {$bOverflow} { + do_execsql_test 1.$pgsz.$bOverflow.1a { + UPDATE t1 SET c = randomblob(100000); + } + } + db close + + + set fd [open test.db] + fconfigure $fd -translation binary + seek $fd $pgsz + set pg1 [read $fd $pgsz] + set pg2 [read $fd $pgsz] + close $fd + + set fd2 [open test.db2 w] + fconfigure $fd2 -translation binary + seek $fd2 $pgsz + puts -nonewline $fd2 $pg1 + close $fd2 + + sqlite3 db2 test.db2 + do_test 1.$pgsz.$bOverflow.2 { + set R [sqlite3_recover_init db2 main test.db3] + $R run + $R finish + } {} + + sqlite3 db3 test.db3 + do_test 1.$pgsz.$bOverflow.3 { + db3 eval { SELECT * FROM sqlite_schema } + db3 eval { PRAGMA page_size } + } $pgsz + + db2 close + db3 close + + forcedelete test.db3 + forcedelete test.db2 + + set fd2 [open test.db2 w] + fconfigure $fd2 -translation binary + seek $fd2 $pgsz + puts -nonewline $fd2 $pg2 + close $fd2 + + sqlite3 db2 test.db2 + do_test 1.$pgsz.$bOverflow.4 { + set R [sqlite3_recover_init db2 main test.db3] + $R run + $R finish + } {} + + sqlite3 db3 test.db3 + do_test 1.$pgsz.$bOverflow.5 { + db3 eval { SELECT * FROM sqlite_schema } + db3 eval { PRAGMA page_size } + } $pgsz + + db2 close + db3 close +} + + +finish_test diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoverslowidx.test b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoverslowidx.test new file mode 100644 index 0000000000000000000000000000000000000000..269105113dd6bf87d05dd9d54497843f0890e857 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoverslowidx.test @@ -0,0 +1,87 @@ +# 2022 September 25 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# +# Tests for the SQLITE_RECOVER_SLOWINDEXES option. +# + +source [file join [file dirname [info script]] recover_common.tcl] +set testprefix recoverslowidx + +do_execsql_test 1.0 { + PRAGMA auto_vacuum = 0; + CREATE TABLE t1(a, b); + CREATE INDEX i1 ON t1(a); + INSERT INTO t1 VALUES(1, 1), (2, 2), (3, 3), (4, 4); +} + +proc my_sql_hook {sql} { + lappend ::lSql $sql + return 0 +} + +do_test 1.1 { + set lSql [list] + set R [sqlite3_recover_init_sql db main my_sql_hook] + while {[$R step]==0} { } + $R finish +} {} + +do_test 1.2 { + set lSql +} [list {*}{ + {BEGIN} + {PRAGMA writable_schema = on} + {PRAGMA encoding = 'UTF-8'} + {PRAGMA page_size = '1024'} + {PRAGMA auto_vacuum = '0'} + {PRAGMA user_version = '0'} + {PRAGMA application_id = '0'} + {CREATE TABLE t1(a, b)} + {INSERT OR IGNORE INTO 't1'(_rowid_, 'a', 'b') VALUES (1, 1, 1)} + {INSERT OR IGNORE INTO 't1'(_rowid_, 'a', 'b') VALUES (2, 2, 2)} + {INSERT OR IGNORE INTO 't1'(_rowid_, 'a', 'b') VALUES (3, 3, 3)} + {INSERT OR IGNORE INTO 't1'(_rowid_, 'a', 'b') VALUES (4, 4, 4)} + {CREATE INDEX i1 ON t1(a)} + {PRAGMA writable_schema = off} + {COMMIT} +}] + +do_test 1.3 { + set lSql [list] + set R [sqlite3_recover_init_sql db main my_sql_hook] + $R config slowindexes 1 + while {[$R step]==0} { } + $R finish +} {} + +do_test 1.4 { + set lSql +} [list {*}{ + {BEGIN} + {PRAGMA writable_schema = on} + {PRAGMA encoding = 'UTF-8'} + {PRAGMA page_size = '1024'} + {PRAGMA auto_vacuum = '0'} + {PRAGMA user_version = '0'} + {PRAGMA application_id = '0'} + {CREATE TABLE t1(a, b)} + {CREATE INDEX i1 ON t1(a)} + {INSERT OR IGNORE INTO 't1'(_rowid_, 'a', 'b') VALUES (1, 1, 1)} + {INSERT OR IGNORE INTO 't1'(_rowid_, 'a', 'b') VALUES (2, 2, 2)} + {INSERT OR IGNORE INTO 't1'(_rowid_, 'a', 'b') VALUES (3, 3, 3)} + {INSERT OR IGNORE INTO 't1'(_rowid_, 'a', 'b') VALUES (4, 4, 4)} + {PRAGMA writable_schema = off} + {COMMIT} +}] + + +finish_test + diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoversql.test b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoversql.test new file mode 100644 index 0000000000000000000000000000000000000000..0a6726727da7f74e61b1f7bfba58999276b2b520 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/recoversql.test @@ -0,0 +1,52 @@ +# 2022 September 13 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# +# + +source [file join [file dirname [info script]] recover_common.tcl] +set testprefix recoversql + +do_execsql_test 1.0 { + CREATE TABLE "x.1" (x, y); + INSERT INTO "x.1" VALUES(1, 1), (2, 2), (3, 3); + CREATE INDEX "i.1" ON "x.1"(y, x); +} + +proc sql_hook {sql} { + incr ::iSqlHook + if {$::iSqlHook==$::sql_hook_cnt} { return 4 } + return 0 +} + +do_test 1.1 { + set ::sql_hook_cnt -1 + set ::iSqlHook 0 + set R [sqlite3_recover_init_sql db main sql_hook] + $R run + $R finish +} {} + +set nSqlCall $iSqlHook + +for {set ii 1} {$ii<$nSqlCall} {incr ii} { + set iSqlHook 0 + set sql_hook_cnt $ii + do_test 1.$ii.a { + set R [sqlite3_recover_init_sql db main sql_hook] + $R run + } {1} + do_test 1.$ii.b { + list [catch { $R finish } msg] $msg + } {1 {callback returned an error - 4}} +} + + +finish_test diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/sqlite3recover.c b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/sqlite3recover.c new file mode 100644 index 0000000000000000000000000000000000000000..58d726f599c9bd953395f4d27e85913d17e340e4 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/sqlite3recover.c @@ -0,0 +1,2872 @@ +/* +** 2022-08-27 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** +*/ + + +#include "sqlite3recover.h" +#include +#include + +#ifndef SQLITE_OMIT_VIRTUALTABLE + +/* +** Declaration for public API function in file dbdata.c. This may be called +** with NULL as the final two arguments to register the sqlite_dbptr and +** sqlite_dbdata virtual tables with a database handle. +*/ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int sqlite3_dbdata_init(sqlite3*, char**, const sqlite3_api_routines*); + +typedef unsigned int u32; +typedef unsigned char u8; +typedef sqlite3_int64 i64; + +typedef struct RecoverTable RecoverTable; +typedef struct RecoverColumn RecoverColumn; + +/* +** When recovering rows of data that can be associated with table +** definitions recovered from the sqlite_schema table, each table is +** represented by an instance of the following object. +** +** iRoot: +** The root page in the original database. Not necessarily (and usually +** not) the same in the recovered database. +** +** zTab: +** Name of the table. +** +** nCol/aCol[]: +** aCol[] is an array of nCol columns. In the order in which they appear +** in the table. +** +** bIntkey: +** Set to true for intkey tables, false for WITHOUT ROWID. +** +** iRowidBind: +** Each column in the aCol[] array has associated with it the index of +** the bind parameter its values will be bound to in the INSERT statement +** used to construct the output database. If the table does has a rowid +** but not an INTEGER PRIMARY KEY column, then iRowidBind contains the +** index of the bind paramater to which the rowid value should be bound. +** Otherwise, it contains -1. If the table does contain an INTEGER PRIMARY +** KEY column, then the rowid value should be bound to the index associated +** with the column. +** +** pNext: +** All RecoverTable objects used by the recovery operation are allocated +** and populated as part of creating the recovered database schema in +** the output database, before any non-schema data are recovered. They +** are then stored in a singly-linked list linked by this variable beginning +** at sqlite3_recover.pTblList. +*/ +struct RecoverTable { + u32 iRoot; /* Root page in original database */ + char *zTab; /* Name of table */ + int nCol; /* Number of columns in table */ + RecoverColumn *aCol; /* Array of columns */ + int bIntkey; /* True for intkey, false for without rowid */ + int iRowidBind; /* If >0, bind rowid to INSERT here */ + RecoverTable *pNext; +}; + +/* +** Each database column is represented by an instance of the following object +** stored in the RecoverTable.aCol[] array of the associated table. +** +** iField: +** The index of the associated field within database records. Or -1 if +** there is no associated field (e.g. for virtual generated columns). +** +** iBind: +** The bind index of the INSERT statement to bind this columns values +** to. Or 0 if there is no such index (iff (iField<0)). +** +** bIPK: +** True if this is the INTEGER PRIMARY KEY column. +** +** zCol: +** Name of column. +** +** eHidden: +** A RECOVER_EHIDDEN_* constant value (see below for interpretation of each). +*/ +struct RecoverColumn { + int iField; /* Field in record on disk */ + int iBind; /* Binding to use in INSERT */ + int bIPK; /* True for IPK column */ + char *zCol; + int eHidden; +}; + +#define RECOVER_EHIDDEN_NONE 0 /* Normal database column */ +#define RECOVER_EHIDDEN_HIDDEN 1 /* Column is __HIDDEN__ */ +#define RECOVER_EHIDDEN_VIRTUAL 2 /* Virtual generated column */ +#define RECOVER_EHIDDEN_STORED 3 /* Stored generated column */ + +/* +** Bitmap object used to track pages in the input database. Allocated +** and manipulated only by the following functions: +** +** recoverBitmapAlloc() +** recoverBitmapFree() +** recoverBitmapSet() +** recoverBitmapQuery() +** +** nPg: +** Largest page number that may be stored in the bitmap. The range +** of valid keys is 1 to nPg, inclusive. +** +** aElem[]: +** Array large enough to contain a bit for each key. For key value +** iKey, the associated bit is the bit (iKey%32) of aElem[iKey/32]. +** In other words, the following is true if bit iKey is set, or +** false if it is clear: +** +** (aElem[iKey/32] & (1 << (iKey%32))) ? 1 : 0 +*/ +typedef struct RecoverBitmap RecoverBitmap; +struct RecoverBitmap { + i64 nPg; /* Size of bitmap */ + u32 aElem[1]; /* Array of 32-bit bitmasks */ +}; + +/* +** State variables (part of the sqlite3_recover structure) used while +** recovering data for tables identified in the recovered schema (state +** RECOVER_STATE_WRITING). +*/ +typedef struct RecoverStateW1 RecoverStateW1; +struct RecoverStateW1 { + sqlite3_stmt *pTbls; + sqlite3_stmt *pSel; + sqlite3_stmt *pInsert; + int nInsert; + + RecoverTable *pTab; /* Table currently being written */ + int nMax; /* Max column count in any schema table */ + sqlite3_value **apVal; /* Array of nMax values */ + int nVal; /* Number of valid entries in apVal[] */ + int bHaveRowid; + i64 iRowid; + i64 iPrevPage; + int iPrevCell; +}; + +/* +** State variables (part of the sqlite3_recover structure) used while +** recovering data destined for the lost and found table (states +** RECOVER_STATE_LOSTANDFOUND[123]). +*/ +typedef struct RecoverStateLAF RecoverStateLAF; +struct RecoverStateLAF { + RecoverBitmap *pUsed; + i64 nPg; /* Size of db in pages */ + sqlite3_stmt *pAllAndParent; + sqlite3_stmt *pMapInsert; + sqlite3_stmt *pMaxField; + sqlite3_stmt *pUsedPages; + sqlite3_stmt *pFindRoot; + sqlite3_stmt *pInsert; /* INSERT INTO lost_and_found ... */ + sqlite3_stmt *pAllPage; + sqlite3_stmt *pPageData; + sqlite3_value **apVal; + int nMaxField; +}; + +/* +** Main recover handle structure. +*/ +struct sqlite3_recover { + /* Copies of sqlite3_recover_init[_sql]() parameters */ + sqlite3 *dbIn; /* Input database */ + char *zDb; /* Name of input db ("main" etc.) */ + char *zUri; /* URI for output database */ + void *pSqlCtx; /* SQL callback context */ + int (*xSql)(void*,const char*); /* Pointer to SQL callback function */ + + /* Values configured by sqlite3_recover_config() */ + char *zStateDb; /* State database to use (or NULL) */ + char *zLostAndFound; /* Name of lost-and-found table (or NULL) */ + int bFreelistCorrupt; /* SQLITE_RECOVER_FREELIST_CORRUPT setting */ + int bRecoverRowid; /* SQLITE_RECOVER_ROWIDS setting */ + int bSlowIndexes; /* SQLITE_RECOVER_SLOWINDEXES setting */ + + int pgsz; + int detected_pgsz; + int nReserve; + u8 *pPage1Disk; + u8 *pPage1Cache; + + /* Error code and error message */ + int errCode; /* For sqlite3_recover_errcode() */ + char *zErrMsg; /* For sqlite3_recover_errmsg() */ + + int eState; + int bCloseTransaction; + + /* Variables used with eState==RECOVER_STATE_WRITING */ + RecoverStateW1 w1; + + /* Variables used with states RECOVER_STATE_LOSTANDFOUND[123] */ + RecoverStateLAF laf; + + /* Fields used within sqlite3_recover_run() */ + sqlite3 *dbOut; /* Output database */ + sqlite3_stmt *pGetPage; /* SELECT against input db sqlite_dbdata */ + RecoverTable *pTblList; /* List of tables recovered from schema */ +}; + +/* +** The various states in which an sqlite3_recover object may exist: +** +** RECOVER_STATE_INIT: +** The object is initially created in this state. sqlite3_recover_step() +** has yet to be called. This is the only state in which it is permitted +** to call sqlite3_recover_config(). +** +** RECOVER_STATE_WRITING: +** +** RECOVER_STATE_LOSTANDFOUND1: +** State to populate the bitmap of pages used by other tables or the +** database freelist. +** +** RECOVER_STATE_LOSTANDFOUND2: +** Populate the recovery.map table - used to figure out a "root" page +** for each lost page from in the database from which records are +** extracted. +** +** RECOVER_STATE_LOSTANDFOUND3: +** Populate the lost-and-found table itself. +*/ +#define RECOVER_STATE_INIT 0 +#define RECOVER_STATE_WRITING 1 +#define RECOVER_STATE_LOSTANDFOUND1 2 +#define RECOVER_STATE_LOSTANDFOUND2 3 +#define RECOVER_STATE_LOSTANDFOUND3 4 +#define RECOVER_STATE_SCHEMA2 5 +#define RECOVER_STATE_DONE 6 + + +/* +** Global variables used by this extension. +*/ +typedef struct RecoverGlobal RecoverGlobal; +struct RecoverGlobal { + const sqlite3_io_methods *pMethods; + sqlite3_recover *p; +}; +static RecoverGlobal recover_g; + +/* +** Use this static SQLite mutex to protect the globals during the +** first call to sqlite3_recover_step(). +*/ +#define RECOVER_MUTEX_ID SQLITE_MUTEX_STATIC_APP2 + + +/* +** Default value for SQLITE_RECOVER_ROWIDS (sqlite3_recover.bRecoverRowid). +*/ +#define RECOVER_ROWID_DEFAULT 1 + +/* +** Mutex handling: +** +** recoverEnterMutex() - Enter the recovery mutex +** recoverLeaveMutex() - Leave the recovery mutex +** recoverAssertMutexHeld() - Assert that the recovery mutex is held +*/ +#if defined(SQLITE_THREADSAFE) && SQLITE_THREADSAFE==0 +# define recoverEnterMutex() +# define recoverLeaveMutex() +#else +static void recoverEnterMutex(void){ + sqlite3_mutex_enter(sqlite3_mutex_alloc(RECOVER_MUTEX_ID)); +} +static void recoverLeaveMutex(void){ + sqlite3_mutex_leave(sqlite3_mutex_alloc(RECOVER_MUTEX_ID)); +} +#endif +#if SQLITE_THREADSAFE+0>=1 && defined(SQLITE_DEBUG) +static void recoverAssertMutexHeld(void){ + assert( sqlite3_mutex_held(sqlite3_mutex_alloc(RECOVER_MUTEX_ID)) ); +} +#else +# define recoverAssertMutexHeld() +#endif + + +/* +** Like strlen(). But handles NULL pointer arguments. +*/ +static int recoverStrlen(const char *zStr){ + if( zStr==0 ) return 0; + return (int)(strlen(zStr)&0x7fffffff); +} + +/* +** This function is a no-op if the recover handle passed as the first +** argument already contains an error (if p->errCode!=SQLITE_OK). +** +** Otherwise, an attempt is made to allocate, zero and return a buffer nByte +** bytes in size. If successful, a pointer to the new buffer is returned. Or, +** if an OOM error occurs, NULL is returned and the handle error code +** (p->errCode) set to SQLITE_NOMEM. +*/ +static void *recoverMalloc(sqlite3_recover *p, i64 nByte){ + void *pRet = 0; + assert( nByte>0 ); + if( p->errCode==SQLITE_OK ){ + pRet = sqlite3_malloc64(nByte); + if( pRet ){ + memset(pRet, 0, nByte); + }else{ + p->errCode = SQLITE_NOMEM; + } + } + return pRet; +} + +/* +** Set the error code and error message for the recover handle passed as +** the first argument. The error code is set to the value of parameter +** errCode. +** +** Parameter zFmt must be a printf() style formatting string. The handle +** error message is set to the result of using any trailing arguments for +** parameter substitutions in the formatting string. +** +** For example: +** +** recoverError(p, SQLITE_ERROR, "no such table: %s", zTablename); +*/ +static int recoverError( + sqlite3_recover *p, + int errCode, + const char *zFmt, ... +){ + char *z = 0; + va_list ap; + va_start(ap, zFmt); + if( zFmt ){ + z = sqlite3_vmprintf(zFmt, ap); + } + va_end(ap); + sqlite3_free(p->zErrMsg); + p->zErrMsg = z; + p->errCode = errCode; + return errCode; +} + + +/* +** This function is a no-op if p->errCode is initially other than SQLITE_OK. +** In this case it returns NULL. +** +** Otherwise, an attempt is made to allocate and return a bitmap object +** large enough to store a bit for all page numbers between 1 and nPg, +** inclusive. The bitmap is initially zeroed. +*/ +static RecoverBitmap *recoverBitmapAlloc(sqlite3_recover *p, i64 nPg){ + int nElem = (nPg+1+31) / 32; + int nByte = sizeof(RecoverBitmap) + nElem*sizeof(u32); + RecoverBitmap *pRet = (RecoverBitmap*)recoverMalloc(p, nByte); + + if( pRet ){ + pRet->nPg = nPg; + } + return pRet; +} + +/* +** Free a bitmap object allocated by recoverBitmapAlloc(). +*/ +static void recoverBitmapFree(RecoverBitmap *pMap){ + sqlite3_free(pMap); +} + +/* +** Set the bit associated with page iPg in bitvec pMap. +*/ +static void recoverBitmapSet(RecoverBitmap *pMap, i64 iPg){ + if( iPg<=pMap->nPg ){ + int iElem = (iPg / 32); + int iBit = (iPg % 32); + pMap->aElem[iElem] |= (((u32)1) << iBit); + } +} + +/* +** Query bitmap object pMap for the state of the bit associated with page +** iPg. Return 1 if it is set, or 0 otherwise. +*/ +static int recoverBitmapQuery(RecoverBitmap *pMap, i64 iPg){ + int ret = 1; + if( iPg<=pMap->nPg && iPg>0 ){ + int iElem = (iPg / 32); + int iBit = (iPg % 32); + ret = (pMap->aElem[iElem] & (((u32)1) << iBit)) ? 1 : 0; + } + return ret; +} + +/* +** Set the recover handle error to the error code and message returned by +** calling sqlite3_errcode() and sqlite3_errmsg(), respectively, on database +** handle db. +*/ +static int recoverDbError(sqlite3_recover *p, sqlite3 *db){ + return recoverError(p, sqlite3_errcode(db), "%s", sqlite3_errmsg(db)); +} + +/* +** This function is a no-op if recover handle p already contains an error +** (if p->errCode!=SQLITE_OK). +** +** Otherwise, it attempts to prepare the SQL statement in zSql against +** database handle db. If successful, the statement handle is returned. +** Or, if an error occurs, NULL is returned and an error left in the +** recover handle. +*/ +static sqlite3_stmt *recoverPrepare( + sqlite3_recover *p, + sqlite3 *db, + const char *zSql +){ + sqlite3_stmt *pStmt = 0; + if( p->errCode==SQLITE_OK ){ + if( sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0) ){ + recoverDbError(p, db); + } + } + return pStmt; +} + +/* +** This function is a no-op if recover handle p already contains an error +** (if p->errCode!=SQLITE_OK). +** +** Otherwise, argument zFmt is used as a printf() style format string, +** along with any trailing arguments, to create an SQL statement. This +** SQL statement is prepared against database handle db and, if successful, +** the statment handle returned. Or, if an error occurs - either during +** the printf() formatting or when preparing the resulting SQL - an +** error code and message are left in the recover handle. +*/ +static sqlite3_stmt *recoverPreparePrintf( + sqlite3_recover *p, + sqlite3 *db, + const char *zFmt, ... +){ + sqlite3_stmt *pStmt = 0; + if( p->errCode==SQLITE_OK ){ + va_list ap; + char *z; + va_start(ap, zFmt); + z = sqlite3_vmprintf(zFmt, ap); + va_end(ap); + if( z==0 ){ + p->errCode = SQLITE_NOMEM; + }else{ + pStmt = recoverPrepare(p, db, z); + sqlite3_free(z); + } + } + return pStmt; +} + +/* +** Reset SQLite statement handle pStmt. If the call to sqlite3_reset() +** indicates that an error occurred, and there is not already an error +** in the recover handle passed as the first argument, set the error +** code and error message appropriately. +** +** This function returns a copy of the statement handle pointer passed +** as the second argument. +*/ +static sqlite3_stmt *recoverReset(sqlite3_recover *p, sqlite3_stmt *pStmt){ + int rc = sqlite3_reset(pStmt); + if( rc!=SQLITE_OK && rc!=SQLITE_CONSTRAINT && p->errCode==SQLITE_OK ){ + recoverDbError(p, sqlite3_db_handle(pStmt)); + } + return pStmt; +} + +/* +** Finalize SQLite statement handle pStmt. If the call to sqlite3_reset() +** indicates that an error occurred, and there is not already an error +** in the recover handle passed as the first argument, set the error +** code and error message appropriately. +*/ +static void recoverFinalize(sqlite3_recover *p, sqlite3_stmt *pStmt){ + sqlite3 *db = sqlite3_db_handle(pStmt); + int rc = sqlite3_finalize(pStmt); + if( rc!=SQLITE_OK && p->errCode==SQLITE_OK ){ + recoverDbError(p, db); + } +} + +/* +** This function is a no-op if recover handle p already contains an error +** (if p->errCode!=SQLITE_OK). A copy of p->errCode is returned in this +** case. +** +** Otherwise, execute SQL script zSql. If successful, return SQLITE_OK. +** Or, if an error occurs, leave an error code and message in the recover +** handle and return a copy of the error code. +*/ +static int recoverExec(sqlite3_recover *p, sqlite3 *db, const char *zSql){ + if( p->errCode==SQLITE_OK ){ + int rc = sqlite3_exec(db, zSql, 0, 0, 0); + if( rc ){ + recoverDbError(p, db); + } + } + return p->errCode; +} + +/* +** Bind the value pVal to parameter iBind of statement pStmt. Leave an +** error in the recover handle passed as the first argument if an error +** (e.g. an OOM) occurs. +*/ +static void recoverBindValue( + sqlite3_recover *p, + sqlite3_stmt *pStmt, + int iBind, + sqlite3_value *pVal +){ + if( p->errCode==SQLITE_OK ){ + int rc = sqlite3_bind_value(pStmt, iBind, pVal); + if( rc ) recoverError(p, rc, 0); + } +} + +/* +** This function is a no-op if recover handle p already contains an error +** (if p->errCode!=SQLITE_OK). NULL is returned in this case. +** +** Otherwise, an attempt is made to interpret zFmt as a printf() style +** formatting string and the result of using the trailing arguments for +** parameter substitution with it written into a buffer obtained from +** sqlite3_malloc(). If successful, a pointer to the buffer is returned. +** It is the responsibility of the caller to eventually free the buffer +** using sqlite3_free(). +** +** Or, if an error occurs, an error code and message is left in the recover +** handle and NULL returned. +*/ +static char *recoverMPrintf(sqlite3_recover *p, const char *zFmt, ...){ + va_list ap; + char *z; + va_start(ap, zFmt); + z = sqlite3_vmprintf(zFmt, ap); + va_end(ap); + if( p->errCode==SQLITE_OK ){ + if( z==0 ) p->errCode = SQLITE_NOMEM; + }else{ + sqlite3_free(z); + z = 0; + } + return z; +} + +/* +** This function is a no-op if recover handle p already contains an error +** (if p->errCode!=SQLITE_OK). Zero is returned in this case. +** +** Otherwise, execute "PRAGMA page_count" against the input database. If +** successful, return the integer result. Or, if an error occurs, leave an +** error code and error message in the sqlite3_recover handle and return +** zero. +*/ +static i64 recoverPageCount(sqlite3_recover *p){ + i64 nPg = 0; + if( p->errCode==SQLITE_OK ){ + sqlite3_stmt *pStmt = 0; + pStmt = recoverPreparePrintf(p, p->dbIn, "PRAGMA %Q.page_count", p->zDb); + if( pStmt ){ + sqlite3_step(pStmt); + nPg = sqlite3_column_int64(pStmt, 0); + } + recoverFinalize(p, pStmt); + } + return nPg; +} + +/* +** Implementation of SQL scalar function "read_i32". The first argument to +** this function must be a blob. The second a non-negative integer. This +** function reads and returns a 32-bit big-endian integer from byte +** offset (4*) of the blob. +** +** SELECT read_i32(, ) +*/ +static void recoverReadI32( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + const unsigned char *pBlob; + int nBlob; + int iInt; + + assert( argc==2 ); + nBlob = sqlite3_value_bytes(argv[0]); + pBlob = (const unsigned char*)sqlite3_value_blob(argv[0]); + iInt = sqlite3_value_int(argv[1]) & 0xFFFF; + + if( (iInt+1)*4<=nBlob ){ + const unsigned char *a = &pBlob[iInt*4]; + i64 iVal = ((i64)a[0]<<24) + + ((i64)a[1]<<16) + + ((i64)a[2]<< 8) + + ((i64)a[3]<< 0); + sqlite3_result_int64(context, iVal); + } +} + +/* +** Implementation of SQL scalar function "page_is_used". This function +** is used as part of the procedure for locating orphan rows for the +** lost-and-found table, and it depends on those routines having populated +** the sqlite3_recover.laf.pUsed variable. +** +** The only argument to this function is a page-number. It returns true +** if the page has already been used somehow during data recovery, or false +** otherwise. +** +** SELECT page_is_used(); +*/ +static void recoverPageIsUsed( + sqlite3_context *pCtx, + int nArg, + sqlite3_value **apArg +){ + sqlite3_recover *p = (sqlite3_recover*)sqlite3_user_data(pCtx); + i64 pgno = sqlite3_value_int64(apArg[0]); + assert( nArg==1 ); + sqlite3_result_int(pCtx, recoverBitmapQuery(p->laf.pUsed, pgno)); +} + +/* +** The implementation of a user-defined SQL function invoked by the +** sqlite_dbdata and sqlite_dbptr virtual table modules to access pages +** of the database being recovered. +** +** This function always takes a single integer argument. If the argument +** is zero, then the value returned is the number of pages in the db being +** recovered. If the argument is greater than zero, it is a page number. +** The value returned in this case is an SQL blob containing the data for +** the identified page of the db being recovered. e.g. +** +** SELECT getpage(0); -- return number of pages in db +** SELECT getpage(4); -- return page 4 of db as a blob of data +*/ +static void recoverGetPage( + sqlite3_context *pCtx, + int nArg, + sqlite3_value **apArg +){ + sqlite3_recover *p = (sqlite3_recover*)sqlite3_user_data(pCtx); + i64 pgno = sqlite3_value_int64(apArg[0]); + sqlite3_stmt *pStmt = 0; + + assert( nArg==1 ); + if( pgno==0 ){ + i64 nPg = recoverPageCount(p); + sqlite3_result_int64(pCtx, nPg); + return; + }else{ + if( p->pGetPage==0 ){ + pStmt = p->pGetPage = recoverPreparePrintf( + p, p->dbIn, "SELECT data FROM sqlite_dbpage(%Q) WHERE pgno=?", p->zDb + ); + }else if( p->errCode==SQLITE_OK ){ + pStmt = p->pGetPage; + } + + if( pStmt ){ + sqlite3_bind_int64(pStmt, 1, pgno); + if( SQLITE_ROW==sqlite3_step(pStmt) ){ + const u8 *aPg; + int nPg; + assert( p->errCode==SQLITE_OK ); + aPg = sqlite3_column_blob(pStmt, 0); + nPg = sqlite3_column_bytes(pStmt, 0); + if( pgno==1 && nPg==p->pgsz && 0==memcmp(p->pPage1Cache, aPg, nPg) ){ + aPg = p->pPage1Disk; + } + sqlite3_result_blob(pCtx, aPg, nPg-p->nReserve, SQLITE_TRANSIENT); + } + recoverReset(p, pStmt); + } + } + + if( p->errCode ){ + if( p->zErrMsg ) sqlite3_result_error(pCtx, p->zErrMsg, -1); + sqlite3_result_error_code(pCtx, p->errCode); + } +} + +/* +** Find a string that is not found anywhere in z[]. Return a pointer +** to that string. +** +** Try to use zA and zB first. If both of those are already found in z[] +** then make up some string and store it in the buffer zBuf. +*/ +static const char *recoverUnusedString( + const char *z, /* Result must not appear anywhere in z */ + const char *zA, const char *zB, /* Try these first */ + char *zBuf /* Space to store a generated string */ +){ + unsigned i = 0; + if( strstr(z, zA)==0 ) return zA; + if( strstr(z, zB)==0 ) return zB; + do{ + sqlite3_snprintf(20,zBuf,"(%s%u)", zA, i++); + }while( strstr(z,zBuf)!=0 ); + return zBuf; +} + +/* +** Implementation of scalar SQL function "escape_crlf". The argument passed to +** this function is the output of built-in function quote(). If the first +** character of the input is "'", indicating that the value passed to quote() +** was a text value, then this function searches the input for "\n" and "\r" +** characters and adds a wrapper similar to the following: +** +** replace(replace(, '\n', char(10), '\r', char(13)); +** +** Or, if the first character of the input is not "'", then a copy of the input +** is returned. +*/ +static void recoverEscapeCrlf( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + const char *zText = (const char*)sqlite3_value_text(argv[0]); + (void)argc; + if( zText && zText[0]=='\'' ){ + int nText = sqlite3_value_bytes(argv[0]); + int i; + char zBuf1[20]; + char zBuf2[20]; + const char *zNL = 0; + const char *zCR = 0; + int nCR = 0; + int nNL = 0; + + for(i=0; zText[i]; i++){ + if( zNL==0 && zText[i]=='\n' ){ + zNL = recoverUnusedString(zText, "\\n", "\\012", zBuf1); + nNL = (int)strlen(zNL); + } + if( zCR==0 && zText[i]=='\r' ){ + zCR = recoverUnusedString(zText, "\\r", "\\015", zBuf2); + nCR = (int)strlen(zCR); + } + } + + if( zNL || zCR ){ + int iOut = 0; + i64 nMax = (nNL > nCR) ? nNL : nCR; + i64 nAlloc = nMax * nText + (nMax+64)*2; + char *zOut = (char*)sqlite3_malloc64(nAlloc); + if( zOut==0 ){ + sqlite3_result_error_nomem(context); + return; + } + + if( zNL && zCR ){ + memcpy(&zOut[iOut], "replace(replace(", 16); + iOut += 16; + }else{ + memcpy(&zOut[iOut], "replace(", 8); + iOut += 8; + } + for(i=0; zText[i]; i++){ + if( zText[i]=='\n' ){ + memcpy(&zOut[iOut], zNL, nNL); + iOut += nNL; + }else if( zText[i]=='\r' ){ + memcpy(&zOut[iOut], zCR, nCR); + iOut += nCR; + }else{ + zOut[iOut] = zText[i]; + iOut++; + } + } + + if( zNL ){ + memcpy(&zOut[iOut], ",'", 2); iOut += 2; + memcpy(&zOut[iOut], zNL, nNL); iOut += nNL; + memcpy(&zOut[iOut], "', char(10))", 12); iOut += 12; + } + if( zCR ){ + memcpy(&zOut[iOut], ",'", 2); iOut += 2; + memcpy(&zOut[iOut], zCR, nCR); iOut += nCR; + memcpy(&zOut[iOut], "', char(13))", 12); iOut += 12; + } + + sqlite3_result_text(context, zOut, iOut, SQLITE_TRANSIENT); + sqlite3_free(zOut); + return; + } + } + + sqlite3_result_value(context, argv[0]); +} + +/* +** This function is a no-op if recover handle p already contains an error +** (if p->errCode!=SQLITE_OK). A copy of the error code is returned in +** this case. +** +** Otherwise, attempt to populate temporary table "recovery.schema" with the +** parts of the database schema that can be extracted from the input database. +** +** If no error occurs, SQLITE_OK is returned. Otherwise, an error code +** and error message are left in the recover handle and a copy of the +** error code returned. It is not considered an error if part of all of +** the database schema cannot be recovered due to corruption. +*/ +static int recoverCacheSchema(sqlite3_recover *p){ + return recoverExec(p, p->dbOut, + "WITH RECURSIVE pages(p) AS (" + " SELECT 1" + " UNION" + " SELECT child FROM sqlite_dbptr('getpage()'), pages WHERE pgno=p" + ")" + "INSERT INTO recovery.schema SELECT" + " max(CASE WHEN field=0 THEN value ELSE NULL END)," + " max(CASE WHEN field=1 THEN value ELSE NULL END)," + " max(CASE WHEN field=2 THEN value ELSE NULL END)," + " max(CASE WHEN field=3 THEN value ELSE NULL END)," + " max(CASE WHEN field=4 THEN value ELSE NULL END)" + "FROM sqlite_dbdata('getpage()') WHERE pgno IN (" + " SELECT p FROM pages" + ") GROUP BY pgno, cell" + ); +} + +/* +** If this recover handle is not in SQL callback mode (i.e. was not created +** using sqlite3_recover_init_sql()) of if an error has already occurred, +** this function is a no-op. Otherwise, issue a callback with SQL statement +** zSql as the parameter. +** +** If the callback returns non-zero, set the recover handle error code to +** the value returned (so that the caller will abandon processing). +*/ +static void recoverSqlCallback(sqlite3_recover *p, const char *zSql){ + if( p->errCode==SQLITE_OK && p->xSql ){ + int res = p->xSql(p->pSqlCtx, zSql); + if( res ){ + recoverError(p, SQLITE_ERROR, "callback returned an error - %d", res); + } + } +} + +/* +** Transfer the following settings from the input database to the output +** database: +** +** + page-size, +** + auto-vacuum settings, +** + database encoding, +** + user-version (PRAGMA user_version), and +** + application-id (PRAGMA application_id), and +*/ +static void recoverTransferSettings(sqlite3_recover *p){ + const char *aPragma[] = { + "encoding", + "page_size", + "auto_vacuum", + "user_version", + "application_id" + }; + int ii; + + /* Truncate the output database to 0 pages in size. This is done by + ** opening a new, empty, temp db, then using the backup API to clobber + ** any existing output db with a copy of it. */ + if( p->errCode==SQLITE_OK ){ + sqlite3 *db2 = 0; + int rc = sqlite3_open("", &db2); + if( rc!=SQLITE_OK ){ + recoverDbError(p, db2); + return; + } + + for(ii=0; ii<(int)(sizeof(aPragma)/sizeof(aPragma[0])); ii++){ + const char *zPrag = aPragma[ii]; + sqlite3_stmt *p1 = 0; + p1 = recoverPreparePrintf(p, p->dbIn, "PRAGMA %Q.%s", p->zDb, zPrag); + if( p->errCode==SQLITE_OK && sqlite3_step(p1)==SQLITE_ROW ){ + const char *zArg = (const char*)sqlite3_column_text(p1, 0); + char *z2 = recoverMPrintf(p, "PRAGMA %s = %Q", zPrag, zArg); + recoverSqlCallback(p, z2); + recoverExec(p, db2, z2); + sqlite3_free(z2); + if( zArg==0 ){ + recoverError(p, SQLITE_NOMEM, 0); + } + } + recoverFinalize(p, p1); + } + recoverExec(p, db2, "CREATE TABLE t1(a); DROP TABLE t1;"); + + if( p->errCode==SQLITE_OK ){ + sqlite3 *db = p->dbOut; + sqlite3_backup *pBackup = sqlite3_backup_init(db, "main", db2, "main"); + if( pBackup ){ + sqlite3_backup_step(pBackup, -1); + p->errCode = sqlite3_backup_finish(pBackup); + }else{ + recoverDbError(p, db); + } + } + + sqlite3_close(db2); + } +} + +/* +** This function is a no-op if recover handle p already contains an error +** (if p->errCode!=SQLITE_OK). A copy of the error code is returned in +** this case. +** +** Otherwise, an attempt is made to open the output database, attach +** and create the schema of the temporary database used to store +** intermediate data, and to register all required user functions and +** virtual table modules with the output handle. +** +** If no error occurs, SQLITE_OK is returned. Otherwise, an error code +** and error message are left in the recover handle and a copy of the +** error code returned. +*/ +static int recoverOpenOutput(sqlite3_recover *p){ + struct Func { + const char *zName; + int nArg; + void (*xFunc)(sqlite3_context*,int,sqlite3_value **); + } aFunc[] = { + { "getpage", 1, recoverGetPage }, + { "page_is_used", 1, recoverPageIsUsed }, + { "read_i32", 2, recoverReadI32 }, + { "escape_crlf", 1, recoverEscapeCrlf }, + }; + + const int flags = SQLITE_OPEN_URI|SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE; + sqlite3 *db = 0; /* New database handle */ + int ii; /* For iterating through aFunc[] */ + + assert( p->dbOut==0 ); + + if( sqlite3_open_v2(p->zUri, &db, flags, 0) ){ + recoverDbError(p, db); + } + + /* Register the sqlite_dbdata and sqlite_dbptr virtual table modules. + ** These two are registered with the output database handle - this + ** module depends on the input handle supporting the sqlite_dbpage + ** virtual table only. */ + if( p->errCode==SQLITE_OK ){ + p->errCode = sqlite3_dbdata_init(db, 0, 0); + } + + /* Register the custom user-functions with the output handle. */ + for(ii=0; + p->errCode==SQLITE_OK && ii<(int)(sizeof(aFunc)/sizeof(aFunc[0])); + ii++){ + p->errCode = sqlite3_create_function(db, aFunc[ii].zName, + aFunc[ii].nArg, SQLITE_UTF8, (void*)p, aFunc[ii].xFunc, 0, 0 + ); + } + + p->dbOut = db; + return p->errCode; +} + +/* +** Attach the auxiliary database 'recovery' to the output database handle. +** This temporary database is used during the recovery process and then +** discarded. +*/ +static void recoverOpenRecovery(sqlite3_recover *p){ + char *zSql = recoverMPrintf(p, "ATTACH %Q AS recovery;", p->zStateDb); + recoverExec(p, p->dbOut, zSql); + recoverExec(p, p->dbOut, + "PRAGMA writable_schema = 1;" + "CREATE TABLE recovery.map(pgno INTEGER PRIMARY KEY, parent INT);" + "CREATE TABLE recovery.schema(type, name, tbl_name, rootpage, sql);" + ); + sqlite3_free(zSql); +} + + +/* +** This function is a no-op if recover handle p already contains an error +** (if p->errCode!=SQLITE_OK). +** +** Otherwise, argument zName must be the name of a table that has just been +** created in the output database. This function queries the output db +** for the schema of said table, and creates a RecoverTable object to +** store the schema in memory. The new RecoverTable object is linked into +** the list at sqlite3_recover.pTblList. +** +** Parameter iRoot must be the root page of table zName in the INPUT +** database. +*/ +static void recoverAddTable( + sqlite3_recover *p, + const char *zName, /* Name of table created in output db */ + i64 iRoot /* Root page of same table in INPUT db */ +){ + sqlite3_stmt *pStmt = recoverPreparePrintf(p, p->dbOut, + "PRAGMA table_xinfo(%Q)", zName + ); + + if( pStmt ){ + int iPk = -1; + int iBind = 1; + RecoverTable *pNew = 0; + int nCol = 0; + int nName = recoverStrlen(zName); + int nByte = 0; + while( sqlite3_step(pStmt)==SQLITE_ROW ){ + nCol++; + nByte += (sqlite3_column_bytes(pStmt, 1)+1); + } + nByte += sizeof(RecoverTable) + nCol*sizeof(RecoverColumn) + nName+1; + recoverReset(p, pStmt); + + pNew = recoverMalloc(p, nByte); + if( pNew ){ + int i = 0; + int iField = 0; + char *csr = 0; + pNew->aCol = (RecoverColumn*)&pNew[1]; + pNew->zTab = csr = (char*)&pNew->aCol[nCol]; + pNew->nCol = nCol; + pNew->iRoot = iRoot; + memcpy(csr, zName, nName); + csr += nName+1; + + for(i=0; sqlite3_step(pStmt)==SQLITE_ROW; i++){ + int iPKF = sqlite3_column_int(pStmt, 5); + int n = sqlite3_column_bytes(pStmt, 1); + const char *z = (const char*)sqlite3_column_text(pStmt, 1); + const char *zType = (const char*)sqlite3_column_text(pStmt, 2); + int eHidden = sqlite3_column_int(pStmt, 6); + + if( iPk==-1 && iPKF==1 && !sqlite3_stricmp("integer", zType) ) iPk = i; + if( iPKF>1 ) iPk = -2; + pNew->aCol[i].zCol = csr; + pNew->aCol[i].eHidden = eHidden; + if( eHidden==RECOVER_EHIDDEN_VIRTUAL ){ + pNew->aCol[i].iField = -1; + }else{ + pNew->aCol[i].iField = iField++; + } + if( eHidden!=RECOVER_EHIDDEN_VIRTUAL + && eHidden!=RECOVER_EHIDDEN_STORED + ){ + pNew->aCol[i].iBind = iBind++; + } + memcpy(csr, z, n); + csr += (n+1); + } + + pNew->pNext = p->pTblList; + p->pTblList = pNew; + pNew->bIntkey = 1; + } + + recoverFinalize(p, pStmt); + + pStmt = recoverPreparePrintf(p, p->dbOut, "PRAGMA index_xinfo(%Q)", zName); + while( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){ + int iField = sqlite3_column_int(pStmt, 0); + int iCol = sqlite3_column_int(pStmt, 1); + + assert( iColnCol ); + pNew->aCol[iCol].iField = iField; + + pNew->bIntkey = 0; + iPk = -2; + } + recoverFinalize(p, pStmt); + + if( p->errCode==SQLITE_OK ){ + if( iPk>=0 ){ + pNew->aCol[iPk].bIPK = 1; + }else if( pNew->bIntkey ){ + pNew->iRowidBind = iBind++; + } + } + } +} + +/* +** This function is called after recoverCacheSchema() has cached those parts +** of the input database schema that could be recovered in temporary table +** "recovery.schema". This function creates in the output database copies +** of all parts of that schema that must be created before the tables can +** be populated. Specifically, this means: +** +** * all tables that are not VIRTUAL, and +** * UNIQUE indexes. +** +** If the recovery handle uses SQL callbacks, then callbacks containing +** the associated "CREATE TABLE" and "CREATE INDEX" statements are made. +** +** Additionally, records are added to the sqlite_schema table of the +** output database for any VIRTUAL tables. The CREATE VIRTUAL TABLE +** records are written directly to sqlite_schema, not actually executed. +** If the handle is in SQL callback mode, then callbacks are invoked +** with equivalent SQL statements. +*/ +static int recoverWriteSchema1(sqlite3_recover *p){ + sqlite3_stmt *pSelect = 0; + sqlite3_stmt *pTblname = 0; + + pSelect = recoverPrepare(p, p->dbOut, + "WITH dbschema(rootpage, name, sql, tbl, isVirtual, isIndex) AS (" + " SELECT rootpage, name, sql, " + " type='table', " + " sql LIKE 'create virtual%'," + " (type='index' AND (sql LIKE '%unique%' OR ?1))" + " FROM recovery.schema" + ")" + "SELECT rootpage, tbl, isVirtual, name, sql" + " FROM dbschema " + " WHERE tbl OR isIndex" + " ORDER BY tbl DESC, name=='sqlite_sequence' DESC" + ); + + pTblname = recoverPrepare(p, p->dbOut, + "SELECT name FROM sqlite_schema " + "WHERE type='table' ORDER BY rowid DESC LIMIT 1" + ); + + if( pSelect ){ + sqlite3_bind_int(pSelect, 1, p->bSlowIndexes); + while( sqlite3_step(pSelect)==SQLITE_ROW ){ + i64 iRoot = sqlite3_column_int64(pSelect, 0); + int bTable = sqlite3_column_int(pSelect, 1); + int bVirtual = sqlite3_column_int(pSelect, 2); + const char *zName = (const char*)sqlite3_column_text(pSelect, 3); + const char *zSql = (const char*)sqlite3_column_text(pSelect, 4); + char *zFree = 0; + int rc = SQLITE_OK; + + if( bVirtual ){ + zSql = (const char*)(zFree = recoverMPrintf(p, + "INSERT INTO sqlite_schema VALUES('table', %Q, %Q, 0, %Q)", + zName, zName, zSql + )); + } + rc = sqlite3_exec(p->dbOut, zSql, 0, 0, 0); + if( rc==SQLITE_OK ){ + recoverSqlCallback(p, zSql); + if( bTable && !bVirtual ){ + if( SQLITE_ROW==sqlite3_step(pTblname) ){ + const char *zTbl = (const char*)sqlite3_column_text(pTblname, 0); + if( zTbl ) recoverAddTable(p, zTbl, iRoot); + } + recoverReset(p, pTblname); + } + }else if( rc!=SQLITE_ERROR ){ + recoverDbError(p, p->dbOut); + } + sqlite3_free(zFree); + } + } + recoverFinalize(p, pSelect); + recoverFinalize(p, pTblname); + + return p->errCode; +} + +/* +** This function is called after the output database has been populated. It +** adds all recovered schema elements that were not created in the output +** database by recoverWriteSchema1() - everything except for tables and +** UNIQUE indexes. Specifically: +** +** * views, +** * triggers, +** * non-UNIQUE indexes. +** +** If the recover handle is in SQL callback mode, then equivalent callbacks +** are issued to create the schema elements. +*/ +static int recoverWriteSchema2(sqlite3_recover *p){ + sqlite3_stmt *pSelect = 0; + + pSelect = recoverPrepare(p, p->dbOut, + p->bSlowIndexes ? + "SELECT rootpage, sql FROM recovery.schema " + " WHERE type!='table' AND type!='index'" + : + "SELECT rootpage, sql FROM recovery.schema " + " WHERE type!='table' AND (type!='index' OR sql NOT LIKE '%unique%')" + ); + + if( pSelect ){ + while( sqlite3_step(pSelect)==SQLITE_ROW ){ + const char *zSql = (const char*)sqlite3_column_text(pSelect, 1); + int rc = sqlite3_exec(p->dbOut, zSql, 0, 0, 0); + if( rc==SQLITE_OK ){ + recoverSqlCallback(p, zSql); + }else if( rc!=SQLITE_ERROR ){ + recoverDbError(p, p->dbOut); + } + } + } + recoverFinalize(p, pSelect); + + return p->errCode; +} + +/* +** This function is a no-op if recover handle p already contains an error +** (if p->errCode!=SQLITE_OK). In this case it returns NULL. +** +** Otherwise, if the recover handle is configured to create an output +** database (was created by sqlite3_recover_init()), then this function +** prepares and returns an SQL statement to INSERT a new record into table +** pTab, assuming the first nField fields of a record extracted from disk +** are valid. +** +** For example, if table pTab is: +** +** CREATE TABLE name(a, b GENERATED ALWAYS AS (a+1) STORED, c, d, e); +** +** And nField is 4, then the SQL statement prepared and returned is: +** +** INSERT INTO (a, c, d) VALUES (?1, ?2, ?3); +** +** In this case even though 4 values were extracted from the input db, +** only 3 are written to the output, as the generated STORED column +** cannot be written. +** +** If the recover handle is in SQL callback mode, then the SQL statement +** prepared is such that evaluating it returns a single row containing +** a single text value - itself an SQL statement similar to the above, +** except with SQL literals in place of the variables. For example: +** +** SELECT 'INSERT INTO (a, c, d) VALUES (' +** || quote(?1) || ', ' +** || quote(?2) || ', ' +** || quote(?3) || ')'; +** +** In either case, it is the responsibility of the caller to eventually +** free the statement handle using sqlite3_finalize(). +*/ +static sqlite3_stmt *recoverInsertStmt( + sqlite3_recover *p, + RecoverTable *pTab, + int nField +){ + sqlite3_stmt *pRet = 0; + const char *zSep = ""; + const char *zSqlSep = ""; + char *zSql = 0; + char *zFinal = 0; + char *zBind = 0; + int ii; + int bSql = p->xSql ? 1 : 0; + + if( nField<=0 ) return 0; + + assert( nField<=pTab->nCol ); + + zSql = recoverMPrintf(p, "INSERT OR IGNORE INTO %Q(", pTab->zTab); + + if( pTab->iRowidBind ){ + assert( pTab->bIntkey ); + zSql = recoverMPrintf(p, "%z_rowid_", zSql); + if( bSql ){ + zBind = recoverMPrintf(p, "%zquote(?%d)", zBind, pTab->iRowidBind); + }else{ + zBind = recoverMPrintf(p, "%z?%d", zBind, pTab->iRowidBind); + } + zSqlSep = "||', '||"; + zSep = ", "; + } + + for(ii=0; iiaCol[ii].eHidden; + if( eHidden!=RECOVER_EHIDDEN_VIRTUAL + && eHidden!=RECOVER_EHIDDEN_STORED + ){ + assert( pTab->aCol[ii].iField>=0 && pTab->aCol[ii].iBind>=1 ); + zSql = recoverMPrintf(p, "%z%s%Q", zSql, zSep, pTab->aCol[ii].zCol); + + if( bSql ){ + zBind = recoverMPrintf(p, + "%z%sescape_crlf(quote(?%d))", zBind, zSqlSep, pTab->aCol[ii].iBind + ); + zSqlSep = "||', '||"; + }else{ + zBind = recoverMPrintf(p, "%z%s?%d", zBind, zSep, pTab->aCol[ii].iBind); + } + zSep = ", "; + } + } + + if( bSql ){ + zFinal = recoverMPrintf(p, "SELECT %Q || ') VALUES (' || %s || ')'", + zSql, zBind + ); + }else{ + zFinal = recoverMPrintf(p, "%s) VALUES (%s)", zSql, zBind); + } + + pRet = recoverPrepare(p, p->dbOut, zFinal); + sqlite3_free(zSql); + sqlite3_free(zBind); + sqlite3_free(zFinal); + + return pRet; +} + + +/* +** Search the list of RecoverTable objects at p->pTblList for one that +** has root page iRoot in the input database. If such an object is found, +** return a pointer to it. Otherwise, return NULL. +*/ +static RecoverTable *recoverFindTable(sqlite3_recover *p, u32 iRoot){ + RecoverTable *pRet = 0; + for(pRet=p->pTblList; pRet && pRet->iRoot!=iRoot; pRet=pRet->pNext); + return pRet; +} + +/* +** This function attempts to create a lost and found table within the +** output db. If successful, it returns a pointer to a buffer containing +** the name of the new table. It is the responsibility of the caller to +** eventually free this buffer using sqlite3_free(). +** +** If an error occurs, NULL is returned and an error code and error +** message left in the recover handle. +*/ +static char *recoverLostAndFoundCreate( + sqlite3_recover *p, /* Recover object */ + int nField /* Number of column fields in new table */ +){ + char *zTbl = 0; + sqlite3_stmt *pProbe = 0; + int ii = 0; + + pProbe = recoverPrepare(p, p->dbOut, + "SELECT 1 FROM sqlite_schema WHERE name=?" + ); + for(ii=-1; zTbl==0 && p->errCode==SQLITE_OK && ii<1000; ii++){ + int bFail = 0; + if( ii<0 ){ + zTbl = recoverMPrintf(p, "%s", p->zLostAndFound); + }else{ + zTbl = recoverMPrintf(p, "%s_%d", p->zLostAndFound, ii); + } + + if( p->errCode==SQLITE_OK ){ + sqlite3_bind_text(pProbe, 1, zTbl, -1, SQLITE_STATIC); + if( SQLITE_ROW==sqlite3_step(pProbe) ){ + bFail = 1; + } + recoverReset(p, pProbe); + } + + if( bFail ){ + sqlite3_clear_bindings(pProbe); + sqlite3_free(zTbl); + zTbl = 0; + } + } + recoverFinalize(p, pProbe); + + if( zTbl ){ + const char *zSep = 0; + char *zField = 0; + char *zSql = 0; + + zSep = "rootpgno INTEGER, pgno INTEGER, nfield INTEGER, id INTEGER, "; + for(ii=0; p->errCode==SQLITE_OK && iidbOut, zSql); + recoverSqlCallback(p, zSql); + sqlite3_free(zSql); + }else if( p->errCode==SQLITE_OK ){ + recoverError( + p, SQLITE_ERROR, "failed to create %s output table", p->zLostAndFound + ); + } + + return zTbl; +} + +/* +** Synthesize and prepare an INSERT statement to write to the lost_and_found +** table in the output database. The name of the table is zTab, and it has +** nField c* fields. +*/ +static sqlite3_stmt *recoverLostAndFoundInsert( + sqlite3_recover *p, + const char *zTab, + int nField +){ + int nTotal = nField + 4; + int ii; + char *zBind = 0; + sqlite3_stmt *pRet = 0; + + if( p->xSql==0 ){ + for(ii=0; iidbOut, "INSERT INTO %s VALUES(%s)", zTab, zBind + ); + }else{ + const char *zSep = ""; + for(ii=0; iidbOut, "SELECT 'INSERT INTO %s VALUES(' || %s || ')'", zTab, zBind + ); + } + + sqlite3_free(zBind); + return pRet; +} + +/* +** Input database page iPg contains data that will be written to the +** lost-and-found table of the output database. This function attempts +** to identify the root page of the tree that page iPg belonged to. +** If successful, it sets output variable (*piRoot) to the page number +** of the root page and returns SQLITE_OK. Otherwise, if an error occurs, +** an SQLite error code is returned and the final value of *piRoot +** undefined. +*/ +static int recoverLostAndFoundFindRoot( + sqlite3_recover *p, + i64 iPg, + i64 *piRoot +){ + RecoverStateLAF *pLaf = &p->laf; + + if( pLaf->pFindRoot==0 ){ + pLaf->pFindRoot = recoverPrepare(p, p->dbOut, + "WITH RECURSIVE p(pgno) AS (" + " SELECT ?" + " UNION" + " SELECT parent FROM recovery.map AS m, p WHERE m.pgno=p.pgno" + ") " + "SELECT p.pgno FROM p, recovery.map m WHERE m.pgno=p.pgno " + " AND m.parent IS NULL" + ); + } + if( p->errCode==SQLITE_OK ){ + sqlite3_bind_int64(pLaf->pFindRoot, 1, iPg); + if( sqlite3_step(pLaf->pFindRoot)==SQLITE_ROW ){ + *piRoot = sqlite3_column_int64(pLaf->pFindRoot, 0); + }else{ + *piRoot = iPg; + } + recoverReset(p, pLaf->pFindRoot); + } + return p->errCode; +} + +/* +** Recover data from page iPage of the input database and write it to +** the lost-and-found table in the output database. +*/ +static void recoverLostAndFoundOnePage(sqlite3_recover *p, i64 iPage){ + RecoverStateLAF *pLaf = &p->laf; + sqlite3_value **apVal = pLaf->apVal; + sqlite3_stmt *pPageData = pLaf->pPageData; + sqlite3_stmt *pInsert = pLaf->pInsert; + + int nVal = -1; + int iPrevCell = 0; + i64 iRoot = 0; + int bHaveRowid = 0; + i64 iRowid = 0; + int ii = 0; + + if( recoverLostAndFoundFindRoot(p, iPage, &iRoot) ) return; + sqlite3_bind_int64(pPageData, 1, iPage); + while( p->errCode==SQLITE_OK && SQLITE_ROW==sqlite3_step(pPageData) ){ + int iCell = sqlite3_column_int64(pPageData, 0); + int iField = sqlite3_column_int64(pPageData, 1); + + if( iPrevCell!=iCell && nVal>=0 ){ + /* Insert the new row */ + sqlite3_bind_int64(pInsert, 1, iRoot); /* rootpgno */ + sqlite3_bind_int64(pInsert, 2, iPage); /* pgno */ + sqlite3_bind_int(pInsert, 3, nVal); /* nfield */ + if( bHaveRowid ){ + sqlite3_bind_int64(pInsert, 4, iRowid); /* id */ + } + for(ii=0; iinMaxField ){ + sqlite3_value *pVal = sqlite3_column_value(pPageData, 2); + apVal[iField] = sqlite3_value_dup(pVal); + assert( iField==nVal || (nVal==-1 && iField==0) ); + nVal = iField+1; + if( apVal[iField]==0 ){ + recoverError(p, SQLITE_NOMEM, 0); + } + } + + iPrevCell = iCell; + } + recoverReset(p, pPageData); + + for(ii=0; iilaf; + if( p->errCode==SQLITE_OK ){ + if( pLaf->pInsert==0 ){ + return SQLITE_DONE; + }else{ + if( p->errCode==SQLITE_OK ){ + int res = sqlite3_step(pLaf->pAllPage); + if( res==SQLITE_ROW ){ + i64 iPage = sqlite3_column_int64(pLaf->pAllPage, 0); + if( recoverBitmapQuery(pLaf->pUsed, iPage)==0 ){ + recoverLostAndFoundOnePage(p, iPage); + } + }else{ + recoverReset(p, pLaf->pAllPage); + return SQLITE_DONE; + } + } + } + } + return SQLITE_OK; +} + +/* +** Initialize resources required in RECOVER_STATE_LOSTANDFOUND3 +** state - during which the lost-and-found table of the output database +** is populated with recovered data that can not be assigned to any +** recovered schema object. +*/ +static void recoverLostAndFound3Init(sqlite3_recover *p){ + RecoverStateLAF *pLaf = &p->laf; + + if( pLaf->nMaxField>0 ){ + char *zTab = 0; /* Name of lost_and_found table */ + + zTab = recoverLostAndFoundCreate(p, pLaf->nMaxField); + pLaf->pInsert = recoverLostAndFoundInsert(p, zTab, pLaf->nMaxField); + sqlite3_free(zTab); + + pLaf->pAllPage = recoverPreparePrintf(p, p->dbOut, + "WITH RECURSIVE seq(ii) AS (" + " SELECT 1 UNION ALL SELECT ii+1 FROM seq WHERE ii<%lld" + ")" + "SELECT ii FROM seq" , p->laf.nPg + ); + pLaf->pPageData = recoverPrepare(p, p->dbOut, + "SELECT cell, field, value " + "FROM sqlite_dbdata('getpage()') d WHERE d.pgno=? " + "UNION ALL " + "SELECT -1, -1, -1" + ); + + pLaf->apVal = (sqlite3_value**)recoverMalloc(p, + pLaf->nMaxField*sizeof(sqlite3_value*) + ); + } +} + +/* +** Initialize resources required in RECOVER_STATE_WRITING state - during which +** tables recovered from the schema of the input database are populated with +** recovered data. +*/ +static int recoverWriteDataInit(sqlite3_recover *p){ + RecoverStateW1 *p1 = &p->w1; + RecoverTable *pTbl = 0; + int nByte = 0; + + /* Figure out the maximum number of columns for any table in the schema */ + assert( p1->nMax==0 ); + for(pTbl=p->pTblList; pTbl; pTbl=pTbl->pNext){ + if( pTbl->nCol>p1->nMax ) p1->nMax = pTbl->nCol; + } + + /* Allocate an array of (sqlite3_value*) in which to accumulate the values + ** that will be written to the output database in a single row. */ + nByte = sizeof(sqlite3_value*) * (p1->nMax+1); + p1->apVal = (sqlite3_value**)recoverMalloc(p, nByte); + if( p1->apVal==0 ) return p->errCode; + + /* Prepare the SELECT to loop through schema tables (pTbls) and the SELECT + ** to loop through cells that appear to belong to a single table (pSel). */ + p1->pTbls = recoverPrepare(p, p->dbOut, + "SELECT rootpage FROM recovery.schema " + " WHERE type='table' AND (sql NOT LIKE 'create virtual%')" + " ORDER BY (tbl_name='sqlite_sequence') ASC" + ); + p1->pSel = recoverPrepare(p, p->dbOut, + "WITH RECURSIVE pages(page) AS (" + " SELECT ?1" + " UNION" + " SELECT child FROM sqlite_dbptr('getpage()'), pages " + " WHERE pgno=page" + ") " + "SELECT page, cell, field, value " + "FROM sqlite_dbdata('getpage()') d, pages p WHERE p.page=d.pgno " + "UNION ALL " + "SELECT 0, 0, 0, 0" + ); + + return p->errCode; +} + +/* +** Clean up resources allocated by recoverWriteDataInit() (stuff in +** sqlite3_recover.w1). +*/ +static void recoverWriteDataCleanup(sqlite3_recover *p){ + RecoverStateW1 *p1 = &p->w1; + int ii; + for(ii=0; iinVal; ii++){ + sqlite3_value_free(p1->apVal[ii]); + } + sqlite3_free(p1->apVal); + recoverFinalize(p, p1->pInsert); + recoverFinalize(p, p1->pTbls); + recoverFinalize(p, p1->pSel); + memset(p1, 0, sizeof(*p1)); +} + +/* +** Perform one step (sqlite3_recover_step()) of work for the connection +** passed as the only argument, which is guaranteed to be in +** RECOVER_STATE_WRITING state - during which tables recovered from the +** schema of the input database are populated with recovered data. +*/ +static int recoverWriteDataStep(sqlite3_recover *p){ + RecoverStateW1 *p1 = &p->w1; + sqlite3_stmt *pSel = p1->pSel; + sqlite3_value **apVal = p1->apVal; + + if( p->errCode==SQLITE_OK && p1->pTab==0 ){ + if( sqlite3_step(p1->pTbls)==SQLITE_ROW ){ + i64 iRoot = sqlite3_column_int64(p1->pTbls, 0); + p1->pTab = recoverFindTable(p, iRoot); + + recoverFinalize(p, p1->pInsert); + p1->pInsert = 0; + + /* If this table is unknown, return early. The caller will invoke this + ** function again and it will move on to the next table. */ + if( p1->pTab==0 ) return p->errCode; + + /* If this is the sqlite_sequence table, delete any rows added by + ** earlier INSERT statements on tables with AUTOINCREMENT primary + ** keys before recovering its contents. The p1->pTbls SELECT statement + ** is rigged to deliver "sqlite_sequence" last of all, so we don't + ** worry about it being modified after it is recovered. */ + if( sqlite3_stricmp("sqlite_sequence", p1->pTab->zTab)==0 ){ + recoverExec(p, p->dbOut, "DELETE FROM sqlite_sequence"); + recoverSqlCallback(p, "DELETE FROM sqlite_sequence"); + } + + /* Bind the root page of this table within the original database to + ** SELECT statement p1->pSel. The SELECT statement will then iterate + ** through cells that look like they belong to table pTab. */ + sqlite3_bind_int64(pSel, 1, iRoot); + + p1->nVal = 0; + p1->bHaveRowid = 0; + p1->iPrevPage = -1; + p1->iPrevCell = -1; + }else{ + return SQLITE_DONE; + } + } + assert( p->errCode!=SQLITE_OK || p1->pTab ); + + if( p->errCode==SQLITE_OK && sqlite3_step(pSel)==SQLITE_ROW ){ + RecoverTable *pTab = p1->pTab; + + i64 iPage = sqlite3_column_int64(pSel, 0); + int iCell = sqlite3_column_int(pSel, 1); + int iField = sqlite3_column_int(pSel, 2); + sqlite3_value *pVal = sqlite3_column_value(pSel, 3); + int bNewCell = (p1->iPrevPage!=iPage || p1->iPrevCell!=iCell); + + assert( bNewCell==0 || (iField==-1 || iField==0) ); + assert( bNewCell || iField==p1->nVal || p1->nVal==pTab->nCol ); + + if( bNewCell ){ + int ii = 0; + if( p1->nVal>=0 ){ + if( p1->pInsert==0 || p1->nVal!=p1->nInsert ){ + recoverFinalize(p, p1->pInsert); + p1->pInsert = recoverInsertStmt(p, pTab, p1->nVal); + p1->nInsert = p1->nVal; + } + if( p1->nVal>0 ){ + sqlite3_stmt *pInsert = p1->pInsert; + for(ii=0; iinCol; ii++){ + RecoverColumn *pCol = &pTab->aCol[ii]; + int iBind = pCol->iBind; + if( iBind>0 ){ + if( pCol->bIPK ){ + sqlite3_bind_int64(pInsert, iBind, p1->iRowid); + }else if( pCol->iFieldnVal ){ + recoverBindValue(p, pInsert, iBind, apVal[pCol->iField]); + } + } + } + if( p->bRecoverRowid && pTab->iRowidBind>0 && p1->bHaveRowid ){ + sqlite3_bind_int64(pInsert, pTab->iRowidBind, p1->iRowid); + } + if( SQLITE_ROW==sqlite3_step(pInsert) ){ + const char *z = (const char*)sqlite3_column_text(pInsert, 0); + recoverSqlCallback(p, z); + } + recoverReset(p, pInsert); + assert( p->errCode || pInsert ); + if( pInsert ) sqlite3_clear_bindings(pInsert); + } + } + + for(ii=0; iinVal; ii++){ + sqlite3_value_free(apVal[ii]); + apVal[ii] = 0; + } + p1->nVal = -1; + p1->bHaveRowid = 0; + } + + if( iPage!=0 ){ + if( iField<0 ){ + p1->iRowid = sqlite3_column_int64(pSel, 3); + assert( p1->nVal==-1 ); + p1->nVal = 0; + p1->bHaveRowid = 1; + }else if( iFieldnCol ){ + assert( apVal[iField]==0 ); + apVal[iField] = sqlite3_value_dup( pVal ); + if( apVal[iField]==0 ){ + recoverError(p, SQLITE_NOMEM, 0); + } + p1->nVal = iField+1; + }else if( pTab->nCol==0 ){ + p1->nVal = pTab->nCol; + } + p1->iPrevCell = iCell; + p1->iPrevPage = iPage; + } + }else{ + recoverReset(p, pSel); + p1->pTab = 0; + } + + return p->errCode; +} + +/* +** Initialize resources required by sqlite3_recover_step() in +** RECOVER_STATE_LOSTANDFOUND1 state - during which the set of pages not +** already allocated to a recovered schema element is determined. +*/ +static void recoverLostAndFound1Init(sqlite3_recover *p){ + RecoverStateLAF *pLaf = &p->laf; + sqlite3_stmt *pStmt = 0; + + assert( p->laf.pUsed==0 ); + pLaf->nPg = recoverPageCount(p); + pLaf->pUsed = recoverBitmapAlloc(p, pLaf->nPg); + + /* Prepare a statement to iterate through all pages that are part of any tree + ** in the recoverable part of the input database schema to the bitmap. And, + ** if !p->bFreelistCorrupt, add all pages that appear to be part of the + ** freelist. */ + pStmt = recoverPrepare( + p, p->dbOut, + "WITH trunk(pgno) AS (" + " SELECT read_i32(getpage(1), 8) AS x WHERE x>0" + " UNION" + " SELECT read_i32(getpage(trunk.pgno), 0) AS x FROM trunk WHERE x>0" + ")," + "trunkdata(pgno, data) AS (" + " SELECT pgno, getpage(pgno) FROM trunk" + ")," + "freelist(data, n, freepgno) AS (" + " SELECT data, min(16384, read_i32(data, 1)-1), pgno FROM trunkdata" + " UNION ALL" + " SELECT data, n-1, read_i32(data, 2+n) FROM freelist WHERE n>=0" + ")," + "" + "roots(r) AS (" + " SELECT 1 UNION ALL" + " SELECT rootpage FROM recovery.schema WHERE rootpage>0" + ")," + "used(page) AS (" + " SELECT r FROM roots" + " UNION" + " SELECT child FROM sqlite_dbptr('getpage()'), used " + " WHERE pgno=page" + ") " + "SELECT page FROM used" + " UNION ALL " + "SELECT freepgno FROM freelist WHERE NOT ?" + ); + if( pStmt ) sqlite3_bind_int(pStmt, 1, p->bFreelistCorrupt); + pLaf->pUsedPages = pStmt; +} + +/* +** Perform one step (sqlite3_recover_step()) of work for the connection +** passed as the only argument, which is guaranteed to be in +** RECOVER_STATE_LOSTANDFOUND1 state - during which the set of pages not +** already allocated to a recovered schema element is determined. +*/ +static int recoverLostAndFound1Step(sqlite3_recover *p){ + RecoverStateLAF *pLaf = &p->laf; + int rc = p->errCode; + if( rc==SQLITE_OK ){ + rc = sqlite3_step(pLaf->pUsedPages); + if( rc==SQLITE_ROW ){ + i64 iPg = sqlite3_column_int64(pLaf->pUsedPages, 0); + recoverBitmapSet(pLaf->pUsed, iPg); + rc = SQLITE_OK; + }else{ + recoverFinalize(p, pLaf->pUsedPages); + pLaf->pUsedPages = 0; + } + } + return rc; +} + +/* +** Initialize resources required by RECOVER_STATE_LOSTANDFOUND2 +** state - during which the pages identified in RECOVER_STATE_LOSTANDFOUND1 +** are sorted into sets that likely belonged to the same database tree. +*/ +static void recoverLostAndFound2Init(sqlite3_recover *p){ + RecoverStateLAF *pLaf = &p->laf; + + assert( p->laf.pAllAndParent==0 ); + assert( p->laf.pMapInsert==0 ); + assert( p->laf.pMaxField==0 ); + assert( p->laf.nMaxField==0 ); + + pLaf->pMapInsert = recoverPrepare(p, p->dbOut, + "INSERT OR IGNORE INTO recovery.map(pgno, parent) VALUES(?, ?)" + ); + pLaf->pAllAndParent = recoverPreparePrintf(p, p->dbOut, + "WITH RECURSIVE seq(ii) AS (" + " SELECT 1 UNION ALL SELECT ii+1 FROM seq WHERE ii<%lld" + ")" + "SELECT pgno, child FROM sqlite_dbptr('getpage()') " + " UNION ALL " + "SELECT NULL, ii FROM seq", p->laf.nPg + ); + pLaf->pMaxField = recoverPreparePrintf(p, p->dbOut, + "SELECT max(field)+1 FROM sqlite_dbdata('getpage') WHERE pgno = ?" + ); +} + +/* +** Perform one step (sqlite3_recover_step()) of work for the connection +** passed as the only argument, which is guaranteed to be in +** RECOVER_STATE_LOSTANDFOUND2 state - during which the pages identified +** in RECOVER_STATE_LOSTANDFOUND1 are sorted into sets that likely belonged +** to the same database tree. +*/ +static int recoverLostAndFound2Step(sqlite3_recover *p){ + RecoverStateLAF *pLaf = &p->laf; + if( p->errCode==SQLITE_OK ){ + int res = sqlite3_step(pLaf->pAllAndParent); + if( res==SQLITE_ROW ){ + i64 iChild = sqlite3_column_int(pLaf->pAllAndParent, 1); + if( recoverBitmapQuery(pLaf->pUsed, iChild)==0 ){ + sqlite3_bind_int64(pLaf->pMapInsert, 1, iChild); + sqlite3_bind_value(pLaf->pMapInsert, 2, + sqlite3_column_value(pLaf->pAllAndParent, 0) + ); + sqlite3_step(pLaf->pMapInsert); + recoverReset(p, pLaf->pMapInsert); + sqlite3_bind_int64(pLaf->pMaxField, 1, iChild); + if( SQLITE_ROW==sqlite3_step(pLaf->pMaxField) ){ + int nMax = sqlite3_column_int(pLaf->pMaxField, 0); + if( nMax>pLaf->nMaxField ) pLaf->nMaxField = nMax; + } + recoverReset(p, pLaf->pMaxField); + } + }else{ + recoverFinalize(p, pLaf->pAllAndParent); + pLaf->pAllAndParent =0; + return SQLITE_DONE; + } + } + return p->errCode; +} + +/* +** Free all resources allocated as part of sqlite3_recover_step() calls +** in one of the RECOVER_STATE_LOSTANDFOUND[123] states. +*/ +static void recoverLostAndFoundCleanup(sqlite3_recover *p){ + recoverBitmapFree(p->laf.pUsed); + p->laf.pUsed = 0; + sqlite3_finalize(p->laf.pUsedPages); + sqlite3_finalize(p->laf.pAllAndParent); + sqlite3_finalize(p->laf.pMapInsert); + sqlite3_finalize(p->laf.pMaxField); + sqlite3_finalize(p->laf.pFindRoot); + sqlite3_finalize(p->laf.pInsert); + sqlite3_finalize(p->laf.pAllPage); + sqlite3_finalize(p->laf.pPageData); + p->laf.pUsedPages = 0; + p->laf.pAllAndParent = 0; + p->laf.pMapInsert = 0; + p->laf.pMaxField = 0; + p->laf.pFindRoot = 0; + p->laf.pInsert = 0; + p->laf.pAllPage = 0; + p->laf.pPageData = 0; + sqlite3_free(p->laf.apVal); + p->laf.apVal = 0; +} + +/* +** Free all resources allocated as part of sqlite3_recover_step() calls. +*/ +static void recoverFinalCleanup(sqlite3_recover *p){ + RecoverTable *pTab = 0; + RecoverTable *pNext = 0; + + recoverWriteDataCleanup(p); + recoverLostAndFoundCleanup(p); + + for(pTab=p->pTblList; pTab; pTab=pNext){ + pNext = pTab->pNext; + sqlite3_free(pTab); + } + p->pTblList = 0; + sqlite3_finalize(p->pGetPage); + p->pGetPage = 0; + sqlite3_file_control(p->dbIn, p->zDb, SQLITE_FCNTL_RESET_CACHE, 0); + + { +#ifndef NDEBUG + int res = +#endif + sqlite3_close(p->dbOut); + assert( res==SQLITE_OK ); + } + p->dbOut = 0; +} + +/* +** Decode and return an unsigned 16-bit big-endian integer value from +** buffer a[]. +*/ +static u32 recoverGetU16(const u8 *a){ + return (((u32)a[0])<<8) + ((u32)a[1]); +} + +/* +** Decode and return an unsigned 32-bit big-endian integer value from +** buffer a[]. +*/ +static u32 recoverGetU32(const u8 *a){ + return (((u32)a[0])<<24) + (((u32)a[1])<<16) + (((u32)a[2])<<8) + ((u32)a[3]); +} + +/* +** Decode an SQLite varint from buffer a[]. Write the decoded value to (*pVal) +** and return the number of bytes consumed. +*/ +static int recoverGetVarint(const u8 *a, i64 *pVal){ + sqlite3_uint64 u = 0; + int i; + for(i=0; i<8; i++){ + u = (u<<7) + (a[i]&0x7f); + if( (a[i]&0x80)==0 ){ *pVal = (sqlite3_int64)u; return i+1; } + } + u = (u<<8) + (a[i]&0xff); + *pVal = (sqlite3_int64)u; + return 9; +} + +/* +** The second argument points to a buffer n bytes in size. If this buffer +** or a prefix thereof appears to contain a well-formed SQLite b-tree page, +** return the page-size in bytes. Otherwise, if the buffer does not +** appear to contain a well-formed b-tree page, return 0. +*/ +static int recoverIsValidPage(u8 *aTmp, const u8 *a, int n){ + u8 *aUsed = aTmp; + int nFrag = 0; + int nActual = 0; + int iFree = 0; + int nCell = 0; /* Number of cells on page */ + int iCellOff = 0; /* Offset of cell array in page */ + int iContent = 0; + int eType = 0; + int ii = 0; + + eType = (int)a[0]; + if( eType!=0x02 && eType!=0x05 && eType!=0x0A && eType!=0x0D ) return 0; + + iFree = (int)recoverGetU16(&a[1]); + nCell = (int)recoverGetU16(&a[3]); + iContent = (int)recoverGetU16(&a[5]); + if( iContent==0 ) iContent = 65536; + nFrag = (int)a[7]; + + if( iContent>n ) return 0; + + memset(aUsed, 0, n); + memset(aUsed, 0xFF, iContent); + + /* Follow the free-list. This is the same format for all b-tree pages. */ + if( iFree && iFree<=iContent ) return 0; + while( iFree ){ + int iNext = 0; + int nByte = 0; + if( iFree>(n-4) ) return 0; + iNext = recoverGetU16(&a[iFree]); + nByte = recoverGetU16(&a[iFree+2]); + if( iFree+nByte>n || nByte<4 ) return 0; + if( iNext && iNextiContent ) return 0; + for(ii=0; iin ){ + return 0; + } + if( eType==0x05 || eType==0x02 ) nByte += 4; + nByte += recoverGetVarint(&a[iOff+nByte], &nPayload); + if( eType==0x0D ){ + i64 dummy = 0; + nByte += recoverGetVarint(&a[iOff+nByte], &dummy); + } + if( eType!=0x05 ){ + int X = (eType==0x0D) ? n-35 : (((n-12)*64/255)-23); + int M = ((n-12)*32/255)-23; + int K = M+((nPayload-M)%(n-4)); + + if( nPayloadn ){ + return 0; + } + for(iByte=iOff; iByte<(iOff+nByte); iByte++){ + if( aUsed[iByte]!=0 ){ + return 0; + } + aUsed[iByte] = 0xFF; + } + } + + nActual = 0; + for(ii=0; iipMethods!=&recover_methods ); + return pFd->pMethods->xClose(pFd); +} + +/* +** Write value v to buffer a[] as a 16-bit big-endian unsigned integer. +*/ +static void recoverPutU16(u8 *a, u32 v){ + a[0] = (v>>8) & 0x00FF; + a[1] = (v>>0) & 0x00FF; +} + +/* +** Write value v to buffer a[] as a 32-bit big-endian unsigned integer. +*/ +static void recoverPutU32(u8 *a, u32 v){ + a[0] = (v>>24) & 0x00FF; + a[1] = (v>>16) & 0x00FF; + a[2] = (v>>8) & 0x00FF; + a[3] = (v>>0) & 0x00FF; +} + +/* +** Detect the page-size of the database opened by file-handle pFd by +** searching the first part of the file for a well-formed SQLite b-tree +** page. If parameter nReserve is non-zero, then as well as searching for +** a b-tree page with zero reserved bytes, this function searches for one +** with nReserve reserved bytes at the end of it. +** +** If successful, set variable p->detected_pgsz to the detected page-size +** in bytes and return SQLITE_OK. Or, if no error occurs but no valid page +** can be found, return SQLITE_OK but leave p->detected_pgsz set to 0. Or, +** if an error occurs (e.g. an IO or OOM error), then an SQLite error code +** is returned. The final value of p->detected_pgsz is undefined in this +** case. +*/ +static int recoverVfsDetectPagesize( + sqlite3_recover *p, /* Recover handle */ + sqlite3_file *pFd, /* File-handle open on input database */ + u32 nReserve, /* Possible nReserve value */ + i64 nSz /* Size of database file in bytes */ +){ + int rc = SQLITE_OK; + const int nMin = 512; + const int nMax = 65536; + const int nMaxBlk = 4; + u32 pgsz = 0; + int iBlk = 0; + u8 *aPg = 0; + u8 *aTmp = 0; + int nBlk = 0; + + aPg = (u8*)sqlite3_malloc(2*nMax); + if( aPg==0 ) return SQLITE_NOMEM; + aTmp = &aPg[nMax]; + + nBlk = (nSz+nMax-1)/nMax; + if( nBlk>nMaxBlk ) nBlk = nMaxBlk; + + do { + for(iBlk=0; rc==SQLITE_OK && iBlk=((iBlk+1)*nMax)) ? nMax : (nSz % nMax); + memset(aPg, 0, nMax); + rc = pFd->pMethods->xRead(pFd, aPg, nByte, iBlk*nMax); + if( rc==SQLITE_OK ){ + int pgsz2; + for(pgsz2=(pgsz ? pgsz*2 : nMin); pgsz2<=nMax; pgsz2=pgsz2*2){ + int iOff; + for(iOff=0; iOff(u32)p->detected_pgsz ){ + p->detected_pgsz = pgsz; + p->nReserve = nReserve; + } + if( nReserve==0 ) break; + nReserve = 0; + }while( 1 ); + + p->detected_pgsz = pgsz; + sqlite3_free(aPg); + return rc; +} + +/* +** The xRead() method of the wrapper VFS. This is used to intercept calls +** to read page 1 of the input database. +*/ +static int recoverVfsRead(sqlite3_file *pFd, void *aBuf, int nByte, i64 iOff){ + int rc = SQLITE_OK; + if( pFd->pMethods==&recover_methods ){ + pFd->pMethods = recover_g.pMethods; + rc = pFd->pMethods->xRead(pFd, aBuf, nByte, iOff); + if( nByte==16 ){ + sqlite3_randomness(16, aBuf); + }else + if( rc==SQLITE_OK && iOff==0 && nByte>=108 ){ + /* Ensure that the database has a valid header file. The only fields + ** that really matter to recovery are: + ** + ** + Database page size (16-bits at offset 16) + ** + Size of db in pages (32-bits at offset 28) + ** + Database encoding (32-bits at offset 56) + ** + ** Also preserved are: + ** + ** + first freelist page (32-bits at offset 32) + ** + size of freelist (32-bits at offset 36) + ** + the wal-mode flags (16-bits at offset 18) + ** + ** We also try to preserve the auto-vacuum, incr-value, user-version + ** and application-id fields - all 32 bit quantities at offsets + ** 52, 60, 64 and 68. All other fields are set to known good values. + ** + ** Byte offset 105 should also contain the page-size as a 16-bit + ** integer. + */ + const int aPreserve[] = {32, 36, 52, 60, 64, 68}; + u8 aHdr[108] = { + 0x53, 0x51, 0x4c, 0x69, 0x74, 0x65, 0x20, 0x66, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x33, 0x00, + 0xFF, 0xFF, 0x01, 0x01, 0x00, 0x40, 0x20, 0x20, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x10, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x2e, 0x5b, 0x30, + + 0x0D, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00 + }; + u8 *a = (u8*)aBuf; + + u32 pgsz = recoverGetU16(&a[16]); + u32 nReserve = a[20]; + u32 enc = recoverGetU32(&a[56]); + u32 dbsz = 0; + i64 dbFileSize = 0; + int ii; + sqlite3_recover *p = recover_g.p; + + if( pgsz==0x01 ) pgsz = 65536; + rc = pFd->pMethods->xFileSize(pFd, &dbFileSize); + + if( rc==SQLITE_OK && p->detected_pgsz==0 ){ + rc = recoverVfsDetectPagesize(p, pFd, nReserve, dbFileSize); + } + if( p->detected_pgsz ){ + pgsz = p->detected_pgsz; + nReserve = p->nReserve; + } + + if( pgsz ){ + dbsz = dbFileSize / pgsz; + } + if( enc!=SQLITE_UTF8 && enc!=SQLITE_UTF16BE && enc!=SQLITE_UTF16LE ){ + enc = SQLITE_UTF8; + } + + sqlite3_free(p->pPage1Cache); + p->pPage1Cache = 0; + p->pPage1Disk = 0; + + p->pgsz = nByte; + p->pPage1Cache = (u8*)recoverMalloc(p, nByte*2); + if( p->pPage1Cache ){ + p->pPage1Disk = &p->pPage1Cache[nByte]; + memcpy(p->pPage1Disk, aBuf, nByte); + aHdr[18] = a[18]; + aHdr[19] = a[19]; + recoverPutU32(&aHdr[28], dbsz); + recoverPutU32(&aHdr[56], enc); + recoverPutU16(&aHdr[105], pgsz-nReserve); + if( pgsz==65536 ) pgsz = 1; + recoverPutU16(&aHdr[16], pgsz); + aHdr[20] = nReserve; + for(ii=0; ii<(int)(sizeof(aPreserve)/sizeof(aPreserve[0])); ii++){ + memcpy(&aHdr[aPreserve[ii]], &a[aPreserve[ii]], 4); + } + memcpy(aBuf, aHdr, sizeof(aHdr)); + memset(&((u8*)aBuf)[sizeof(aHdr)], 0, nByte-sizeof(aHdr)); + + memcpy(p->pPage1Cache, aBuf, nByte); + }else{ + rc = p->errCode; + } + + } + pFd->pMethods = &recover_methods; + }else{ + rc = pFd->pMethods->xRead(pFd, aBuf, nByte, iOff); + } + return rc; +} + +/* +** Used to make sqlite3_io_methods wrapper methods less verbose. +*/ +#define RECOVER_VFS_WRAPPER(code) \ + int rc = SQLITE_OK; \ + if( pFd->pMethods==&recover_methods ){ \ + pFd->pMethods = recover_g.pMethods; \ + rc = code; \ + pFd->pMethods = &recover_methods; \ + }else{ \ + rc = code; \ + } \ + return rc; + +/* +** Methods of the wrapper VFS. All methods except for xRead() and xClose() +** simply uninstall the sqlite3_io_methods wrapper, invoke the equivalent +** method on the lower level VFS, then reinstall the wrapper before returning. +** Those that return an integer value use the RECOVER_VFS_WRAPPER macro. +*/ +static int recoverVfsWrite( + sqlite3_file *pFd, const void *aBuf, int nByte, i64 iOff +){ + RECOVER_VFS_WRAPPER ( + pFd->pMethods->xWrite(pFd, aBuf, nByte, iOff) + ); +} +static int recoverVfsTruncate(sqlite3_file *pFd, sqlite3_int64 size){ + RECOVER_VFS_WRAPPER ( + pFd->pMethods->xTruncate(pFd, size) + ); +} +static int recoverVfsSync(sqlite3_file *pFd, int flags){ + RECOVER_VFS_WRAPPER ( + pFd->pMethods->xSync(pFd, flags) + ); +} +static int recoverVfsFileSize(sqlite3_file *pFd, sqlite3_int64 *pSize){ + RECOVER_VFS_WRAPPER ( + pFd->pMethods->xFileSize(pFd, pSize) + ); +} +static int recoverVfsLock(sqlite3_file *pFd, int eLock){ + RECOVER_VFS_WRAPPER ( + pFd->pMethods->xLock(pFd, eLock) + ); +} +static int recoverVfsUnlock(sqlite3_file *pFd, int eLock){ + RECOVER_VFS_WRAPPER ( + pFd->pMethods->xUnlock(pFd, eLock) + ); +} +static int recoverVfsCheckReservedLock(sqlite3_file *pFd, int *pResOut){ + RECOVER_VFS_WRAPPER ( + pFd->pMethods->xCheckReservedLock(pFd, pResOut) + ); +} +static int recoverVfsFileControl(sqlite3_file *pFd, int op, void *pArg){ + RECOVER_VFS_WRAPPER ( + (pFd->pMethods ? pFd->pMethods->xFileControl(pFd, op, pArg) : SQLITE_NOTFOUND) + ); +} +static int recoverVfsSectorSize(sqlite3_file *pFd){ + RECOVER_VFS_WRAPPER ( + pFd->pMethods->xSectorSize(pFd) + ); +} +static int recoverVfsDeviceCharacteristics(sqlite3_file *pFd){ + RECOVER_VFS_WRAPPER ( + pFd->pMethods->xDeviceCharacteristics(pFd) + ); +} +static int recoverVfsShmMap( + sqlite3_file *pFd, int iPg, int pgsz, int bExtend, void volatile **pp +){ + RECOVER_VFS_WRAPPER ( + pFd->pMethods->xShmMap(pFd, iPg, pgsz, bExtend, pp) + ); +} +static int recoverVfsShmLock(sqlite3_file *pFd, int offset, int n, int flags){ + RECOVER_VFS_WRAPPER ( + pFd->pMethods->xShmLock(pFd, offset, n, flags) + ); +} +static void recoverVfsShmBarrier(sqlite3_file *pFd){ + if( pFd->pMethods==&recover_methods ){ + pFd->pMethods = recover_g.pMethods; + pFd->pMethods->xShmBarrier(pFd); + pFd->pMethods = &recover_methods; + }else{ + pFd->pMethods->xShmBarrier(pFd); + } +} +static int recoverVfsShmUnmap(sqlite3_file *pFd, int deleteFlag){ + RECOVER_VFS_WRAPPER ( + pFd->pMethods->xShmUnmap(pFd, deleteFlag) + ); +} + +static int recoverVfsFetch( + sqlite3_file *pFd, + sqlite3_int64 iOff, + int iAmt, + void **pp +){ + (void)pFd; + (void)iOff; + (void)iAmt; + *pp = 0; + return SQLITE_OK; +} +static int recoverVfsUnfetch(sqlite3_file *pFd, sqlite3_int64 iOff, void *p){ + (void)pFd; + (void)iOff; + (void)p; + return SQLITE_OK; +} + +/* +** Install the VFS wrapper around the file-descriptor open on the input +** database for recover handle p. Mutex RECOVER_MUTEX_ID must be held +** when this function is called. +*/ +static void recoverInstallWrapper(sqlite3_recover *p){ + sqlite3_file *pFd = 0; + assert( recover_g.pMethods==0 ); + recoverAssertMutexHeld(); + sqlite3_file_control(p->dbIn, p->zDb, SQLITE_FCNTL_FILE_POINTER, (void*)&pFd); + assert( pFd==0 || pFd->pMethods!=&recover_methods ); + if( pFd && pFd->pMethods ){ + int iVersion = 1 + (pFd->pMethods->iVersion>1 && pFd->pMethods->xShmMap!=0); + recover_g.pMethods = pFd->pMethods; + recover_g.p = p; + recover_methods.iVersion = iVersion; + pFd->pMethods = &recover_methods; + } +} + +/* +** Uninstall the VFS wrapper that was installed around the file-descriptor open +** on the input database for recover handle p. Mutex RECOVER_MUTEX_ID must be +** held when this function is called. +*/ +static void recoverUninstallWrapper(sqlite3_recover *p){ + sqlite3_file *pFd = 0; + recoverAssertMutexHeld(); + sqlite3_file_control(p->dbIn, p->zDb,SQLITE_FCNTL_FILE_POINTER,(void*)&pFd); + if( pFd && pFd->pMethods ){ + pFd->pMethods = recover_g.pMethods; + recover_g.pMethods = 0; + recover_g.p = 0; + } +} + +/* +** This function does the work of a single sqlite3_recover_step() call. It +** is guaranteed that the handle is not in an error state when this +** function is called. +*/ +static void recoverStep(sqlite3_recover *p){ + assert( p && p->errCode==SQLITE_OK ); + switch( p->eState ){ + case RECOVER_STATE_INIT: + /* This is the very first call to sqlite3_recover_step() on this object. + */ + recoverSqlCallback(p, "BEGIN"); + recoverSqlCallback(p, "PRAGMA writable_schema = on"); + + recoverEnterMutex(); + recoverInstallWrapper(p); + + /* Open the output database. And register required virtual tables and + ** user functions with the new handle. */ + recoverOpenOutput(p); + + /* Open transactions on both the input and output databases. */ + sqlite3_file_control(p->dbIn, p->zDb, SQLITE_FCNTL_RESET_CACHE, 0); + recoverExec(p, p->dbIn, "PRAGMA writable_schema = on"); + recoverExec(p, p->dbIn, "BEGIN"); + if( p->errCode==SQLITE_OK ) p->bCloseTransaction = 1; + recoverExec(p, p->dbIn, "SELECT 1 FROM sqlite_schema"); + recoverTransferSettings(p); + recoverOpenRecovery(p); + recoverCacheSchema(p); + + recoverUninstallWrapper(p); + recoverLeaveMutex(); + + recoverExec(p, p->dbOut, "BEGIN"); + + recoverWriteSchema1(p); + p->eState = RECOVER_STATE_WRITING; + break; + + case RECOVER_STATE_WRITING: { + if( p->w1.pTbls==0 ){ + recoverWriteDataInit(p); + } + if( SQLITE_DONE==recoverWriteDataStep(p) ){ + recoverWriteDataCleanup(p); + if( p->zLostAndFound ){ + p->eState = RECOVER_STATE_LOSTANDFOUND1; + }else{ + p->eState = RECOVER_STATE_SCHEMA2; + } + } + break; + } + + case RECOVER_STATE_LOSTANDFOUND1: { + if( p->laf.pUsed==0 ){ + recoverLostAndFound1Init(p); + } + if( SQLITE_DONE==recoverLostAndFound1Step(p) ){ + p->eState = RECOVER_STATE_LOSTANDFOUND2; + } + break; + } + case RECOVER_STATE_LOSTANDFOUND2: { + if( p->laf.pAllAndParent==0 ){ + recoverLostAndFound2Init(p); + } + if( SQLITE_DONE==recoverLostAndFound2Step(p) ){ + p->eState = RECOVER_STATE_LOSTANDFOUND3; + } + break; + } + + case RECOVER_STATE_LOSTANDFOUND3: { + if( p->laf.pInsert==0 ){ + recoverLostAndFound3Init(p); + } + if( SQLITE_DONE==recoverLostAndFound3Step(p) ){ + p->eState = RECOVER_STATE_SCHEMA2; + } + break; + } + + case RECOVER_STATE_SCHEMA2: { + int rc = SQLITE_OK; + + recoverWriteSchema2(p); + p->eState = RECOVER_STATE_DONE; + + /* If no error has occurred, commit the write transaction on the output + ** database. Regardless of whether or not an error has occurred, make + ** an attempt to end the read transaction on the input database. */ + recoverExec(p, p->dbOut, "COMMIT"); + rc = sqlite3_exec(p->dbIn, "END", 0, 0, 0); + if( p->errCode==SQLITE_OK ) p->errCode = rc; + + recoverSqlCallback(p, "PRAGMA writable_schema = off"); + recoverSqlCallback(p, "COMMIT"); + p->eState = RECOVER_STATE_DONE; + recoverFinalCleanup(p); + break; + }; + + case RECOVER_STATE_DONE: { + /* no-op */ + break; + }; + } +} + + +/* +** This is a worker function that does the heavy lifting for both init +** functions: +** +** sqlite3_recover_init() +** sqlite3_recover_init_sql() +** +** All this function does is allocate space for the recover handle and +** take copies of the input parameters. All the real work is done within +** sqlite3_recover_run(). +*/ +sqlite3_recover *recoverInit( + sqlite3* db, + const char *zDb, + const char *zUri, /* Output URI for _recover_init() */ + int (*xSql)(void*, const char*),/* SQL callback for _recover_init_sql() */ + void *pSqlCtx /* Context arg for _recover_init_sql() */ +){ + sqlite3_recover *pRet = 0; + int nDb = 0; + int nUri = 0; + int nByte = 0; + + if( zDb==0 ){ zDb = "main"; } + + nDb = recoverStrlen(zDb); + nUri = recoverStrlen(zUri); + + nByte = sizeof(sqlite3_recover) + nDb+1 + nUri+1; + pRet = (sqlite3_recover*)sqlite3_malloc(nByte); + if( pRet ){ + memset(pRet, 0, nByte); + pRet->dbIn = db; + pRet->zDb = (char*)&pRet[1]; + pRet->zUri = &pRet->zDb[nDb+1]; + memcpy(pRet->zDb, zDb, nDb); + if( nUri>0 && zUri ) memcpy(pRet->zUri, zUri, nUri); + pRet->xSql = xSql; + pRet->pSqlCtx = pSqlCtx; + pRet->bRecoverRowid = RECOVER_ROWID_DEFAULT; + } + + return pRet; +} + +/* +** Initialize a recovery handle that creates a new database containing +** the recovered data. +*/ +sqlite3_recover *sqlite3_recover_init( + sqlite3* db, + const char *zDb, + const char *zUri +){ + return recoverInit(db, zDb, zUri, 0, 0); +} + +/* +** Initialize a recovery handle that returns recovered data in the +** form of SQL statements via a callback. +*/ +sqlite3_recover *sqlite3_recover_init_sql( + sqlite3* db, + const char *zDb, + int (*xSql)(void*, const char*), + void *pSqlCtx +){ + return recoverInit(db, zDb, 0, xSql, pSqlCtx); +} + +/* +** Return the handle error message, if any. +*/ +const char *sqlite3_recover_errmsg(sqlite3_recover *p){ + return (p && p->errCode!=SQLITE_NOMEM) ? p->zErrMsg : "out of memory"; +} + +/* +** Return the handle error code. +*/ +int sqlite3_recover_errcode(sqlite3_recover *p){ + return p ? p->errCode : SQLITE_NOMEM; +} + +/* +** Configure the handle. +*/ +int sqlite3_recover_config(sqlite3_recover *p, int op, void *pArg){ + int rc = SQLITE_OK; + if( p==0 ){ + rc = SQLITE_NOMEM; + }else if( p->eState!=RECOVER_STATE_INIT ){ + rc = SQLITE_MISUSE; + }else{ + switch( op ){ + case 789: + /* This undocumented magic configuration option is used to set the + ** name of the auxiliary database that is ATTACH-ed to the database + ** connection and used to hold state information during the + ** recovery process. This option is for debugging use only and + ** is subject to change or removal at any time. */ + sqlite3_free(p->zStateDb); + p->zStateDb = recoverMPrintf(p, "%s", (char*)pArg); + break; + + case SQLITE_RECOVER_LOST_AND_FOUND: { + const char *zArg = (const char*)pArg; + sqlite3_free(p->zLostAndFound); + if( zArg ){ + p->zLostAndFound = recoverMPrintf(p, "%s", zArg); + }else{ + p->zLostAndFound = 0; + } + break; + } + + case SQLITE_RECOVER_FREELIST_CORRUPT: + p->bFreelistCorrupt = *(int*)pArg; + break; + + case SQLITE_RECOVER_ROWIDS: + p->bRecoverRowid = *(int*)pArg; + break; + + case SQLITE_RECOVER_SLOWINDEXES: + p->bSlowIndexes = *(int*)pArg; + break; + + default: + rc = SQLITE_NOTFOUND; + break; + } + } + + return rc; +} + +/* +** Do a unit of work towards the recovery job. Return SQLITE_OK if +** no error has occurred but database recovery is not finished, SQLITE_DONE +** if database recovery has been successfully completed, or an SQLite +** error code if an error has occurred. +*/ +int sqlite3_recover_step(sqlite3_recover *p){ + if( p==0 ) return SQLITE_NOMEM; + if( p->errCode==SQLITE_OK ) recoverStep(p); + if( p->eState==RECOVER_STATE_DONE && p->errCode==SQLITE_OK ){ + return SQLITE_DONE; + } + return p->errCode; +} + +/* +** Do the configured recovery operation. Return SQLITE_OK if successful, or +** else an SQLite error code. +*/ +int sqlite3_recover_run(sqlite3_recover *p){ + while( SQLITE_OK==sqlite3_recover_step(p) ); + return sqlite3_recover_errcode(p); +} + + +/* +** Free all resources associated with the recover handle passed as the only +** argument. The results of using a handle with any sqlite3_recover_** +** API function after it has been passed to this function are undefined. +** +** A copy of the value returned by the first call made to sqlite3_recover_run() +** on this handle is returned, or SQLITE_OK if sqlite3_recover_run() has +** not been called on this handle. +*/ +int sqlite3_recover_finish(sqlite3_recover *p){ + int rc; + if( p==0 ){ + rc = SQLITE_NOMEM; + }else{ + recoverFinalCleanup(p); + if( p->bCloseTransaction && sqlite3_get_autocommit(p->dbIn)==0 ){ + rc = sqlite3_exec(p->dbIn, "END", 0, 0, 0); + if( p->errCode==SQLITE_OK ) p->errCode = rc; + } + rc = p->errCode; + sqlite3_free(p->zErrMsg); + sqlite3_free(p->zStateDb); + sqlite3_free(p->zLostAndFound); + sqlite3_free(p->pPage1Cache); + sqlite3_free(p); + } + return rc; +} + +#endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */ diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/sqlite3recover.h b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/sqlite3recover.h new file mode 100644 index 0000000000000000000000000000000000000000..7a1cd1cd878f26d34f2b7aeebc39b0f8059a3735 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/recover/sqlite3recover.h @@ -0,0 +1,249 @@ +/* +** 2022-08-27 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** +** This file contains the public interface to the "recover" extension - +** an SQLite extension designed to recover data from corrupted database +** files. +*/ + +/* +** OVERVIEW: +** +** To use the API to recover data from a corrupted database, an +** application: +** +** 1) Creates an sqlite3_recover handle by calling either +** sqlite3_recover_init() or sqlite3_recover_init_sql(). +** +** 2) Configures the new handle using one or more calls to +** sqlite3_recover_config(). +** +** 3) Executes the recovery by repeatedly calling sqlite3_recover_step() on +** the handle until it returns something other than SQLITE_OK. If it +** returns SQLITE_DONE, then the recovery operation completed without +** error. If it returns some other non-SQLITE_OK value, then an error +** has occurred. +** +** 4) Retrieves any error code and English language error message using the +** sqlite3_recover_errcode() and sqlite3_recover_errmsg() APIs, +** respectively. +** +** 5) Destroys the sqlite3_recover handle and frees all resources +** using sqlite3_recover_finish(). +** +** The application may abandon the recovery operation at any point +** before it is finished by passing the sqlite3_recover handle to +** sqlite3_recover_finish(). This is not an error, but the final state +** of the output database, or the results of running the partial script +** delivered to the SQL callback, are undefined. +*/ + +#ifndef _SQLITE_RECOVER_H +#define _SQLITE_RECOVER_H + +#include "sqlite3.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** An instance of the sqlite3_recover object represents a recovery +** operation in progress. +** +** Constructors: +** +** sqlite3_recover_init() +** sqlite3_recover_init_sql() +** +** Destructor: +** +** sqlite3_recover_finish() +** +** Methods: +** +** sqlite3_recover_config() +** sqlite3_recover_errcode() +** sqlite3_recover_errmsg() +** sqlite3_recover_run() +** sqlite3_recover_step() +*/ +typedef struct sqlite3_recover sqlite3_recover; + +/* +** These two APIs attempt to create and return a new sqlite3_recover object. +** In both cases the first two arguments identify the (possibly +** corrupt) database to recover data from. The first argument is an open +** database handle and the second the name of a database attached to that +** handle (i.e. "main", "temp" or the name of an attached database). +** +** If sqlite3_recover_init() is used to create the new sqlite3_recover +** handle, then data is recovered into a new database, identified by +** string parameter zUri. zUri may be an absolute or relative file path, +** or may be an SQLite URI. If the identified database file already exists, +** it is overwritten. +** +** If sqlite3_recover_init_sql() is invoked, then any recovered data will +** be returned to the user as a series of SQL statements. Executing these +** SQL statements results in the same database as would have been created +** had sqlite3_recover_init() been used. For each SQL statement in the +** output, the callback function passed as the third argument (xSql) is +** invoked once. The first parameter is a passed a copy of the fourth argument +** to this function (pCtx) as its first parameter, and a pointer to a +** nul-terminated buffer containing the SQL statement formated as UTF-8 as +** the second. If the xSql callback returns any value other than SQLITE_OK, +** then processing is immediately abandoned and the value returned used as +** the recover handle error code (see below). +** +** If an out-of-memory error occurs, NULL may be returned instead of +** a valid handle. In all other cases, it is the responsibility of the +** application to avoid resource leaks by ensuring that +** sqlite3_recover_finish() is called on all allocated handles. +*/ +sqlite3_recover *sqlite3_recover_init( + sqlite3* db, + const char *zDb, + const char *zUri +); +sqlite3_recover *sqlite3_recover_init_sql( + sqlite3* db, + const char *zDb, + int (*xSql)(void*, const char*), + void *pCtx +); + +/* +** Configure an sqlite3_recover object that has just been created using +** sqlite3_recover_init() or sqlite3_recover_init_sql(). This function +** may only be called before the first call to sqlite3_recover_step() +** or sqlite3_recover_run() on the object. +** +** The second argument passed to this function must be one of the +** SQLITE_RECOVER_* symbols defined below. Valid values for the third argument +** depend on the specific SQLITE_RECOVER_* symbol in use. +** +** SQLITE_OK is returned if the configuration operation was successful, +** or an SQLite error code otherwise. +*/ +int sqlite3_recover_config(sqlite3_recover*, int op, void *pArg); + +/* +** SQLITE_RECOVER_LOST_AND_FOUND: +** The pArg argument points to a string buffer containing the name +** of a "lost-and-found" table in the output database, or NULL. If +** the argument is non-NULL and the database contains seemingly +** valid pages that cannot be associated with any table in the +** recovered part of the schema, data is extracted from these +** pages to add to the lost-and-found table. +** +** SQLITE_RECOVER_FREELIST_CORRUPT: +** The pArg value must actually be a pointer to a value of type +** int containing value 0 or 1 cast as a (void*). If this option is set +** (argument is 1) and a lost-and-found table has been configured using +** SQLITE_RECOVER_LOST_AND_FOUND, then is assumed that the freelist is +** corrupt and an attempt is made to recover records from pages that +** appear to be linked into the freelist. Otherwise, pages on the freelist +** are ignored. Setting this option can recover more data from the +** database, but often ends up "recovering" deleted records. The default +** value is 0 (clear). +** +** SQLITE_RECOVER_ROWIDS: +** The pArg value must actually be a pointer to a value of type +** int containing value 0 or 1 cast as a (void*). If this option is set +** (argument is 1), then an attempt is made to recover rowid values +** that are not also INTEGER PRIMARY KEY values. If this option is +** clear, then new rowids are assigned to all recovered rows. The +** default value is 1 (set). +** +** SQLITE_RECOVER_SLOWINDEXES: +** The pArg value must actually be a pointer to a value of type +** int containing value 0 or 1 cast as a (void*). If this option is clear +** (argument is 0), then when creating an output database, the recover +** module creates and populates non-UNIQUE indexes right at the end of the +** recovery operation - after all recoverable data has been inserted +** into the new database. This is faster overall, but means that the +** final call to sqlite3_recover_step() for a recovery operation may +** be need to create a large number of indexes, which may be very slow. +** +** Or, if this option is set (argument is 1), then non-UNIQUE indexes +** are created in the output database before it is populated with +** recovered data. This is slower overall, but avoids the slow call +** to sqlite3_recover_step() at the end of the recovery operation. +** +** The default option value is 0. +*/ +#define SQLITE_RECOVER_LOST_AND_FOUND 1 +#define SQLITE_RECOVER_FREELIST_CORRUPT 2 +#define SQLITE_RECOVER_ROWIDS 3 +#define SQLITE_RECOVER_SLOWINDEXES 4 + +/* +** Perform a unit of work towards the recovery operation. This function +** must normally be called multiple times to complete database recovery. +** +** If no error occurs but the recovery operation is not completed, this +** function returns SQLITE_OK. If recovery has been completed successfully +** then SQLITE_DONE is returned. If an error has occurred, then an SQLite +** error code (e.g. SQLITE_IOERR or SQLITE_NOMEM) is returned. It is not +** considered an error if some or all of the data cannot be recovered +** due to database corruption. +** +** Once sqlite3_recover_step() has returned a value other than SQLITE_OK, +** all further such calls on the same recover handle are no-ops that return +** the same non-SQLITE_OK value. +*/ +int sqlite3_recover_step(sqlite3_recover*); + +/* +** Run the recovery operation to completion. Return SQLITE_OK if successful, +** or an SQLite error code otherwise. Calling this function is the same +** as executing: +** +** while( SQLITE_OK==sqlite3_recover_step(p) ); +** return sqlite3_recover_errcode(p); +*/ +int sqlite3_recover_run(sqlite3_recover*); + +/* +** If an error has been encountered during a prior call to +** sqlite3_recover_step(), then this function attempts to return a +** pointer to a buffer containing an English language explanation of +** the error. If no error message is available, or if an out-of memory +** error occurs while attempting to allocate a buffer in which to format +** the error message, NULL is returned. +** +** The returned buffer remains valid until the sqlite3_recover handle is +** destroyed using sqlite3_recover_finish(). +*/ +const char *sqlite3_recover_errmsg(sqlite3_recover*); + +/* +** If this function is called on an sqlite3_recover handle after +** an error occurs, an SQLite error code is returned. Otherwise, SQLITE_OK. +*/ +int sqlite3_recover_errcode(sqlite3_recover*); + +/* +** Clean up a recovery object created by a call to sqlite3_recover_init(). +** The results of using a recovery object with any API after it has been +** passed to this function are undefined. +** +** This function returns the same value as sqlite3_recover_errcode(). +*/ +int sqlite3_recover_finish(sqlite3_recover*); + + +#ifdef __cplusplus +} /* end of the 'extern "C"' block */ +#endif + +#endif /* ifndef _SQLITE_RECOVER_H */ diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/rtree/README b/local-test-sqlite3-delta-03/afc-sqlite3/ext/rtree/README new file mode 100644 index 0000000000000000000000000000000000000000..3736f45c5fd968542a4d201a2274dd09b66b7865 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/rtree/README @@ -0,0 +1,120 @@ + +This directory contains an SQLite extension that implements a virtual +table type that allows users to create, query and manipulate r-tree[1] +data structures inside of SQLite databases. Users create, populate +and query r-tree structures using ordinary SQL statements. + + 1. SQL Interface + + 1.1 Table Creation + 1.2 Data Manipulation + 1.3 Data Querying + 1.4 Introspection and Analysis + + 2. Compilation and Deployment + + 3. References + + +1. SQL INTERFACE + + 1.1 Table Creation. + + All r-tree virtual tables have an odd number of columns between + 3 and 11. Unlike regular SQLite tables, r-tree tables are strongly + typed. + + The leftmost column is always the pimary key and contains 64-bit + integer values. Each subsequent column contains a 32-bit real + value. For each pair of real values, the first (leftmost) must be + less than or equal to the second. R-tree tables may be + constructed using the following syntax: + + CREATE VIRTUAL TABLE USING rtree() + + For example: + + CREATE VIRTUAL TABLE boxes USING rtree(boxno, xmin, xmax, ymin, ymax); + INSERT INTO boxes VALUES(1, 1.0, 3.0, 2.0, 4.0); + + Constructing a virtual r-tree table creates the following three + real tables in the database to store the data structure: + + _node + _rowid + _parent + + Dropping or modifying the contents of these tables directly will + corrupt the r-tree structure. To delete an r-tree from a database, + use a regular DROP TABLE statement: + + DROP TABLE ; + + Dropping the main r-tree table automatically drops the automatically + created tables. + + 1.2 Data Manipulation (INSERT, UPDATE, DELETE). + + The usual INSERT, UPDATE or DELETE syntax is used to manipulate data + stored in an r-tree table. Please note the following: + + * Inserting a NULL value into the primary key column has the + same effect as inserting a NULL into an INTEGER PRIMARY KEY + column of a regular table. The system automatically assigns + an unused integer key value to the new record. Usually, this + is one greater than the largest primary key value currently + present in the table. + + * Attempting to insert a duplicate primary key value fails with + an SQLITE_CONSTRAINT error. + + * Attempting to insert or modify a record such that the value + stored in the (N*2)th column is greater than that stored in + the (N*2+1)th column fails with an SQLITE_CONSTRAINT error. + + * When a record is inserted, values are always converted to + the required type (64-bit integer or 32-bit real) as if they + were part of an SQL CAST expression. Non-numeric strings are + converted to zero. + + 1.3 Queries. + + R-tree tables may be queried using all of the same SQL syntax supported + by regular tables. However, some query patterns are more efficient + than others. + + R-trees support fast lookup by primary key value (O(logN), like + regular tables). + + Any combination of equality and range (<, <=, >, >=) constraints + on spatial data columns may be used to optimize other queries. This + is the key advantage to using r-tree tables instead of creating + indices on regular tables. + + 1.4 Introspection and Analysis. + + TODO: Describe rtreenode() and rtreedepth() functions. + + +2. COMPILATION AND USAGE + + The easiest way to compile and use the RTREE extension is to build + and use it as a dynamically loadable SQLite extension. To do this + using gcc on *nix: + + gcc -shared rtree.c -o libSqliteRtree.so + + You may need to add "-I" flags so that gcc can find sqlite3ext.h + and sqlite3.h. The resulting shared lib, libSqliteRtree.so, may be + loaded into sqlite in the same way as any other dynamicly loadable + extension. + + +3. REFERENCES + + [1] Atonin Guttman, "R-trees - A Dynamic Index Structure For Spatial + Searching", University of California Berkeley, 1984. + + [2] Norbert Beckmann, Hans-Peter Kriegel, Ralf Schneider, Bernhard Seeger, + "The R*-tree: An Efficient and Robust Access Method for Points and + Rectangles", Universitaet Bremen, 1990. diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/rtree/rtreeconnect.test b/local-test-sqlite3-delta-03/afc-sqlite3/ext/rtree/rtreeconnect.test new file mode 100644 index 0000000000000000000000000000000000000000..16d04d9a047ad7bb19a43696a27f6a9ce2c62905 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/rtree/rtreeconnect.test @@ -0,0 +1,56 @@ +# 2017 August 17 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# +# The focus of this file is testing the r-tree extension. Specifically, +# the impact of an SQLITE_SCHEMA error within the rtree module xConnect +# callback. +# + + +if {![info exists testdir]} { + set testdir [file join [file dirname [info script]] .. .. test] +} +source $testdir/tester.tcl +set testprefix rtreeconnect + +ifcapable !rtree { + finish_test + return +} + +do_execsql_test 1.0 { + CREATE VIRTUAL TABLE r1 USING rtree(id, x1, x2, y1, y2); + CREATE TABLE t1(id, x1, x2, y1, y2); + CREATE TABLE log(l); + + CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN + INSERT INTO r1 VALUES(new.id, new.x1, new.x2, new.y1, new.y2); + INSERT INTO log VALUES('r1: ' || new.id); + END; +} + +db close +sqlite3 db test.db +sqlite3 db2 test.db + +do_test 1.1 { + db eval { INSERT INTO log VALUES('startup'); } + db2 eval { CREATE TABLE newtable(x,y); } +} {} + +do_execsql_test 1.2 { + INSERT INTO t1 VALUES(1, 2, 3, 4, 5); +} + +db2 close +db close + +finish_test diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/SQLTester/GNUmakefile b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/SQLTester/GNUmakefile new file mode 100644 index 0000000000000000000000000000000000000000..8fa1247138cea945098c724d0c82d52fa43a0846 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/SQLTester/GNUmakefile @@ -0,0 +1,55 @@ +#!/this/is/make +# +# This makefile compiles SQLTester test files into something +# we can readily import into JavaScript. +all: + +SHELL := $(shell which bash 2>/dev/null) +MAKEFILE := $(lastword $(MAKEFILE_LIST)) +CLEAN_FILES := +DISTCLEAN_FILES := ./--dummy-- *~ + +test-list.mjs := test-list.mjs +test-list.mjs.gz := $(test-list.mjs).gz +CLEAN_FILES += $(test-list.mjs) + +tests.dir := $(firstword $(wildcard tests ../../jni/src/tests)) +$(info test script dir=$(tests.dir)) + +tests.all := $(wildcard $(tests.dir)/*.test) + +bin.touint8array := ./touint8array +$(bin.touint8array): $(bin.touint8array).c $(MAKEFILE) + $(CC) -o $@ $< +CLEAN_FILES += $(bin.touint8array) + +ifneq (,$(tests.all)) +$(test-list.mjs): $(bin.touint8array) $(tests.all) $(MAKEFILE) + @{\ + echo 'export default ['; \ + sep=''; \ + for f in $(sort $(tests.all)); do \ + echo -en $$sep'{"name": "'$${f##*/}'", "content":'; \ + $(bin.touint8array) < $$f; \ + echo -n '}'; \ + sep=',\n'; \ + done; \ + echo '];'; \ + } > $@ + @echo "Created $@" +$(test-list.mjs.gz): $(test-list.mjs) + gzip -c $< > $@ +CLEAN_FILES += $(test-list.mjs.gz) +all: $(test-list.mjs.gz) +else + @echo "Cannot build $(test-list.mjs) for lack of input test files."; \ + echo "Symlink ./tests to a directory containing SQLTester-format "; \ + echo "test scripts named *.test, then try again"; \ + exit 1 +endif + +.PHONY: clean distclean +clean: + -rm -f $(CLEAN_FILES) +distclean: clean + -rm -f $(DISTCLEAN_FILES) diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-core b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-core new file mode 100644 index 0000000000000000000000000000000000000000..2578002ce40015851e88938ee0cca6177a8e31bc --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-core @@ -0,0 +1,155 @@ +_malloc +_free +_realloc +_sqlite3_aggregate_context +_sqlite3_auto_extension +_sqlite3_bind_blob +_sqlite3_bind_double +_sqlite3_bind_int +_sqlite3_bind_int64 +_sqlite3_bind_null +_sqlite3_bind_parameter_count +_sqlite3_bind_parameter_index +_sqlite3_bind_parameter_name +_sqlite3_bind_pointer +_sqlite3_bind_text +_sqlite3_busy_handler +_sqlite3_busy_timeout +_sqlite3_cancel_auto_extension +_sqlite3_changes +_sqlite3_changes64 +_sqlite3_clear_bindings +_sqlite3_close_v2 +_sqlite3_collation_needed +_sqlite3_column_blob +_sqlite3_column_bytes +_sqlite3_column_count +_sqlite3_column_decltype +_sqlite3_column_double +_sqlite3_column_int +_sqlite3_column_int64 +_sqlite3_column_name +_sqlite3_column_text +_sqlite3_column_type +_sqlite3_column_value +_sqlite3_commit_hook +_sqlite3_compileoption_get +_sqlite3_compileoption_used +_sqlite3_complete +_sqlite3_context_db_handle +_sqlite3_create_collation +_sqlite3_create_collation_v2 +_sqlite3_create_function +_sqlite3_create_function_v2 +_sqlite3_data_count +_sqlite3_db_filename +_sqlite3_db_handle +_sqlite3_db_name +_sqlite3_db_readonly +_sqlite3_db_status +_sqlite3_deserialize +_sqlite3_errcode +_sqlite3_errmsg +_sqlite3_error_offset +_sqlite3_errstr +_sqlite3_exec +_sqlite3_expanded_sql +_sqlite3_extended_errcode +_sqlite3_extended_result_codes +_sqlite3_file_control +_sqlite3_finalize +_sqlite3_free +_sqlite3_get_auxdata +_sqlite3_get_autocommit +_sqlite3_initialize +_sqlite3_interrupt +_sqlite3_is_interrupted +_sqlite3_keyword_count +_sqlite3_keyword_name +_sqlite3_keyword_check +_sqlite3_last_insert_rowid +_sqlite3_libversion +_sqlite3_libversion_number +_sqlite3_limit +_sqlite3_malloc +_sqlite3_malloc64 +_sqlite3_msize +_sqlite3_open +_sqlite3_open_v2 +_sqlite3_overload_function +_sqlite3_prepare_v2 +_sqlite3_prepare_v3 +_sqlite3_randomness +_sqlite3_realloc +_sqlite3_realloc64 +_sqlite3_reset +_sqlite3_reset_auto_extension +_sqlite3_result_blob +_sqlite3_result_double +_sqlite3_result_error +_sqlite3_result_error_code +_sqlite3_result_error_nomem +_sqlite3_result_error_toobig +_sqlite3_result_int +_sqlite3_result_int64 +_sqlite3_result_null +_sqlite3_result_pointer +_sqlite3_result_subtype +_sqlite3_result_text +_sqlite3_result_zeroblob +_sqlite3_result_zeroblob64 +_sqlite3_rollback_hook +_sqlite3_serialize +_sqlite3_set_auxdata +_sqlite3_set_last_insert_rowid +_sqlite3_shutdown +_sqlite3_sourceid +_sqlite3_sql +_sqlite3_status +_sqlite3_status64 +_sqlite3_step +_sqlite3_stmt_busy +_sqlite3_stmt_explain +_sqlite3_stmt_isexplain +_sqlite3_stmt_readonly +_sqlite3_stmt_status +_sqlite3_strglob +_sqlite3_stricmp +_sqlite3_strlike +_sqlite3_strnicmp +_sqlite3_table_column_metadata +_sqlite3_total_changes +_sqlite3_total_changes64 +_sqlite3_trace_v2 +_sqlite3_txn_state +_sqlite3_update_hook +_sqlite3_uri_boolean +_sqlite3_uri_int64 +_sqlite3_uri_key +_sqlite3_uri_parameter +_sqlite3_user_data +_sqlite3_value_blob +_sqlite3_value_bytes +_sqlite3_value_double +_sqlite3_value_dup +_sqlite3_value_free +_sqlite3_value_frombind +_sqlite3_value_int +_sqlite3_value_int64 +_sqlite3_value_nochange +_sqlite3_value_numeric_type +_sqlite3_value_pointer +_sqlite3_value_subtype +_sqlite3_value_text +_sqlite3_value_type +_sqlite3_vfs_find +_sqlite3_vfs_register +_sqlite3_vfs_unregister +_sqlite3_vtab_collation +_sqlite3_vtab_distinct +_sqlite3_vtab_in +_sqlite3_vtab_in_first +_sqlite3_vtab_in_next +_sqlite3_vtab_nochange +_sqlite3_vtab_on_conflict +_sqlite3_vtab_rhs_value diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-extras b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-extras new file mode 100644 index 0000000000000000000000000000000000000000..e635d93b32ff696a77d924997b9c67d206fd1570 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-extras @@ -0,0 +1,63 @@ +_sqlite3_create_window_function +_sqlite3_progress_handler +_sqlite3_set_authorizer +_sqlite3_preupdate_blobwrite +_sqlite3_preupdate_count +_sqlite3_preupdate_depth +_sqlite3_preupdate_hook +_sqlite3_preupdate_new +_sqlite3_preupdate_old +_sqlite3changegroup_add +_sqlite3changegroup_add_strm +_sqlite3changegroup_delete +_sqlite3changegroup_new +_sqlite3changegroup_output +_sqlite3changegroup_output_strm +_sqlite3changeset_apply +_sqlite3changeset_apply_strm +_sqlite3changeset_apply_v2 +_sqlite3changeset_apply_v2_strm +_sqlite3changeset_concat +_sqlite3changeset_concat_strm +_sqlite3changeset_conflict +_sqlite3changeset_finalize +_sqlite3changeset_fk_conflicts +_sqlite3changeset_invert +_sqlite3changeset_invert_strm +_sqlite3changeset_new +_sqlite3changeset_next +_sqlite3changeset_old +_sqlite3changeset_op +_sqlite3changeset_pk +_sqlite3changeset_start +_sqlite3changeset_start_strm +_sqlite3changeset_start_v2 +_sqlite3changeset_start_v2_strm +_sqlite3session_attach +_sqlite3session_changeset +_sqlite3session_changeset_size +_sqlite3session_changeset_strm +_sqlite3session_config +_sqlite3session_create +_sqlite3session_delete +_sqlite3session_diff +_sqlite3session_enable +_sqlite3session_indirect +_sqlite3session_isempty +_sqlite3session_memory_used +_sqlite3session_object_config +_sqlite3session_patchset +_sqlite3session_patchset_strm +_sqlite3session_table_filter +_sqlite3_create_module +_sqlite3_create_module_v2 +_sqlite3_declare_vtab +_sqlite3_drop_modules +_sqlite3_vtab_collation +_sqlite3_vtab_distinct +_sqlite3_vtab_in +_sqlite3_vtab_in_first +_sqlite3_vtab_in_next +_sqlite3_vtab_nochange +_sqlite3_vtab_on_conflict +_sqlite3_vtab_rhs_value diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-see b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-see new file mode 100644 index 0000000000000000000000000000000000000000..83f3a97dbca2788d4f151c80cb2ee52e93122aae --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-see @@ -0,0 +1,5 @@ +_sqlite3_key +_sqlite3_key_v2 +_sqlite3_rekey +_sqlite3_rekey_v2 +_sqlite3_activate_see diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/EXPORTED_RUNTIME_METHODS.sqlite3-api b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/EXPORTED_RUNTIME_METHODS.sqlite3-api new file mode 100644 index 0000000000000000000000000000000000000000..aab1d8bd3739923f8870261a2b81256ea9e2170c --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/EXPORTED_RUNTIME_METHODS.sqlite3-api @@ -0,0 +1,3 @@ +FS +wasmMemory + diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/extern-post-js.c-pp.js b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/extern-post-js.c-pp.js new file mode 100644 index 0000000000000000000000000000000000000000..63e55051c6f4abee3e756b944613dfce69c90bc7 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/extern-post-js.c-pp.js @@ -0,0 +1,126 @@ + +/* ^^^^ ACHTUNG: blank line at the start is necessary because + Emscripten will not add a newline in some cases and we need + a blank line for a sed-based kludge for the ES6 build. */ +/* extern-post-js.js must be appended to the resulting sqlite3.js + file. It gets its name from being used as the value for the + --extern-post-js=... Emscripten flag. Note that this code, unlike + most of the associated JS code, runs outside of the + Emscripten-generated module init scope, in the current + global scope. */ +//#if target=es6-module +const toExportForESM = +//#endif +(function(){ + /** + In order to hide the sqlite3InitModule()'s resulting + Emscripten module from downstream clients (and simplify our + documentation by being able to elide those details), we hide that + function and expose a hand-written sqlite3InitModule() to return + the sqlite3 object (most of the time). + + Unfortunately, we cannot modify the module-loader/exporter-based + impls which Emscripten installs at some point in the file above + this. + */ + const originalInit = sqlite3InitModule; + if(!originalInit){ + throw new Error("Expecting globalThis.sqlite3InitModule to be defined by the Emscripten build."); + } + /** + We need to add some state which our custom Module.locateFile() + can see, but an Emscripten limitation currently prevents us from + attaching it to the sqlite3InitModule function object: + + https://github.com/emscripten-core/emscripten/issues/18071 + + The only(?) current workaround is to temporarily stash this state + into the global scope and delete it when sqlite3InitModule() + is called. + */ + const initModuleState = globalThis.sqlite3InitModuleState = Object.assign(Object.create(null),{ + moduleScript: globalThis?.document?.currentScript, + isWorker: ('undefined' !== typeof WorkerGlobalScope), + location: globalThis.location, + urlParams: globalThis?.location?.href + ? new URL(globalThis.location.href).searchParams + : new URLSearchParams() + }); + initModuleState.debugModule = + initModuleState.urlParams.has('sqlite3.debugModule') + ? (...args)=>console.warn('sqlite3.debugModule:',...args) + : ()=>{}; + + if(initModuleState.urlParams.has('sqlite3.dir')){ + initModuleState.sqlite3Dir = initModuleState.urlParams.get('sqlite3.dir') +'/'; + }else if(initModuleState.moduleScript){ + const li = initModuleState.moduleScript.src.split('/'); + li.pop(); + initModuleState.sqlite3Dir = li.join('/') + '/'; + } + + globalThis.sqlite3InitModule = function ff(...args){ + //console.warn("Using replaced sqlite3InitModule()",globalThis.location); + return originalInit(...args).then((EmscriptenModule)=>{ +//#if wasmfs + if('undefined'!==typeof WorkerGlobalScope && + EmscriptenModule['ENVIRONMENT_IS_PTHREAD']){ + /** Workaround for wasmfs-generated worker, which calls this + routine from each individual thread and requires that its + argument be returned. The conditional criteria above are + fragile, based solely on inspection of the offending code, + not public Emscripten details. */ + //console.warn("sqlite3InitModule() returning E-module.",EmscriptenModule); + return EmscriptenModule; + } +//#endif + //console.warn("sqlite3InitModule() returning sqlite3 object."); + const s = EmscriptenModule.sqlite3; + s.scriptInfo = initModuleState; + //console.warn("sqlite3.scriptInfo =",s.scriptInfo); + if(ff.__isUnderTest) s.__isUnderTest = true; + const f = s.asyncPostInit; + delete s.asyncPostInit; + return f(); + }).catch((e)=>{ + console.error("Exception loading sqlite3 module:",e); + throw e; + }); + }; + globalThis.sqlite3InitModule.ready = originalInit.ready; + + if(globalThis.sqlite3InitModuleState.moduleScript){ + const sim = globalThis.sqlite3InitModuleState; + let src = sim.moduleScript.src.split('/'); + src.pop(); + sim.scriptDir = src.join('/') + '/'; + } + initModuleState.debugModule('sqlite3InitModuleState =',initModuleState); + if(0){ + console.warn("Replaced sqlite3InitModule()"); + console.warn("globalThis.location.href =",globalThis.location.href); + if('undefined' !== typeof document){ + console.warn("document.currentScript.src =", + document?.currentScript?.src); + } + } +//#ifnot target=es6-module +// Emscripten does not inject these module-loader bits in ES6 module +// builds and including them here breaks JS bundlers, so elide them +// from ESM builds. + /* Replace the various module exports performed by the Emscripten + glue... */ + if (typeof exports === 'object' && typeof module === 'object'){ + module.exports = sqlite3InitModule; + }else if (typeof exports === 'object'){ + exports["sqlite3InitModule"] = sqlite3InitModule; + } + /* AMD modules get injected in a way we cannot override, + so we can't handle those here. */ +//#endif // !target=es6-module + return globalThis.sqlite3InitModule /* required for ESM */; +})(); +//#if target=es6-module +sqlite3InitModule = toExportForESM; +export default sqlite3InitModule; +//#endif diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/extern-pre-js.js b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/extern-pre-js.js new file mode 100644 index 0000000000000000000000000000000000000000..7d47d33e330315f28a9ebce1581627ad0eeacce8 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/extern-pre-js.js @@ -0,0 +1,7 @@ +/* extern-pre-js.js must be prepended to the resulting sqlite3.js + file. This file is currently only used for holding snippets during + test and development. + + It gets its name from being used as the value for the + --extern-pre-js=... Emscripten flag. +*/ diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/post-js-footer.js b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/post-js-footer.js new file mode 100644 index 0000000000000000000000000000000000000000..58882cbd9c0ebfb7b2c811a08de180bd190a236f --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/post-js-footer.js @@ -0,0 +1,4 @@ +/* The current function scope was opened via post-js-header.js, which + gets prepended to this at build-time. This file closes that + scope. */ +})/*postRun.push(...)*/; diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/post-js-header.js b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/post-js-header.js new file mode 100644 index 0000000000000000000000000000000000000000..7fd82a7d6c5b65bf025581fb2de89f4a0bf3f2c4 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/post-js-header.js @@ -0,0 +1,28 @@ +/** + post-js-header.js is to be prepended to other code to create + post-js.js for use with Emscripten's --post-js flag. This code + requires that it be running in that context. The Emscripten + environment must have been set up already but it will not have + loaded its WASM when the code in this file is run. The function it + installs will be run after the WASM module is loaded, at which + point the sqlite3 JS API bits will get set up. +*/ +if(!Module.postRun) Module.postRun = []; +Module.postRun.push(function(Module/*the Emscripten-style module object*/){ + 'use strict'; + /* This function will contain at least the following: + + - post-js-header.js (this file) + - sqlite3-api-prologue.js => Bootstrapping bits to attach the rest to + - common/whwasmutil.js => Replacements for much of Emscripten's glue + - jaccwaby/jaccwabyt.js => Jaccwabyt (C/JS struct binding) + - sqlite3-api-glue.js => glues previous parts together + - sqlite3-api-oo.js => SQLite3 OO API #1 + - sqlite3-api-worker1.js => Worker-based API + - sqlite3-vfs-helper.c-pp.js => Utilities for VFS impls + - sqlite3-vtab-helper.c-pp.js => Utilities for virtual table impls + - sqlite3-vfs-opfs.c-pp.js => OPFS VFS + - sqlite3-vfs-opfs-sahpool.c-pp.js => OPFS SAHPool VFS + - sqlite3-api-cleanup.js => final API cleanup + - post-js-footer.js => closes this postRun() function + */ diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/pre-js.c-pp.js b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/pre-js.c-pp.js new file mode 100644 index 0000000000000000000000000000000000000000..4045fb11cdaf56ae948b328721f84c6b999799cb --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/pre-js.c-pp.js @@ -0,0 +1,121 @@ +/** + BEGIN FILE: api/pre-js.js + + This file is intended to be prepended to the sqlite3.js build using + Emscripten's --pre-js=THIS_FILE flag (or equivalent). +*/ + +// See notes in extern-post-js.js +const sqlite3InitModuleState = globalThis.sqlite3InitModuleState + || Object.assign(Object.create(null),{ + debugModule: ()=>{} + }); +delete globalThis.sqlite3InitModuleState; +sqlite3InitModuleState.debugModule('globalThis.location =',globalThis.location); + +//#ifnot target=es6-bundler-friendly +/** + This custom locateFile() tries to figure out where to load `path` + from. The intent is to provide a way for foo/bar/X.js loaded from a + Worker constructor or importScripts() to be able to resolve + foo/bar/X.wasm (in the latter case, with some help): + + 1) If URL param named the same as `path` is set, it is returned. + + 2) If sqlite3InitModuleState.sqlite3Dir is set, then (thatName + path) + is returned (note that it's assumed to end with '/'). + + 3) If this code is running in the main UI thread AND it was loaded + from a SCRIPT tag, the directory part of that URL is used + as the prefix. (This form of resolution unfortunately does not + function for scripts loaded via importScripts().) + + 4) If none of the above apply, (prefix+path) is returned. +*/ +Module['locateFile'] = function(path, prefix) { +//#if target=es6-module + return new URL(path, import.meta.url).href; +//#else + 'use strict'; + let theFile; + const up = this.urlParams; + if(up.has(path)){ + theFile = up.get(path); + }else if(this.sqlite3Dir){ + theFile = this.sqlite3Dir + path; + }else if(this.scriptDir){ + theFile = this.scriptDir + path; + }else{ + theFile = prefix + path; + } + this.debugModule( + "locateFile(",arguments[0], ',', arguments[1],")", + 'sqlite3InitModuleState.scriptDir =',this.scriptDir, + 'up.entries() =',Array.from(up.entries()), + "result =", theFile + ); + return theFile; +//#endif target=es6-module +}.bind(sqlite3InitModuleState); +//#endif ifnot target=es6-bundler-friendly + +//#if custom-Module.instantiateModule +/** + Bug warning: a custom Module.instantiateWasm() does not work + in WASMFS builds: + + https://github.com/emscripten-core/emscripten/issues/17951 + + In such builds we must disable this. +*/ +const xNameOfInstantiateWasm = +//#if wasmfs + false +//#else + true /* This works, but it does not have the testing coverage in the + wild which Emscripten's default impl does, so we'll save + this option until we really need a custom + Module.instantiateWasm() */ +//#endif + ? 'instantiateWasm' + : 'emscripten-bug-17951'; +Module[xNameOfInstantiateWasm] = function callee(imports,onSuccess){ + imports.env.foo = function(){}; + const uri = Module.locateFile( + callee.uri, ( + ('undefined'===typeof scriptDirectory/*var defined by Emscripten glue*/) + ? "" : scriptDirectory) + ); + sqlite3InitModuleState.debugModule( + "instantiateWasm() uri =", uri + ); + //console.warn("Custom instantiateModule",uri); + const wfetch = ()=>fetch(uri, {credentials: 'same-origin'}); + const loadWasm = WebAssembly.instantiateStreaming + ? async ()=>{ + return WebAssembly.instantiateStreaming(wfetch(), imports) + .then((arg)=>onSuccess(arg.instance, arg.module)); + } + : async ()=>{ // Safari < v15 + return wfetch() + .then(response => response.arrayBuffer()) + .then(bytes => WebAssembly.instantiate(bytes, imports)) + .then((arg)=>onSuccess(arg.instance, arg.module)); + }; + loadWasm(); + return {}; +}; +/* + It is literally impossible to reliably get the name of _this_ script + at runtime, so impossible to derive X.wasm from script name + X.js. Thus we need, at build-time, to redefine + Module[xNameOfInstantiateWasm].uri by appending it to a build-specific + copy of this file with the name of the wasm file. This is apparently + why Emscripten hard-codes the name of the wasm file into their glue + scripts. +*/ +Module[xNameOfInstantiateWasm].uri = 'sqlite3.wasm'; +//#endif custom-Module.instantiateModule +/* END FILE: api/pre-js.js, noting that the build process may add a + line after this one to change the above .uri to a build-specific + one. */ diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-api-glue.c-pp.js b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-api-glue.c-pp.js new file mode 100644 index 0000000000000000000000000000000000000000..680218370a850886675e832232660d68fdf02bad --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-api-glue.c-pp.js @@ -0,0 +1,1922 @@ +/* + 2022-07-22 + + The author disclaims copyright to this source code. In place of a + legal notice, here is a blessing: + + * May you do good and not evil. + * May you find forgiveness for yourself and forgive others. + * May you share freely, never taking more than you give. + + *********************************************************************** + + This file glues together disparate pieces of JS which are loaded in + previous steps of the sqlite3-api.js bootstrapping process: + sqlite3-api-prologue.js, whwasmutil.js, and jaccwabyt.js. It + initializes the main API pieces so that the downstream components + (e.g. sqlite3-api-oo1.js) have all of the infrastructure that they + need. +*/ +globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ + 'use strict'; + const toss = (...args)=>{throw new Error(args.join(' '))}; + const toss3 = sqlite3.SQLite3Error.toss; + const capi = sqlite3.capi, wasm = sqlite3.wasm, util = sqlite3.util; + globalThis.WhWasmUtilInstaller(wasm); + delete globalThis.WhWasmUtilInstaller; + + if(0){ + /** + Please keep this block around as a maintenance reminder + that we cannot rely on this type of check. + + This block fails on Safari, per a report at + https://sqlite.org/forum/forumpost/e5b20e1feb. + + It turns out that what Safari serves from the indirect function + table (e.g. wasm.functionEntry(X)) is anonymous functions which + wrap the WASM functions, rather than returning the WASM + functions themselves. That means comparison of such functions + is useless for determining whether or not we have a specific + function from wasm.exports. i.e. if function X is indirection + function table entry N then wasm.exports.X is not equal to + wasm.functionEntry(N) in Safari, despite being so in the other + browsers. + */ + /** + Find a mapping for SQLITE_WASM_DEALLOC, which the API + guarantees is a WASM pointer to the same underlying function as + wasm.dealloc() (noting that wasm.dealloc() is permitted to be a + JS wrapper around the WASM function). There is unfortunately no + O(1) algorithm for finding this pointer: we have to walk the + WASM indirect function table to find it. However, experience + indicates that that particular function is always very close to + the front of the table (it's been entry #3 in all relevant + tests). + */ + const dealloc = wasm.exports[sqlite3.config.deallocExportName]; + const nFunc = wasm.functionTable().length; + let i; + for(i = 0; i < nFunc; ++i){ + const e = wasm.functionEntry(i); + if(dealloc === e){ + capi.SQLITE_WASM_DEALLOC = i; + break; + } + } + if(dealloc !== wasm.functionEntry(capi.SQLITE_WASM_DEALLOC)){ + toss("Internal error: cannot find function pointer for SQLITE_WASM_DEALLOC."); + } + } + + /** + Signatures for the WASM-exported C-side functions. Each entry + is an array with 2+ elements: + + [ "c-side name", + "result type" (wasm.xWrap() syntax), + [arg types in xWrap() syntax] + // ^^^ this needn't strictly be an array: it can be subsequent + // elements instead: [x,y,z] is equivalent to x,y,z + ] + + Note that support for the API-specific data types in the + result/argument type strings gets plugged in at a later phase in + the API initialization process. + */ + wasm.bindingSignatures = [ + // Please keep these sorted by function name! + ["sqlite3_aggregate_context","void*", "sqlite3_context*", "int"], + /* sqlite3_auto_extension() has a hand-written binding. */ + /* sqlite3_bind_blob() and sqlite3_bind_text() have hand-written + bindings to permit more flexible inputs. */ + ["sqlite3_bind_double","int", "sqlite3_stmt*", "int", "f64"], + ["sqlite3_bind_int","int", "sqlite3_stmt*", "int", "int"], + ["sqlite3_bind_null",undefined, "sqlite3_stmt*", "int"], + ["sqlite3_bind_parameter_count", "int", "sqlite3_stmt*"], + ["sqlite3_bind_parameter_index","int", "sqlite3_stmt*", "string"], + ["sqlite3_bind_parameter_name", "string", "sqlite3_stmt*", "int"], + ["sqlite3_bind_pointer", "int", + "sqlite3_stmt*", "int", "*", "string:static", "*"], + ["sqlite3_busy_handler","int", [ + "sqlite3*", + new wasm.xWrap.FuncPtrAdapter({ + signature: 'i(pi)', + contextKey: (argv,argIndex)=>argv[0/* sqlite3* */] + }), + "*" + ]], + ["sqlite3_busy_timeout","int", "sqlite3*", "int"], + /* sqlite3_cancel_auto_extension() has a hand-written binding. */ + /* sqlite3_close_v2() is implemented by hand to perform some + extra work. */ + ["sqlite3_changes", "int", "sqlite3*"], + ["sqlite3_clear_bindings","int", "sqlite3_stmt*"], + ["sqlite3_collation_needed", "int", "sqlite3*", "*", "*"/*=>v(ppis)*/], + ["sqlite3_column_blob","*", "sqlite3_stmt*", "int"], + ["sqlite3_column_bytes","int", "sqlite3_stmt*", "int"], + ["sqlite3_column_count", "int", "sqlite3_stmt*"], + ["sqlite3_column_decltype", "string", "sqlite3_stmt*", "int"], + ["sqlite3_column_double","f64", "sqlite3_stmt*", "int"], + ["sqlite3_column_int","int", "sqlite3_stmt*", "int"], + ["sqlite3_column_name","string", "sqlite3_stmt*", "int"], + ["sqlite3_column_text","string", "sqlite3_stmt*", "int"], + ["sqlite3_column_type","int", "sqlite3_stmt*", "int"], + ["sqlite3_column_value","sqlite3_value*", "sqlite3_stmt*", "int"], + ["sqlite3_commit_hook", "void*", [ + "sqlite3*", + new wasm.xWrap.FuncPtrAdapter({ + name: 'sqlite3_commit_hook', + signature: 'i(p)', + contextKey: (argv)=>argv[0/* sqlite3* */] + }), + '*' + ]], + ["sqlite3_compileoption_get", "string", "int"], + ["sqlite3_compileoption_used", "int", "string"], + ["sqlite3_complete", "int", "string:flexible"], + ["sqlite3_context_db_handle", "sqlite3*", "sqlite3_context*"], + /* sqlite3_create_collation() and sqlite3_create_collation_v2() + use hand-written bindings to simplify passing of the callback + function. */ + /* sqlite3_create_function(), sqlite3_create_function_v2(), and + sqlite3_create_window_function() use hand-written bindings to + simplify handling of their function-type arguments. */ + ["sqlite3_data_count", "int", "sqlite3_stmt*"], + ["sqlite3_db_filename", "string", "sqlite3*", "string"], + ["sqlite3_db_handle", "sqlite3*", "sqlite3_stmt*"], + ["sqlite3_db_name", "string", "sqlite3*", "int"], + ["sqlite3_db_readonly", "int", "sqlite3*", "string"], + ["sqlite3_db_status", "int", "sqlite3*", "int", "*", "*", "int"], + ["sqlite3_errcode", "int", "sqlite3*"], + ["sqlite3_errmsg", "string", "sqlite3*"], + ["sqlite3_error_offset", "int", "sqlite3*"], + ["sqlite3_errstr", "string", "int"], + ["sqlite3_exec", "int", [ + "sqlite3*", "string:flexible", + new wasm.xWrap.FuncPtrAdapter({ + signature: 'i(pipp)', + bindScope: 'transient', + callProxy: (callback)=>{ + let aNames; + return (pVoid, nCols, pColVals, pColNames)=>{ + try { + const aVals = wasm.cArgvToJs(nCols, pColVals); + if(!aNames) aNames = wasm.cArgvToJs(nCols, pColNames); + return callback(aVals, aNames) | 0; + }catch(e){ + /* If we set the db error state here, the higher-level + exec() call replaces it with its own, so we have no way + of reporting the exception message except the console. We + must not propagate exceptions through the C API. Though + we make an effort to report OOM here, sqlite3_exec() + translates that into SQLITE_ABORT as well. */ + return e.resultCode || capi.SQLITE_ERROR; + } + } + } + }), + "*", "**" + ]], + ["sqlite3_expanded_sql", "string", "sqlite3_stmt*"], + ["sqlite3_extended_errcode", "int", "sqlite3*"], + ["sqlite3_extended_result_codes", "int", "sqlite3*", "int"], + ["sqlite3_file_control", "int", "sqlite3*", "string", "int", "*"], + ["sqlite3_finalize", "int", "sqlite3_stmt*"], + ["sqlite3_free", undefined,"*"], + ["sqlite3_get_autocommit", "int", "sqlite3*"], + ["sqlite3_get_auxdata", "*", "sqlite3_context*", "int"], + ["sqlite3_initialize", undefined], + ["sqlite3_interrupt", undefined, "sqlite3*"], + ["sqlite3_is_interrupted", "int", "sqlite3*"], + ["sqlite3_keyword_count", "int"], + ["sqlite3_keyword_name", "int", ["int", "**", "*"]], + ["sqlite3_keyword_check", "int", ["string", "int"]], + ["sqlite3_libversion", "string"], + ["sqlite3_libversion_number", "int"], + ["sqlite3_limit", "int", ["sqlite3*", "int", "int"]], + ["sqlite3_malloc", "*","int"], + ["sqlite3_open", "int", "string", "*"], + ["sqlite3_open_v2", "int", "string", "*", "int", "string"], + /* sqlite3_prepare_v2() and sqlite3_prepare_v3() are handled + separately due to us requiring two different sets of semantics + for those, depending on how their SQL argument is provided. */ + /* sqlite3_randomness() uses a hand-written wrapper to extend + the range of supported argument types. */ + ["sqlite3_realloc", "*","*","int"], + ["sqlite3_reset", "int", "sqlite3_stmt*"], + /* sqlite3_reset_auto_extension() has a hand-written binding. */ + ["sqlite3_result_blob", undefined, "sqlite3_context*", "*", "int", "*"], + ["sqlite3_result_double", undefined, "sqlite3_context*", "f64"], + ["sqlite3_result_error", undefined, "sqlite3_context*", "string", "int"], + ["sqlite3_result_error_code", undefined, "sqlite3_context*", "int"], + ["sqlite3_result_error_nomem", undefined, "sqlite3_context*"], + ["sqlite3_result_error_toobig", undefined, "sqlite3_context*"], + ["sqlite3_result_int", undefined, "sqlite3_context*", "int"], + ["sqlite3_result_null", undefined, "sqlite3_context*"], + ["sqlite3_result_pointer", undefined, + "sqlite3_context*", "*", "string:static", "*"], + ["sqlite3_result_subtype", undefined, "sqlite3_value*", "int"], + ["sqlite3_result_text", undefined, "sqlite3_context*", "string", "int", "*"], + ["sqlite3_result_zeroblob", undefined, "sqlite3_context*", "int"], + ["sqlite3_rollback_hook", "void*", [ + "sqlite3*", + new wasm.xWrap.FuncPtrAdapter({ + name: 'sqlite3_rollback_hook', + signature: 'v(p)', + contextKey: (argv)=>argv[0/* sqlite3* */] + }), + '*' + ]], + ["sqlite3_set_auxdata", undefined, [ + "sqlite3_context*", "int", "*", + new wasm.xWrap.FuncPtrAdapter({ + name: 'xDestroyAuxData', + signature: 'v(*)', + contextKey: (argv, argIndex)=>argv[0/* sqlite3_context* */] + }) + ]], + ["sqlite3_shutdown", undefined], + ["sqlite3_sourceid", "string"], + ["sqlite3_sql", "string", "sqlite3_stmt*"], + ["sqlite3_status", "int", "int", "*", "*", "int"], + ["sqlite3_step", "int", "sqlite3_stmt*"], + ["sqlite3_stmt_busy", "int", "sqlite3_stmt*"], + ["sqlite3_stmt_readonly", "int", "sqlite3_stmt*"], + ["sqlite3_stmt_status", "int", "sqlite3_stmt*", "int", "int"], + ["sqlite3_strglob", "int", "string","string"], + ["sqlite3_stricmp", "int", "string", "string"], + ["sqlite3_strlike", "int", "string", "string","int"], + ["sqlite3_strnicmp", "int", "string", "string", "int"], + ["sqlite3_table_column_metadata", "int", + "sqlite3*", "string", "string", "string", + "**", "**", "*", "*", "*"], + ["sqlite3_total_changes", "int", "sqlite3*"], + ["sqlite3_trace_v2", "int", [ + "sqlite3*", "int", + new wasm.xWrap.FuncPtrAdapter({ + name: 'sqlite3_trace_v2::callback', + signature: 'i(ippp)', + contextKey: (argv,argIndex)=>argv[0/* sqlite3* */] + }), + "*" + ]], + ["sqlite3_txn_state", "int", ["sqlite3*","string"]], + /* Note that sqlite3_uri_...() have very specific requirements for + their first C-string arguments, so we cannot perform any value + conversion on those. */ + ["sqlite3_uri_boolean", "int", "sqlite3_filename", "string", "int"], + ["sqlite3_uri_key", "string", "sqlite3_filename", "int"], + ["sqlite3_uri_parameter", "string", "sqlite3_filename", "string"], + ["sqlite3_user_data","void*", "sqlite3_context*"], + ["sqlite3_value_blob", "*", "sqlite3_value*"], + ["sqlite3_value_bytes","int", "sqlite3_value*"], + ["sqlite3_value_double","f64", "sqlite3_value*"], + ["sqlite3_value_dup", "sqlite3_value*", "sqlite3_value*"], + ["sqlite3_value_free", undefined, "sqlite3_value*"], + ["sqlite3_value_frombind", "int", "sqlite3_value*"], + ["sqlite3_value_int","int", "sqlite3_value*"], + ["sqlite3_value_nochange", "int", "sqlite3_value*"], + ["sqlite3_value_numeric_type", "int", "sqlite3_value*"], + ["sqlite3_value_pointer", "*", "sqlite3_value*", "string:static"], + ["sqlite3_value_subtype", "int", "sqlite3_value*"], + ["sqlite3_value_text", "string", "sqlite3_value*"], + ["sqlite3_value_type", "int", "sqlite3_value*"], + ["sqlite3_vfs_find", "*", "string"], + ["sqlite3_vfs_register", "int", "sqlite3_vfs*", "int"], + ["sqlite3_vfs_unregister", "int", "sqlite3_vfs*"] + ]/*wasm.bindingSignatures*/; + + if( !!wasm.exports.sqlite3_progress_handler ){ + wasm.bindingSignatures.push( + ["sqlite3_progress_handler", undefined, [ + "sqlite3*", "int", new wasm.xWrap.FuncPtrAdapter({ + name: 'xProgressHandler', + signature: 'i(p)', + bindScope: 'context', + contextKey: (argv,argIndex)=>argv[0/* sqlite3* */] + }), "*" + ]] + ); + } + + if( !!wasm.exports.sqlite3_stmt_explain ){ + wasm.bindingSignatures.push( + ["sqlite3_stmt_explain", "int", "sqlite3_stmt*", "int"], + ["sqlite3_stmt_isexplain", "int", "sqlite3_stmt*"] + ); + } + + if( !!wasm.exports.sqlite3_set_authorizer ){ + wasm.bindingSignatures.push( + ["sqlite3_set_authorizer", "int", [ + "sqlite3*", + new wasm.xWrap.FuncPtrAdapter({ + name: "sqlite3_set_authorizer::xAuth", + signature: "i(pi"+"ssss)", + contextKey: (argv, argIndex)=>argv[0/*(sqlite3*)*/], + callProxy: (callback)=>{ + return (pV, iCode, s0, s1, s2, s3)=>{ + try{ + s0 = s0 && wasm.cstrToJs(s0); s1 = s1 && wasm.cstrToJs(s1); + s2 = s2 && wasm.cstrToJs(s2); s3 = s3 && wasm.cstrToJs(s3); + return callback(pV, iCode, s0, s1, s2, s3) || 0; + }catch(e){ + return e.resultCode || capi.SQLITE_ERROR; + } + } + } + }), + "*"/*pUserData*/ + ]] + ); + }/* sqlite3_set_authorizer() */ + + if(false && wasm.compileOptionUsed('SQLITE_ENABLE_NORMALIZE')){ + /* ^^^ "the problem" is that this is an optional feature and the + build-time function-export list does not currently take + optional features into account. */ + wasm.bindingSignatures.push(["sqlite3_normalized_sql", "string", "sqlite3_stmt*"]); + } + +//#if enable-see + if(wasm.exports.sqlite3_key_v2 instanceof Function){ + /** + This code is capable of using an SEE build but note that an SEE + WASM build is generally incompatible with SEE's license + conditions. It is permitted for use internally in organizations + which have licensed SEE, but not for public sites because + exposing an SEE build of sqlite3.wasm effectively provides all + clients with a working copy of the commercial SEE code. + */ + wasm.bindingSignatures.push( + ["sqlite3_key", "int", "sqlite3*", "string", "int"], + ["sqlite3_key_v2","int","sqlite3*","string","*","int"], + ["sqlite3_rekey", "int", "sqlite3*", "string", "int"], + ["sqlite3_rekey_v2", "int", "sqlite3*", "string", "*", "int"], + ["sqlite3_activate_see", undefined, "string"] + ); + } +//#endif enable-see + + /** + Functions which require BigInt (int64) support are separated from + the others because we need to conditionally bind them or apply + dummy impls, depending on the capabilities of the environment. + (That said: we never actually build without BigInt support, + and such builds are untested.) + + Note that not all of these functions directly require int64 + but are only for use with APIs which require int64. For example, + the vtab-related functions. + */ + wasm.bindingSignatures.int64 = [ + ["sqlite3_bind_int64","int", ["sqlite3_stmt*", "int", "i64"]], + ["sqlite3_changes64","i64", ["sqlite3*"]], + ["sqlite3_column_int64","i64", ["sqlite3_stmt*", "int"]], + ["sqlite3_deserialize", "int", "sqlite3*", "string", "*", "i64", "i64", "int"] + /* Careful! Short version: de/serialize() are problematic because they + might use a different allocator than the user for managing the + deserialized block. de/serialize() are ONLY safe to use with + sqlite3_malloc(), sqlite3_free(), and its 64-bit variants. Because + of this, the canonical builds of sqlite3.wasm/js guarantee that + sqlite3.wasm.alloc() and friends use those allocators. Custom builds + may not guarantee that, however. */, + ["sqlite3_last_insert_rowid", "i64", ["sqlite3*"]], + ["sqlite3_malloc64", "*","i64"], + ["sqlite3_msize", "i64", "*"], + ["sqlite3_overload_function", "int", ["sqlite3*","string","int"]], + ["sqlite3_realloc64", "*","*", "i64"], + ["sqlite3_result_int64", undefined, "*", "i64"], + ["sqlite3_result_zeroblob64", "int", "*", "i64"], + ["sqlite3_serialize","*", "sqlite3*", "string", "*", "int"], + ["sqlite3_set_last_insert_rowid", undefined, ["sqlite3*", "i64"]], + ["sqlite3_status64", "int", "int", "*", "*", "int"], + ["sqlite3_total_changes64", "i64", ["sqlite3*"]], + ["sqlite3_update_hook", "*", [ + "sqlite3*", + new wasm.xWrap.FuncPtrAdapter({ + name: 'sqlite3_update_hook', + signature: "v(iippj)", + contextKey: (argv)=>argv[0/* sqlite3* */], + callProxy: (callback)=>{ + return (p,op,z0,z1,rowid)=>{ + callback(p, op, wasm.cstrToJs(z0), wasm.cstrToJs(z1), rowid); + }; + } + }), + "*" + ]], + ["sqlite3_uri_int64", "i64", ["sqlite3_filename", "string", "i64"]], + ["sqlite3_value_int64","i64", "sqlite3_value*"] + ]; + + if( wasm.bigIntEnabled && !!wasm.exports.sqlite3_declare_vtab ){ + wasm.bindingSignatures.int64.push( + ["sqlite3_create_module", "int", + ["sqlite3*","string","sqlite3_module*","*"]], + ["sqlite3_create_module_v2", "int", + ["sqlite3*","string","sqlite3_module*","*","*"]], + ["sqlite3_declare_vtab", "int", ["sqlite3*", "string:flexible"]], + ["sqlite3_drop_modules", "int", ["sqlite3*", "**"]], + ["sqlite3_vtab_collation","string","sqlite3_index_info*","int"], + ["sqlite3_vtab_distinct","int", "sqlite3_index_info*"], + ["sqlite3_vtab_in","int", "sqlite3_index_info*", "int", "int"], + ["sqlite3_vtab_in_first", "int", "sqlite3_value*", "**"], + ["sqlite3_vtab_in_next", "int", "sqlite3_value*", "**"], + /*["sqlite3_vtab_config" is variadic and requires a hand-written + proxy.] */ + ["sqlite3_vtab_nochange","int", "sqlite3_context*"], + ["sqlite3_vtab_on_conflict","int", "sqlite3*"], + ["sqlite3_vtab_rhs_value","int", "sqlite3_index_info*", "int", "**"] + ); + }/* virtual table APIs */ + + if(wasm.bigIntEnabled && !!wasm.exports.sqlite3_preupdate_hook){ + wasm.bindingSignatures.int64.push( + ["sqlite3_preupdate_blobwrite", "int", "sqlite3*"], + ["sqlite3_preupdate_count", "int", "sqlite3*"], + ["sqlite3_preupdate_depth", "int", "sqlite3*"], + ["sqlite3_preupdate_hook", "*", [ + "sqlite3*", + new wasm.xWrap.FuncPtrAdapter({ + name: 'sqlite3_preupdate_hook', + signature: "v(ppippjj)", + contextKey: (argv)=>argv[0/* sqlite3* */], + callProxy: (callback)=>{ + return (p,db,op,zDb,zTbl,iKey1,iKey2)=>{ + callback(p, db, op, wasm.cstrToJs(zDb), wasm.cstrToJs(zTbl), + iKey1, iKey2); + }; + } + }), + "*" + ]], + ["sqlite3_preupdate_new", "int", ["sqlite3*", "int", "**"]], + ["sqlite3_preupdate_old", "int", ["sqlite3*", "int", "**"]] + ); + } /* preupdate API */ + + // Add session/changeset APIs... + if(wasm.bigIntEnabled + && !!wasm.exports.sqlite3changegroup_add + && !!wasm.exports.sqlite3session_create + && !!wasm.exports.sqlite3_preupdate_hook /* required by the session API */){ + /** + FuncPtrAdapter options for session-related callbacks with the + native signature "i(ps)". This proxy converts the 2nd argument + from a C string to a JS string before passing the arguments on + to the client-provided JS callback. + */ + const __ipsProxy = { + signature: 'i(ps)', + callProxy:(callback)=>{ + return (p,s)=>{ + try{return callback(p, wasm.cstrToJs(s)) | 0} + catch(e){return e.resultCode || capi.SQLITE_ERROR} + } + } + }; + + wasm.bindingSignatures.int64.push(...[ + ['sqlite3changegroup_add', 'int', ['sqlite3_changegroup*', 'int', 'void*']], + ['sqlite3changegroup_add_strm', 'int', [ + 'sqlite3_changegroup*', + new wasm.xWrap.FuncPtrAdapter({ + name: 'xInput', signature: 'i(ppp)', bindScope: 'transient' + }), + 'void*' + ]], + ['sqlite3changegroup_delete', undefined, ['sqlite3_changegroup*']], + ['sqlite3changegroup_new', 'int', ['**']], + ['sqlite3changegroup_output', 'int', ['sqlite3_changegroup*', 'int*', '**']], + ['sqlite3changegroup_output_strm', 'int', [ + 'sqlite3_changegroup*', + new wasm.xWrap.FuncPtrAdapter({ + name: 'xOutput', signature: 'i(ppi)', bindScope: 'transient' + }), + 'void*' + ]], + ['sqlite3changeset_apply', 'int', [ + 'sqlite3*', 'int', 'void*', + new wasm.xWrap.FuncPtrAdapter({ + name: 'xFilter', bindScope: 'transient', ...__ipsProxy + }), + new wasm.xWrap.FuncPtrAdapter({ + name: 'xConflict', signature: 'i(pip)', bindScope: 'transient' + }), + 'void*' + ]], + ['sqlite3changeset_apply_strm', 'int', [ + 'sqlite3*', + new wasm.xWrap.FuncPtrAdapter({ + name: 'xInput', signature: 'i(ppp)', bindScope: 'transient' + }), + 'void*', + new wasm.xWrap.FuncPtrAdapter({ + name: 'xFilter', bindScope: 'transient', ...__ipsProxy + }), + new wasm.xWrap.FuncPtrAdapter({ + name: 'xConflict', signature: 'i(pip)', bindScope: 'transient' + }), + 'void*' + ]], + ['sqlite3changeset_apply_v2', 'int', [ + 'sqlite3*', 'int', 'void*', + new wasm.xWrap.FuncPtrAdapter({ + name: 'xFilter', bindScope: 'transient', ...__ipsProxy + }), + new wasm.xWrap.FuncPtrAdapter({ + name: 'xConflict', signature: 'i(pip)', bindScope: 'transient' + }), + 'void*', '**', 'int*', 'int' + + ]], + ['sqlite3changeset_apply_v2_strm', 'int', [ + 'sqlite3*', + new wasm.xWrap.FuncPtrAdapter({ + name: 'xInput', signature: 'i(ppp)', bindScope: 'transient' + }), + 'void*', + new wasm.xWrap.FuncPtrAdapter({ + name: 'xFilter', bindScope: 'transient', ...__ipsProxy + }), + new wasm.xWrap.FuncPtrAdapter({ + name: 'xConflict', signature: 'i(pip)', bindScope: 'transient' + }), + 'void*', '**', 'int*', 'int' + ]], + ['sqlite3changeset_concat', 'int', ['int','void*', 'int', 'void*', 'int*', '**']], + ['sqlite3changeset_concat_strm', 'int', [ + new wasm.xWrap.FuncPtrAdapter({ + name: 'xInputA', signature: 'i(ppp)', bindScope: 'transient' + }), + 'void*', + new wasm.xWrap.FuncPtrAdapter({ + name: 'xInputB', signature: 'i(ppp)', bindScope: 'transient' + }), + 'void*', + new wasm.xWrap.FuncPtrAdapter({ + name: 'xOutput', signature: 'i(ppi)', bindScope: 'transient' + }), + 'void*' + ]], + ['sqlite3changeset_conflict', 'int', ['sqlite3_changeset_iter*', 'int', '**']], + ['sqlite3changeset_finalize', 'int', ['sqlite3_changeset_iter*']], + ['sqlite3changeset_fk_conflicts', 'int', ['sqlite3_changeset_iter*', 'int*']], + ['sqlite3changeset_invert', 'int', ['int', 'void*', 'int*', '**']], + ['sqlite3changeset_invert_strm', 'int', [ + new wasm.xWrap.FuncPtrAdapter({ + name: 'xInput', signature: 'i(ppp)', bindScope: 'transient' + }), + 'void*', + new wasm.xWrap.FuncPtrAdapter({ + name: 'xOutput', signature: 'i(ppi)', bindScope: 'transient' + }), + 'void*' + ]], + ['sqlite3changeset_new', 'int', ['sqlite3_changeset_iter*', 'int', '**']], + ['sqlite3changeset_next', 'int', ['sqlite3_changeset_iter*']], + ['sqlite3changeset_old', 'int', ['sqlite3_changeset_iter*', 'int', '**']], + ['sqlite3changeset_op', 'int', [ + 'sqlite3_changeset_iter*', '**', 'int*', 'int*','int*' + ]], + ['sqlite3changeset_pk', 'int', ['sqlite3_changeset_iter*', '**', 'int*']], + ['sqlite3changeset_start', 'int', ['**', 'int', '*']], + ['sqlite3changeset_start_strm', 'int', [ + '**', + new wasm.xWrap.FuncPtrAdapter({ + name: 'xInput', signature: 'i(ppp)', bindScope: 'transient' + }), + 'void*' + ]], + ['sqlite3changeset_start_v2', 'int', ['**', 'int', '*', 'int']], + ['sqlite3changeset_start_v2_strm', 'int', [ + '**', + new wasm.xWrap.FuncPtrAdapter({ + name: 'xInput', signature: 'i(ppp)', bindScope: 'transient' + }), + 'void*', 'int' + ]], + ['sqlite3session_attach', 'int', ['sqlite3_session*', 'string']], + ['sqlite3session_changeset', 'int', ['sqlite3_session*', 'int*', '**']], + ['sqlite3session_changeset_size', 'i64', ['sqlite3_session*']], + ['sqlite3session_changeset_strm', 'int', [ + 'sqlite3_session*', + new wasm.xWrap.FuncPtrAdapter({ + name: 'xOutput', signature: 'i(ppp)', bindScope: 'transient' + }), + 'void*' + ]], + ['sqlite3session_config', 'int', ['int', 'void*']], + ['sqlite3session_create', 'int', ['sqlite3*', 'string', '**']], + //sqlite3session_delete() is bound manually + ['sqlite3session_diff', 'int', ['sqlite3_session*', 'string', 'string', '**']], + ['sqlite3session_enable', 'int', ['sqlite3_session*', 'int']], + ['sqlite3session_indirect', 'int', ['sqlite3_session*', 'int']], + ['sqlite3session_isempty', 'int', ['sqlite3_session*']], + ['sqlite3session_memory_used', 'i64', ['sqlite3_session*']], + ['sqlite3session_object_config', 'int', ['sqlite3_session*', 'int', 'void*']], + ['sqlite3session_patchset', 'int', ['sqlite3_session*', '*', '**']], + ['sqlite3session_patchset_strm', 'int', [ + 'sqlite3_session*', + new wasm.xWrap.FuncPtrAdapter({ + name: 'xOutput', signature: 'i(ppp)', bindScope: 'transient' + }), + 'void*' + ]], + ['sqlite3session_table_filter', undefined, [ + 'sqlite3_session*', + new wasm.xWrap.FuncPtrAdapter({ + name: 'xFilter', ...__ipsProxy, + contextKey: (argv,argIndex)=>argv[0/* (sqlite3_session*) */] + }), + '*' + ]] + ]); + }/*session/changeset APIs*/ + + /** + Functions which are intended solely for API-internal use by the + WASM components, not client code. These get installed into + sqlite3.util. Some of them get exposed to clients via variants + in sqlite3_js_...(). + + 2024-01-11: these were renamed, with two underscores in the + prefix, to ensure that clients do not accidentally depend on + them. They have always been documented as internal-use-only, so + no clients "should" be depending on the old names. + */ + wasm.bindingSignatures.wasmInternal = [ + ["sqlite3__wasm_db_reset", "int", "sqlite3*"], + ["sqlite3__wasm_db_vfs", "sqlite3_vfs*", "sqlite3*","string"], + [/* DO NOT USE. This is deprecated since 2023-08-11 because it can + trigger assert() in debug builds when used with file sizes + which are not sizes to a multiple of a valid db page size. */ + "sqlite3__wasm_vfs_create_file", "int", "sqlite3_vfs*","string","*", "int" + ], + ["sqlite3__wasm_posix_create_file", "int", "string","*", "int"], + ["sqlite3__wasm_vfs_unlink", "int", "sqlite3_vfs*","string"], + ["sqlite3__wasm_qfmt_token","string:dealloc", "string","int"] + ]; + + /** + Install JS<->C struct bindings for the non-opaque struct types we + need... */ + sqlite3.StructBinder = globalThis.Jaccwabyt({ + heap: 0 ? wasm.memory : wasm.heap8u, + alloc: wasm.alloc, + dealloc: wasm.dealloc, + bigIntEnabled: wasm.bigIntEnabled, + memberPrefix: /* Never change this: this prefix is baked into any + amount of code and client-facing docs. */ '$' + }); + delete globalThis.Jaccwabyt; + + {// wasm.xWrap() bindings... + + /* Convert Arrays and certain TypedArrays to strings for + 'string:flexible'-type arguments */ + const __xString = wasm.xWrap.argAdapter('string'); + wasm.xWrap.argAdapter( + 'string:flexible', (v)=>__xString(util.flexibleString(v)) + ); + + /** + The 'string:static' argument adapter treats its argument as + either... + + - WASM pointer: assumed to be a long-lived C-string which gets + returned as-is. + + - Anything else: gets coerced to a JS string for use as a map + key. If a matching entry is found (as described next), it is + returned, else wasm.allocCString() is used to create a a new + string, map its pointer to (''+v) for the remainder of the + application's life, and returns that pointer value for this + call and all future calls which are passed a + string-equivalent argument. + + Use case: sqlite3_bind_pointer() and sqlite3_result_pointer() + call for "a static string and preferably a string + literal." This converter is used to ensure that the string + value seen by those functions is long-lived and behaves as they + need it to. + */ + wasm.xWrap.argAdapter( + 'string:static', + function(v){ + if(wasm.isPtr(v)) return v; + v = ''+v; + let rc = this[v]; + return rc || (this[v] = wasm.allocCString(v)); + }.bind(Object.create(null)) + ); + + /** + Add some descriptive xWrap() aliases for '*' intended to (A) + initially improve readability/correctness of + wasm.bindingSignatures and (B) provide automatic conversion + from higher-level representations, e.g. capi.sqlite3_vfs to + `sqlite3_vfs*` via capi.sqlite3_vfs.pointer. + */ + const __xArgPtr = wasm.xWrap.argAdapter('*'); + const nilType = function(){ + /*a class which no value can ever be an instance of*/ + }; + wasm.xWrap.argAdapter('sqlite3_filename', __xArgPtr) + ('sqlite3_context*', __xArgPtr) + ('sqlite3_value*', __xArgPtr) + ('void*', __xArgPtr) + ('sqlite3_changegroup*', __xArgPtr) + ('sqlite3_changeset_iter*', __xArgPtr) + ('sqlite3_session*', __xArgPtr) + ('sqlite3_stmt*', (v)=> + __xArgPtr((v instanceof (sqlite3?.oo1?.Stmt || nilType)) + ? v.pointer : v)) + ('sqlite3*', (v)=> + __xArgPtr((v instanceof (sqlite3?.oo1?.DB || nilType)) + ? v.pointer : v)) + /** + `sqlite3_vfs*`: + + - v is-a string: use the result of sqlite3_vfs_find(v) but + throw if it returns 0. + - v is-a capi.sqlite3_vfs: use v.pointer. + - Else return the same as the `'*'` argument conversion. + */ + ('sqlite3_vfs*', (v)=>{ + if('string'===typeof v){ + /* A NULL sqlite3_vfs pointer will be treated as the default + VFS in many contexts. We specifically do not want that + behavior here. */ + return capi.sqlite3_vfs_find(v) + || sqlite3.SQLite3Error.toss( + capi.SQLITE_NOTFOUND, + "Unknown sqlite3_vfs name:", v + ); + } + return __xArgPtr((v instanceof (capi.sqlite3_vfs || nilType)) + ? v.pointer : v); + }); + if( wasm.exports.sqlite3_declare_vtab ){ + wasm.xWrap.argAdapter('sqlite3_index_info*', (v)=> + __xArgPtr((v instanceof (capi.sqlite3_index_info || nilType)) + ? v.pointer : v)) + ('sqlite3_module*', (v)=> + __xArgPtr((v instanceof (capi.sqlite3_module || nilType)) + ? v.pointer : v) + ); + } + + const __xRcPtr = wasm.xWrap.resultAdapter('*'); + wasm.xWrap.resultAdapter('sqlite3*', __xRcPtr) + ('sqlite3_context*', __xRcPtr) + ('sqlite3_stmt*', __xRcPtr) + ('sqlite3_value*', __xRcPtr) + ('sqlite3_vfs*', __xRcPtr) + ('void*', __xRcPtr); + + /** + Populate api object with sqlite3_...() by binding the "raw" wasm + exports into type-converting proxies using wasm.xWrap(). + */ + if(0 === wasm.exports.sqlite3_step.length){ + /* This environment wraps exports in nullary functions, which means + we must disable the arg-count validation we otherwise perform + on the wrappers. */ + wasm.xWrap.doArgcCheck = false; + sqlite3.config.warn( + "Disabling sqlite3.wasm.xWrap.doArgcCheck due to environmental quirks." + ); + } + for(const e of wasm.bindingSignatures){ + capi[e[0]] = wasm.xWrap.apply(null, e); + } + for(const e of wasm.bindingSignatures.wasmInternal){ + util[e[0]] = wasm.xWrap.apply(null, e); + } + + /* For C API functions which cannot work properly unless + wasm.bigIntEnabled is true, install a bogus impl which throws + if called when bigIntEnabled is false. The alternative would be + to elide these functions altogether, which seems likely to + cause more confusion. */ + const fI64Disabled = function(fname){ + return ()=>toss(fname+"() is unavailable due to lack", + "of BigInt support in this build."); + }; + for(const e of wasm.bindingSignatures.int64){ + capi[e[0]] = wasm.bigIntEnabled + ? wasm.xWrap.apply(null, e) + : fI64Disabled(e[0]); + } + + /* There's no need to expose bindingSignatures to clients, + implicitly making it part of the public interface. */ + delete wasm.bindingSignatures; + + if(wasm.exports.sqlite3__wasm_db_error){ + const __db_err = wasm.xWrap( + 'sqlite3__wasm_db_error', 'int', 'sqlite3*', 'int', 'string' + ); + /** + Sets the given db's error state. Accepts: + + - (sqlite3*, int code, string msg) + - (sqlite3*, Error e [,string msg = ''+e]) + + If passed a WasmAllocError, the message is ignored and the + result code is SQLITE_NOMEM. If passed any other Error type, + the result code defaults to SQLITE_ERROR unless the Error + object has a resultCode property, in which case that is used + (e.g. SQLite3Error has that). If passed a non-WasmAllocError + exception, the message string defaults to theError.message. + + Returns the resulting code. Pass (pDb,0,0) to clear the error + state. + */ + util.sqlite3__wasm_db_error = function(pDb, resultCode, message){ + if(resultCode instanceof sqlite3.WasmAllocError){ + resultCode = capi.SQLITE_NOMEM; + message = 0 /*avoid allocating message string*/; + }else if(resultCode instanceof Error){ + message = message || ''+resultCode; + resultCode = (resultCode.resultCode || capi.SQLITE_ERROR); + } + return pDb ? __db_err(pDb, resultCode, message) : resultCode; + }; + }else{ + util.sqlite3__wasm_db_error = function(pDb,errCode,msg){ + console.warn("sqlite3__wasm_db_error() is not exported.",arguments); + return errCode; + }; + } + }/*xWrap() bindings*/ + + {/* Import C-level constants and structs... */ + const cJson = wasm.xCall('sqlite3__wasm_enum_json'); + if(!cJson){ + toss("Maintenance required: increase sqlite3__wasm_enum_json()'s", + "static buffer size!"); + } + //console.debug('wasm.ctype length =',wasm.cstrlen(cJson)); + wasm.ctype = JSON.parse(wasm.cstrToJs(cJson)); + // Groups of SQLITE_xyz macros... + const defineGroups = ['access', 'authorizer', + 'blobFinalizers', 'changeset', + 'config', 'dataTypes', + 'dbConfig', 'dbStatus', + 'encodings', 'fcntl', 'flock', 'ioCap', + 'limits', 'openFlags', + 'prepareFlags', 'resultCodes', + 'sqlite3Status', + 'stmtStatus', 'syncFlags', + 'trace', 'txnState', 'udfFlags', + 'version' ]; + if(wasm.bigIntEnabled){ + defineGroups.push('serialize', 'session', 'vtab'); + } + for(const t of defineGroups){ + for(const e of Object.entries(wasm.ctype[t])){ + // ^^^ [k,v] there triggers a buggy code transformation via + // one of the Emscripten-driven optimizers. + capi[e[0]] = e[1]; + } + } + if(!wasm.functionEntry(capi.SQLITE_WASM_DEALLOC)){ + toss("Internal error: cannot resolve exported function", + "entry SQLITE_WASM_DEALLOC (=="+capi.SQLITE_WASM_DEALLOC+")."); + } + const __rcMap = Object.create(null); + for(const t of ['resultCodes']){ + for(const e of Object.entries(wasm.ctype[t])){ + __rcMap[e[1]] = e[0]; + } + } + /** + For the given integer, returns the SQLITE_xxx result code as a + string, or undefined if no such mapping is found. + */ + capi.sqlite3_js_rc_str = (rc)=>__rcMap[rc]; + /* Bind all registered C-side structs... */ + const notThese = Object.assign(Object.create(null),{ + // For each struct to NOT register, map its name to true: + WasmTestStruct: true, + /* We unregister the kvvfs VFS from Worker threads below. */ + sqlite3_kvvfs_methods: !util.isUIThread(), + /* sqlite3_index_info and friends require int64: */ + sqlite3_index_info: !wasm.bigIntEnabled, + sqlite3_index_constraint: !wasm.bigIntEnabled, + sqlite3_index_orderby: !wasm.bigIntEnabled, + sqlite3_index_constraint_usage: !wasm.bigIntEnabled + }); + for(const s of wasm.ctype.structs){ + if(!notThese[s.name]){ + capi[s.name] = sqlite3.StructBinder(s); + } + } + if(capi.sqlite3_index_info){ + /* Move these inner structs into sqlite3_index_info. Binding + ** them to WASM requires that we create global-scope structs to + ** model them with, but those are no longer needed after we've + ** passed them to StructBinder. */ + for(const k of ['sqlite3_index_constraint', + 'sqlite3_index_orderby', + 'sqlite3_index_constraint_usage']){ + capi.sqlite3_index_info[k] = capi[k]; + delete capi[k]; + } + capi.sqlite3_vtab_config = wasm.xWrap( + 'sqlite3__wasm_vtab_config','int',[ + 'sqlite3*', 'int', 'int'] + ); + }/* end vtab-related setup */ + }/*end C constant and struct imports*/ + + /** + Internal helper to assist in validating call argument counts in + the hand-written sqlite3_xyz() wrappers. We do this only for + consistency with non-special-case wrappings. + */ + const __dbArgcMismatch = (pDb,f,n)=>{ + return util.sqlite3__wasm_db_error(pDb, capi.SQLITE_MISUSE, + f+"() requires "+n+" argument"+ + (1===n?"":'s')+"."); + }; + + /** Code duplication reducer for functions which take an encoding + argument and require SQLITE_UTF8. Sets the db error code to + SQLITE_FORMAT, installs a descriptive error message, + and returns SQLITE_FORMAT. */ + const __errEncoding = (pDb)=>{ + return util.sqlite3__wasm_db_error( + pDb, capi.SQLITE_FORMAT, "SQLITE_UTF8 is the only supported encoding." + ); + }; + + /** + __dbCleanupMap is infrastructure for recording registration of + UDFs and collations so that sqlite3_close_v2() can clean up any + automated JS-to-WASM function conversions installed by those. + */ + const __argPDb = (pDb)=>wasm.xWrap.argAdapter('sqlite3*')(pDb); + const __argStr = (str)=>wasm.isPtr(str) ? wasm.cstrToJs(str) : str; + const __dbCleanupMap = function( + pDb, mode/*0=remove, >0=create if needed, <0=do not create if missing*/ + ){ + pDb = __argPDb(pDb); + let m = this.dbMap.get(pDb); + if(!mode){ + this.dbMap.delete(pDb); + return m; + }else if(!m && mode>0){ + this.dbMap.set(pDb, (m = Object.create(null))); + } + return m; + }.bind(Object.assign(Object.create(null),{ + dbMap: new Map + })); + + __dbCleanupMap.addCollation = function(pDb, name){ + const m = __dbCleanupMap(pDb, 1); + if(!m.collation) m.collation = new Set; + m.collation.add(__argStr(name).toLowerCase()); + }; + + __dbCleanupMap._addUDF = function(pDb, name, arity, map){ + /* Map UDF name to a Set of arity values */ + name = __argStr(name).toLowerCase(); + let u = map.get(name); + if(!u) map.set(name, (u = new Set)); + u.add((arity<0) ? -1 : arity); + }; + + __dbCleanupMap.addFunction = function(pDb, name, arity){ + const m = __dbCleanupMap(pDb, 1); + if(!m.udf) m.udf = new Map; + this._addUDF(pDb, name, arity, m.udf); + }; + + if( wasm.exports.sqlite3_create_window_function ){ + __dbCleanupMap.addWindowFunc = function(pDb, name, arity){ + const m = __dbCleanupMap(pDb, 1); + if(!m.wudf) m.wudf = new Map; + this._addUDF(pDb, name, arity, m.wudf); + }; + } + + /** + Intended to be called _only_ from sqlite3_close_v2(), + passed its non-0 db argument. + + This function frees up certain automatically-installed WASM + function bindings which were installed on behalf of the given db, + as those may otherwise leak. + + Notable caveat: this is only ever run via + sqlite3.capi.sqlite3_close_v2(). If a client, for whatever + reason, uses sqlite3.wasm.exports.sqlite3_close_v2() (the + function directly exported from WASM), this cleanup will not + happen. + + This is not a silver bullet for avoiding automation-related + leaks but represents "an honest effort." + + The issue being addressed here is covered at: + + https://sqlite.org/wasm/doc/trunk/api-c-style.md#convert-func-ptr + */ + __dbCleanupMap.cleanup = function(pDb){ + pDb = __argPDb(pDb); + //wasm.xWrap.FuncPtrAdapter.debugFuncInstall = false; + /** + Installing NULL functions in the C API will remove those + bindings. The FuncPtrAdapter which sits between us and the C + API will also treat that as an opportunity to + wasm.uninstallFunction() any WASM function bindings it has + installed for pDb. + */ + const closeArgs = [pDb]; + for(const name of [ + 'sqlite3_busy_handler', + 'sqlite3_commit_hook', + 'sqlite3_preupdate_hook', + 'sqlite3_progress_handler', + 'sqlite3_rollback_hook', + 'sqlite3_set_authorizer', + 'sqlite3_trace_v2', + 'sqlite3_update_hook' + ]) { + const x = wasm.exports[name]; + if( !x ){ + /* assume it was built without this API */ + continue; + } + closeArgs.length = x.length/*==argument count*/ + /* recall that undefined entries translate to 0 when passed to + WASM. */; + try{ capi[name](...closeArgs) } + catch(e){ + sqlite3.config.warn("close-time call of",name+"(",closeArgs,") threw:",e); + } + } + const m = __dbCleanupMap(pDb, 0); + if(!m) return; + if(m.collation){ + for(const name of m.collation){ + try{ + capi.sqlite3_create_collation_v2( + pDb, name, capi.SQLITE_UTF8, 0, 0, 0 + ); + }catch(e){ + /*ignored*/ + } + } + delete m.collation; + } + let i; + for(i = 0; i < 2; ++i){ /* Clean up UDFs... */ + const fmap = i ? m.wudf : m.udf; + if(!fmap) continue; + const func = i + ? capi.sqlite3_create_window_function + : capi.sqlite3_create_function_v2; + for(const e of fmap){ + const name = e[0], arities = e[1]; + const fargs = [pDb, name, 0/*arity*/, capi.SQLITE_UTF8, 0, 0, 0, 0, 0]; + if(i) fargs.push(0); + for(const arity of arities){ + try{ fargs[2] = arity; func.apply(null, fargs); } + catch(e){/*ignored*/} + } + arities.clear(); + } + fmap.clear(); + } + delete m.udf; + delete m.wudf; + }/*__dbCleanupMap.cleanup()*/; + + {/* Binding of sqlite3_close_v2() */ + const __sqlite3CloseV2 = wasm.xWrap("sqlite3_close_v2", "int", "sqlite3*"); + capi.sqlite3_close_v2 = function(pDb){ + if(1!==arguments.length) return __dbArgcMismatch(pDb, 'sqlite3_close_v2', 1); + if(pDb){ + try{__dbCleanupMap.cleanup(pDb)} catch(e){/*ignored*/} + } + return __sqlite3CloseV2(pDb); + }; + }/*sqlite3_close_v2()*/ + + if(capi.sqlite3session_create){ + const __sqlite3SessionDelete = wasm.xWrap( + 'sqlite3session_delete', undefined, ['sqlite3_session*'] + ); + capi.sqlite3session_delete = function(pSession){ + if(1!==arguments.length){ + return __dbArgcMismatch(pDb, 'sqlite3session_delete', 1); + /* Yes, we're returning a value from a void function. That seems + like the lesser evil compared to not maintaining arg-count + consistency as we do with other similar bindings. */ + } + else if(pSession){ + //wasm.xWrap.FuncPtrAdapter.debugFuncInstall = true; + capi.sqlite3session_table_filter(pSession, 0, 0); + } + __sqlite3SessionDelete(pSession); + }; + } + + {/* Bindings for sqlite3_create_collation[_v2]() */ + // contextKey() impl for wasm.xWrap.FuncPtrAdapter + const contextKey = (argv,argIndex)=>{ + return 'argv['+argIndex+']:'+argv[0/* sqlite3* */]+ + ':'+wasm.cstrToJs(argv[1/* collation name */]).toLowerCase() + }; + const __sqlite3CreateCollationV2 = wasm.xWrap( + 'sqlite3_create_collation_v2', 'int', [ + 'sqlite3*', 'string', 'int', '*', + new wasm.xWrap.FuncPtrAdapter({ + /* int(*xCompare)(void*,int,const void*,int,const void*) */ + name: 'xCompare', signature: 'i(pipip)', contextKey + }), + new wasm.xWrap.FuncPtrAdapter({ + /* void(*xDestroy(void*) */ + name: 'xDestroy', signature: 'v(p)', contextKey + }) + ] + ); + + /** + Works exactly like C's sqlite3_create_collation_v2() except that: + + 1) It returns capi.SQLITE_FORMAT if the 3rd argument contains + any encoding-related value other than capi.SQLITE_UTF8. No + other encodings are supported. As a special case, if the + bottom 4 bits of that argument are 0, SQLITE_UTF8 is + assumed. + + 2) It accepts JS functions for its function-pointer arguments, + for which it will install WASM-bound proxies. The bindings + are "permanent," in that they will stay in the WASM environment + until it shuts down unless the client calls this again with the + same collation name and a value of 0 or null for the + the function pointer(s). + + For consistency with the C API, it requires the same number of + arguments. It returns capi.SQLITE_MISUSE if passed any other + argument count. + + Returns 0 on success, non-0 on error, in which case the error + state of pDb (of type `sqlite3*` or argument-convertible to it) + may contain more information. + */ + capi.sqlite3_create_collation_v2 = function(pDb,zName,eTextRep,pArg,xCompare,xDestroy){ + if(6!==arguments.length) return __dbArgcMismatch(pDb, 'sqlite3_create_collation_v2', 6); + else if( 0 === (eTextRep & 0xf) ){ + eTextRep |= capi.SQLITE_UTF8; + }else if( capi.SQLITE_UTF8 !== (eTextRep & 0xf) ){ + return __errEncoding(pDb); + } + try{ + const rc = __sqlite3CreateCollationV2(pDb, zName, eTextRep, pArg, xCompare, xDestroy); + if(0===rc && xCompare instanceof Function){ + __dbCleanupMap.addCollation(pDb, zName); + } + return rc; + }catch(e){ + return util.sqlite3__wasm_db_error(pDb, e); + } + }; + + capi.sqlite3_create_collation = (pDb,zName,eTextRep,pArg,xCompare)=>{ + return (5===arguments.length) + ? capi.sqlite3_create_collation_v2(pDb,zName,eTextRep,pArg,xCompare,0) + : __dbArgcMismatch(pDb, 'sqlite3_create_collation', 5); + }; + + }/*sqlite3_create_collation() and friends*/ + + {/* Special-case handling of sqlite3_create_function_v2() + and sqlite3_create_window_function(). */ + /** FuncPtrAdapter for contextKey() for sqlite3_create_function() + and friends. */ + const contextKey = function(argv,argIndex){ + return ( + argv[0/* sqlite3* */] + +':'+(argv[2/*number of UDF args*/] < 0 ? -1 : argv[2]) + +':'+argIndex/*distinct for each xAbc callback type*/ + +':'+wasm.cstrToJs(argv[1]).toLowerCase() + ) + }; + + /** + JS proxies for the various sqlite3_create[_window]_function() + callbacks, structured in a form usable by wasm.xWrap.FuncPtrAdapter. + */ + const __cfProxy = Object.assign(Object.create(null), { + xInverseAndStep: { + signature:'v(pip)', contextKey, + callProxy: (callback)=>{ + return (pCtx, argc, pArgv)=>{ + try{ callback(pCtx, ...capi.sqlite3_values_to_js(argc, pArgv)) } + catch(e){ capi.sqlite3_result_error_js(pCtx, e) } + }; + } + }, + xFinalAndValue: { + signature:'v(p)', contextKey, + callProxy: (callback)=>{ + return (pCtx)=>{ + try{ capi.sqlite3_result_js(pCtx, callback(pCtx)) } + catch(e){ capi.sqlite3_result_error_js(pCtx, e) } + }; + } + }, + xFunc: { + signature:'v(pip)', contextKey, + callProxy: (callback)=>{ + return (pCtx, argc, pArgv)=>{ + try{ + capi.sqlite3_result_js( + pCtx, + callback(pCtx, ...capi.sqlite3_values_to_js(argc, pArgv)) + ); + }catch(e){ + //console.error('xFunc() caught:',e); + capi.sqlite3_result_error_js(pCtx, e); + } + }; + } + }, + xDestroy: { + signature:'v(p)', contextKey, + //Arguable: a well-behaved destructor doesn't require a proxy. + callProxy: (callback)=>{ + return (pVoid)=>{ + try{ callback(pVoid) } + catch(e){ console.error("UDF xDestroy method threw:",e) } + }; + } + } + })/*__cfProxy*/; + + const __sqlite3CreateFunction = wasm.xWrap( + "sqlite3_create_function_v2", "int", [ + "sqlite3*", "string"/*funcName*/, "int"/*nArg*/, + "int"/*eTextRep*/, "*"/*pApp*/, + new wasm.xWrap.FuncPtrAdapter({name: 'xFunc', ...__cfProxy.xFunc}), + new wasm.xWrap.FuncPtrAdapter({name: 'xStep', ...__cfProxy.xInverseAndStep}), + new wasm.xWrap.FuncPtrAdapter({name: 'xFinal', ...__cfProxy.xFinalAndValue}), + new wasm.xWrap.FuncPtrAdapter({name: 'xDestroy', ...__cfProxy.xDestroy}) + ] + ); + + const __sqlite3CreateWindowFunction = + wasm.exports.sqlite3_create_window_function + ? wasm.xWrap( + "sqlite3_create_window_function", "int", [ + "sqlite3*", "string"/*funcName*/, "int"/*nArg*/, + "int"/*eTextRep*/, "*"/*pApp*/, + new wasm.xWrap.FuncPtrAdapter({name: 'xStep', ...__cfProxy.xInverseAndStep}), + new wasm.xWrap.FuncPtrAdapter({name: 'xFinal', ...__cfProxy.xFinalAndValue}), + new wasm.xWrap.FuncPtrAdapter({name: 'xValue', ...__cfProxy.xFinalAndValue}), + new wasm.xWrap.FuncPtrAdapter({name: 'xInverse', ...__cfProxy.xInverseAndStep}), + new wasm.xWrap.FuncPtrAdapter({name: 'xDestroy', ...__cfProxy.xDestroy}) + ] + ) + : undefined; + + /* Documented in the api object's initializer. */ + capi.sqlite3_create_function_v2 = function f( + pDb, funcName, nArg, eTextRep, pApp, + xFunc, //void (*xFunc)(sqlite3_context*,int,sqlite3_value**) + xStep, //void (*xStep)(sqlite3_context*,int,sqlite3_value**) + xFinal, //void (*xFinal)(sqlite3_context*) + xDestroy //void (*xDestroy)(void*) + ){ + if( f.length!==arguments.length ){ + return __dbArgcMismatch(pDb,"sqlite3_create_function_v2",f.length); + }else if( 0 === (eTextRep & 0xf) ){ + eTextRep |= capi.SQLITE_UTF8; + }else if( capi.SQLITE_UTF8 !== (eTextRep & 0xf) ){ + return __errEncoding(pDb); + } + try{ + const rc = __sqlite3CreateFunction(pDb, funcName, nArg, eTextRep, + pApp, xFunc, xStep, xFinal, xDestroy); + if(0===rc && (xFunc instanceof Function + || xStep instanceof Function + || xFinal instanceof Function + || xDestroy instanceof Function)){ + __dbCleanupMap.addFunction(pDb, funcName, nArg); + } + return rc; + }catch(e){ + console.error("sqlite3_create_function_v2() setup threw:",e); + return util.sqlite3__wasm_db_error(pDb, e, "Creation of UDF threw: "+e); + } + }; + + /* Documented in the api object's initializer. */ + capi.sqlite3_create_function = function f( + pDb, funcName, nArg, eTextRep, pApp, + xFunc, xStep, xFinal + ){ + return (f.length===arguments.length) + ? capi.sqlite3_create_function_v2(pDb, funcName, nArg, eTextRep, + pApp, xFunc, xStep, xFinal, 0) + : __dbArgcMismatch(pDb,"sqlite3_create_function",f.length); + }; + + /* Documented in the api object's initializer. */ + if( __sqlite3CreateWindowFunction ){ + capi.sqlite3_create_window_function = function f( + pDb, funcName, nArg, eTextRep, pApp, + xStep, //void (*xStep)(sqlite3_context*,int,sqlite3_value**) + xFinal, //void (*xFinal)(sqlite3_context*) + xValue, //void (*xValue)(sqlite3_context*) + xInverse,//void (*xInverse)(sqlite3_context*,int,sqlite3_value**) + xDestroy //void (*xDestroy)(void*) + ){ + if( f.length!==arguments.length ){ + return __dbArgcMismatch(pDb,"sqlite3_create_window_function",f.length); + }else if( 0 === (eTextRep & 0xf) ){ + eTextRep |= capi.SQLITE_UTF8; + }else if( capi.SQLITE_UTF8 !== (eTextRep & 0xf) ){ + return __errEncoding(pDb); + } + try{ + const rc = __sqlite3CreateWindowFunction(pDb, funcName, nArg, eTextRep, + pApp, xStep, xFinal, xValue, + xInverse, xDestroy); + if(0===rc && (xStep instanceof Function + || xFinal instanceof Function + || xValue instanceof Function + || xInverse instanceof Function + || xDestroy instanceof Function)){ + __dbCleanupMap.addWindowFunc(pDb, funcName, nArg); + } + return rc; + }catch(e){ + console.error("sqlite3_create_window_function() setup threw:",e); + return util.sqlite3__wasm_db_error(pDb, e, "Creation of UDF threw: "+e); + } + }; + }else{ + delete capi.sqlite3_create_window_function; + } + /** + A _deprecated_ alias for capi.sqlite3_result_js() which + predates the addition of that function in the public API. + */ + capi.sqlite3_create_function_v2.udfSetResult = + capi.sqlite3_create_function.udfSetResult = capi.sqlite3_result_js; + if(capi.sqlite3_create_window_function){ + capi.sqlite3_create_window_function.udfSetResult = capi.sqlite3_result_js; + } + + /** + A _deprecated_ alias for capi.sqlite3_values_to_js() which + predates the addition of that function in the public API. + */ + capi.sqlite3_create_function_v2.udfConvertArgs = + capi.sqlite3_create_function.udfConvertArgs = capi.sqlite3_values_to_js; + if(capi.sqlite3_create_window_function){ + capi.sqlite3_create_window_function.udfConvertArgs = capi.sqlite3_values_to_js; + } + + /** + A _deprecated_ alias for capi.sqlite3_result_error_js() which + predates the addition of that function in the public API. + */ + capi.sqlite3_create_function_v2.udfSetError = + capi.sqlite3_create_function.udfSetError = capi.sqlite3_result_error_js; + if(capi.sqlite3_create_window_function){ + capi.sqlite3_create_window_function.udfSetError = capi.sqlite3_result_error_js; + } + + }/*sqlite3_create_function_v2() and sqlite3_create_window_function() proxies*/; + + {/* Special-case handling of sqlite3_prepare_v2() and + sqlite3_prepare_v3() */ + + /** + Helper for string:flexible conversions which require a + byte-length counterpart argument. Passed a value and its + ostensible length, this function returns [V,N], where V is + either v or a transformed copy of v and N is either n, -1, or + the byte length of v (if it's a byte array or ArrayBuffer). + */ + const __flexiString = (v,n)=>{ + if('string'===typeof v){ + n = -1; + }else if(util.isSQLableTypedArray(v)){ + n = v.byteLength; + v = util.typedArrayToString( + (v instanceof ArrayBuffer) ? new Uint8Array(v) : v + ); + }else if(Array.isArray(v)){ + v = v.join(""); + n = -1; + } + return [v, n]; + }; + + /** + Scope-local holder of the two impls of sqlite3_prepare_v2/v3(). + */ + const __prepare = { + /** + This binding expects a JS string as its 2nd argument and + null as its final argument. In order to compile multiple + statements from a single string, the "full" impl (see + below) must be used. + */ + basic: wasm.xWrap('sqlite3_prepare_v3', + "int", ["sqlite3*", "string", + "int"/*ignored for this impl!*/, + "int", "**", + "**"/*MUST be 0 or null or undefined!*/]), + /** + Impl which requires that the 2nd argument be a pointer + to the SQL string, instead of being converted to a + string. This variant is necessary for cases where we + require a non-NULL value for the final argument + (exec()'ing multiple statements from one input + string). For simpler cases, where only the first + statement in the SQL string is required, the wrapper + named sqlite3_prepare_v2() is sufficient and easier to + use because it doesn't require dealing with pointers. + */ + full: wasm.xWrap('sqlite3_prepare_v3', + "int", ["sqlite3*", "*", "int", "int", + "**", "**"]) + }; + + /* Documented in the capi object's initializer. */ + capi.sqlite3_prepare_v3 = function f(pDb, sql, sqlLen, prepFlags, ppStmt, pzTail){ + if(f.length!==arguments.length){ + return __dbArgcMismatch(pDb,"sqlite3_prepare_v3",f.length); + } + const [xSql, xSqlLen] = __flexiString(sql, sqlLen); + switch(typeof xSql){ + case 'string': return __prepare.basic(pDb, xSql, xSqlLen, prepFlags, ppStmt, null); + case 'number': return __prepare.full(pDb, xSql, xSqlLen, prepFlags, ppStmt, pzTail); + default: + return util.sqlite3__wasm_db_error( + pDb, capi.SQLITE_MISUSE, + "Invalid SQL argument type for sqlite3_prepare_v2/v3()." + ); + } + }; + + /* Documented in the capi object's initializer. */ + capi.sqlite3_prepare_v2 = function f(pDb, sql, sqlLen, ppStmt, pzTail){ + return (f.length===arguments.length) + ? capi.sqlite3_prepare_v3(pDb, sql, sqlLen, 0, ppStmt, pzTail) + : __dbArgcMismatch(pDb,"sqlite3_prepare_v2",f.length); + }; + + }/*sqlite3_prepare_v2/v3()*/ + + {/*sqlite3_bind_text/blob()*/ + const __bindText = wasm.xWrap("sqlite3_bind_text", "int", [ + "sqlite3_stmt*", "int", "string", "int", "*" + ]); + const __bindBlob = wasm.xWrap("sqlite3_bind_blob", "int", [ + "sqlite3_stmt*", "int", "*", "int", "*" + ]); + + /** Documented in the capi object's initializer. */ + capi.sqlite3_bind_text = function f(pStmt, iCol, text, nText, xDestroy){ + if(f.length!==arguments.length){ + return __dbArgcMismatch(capi.sqlite3_db_handle(pStmt), + "sqlite3_bind_text", f.length); + }else if(wasm.isPtr(text) || null===text){ + return __bindText(pStmt, iCol, text, nText, xDestroy); + }else if(text instanceof ArrayBuffer){ + text = new Uint8Array(text); + }else if(Array.isArray(pMem)){ + text = pMem.join(''); + } + let p, n; + try{ + if(util.isSQLableTypedArray(text)){ + p = wasm.allocFromTypedArray(text); + n = text.byteLength; + }else if('string'===typeof text){ + [p, n] = wasm.allocCString(text); + }else{ + return util.sqlite3__wasm_db_error( + capi.sqlite3_db_handle(pStmt), capi.SQLITE_MISUSE, + "Invalid 3rd argument type for sqlite3_bind_text()." + ); + } + return __bindText(pStmt, iCol, p, n, capi.SQLITE_WASM_DEALLOC); + }catch(e){ + wasm.dealloc(p); + return util.sqlite3__wasm_db_error( + capi.sqlite3_db_handle(pStmt), e + ); + } + }/*sqlite3_bind_text()*/; + + /** Documented in the capi object's initializer. */ + capi.sqlite3_bind_blob = function f(pStmt, iCol, pMem, nMem, xDestroy){ + if(f.length!==arguments.length){ + return __dbArgcMismatch(capi.sqlite3_db_handle(pStmt), + "sqlite3_bind_blob", f.length); + }else if(wasm.isPtr(pMem) || null===pMem){ + return __bindBlob(pStmt, iCol, pMem, nMem, xDestroy); + }else if(pMem instanceof ArrayBuffer){ + pMem = new Uint8Array(pMem); + }else if(Array.isArray(pMem)){ + pMem = pMem.join(''); + } + let p, n; + try{ + if(util.isBindableTypedArray(pMem)){ + p = wasm.allocFromTypedArray(pMem); + n = nMem>=0 ? nMem : pMem.byteLength; + }else if('string'===typeof pMem){ + [p, n] = wasm.allocCString(pMem); + }else{ + return util.sqlite3__wasm_db_error( + capi.sqlite3_db_handle(pStmt), capi.SQLITE_MISUSE, + "Invalid 3rd argument type for sqlite3_bind_blob()." + ); + } + return __bindBlob(pStmt, iCol, p, n, capi.SQLITE_WASM_DEALLOC); + }catch(e){ + wasm.dealloc(p); + return util.sqlite3__wasm_db_error( + capi.sqlite3_db_handle(pStmt), e + ); + } + }/*sqlite3_bind_blob()*/; + + }/*sqlite3_bind_text/blob()*/ + + {/* sqlite3_config() */ + /** + Wraps a small subset of the C API's sqlite3_config() options. + Unsupported options trigger the return of capi.SQLITE_NOTFOUND. + Passing fewer than 2 arguments triggers return of + capi.SQLITE_MISUSE. + */ + capi.sqlite3_config = function(op, ...args){ + if(arguments.length<2) return capi.SQLITE_MISUSE; + switch(op){ + case capi.SQLITE_CONFIG_COVERING_INDEX_SCAN: // 20 /* int */ + case capi.SQLITE_CONFIG_MEMSTATUS:// 9 /* boolean */ + case capi.SQLITE_CONFIG_SMALL_MALLOC: // 27 /* boolean */ + case capi.SQLITE_CONFIG_SORTERREF_SIZE: // 28 /* int nByte */ + case capi.SQLITE_CONFIG_STMTJRNL_SPILL: // 26 /* int nByte */ + case capi.SQLITE_CONFIG_URI:// 17 /* int */ + return wasm.exports.sqlite3__wasm_config_i(op, args[0]); + case capi.SQLITE_CONFIG_LOOKASIDE: // 13 /* int int */ + return wasm.exports.sqlite3__wasm_config_ii(op, args[0], args[1]); + case capi.SQLITE_CONFIG_MEMDB_MAXSIZE: // 29 /* sqlite3_int64 */ + return wasm.exports.sqlite3__wasm_config_j(op, args[0]); + case capi.SQLITE_CONFIG_GETMALLOC: // 5 /* sqlite3_mem_methods* */ + case capi.SQLITE_CONFIG_GETMUTEX: // 11 /* sqlite3_mutex_methods* */ + case capi.SQLITE_CONFIG_GETPCACHE2: // 19 /* sqlite3_pcache_methods2* */ + case capi.SQLITE_CONFIG_GETPCACHE: // 15 /* no-op */ + case capi.SQLITE_CONFIG_HEAP: // 8 /* void*, int nByte, int min */ + case capi.SQLITE_CONFIG_LOG: // 16 /* xFunc, void* */ + case capi.SQLITE_CONFIG_MALLOC:// 4 /* sqlite3_mem_methods* */ + case capi.SQLITE_CONFIG_MMAP_SIZE: // 22 /* sqlite3_int64, sqlite3_int64 */ + case capi.SQLITE_CONFIG_MULTITHREAD: // 2 /* nil */ + case capi.SQLITE_CONFIG_MUTEX: // 10 /* sqlite3_mutex_methods* */ + case capi.SQLITE_CONFIG_PAGECACHE: // 7 /* void*, int sz, int N */ + case capi.SQLITE_CONFIG_PCACHE2: // 18 /* sqlite3_pcache_methods2* */ + case capi.SQLITE_CONFIG_PCACHE: // 14 /* no-op */ + case capi.SQLITE_CONFIG_PCACHE_HDRSZ: // 24 /* int *psz */ + case capi.SQLITE_CONFIG_PMASZ: // 25 /* unsigned int szPma */ + case capi.SQLITE_CONFIG_SERIALIZED: // 3 /* nil */ + case capi.SQLITE_CONFIG_SINGLETHREAD: // 1 /* nil */: + case capi.SQLITE_CONFIG_SQLLOG: // 21 /* xSqllog, void* */ + case capi.SQLITE_CONFIG_WIN32_HEAPSIZE: // 23 /* int nByte */ + default: + /* maintenance note: we specifically do not include + SQLITE_CONFIG_ROWID_IN_VIEW here, on the grounds that + it's only for legacy support and no apps written with + this API require that. */ + return capi.SQLITE_NOTFOUND; + } + }; + }/* sqlite3_config() */ + + {/*auto-extension bindings.*/ + const __autoExtFptr = new Set; + + capi.sqlite3_auto_extension = function(fPtr){ + if( fPtr instanceof Function ){ + fPtr = wasm.installFunction('i(ppp)', fPtr); + }else if( 1!==arguments.length || !wasm.isPtr(fPtr) ){ + return capi.SQLITE_MISUSE; + } + const rc = wasm.exports.sqlite3_auto_extension(fPtr); + if( fPtr!==arguments[0] ){ + if(0===rc) __autoExtFptr.add(fPtr); + else wasm.uninstallFunction(fPtr); + } + return rc; + }; + + capi.sqlite3_cancel_auto_extension = function(fPtr){ + /* We do not do an automatic JS-to-WASM function conversion here + because it would be senseless: the converted pointer would + never possibly match an already-installed one. */; + if(!fPtr || 1!==arguments.length || !wasm.isPtr(fPtr)) return 0; + return wasm.exports.sqlite3_cancel_auto_extension(fPtr); + /* Note that it "cannot happen" that a client passes a pointer which + is in __autoExtFptr because __autoExtFptr only contains automatic + conversions created inside sqlite3_auto_extension() and + never exposed to the client. */ + }; + + capi.sqlite3_reset_auto_extension = function(){ + wasm.exports.sqlite3_reset_auto_extension(); + for(const fp of __autoExtFptr) wasm.uninstallFunction(fp); + __autoExtFptr.clear(); + }; + }/* auto-extension */ + + const pKvvfs = capi.sqlite3_vfs_find("kvvfs"); + if( pKvvfs ){/* kvvfs-specific glue */ + if(util.isUIThread()){ + const kvvfsMethods = new capi.sqlite3_kvvfs_methods( + wasm.exports.sqlite3__wasm_kvvfs_methods() + ); + delete capi.sqlite3_kvvfs_methods; + + const kvvfsMakeKey = wasm.exports.sqlite3__wasm_kvvfsMakeKeyOnPstack, + pstack = wasm.pstack; + + const kvvfsStorage = (zClass)=> + ((115/*=='s'*/===wasm.peek(zClass)) + ? sessionStorage : localStorage); + + /** + Implementations for members of the object referred to by + sqlite3__wasm_kvvfs_methods(). We swap out the native + implementations with these, which use localStorage or + sessionStorage for their backing store. + */ + const kvvfsImpls = { + xRead: (zClass, zKey, zBuf, nBuf)=>{ + const stack = pstack.pointer, + astack = wasm.scopedAllocPush(); + try { + const zXKey = kvvfsMakeKey(zClass,zKey); + if(!zXKey) return -3/*OOM*/; + const jKey = wasm.cstrToJs(zXKey); + const jV = kvvfsStorage(zClass).getItem(jKey); + if(!jV) return -1; + const nV = jV.length /* Note that we are relying 100% on v being + ASCII so that jV.length is equal to the + C-string's byte length. */; + if(nBuf<=0) return nV; + else if(1===nBuf){ + wasm.poke(zBuf, 0); + return nV; + } + const zV = wasm.scopedAllocCString(jV); + if(nBuf > nV + 1) nBuf = nV + 1; + wasm.heap8u().copyWithin(zBuf, zV, zV + nBuf - 1); + wasm.poke(zBuf + nBuf - 1, 0); + return nBuf - 1; + }catch(e){ + console.error("kvstorageRead()",e); + return -2; + }finally{ + pstack.restore(stack); + wasm.scopedAllocPop(astack); + } + }, + xWrite: (zClass, zKey, zData)=>{ + const stack = pstack.pointer; + try { + const zXKey = kvvfsMakeKey(zClass,zKey); + if(!zXKey) return 1/*OOM*/; + const jKey = wasm.cstrToJs(zXKey); + kvvfsStorage(zClass).setItem(jKey, wasm.cstrToJs(zData)); + return 0; + }catch(e){ + console.error("kvstorageWrite()",e); + return capi.SQLITE_IOERR; + }finally{ + pstack.restore(stack); + } + }, + xDelete: (zClass, zKey)=>{ + const stack = pstack.pointer; + try { + const zXKey = kvvfsMakeKey(zClass,zKey); + if(!zXKey) return 1/*OOM*/; + kvvfsStorage(zClass).removeItem(wasm.cstrToJs(zXKey)); + return 0; + }catch(e){ + console.error("kvstorageDelete()",e); + return capi.SQLITE_IOERR; + }finally{ + pstack.restore(stack); + } + } + }/*kvvfsImpls*/; + for(const k of Object.keys(kvvfsImpls)){ + kvvfsMethods[kvvfsMethods.memberKey(k)] = + wasm.installFunction( + kvvfsMethods.memberSignature(k), + kvvfsImpls[k] + ); + } + }else{ + /* Worker thread: unregister kvvfs to avoid it being used + for anything other than local/sessionStorage. It "can" + be used that way but it's not really intended to be. */ + capi.sqlite3_vfs_unregister(pKvvfs); + } + }/*pKvvfs*/ + + /* Warn if client-level code makes use of FuncPtrAdapter. */ + wasm.xWrap.FuncPtrAdapter.warnOnUse = true; + + const StructBinder = sqlite3.StructBinder + /* we require a local alias b/c StructBinder is removed from the sqlite3 + object during the final steps of the API cleanup. */; + /** + Installs a StructBinder-bound function pointer member of the + given name and function in the given StructBinder.StructType + target object. + + It creates a WASM proxy for the given function and arranges for + that proxy to be cleaned up when tgt.dispose() is called. Throws + on the slightest hint of error, e.g. tgt is-not-a StructType, + name does not map to a struct-bound member, etc. + + As a special case, if the given function is a pointer, then + `wasm.functionEntry()` is used to validate that it is a known + function. If so, it is used as-is with no extra level of proxying + or cleanup, else an exception is thrown. It is legal to pass a + value of 0, indicating a NULL pointer, with the caveat that 0 + _is_ a legal function pointer in WASM but it will not be accepted + as such _here_. (Justification: the function at address zero must + be one which initially came from the WASM module, not a method we + want to bind to a virtual table or VFS.) + + This function returns a proxy for itself which is bound to tgt + and takes 2 args (name,func). That function returns the same + thing as this one, permitting calls to be chained. + + If called with only 1 arg, it has no side effects but returns a + func with the same signature as described above. + + ACHTUNG: because we cannot generically know how to transform JS + exceptions into result codes, the installed functions do no + automatic catching of exceptions. It is critical, to avoid + undefined behavior in the C layer, that methods mapped via + this function do not throw. The exception, as it were, to that + rule is... + + If applyArgcCheck is true then each JS function (as opposed to + function pointers) gets wrapped in a proxy which asserts that it + is passed the expected number of arguments, throwing if the + argument count does not match expectations. That is only intended + for dev-time usage for sanity checking, and may leave the C + environment in an undefined state. + */ + const installMethod = function callee( + tgt, name, func, applyArgcCheck = callee.installMethodArgcCheck + ){ + if(!(tgt instanceof StructBinder.StructType)){ + toss("Usage error: target object is-not-a StructType."); + }else if(!(func instanceof Function) && !wasm.isPtr(func)){ + toss("Usage errror: expecting a Function or WASM pointer to one."); + } + if(1===arguments.length){ + return (n,f)=>callee(tgt, n, f, applyArgcCheck); + } + if(!callee.argcProxy){ + callee.argcProxy = function(tgt, funcName, func,sig){ + return function(...args){ + if(func.length!==arguments.length){ + toss("Argument mismatch for", + tgt.structInfo.name+"::"+funcName + +": Native signature is:",sig); + } + return func.apply(this, args); + } + }; + /* An ondispose() callback for use with + StructBinder-created types. */ + callee.removeFuncList = function(){ + if(this.ondispose.__removeFuncList){ + this.ondispose.__removeFuncList.forEach( + (v,ndx)=>{ + if('number'===typeof v){ + try{wasm.uninstallFunction(v)} + catch(e){/*ignore*/} + } + /* else it's a descriptive label for the next number in + the list. */ + } + ); + delete this.ondispose.__removeFuncList; + } + }; + }/*static init*/ + const sigN = tgt.memberSignature(name); + if(sigN.length<2){ + toss("Member",name,"does not have a function pointer signature:",sigN); + } + const memKey = tgt.memberKey(name); + const fProxy = (applyArgcCheck && !wasm.isPtr(func)) + /** This middle-man proxy is only for use during development, to + confirm that we always pass the proper number of + arguments. We know that the C-level code will always use the + correct argument count. */ + ? callee.argcProxy(tgt, memKey, func, sigN) + : func; + if(wasm.isPtr(fProxy)){ + if(fProxy && !wasm.functionEntry(fProxy)){ + toss("Pointer",fProxy,"is not a WASM function table entry."); + } + tgt[memKey] = fProxy; + }else{ + const pFunc = wasm.installFunction(fProxy, tgt.memberSignature(name, true)); + tgt[memKey] = pFunc; + if(!tgt.ondispose || !tgt.ondispose.__removeFuncList){ + tgt.addOnDispose('ondispose.__removeFuncList handler', + callee.removeFuncList); + tgt.ondispose.__removeFuncList = []; + } + tgt.ondispose.__removeFuncList.push(memKey, pFunc); + } + return (n,f)=>callee(tgt, n, f, applyArgcCheck); + }/*installMethod*/; + installMethod.installMethodArgcCheck = false; + + /** + Installs methods into the given StructBinder.StructType-type + instance. Each entry in the given methods object must map to a + known member of the given StructType, else an exception will be + triggered. See installMethod() for more details, including the + semantics of the 3rd argument. + + As an exception to the above, if any two or more methods in the + 2nd argument are the exact same function, installMethod() is + _not_ called for the 2nd and subsequent instances, and instead + those instances get assigned the same method pointer which is + created for the first instance. This optimization is primarily to + accommodate special handling of sqlite3_module::xConnect and + xCreate methods. + + On success, returns its first argument. Throws on error. + */ + const installMethods = function( + structInstance, methods, applyArgcCheck = installMethod.installMethodArgcCheck + ){ + const seen = new Map /* map of */; + for(const k of Object.keys(methods)){ + const m = methods[k]; + const prior = seen.get(m); + if(prior){ + const mkey = structInstance.memberKey(k); + structInstance[mkey] = structInstance[structInstance.memberKey(prior)]; + }else{ + installMethod(structInstance, k, m, applyArgcCheck); + seen.set(m, k); + } + } + return structInstance; + }; + + /** + Equivalent to calling installMethod(this,...arguments) with a + first argument of this object. If called with 1 or 2 arguments + and the first is an object, it's instead equivalent to calling + installMethods(this,...arguments). + */ + StructBinder.StructType.prototype.installMethod = function callee( + name, func, applyArgcCheck = installMethod.installMethodArgcCheck + ){ + return (arguments.length < 3 && name && 'object'===typeof name) + ? installMethods(this, ...arguments) + : installMethod(this, ...arguments); + }; + + /** + Equivalent to calling installMethods() with a first argument + of this object. + */ + StructBinder.StructType.prototype.installMethods = function( + methods, applyArgcCheck = installMethod.installMethodArgcCheck + ){ + return installMethods(this, methods, applyArgcCheck); + }; + +}); diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-api-oo1.c-pp.js b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-api-oo1.c-pp.js new file mode 100644 index 0000000000000000000000000000000000000000..3d6a24c77bb73ccff0aa7e1a6c084c934aa2573a --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-api-oo1.c-pp.js @@ -0,0 +1,2170 @@ +//#ifnot omit-oo1 +/* + 2022-07-22 + + The author disclaims copyright to this source code. In place of a + legal notice, here is a blessing: + + * May you do good and not evil. + * May you find forgiveness for yourself and forgive others. + * May you share freely, never taking more than you give. + + *********************************************************************** + + This file contains the so-called OO #1 API wrapper for the sqlite3 + WASM build. It requires that sqlite3-api-glue.js has already run + and it installs its deliverable as globalThis.sqlite3.oo1. +*/ +globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ + const toss = (...args)=>{throw new Error(args.join(' '))}; + const toss3 = (...args)=>{throw new sqlite3.SQLite3Error(...args)}; + + const capi = sqlite3.capi, wasm = sqlite3.wasm, util = sqlite3.util; + /* What follows is colloquially known as "OO API #1". It is a + binding of the sqlite3 API which is designed to be run within + the same thread (main or worker) as the one in which the + sqlite3 WASM binding was initialized. This wrapper cannot use + the sqlite3 binding if, e.g., the wrapper is in the main thread + and the sqlite3 API is in a worker. */ + + /** + In order to keep clients from manipulating, perhaps + inadvertently, the underlying pointer values of DB and Stmt + instances, we'll gate access to them via the `pointer` property + accessor and store their real values in this map. Keys = DB/Stmt + objects, values = pointer values. This also unifies how those are + accessed, for potential use downstream via custom + wasm.xWrap() function signatures which know how to extract + it. + */ + const __ptrMap = new WeakMap(); + /** + Map of DB instances to objects, each object being a map of Stmt + wasm pointers to Stmt objects. + */ + const __stmtMap = new WeakMap(); + + /** If object opts has _its own_ property named p then that + property's value is returned, else dflt is returned. */ + const getOwnOption = (opts, p, dflt)=>{ + const d = Object.getOwnPropertyDescriptor(opts,p); + return d ? d.value : dflt; + }; + + // Documented in DB.checkRc() + const checkSqlite3Rc = function(dbPtr, sqliteResultCode){ + if(sqliteResultCode){ + if(dbPtr instanceof DB) dbPtr = dbPtr.pointer; + toss3( + sqliteResultCode, + "sqlite3 result code",sqliteResultCode+":", + (dbPtr + ? capi.sqlite3_errmsg(dbPtr) + : capi.sqlite3_errstr(sqliteResultCode)) + ); + } + return arguments[0]; + }; + + /** + sqlite3_trace_v2() callback which gets installed by the DB ctor + if its open-flags contain "t". + */ + const __dbTraceToConsole = + wasm.installFunction('i(ippp)', function(t,c,p,x){ + if(capi.SQLITE_TRACE_STMT===t){ + // x == SQL, p == sqlite3_stmt* + console.log("SQL TRACE #"+(++this.counter)+' via sqlite3@'+c+':', + wasm.cstrToJs(x)); + } + }.bind({counter: 0})); + + /** + A map of sqlite3_vfs pointers to SQL code or a callback function + to run when the DB constructor opens a database with the given + VFS. In the latter case, the call signature is + (theDbObject,sqlite3Namespace) and the callback is expected to + throw on error. + */ + const __vfsPostOpenCallback = Object.create(null); + +//#if enable-see + /** + Converts ArrayBuffer or Uint8Array ba into a string of hex + digits. + */ + const byteArrayToHex = function(ba){ + if( ba instanceof ArrayBuffer ){ + ba = new Uint8Array(ba); + } + const li = []; + const digits = "0123456789abcdef"; + for( const d of ba ){ + li.push( digits[(d & 0xf0) >> 4], digits[d & 0x0f] ); + } + return li.join(''); + }; + + /** + Internal helper to apply an SEE key to a just-opened + database. Requires that db be-a DB object which has just been + opened, opt be the options object processed by its ctor, and opt + must have either the key, hexkey, or textkey properties, either + as a string, an ArrayBuffer, or a Uint8Array. + + This is a no-op in non-SEE builds. It throws on error and returns + without side effects if none of the key/textkey/hexkey options + are set. It throws if more than one is set or if any are set to + values of an invalid type. + + Returns true if it applies the key, else an unspecified falsy + value. Note that applying the key does not imply that the key is + correct, only that it was passed on to the db. + */ + const dbCtorApplySEEKey = function(db,opt){ + if( !capi.sqlite3_key_v2 ) return; + let keytype; + let key; + const check = (opt.key ? 1 : 0) + (opt.hexkey ? 1 : 0) + (opt.textkey ? 1 : 0); + if( !check ) return; + else if( check>1 ){ + toss3(capi.SQLITE_MISUSE, + "Only ONE of (key, hexkey, textkey) may be provided."); + } + if( opt.key ){ + /* It is not legal to bind an argument to PRAGMA key=?, so we + convert it to a hexkey... */ + keytype = 'key'; + key = opt.key; + if('string'===typeof key){ + key = new TextEncoder('utf-8').encode(key); + } + if((key instanceof ArrayBuffer) || (key instanceof Uint8Array)){ + key = byteArrayToHex(key); + keytype = 'hexkey'; + }else{ + toss3(capi.SQLITE_MISUSE, + "Invalid value for the 'key' option. Expecting a string,", + "ArrayBuffer, or Uint8Array."); + return; + } + }else if( opt.textkey ){ + /* For textkey we need it to be in string form, so convert it to + a string if it's a byte array... */ + keytype = 'textkey'; + key = opt.textkey; + if(key instanceof ArrayBuffer){ + key = new Uint8Array(key); + } + if(key instanceof Uint8Array){ + key = new TextDecoder('utf-8').decode(key); + }else if('string'!==typeof key){ + toss3(capi.SQLITE_MISUSE, + "Invalid value for the 'textkey' option. Expecting a string,", + "ArrayBuffer, or Uint8Array."); + } + }else if( opt.hexkey ){ + keytype = 'hexkey'; + key = opt.hexkey; + if((key instanceof ArrayBuffer) || (key instanceof Uint8Array)){ + key = byteArrayToHex(key); + }else if('string'!==typeof key){ + toss3(capi.SQLITE_MISUSE, + "Invalid value for the 'hexkey' option. Expecting a string,", + "ArrayBuffer, or Uint8Array."); + } + /* else assume it's valid hex codes */ + }else{ + return; + } + let stmt; + try{ + stmt = db.prepare("PRAGMA "+keytype+"="+util.sqlite3__wasm_qfmt_token(key, 1)); + stmt.step(); + return true; + }finally{ + if(stmt) stmt.finalize(); + } + }; +//#endif enable-see + + /** + A proxy for DB class constructors. It must be called with the + being-construct DB object as its "this". See the DB constructor + for the argument docs. This is split into a separate function + in order to enable simple creation of special-case DB constructors, + e.g. JsStorageDb and OpfsDb. + + Expects to be passed a configuration object with the following + properties: + + - `.filename`: the db filename. It may be a special name like ":memory:" + or "". + + - `.flags`: as documented in the DB constructor. + + - `.vfs`: as documented in the DB constructor. + + It also accepts those as the first 3 arguments. + */ + const dbCtorHelper = function ctor(...args){ + if(!ctor._name2vfs){ + /** + Map special filenames which we handle here (instead of in C) + to some helpful metadata... + + As of 2022-09-20, the C API supports the names :localStorage: + and :sessionStorage: for kvvfs. However, C code cannot + determine (without embedded JS code, e.g. via Emscripten's + EM_JS()) whether the kvvfs is legal in the current browser + context (namely the main UI thread). In order to help client + code fail early on, instead of it being delayed until they + try to read or write a kvvfs-backed db, we'll check for those + names here and throw if they're not legal in the current + context. + */ + ctor._name2vfs = Object.create(null); + const isWorkerThread = ('function'===typeof importScripts/*===running in worker thread*/) + ? (n)=>toss3("The VFS for",n,"is only available in the main window thread.") + : false; + ctor._name2vfs[':localStorage:'] = { + vfs: 'kvvfs', filename: isWorkerThread || (()=>'local') + }; + ctor._name2vfs[':sessionStorage:'] = { + vfs: 'kvvfs', filename: isWorkerThread || (()=>'session') + }; + } + const opt = ctor.normalizeArgs(...args); + let fn = opt.filename, vfsName = opt.vfs, flagsStr = opt.flags; + if(('string'!==typeof fn && 'number'!==typeof fn) + || 'string'!==typeof flagsStr + || (vfsName && ('string'!==typeof vfsName && 'number'!==typeof vfsName))){ + sqlite3.config.error("Invalid DB ctor args",opt,arguments); + toss3("Invalid arguments for DB constructor."); + } + let fnJs = ('number'===typeof fn) ? wasm.cstrToJs(fn) : fn; + const vfsCheck = ctor._name2vfs[fnJs]; + if(vfsCheck){ + vfsName = vfsCheck.vfs; + fn = fnJs = vfsCheck.filename(fnJs); + } + let pDb, oflags = 0; + if( flagsStr.indexOf('c')>=0 ){ + oflags |= capi.SQLITE_OPEN_CREATE | capi.SQLITE_OPEN_READWRITE; + } + if( flagsStr.indexOf('w')>=0 ) oflags |= capi.SQLITE_OPEN_READWRITE; + if( 0===oflags ) oflags |= capi.SQLITE_OPEN_READONLY; + oflags |= capi.SQLITE_OPEN_EXRESCODE; + const stack = wasm.pstack.pointer; + try { + const pPtr = wasm.pstack.allocPtr() /* output (sqlite3**) arg */; + let rc = capi.sqlite3_open_v2(fn, pPtr, oflags, vfsName || 0); + pDb = wasm.peekPtr(pPtr); + checkSqlite3Rc(pDb, rc); + capi.sqlite3_extended_result_codes(pDb, 1); + if(flagsStr.indexOf('t')>=0){ + capi.sqlite3_trace_v2(pDb, capi.SQLITE_TRACE_STMT, + __dbTraceToConsole, pDb); + } + }catch( e ){ + if( pDb ) capi.sqlite3_close_v2(pDb); + throw e; + }finally{ + wasm.pstack.restore(stack); + } + this.filename = fnJs; + __ptrMap.set(this, pDb); + __stmtMap.set(this, Object.create(null)); + try{ +//#if enable-see + dbCtorApplySEEKey(this,opt); +//#endif + // Check for per-VFS post-open SQL/callback... + const pVfs = capi.sqlite3_js_db_vfs(pDb) + || toss3("Internal error: cannot get VFS for new db handle."); + const postInitSql = __vfsPostOpenCallback[pVfs]; + if(postInitSql){ + /** + Reminder: if this db is encrypted and the client did _not_ pass + in the key, any init code will fail, causing the ctor to throw. + We don't actually know whether the db is encrypted, so we cannot + sensibly apply any heuristics which skip the init code only for + encrypted databases for which no key has yet been supplied. + */ + if(postInitSql instanceof Function){ + postInitSql(this, sqlite3); + }else{ + checkSqlite3Rc( + pDb, capi.sqlite3_exec(pDb, postInitSql, 0, 0, 0) + ); + } + } + }catch(e){ + this.close(); + throw e; + } + }; + + /** + Sets a callback which should be called after a db is opened with + the given sqlite3_vfs pointer. The 2nd argument must be a + function, which gets called with + (theOo1DbObject,sqlite3Namespace) at the end of the DB() + constructor. The function must throw on error, in which case the + db is closed and the exception is propagated. This function is + intended only for use by DB subclasses or sqlite3_vfs + implementations. + + Prior to 2024-07-22, it was legal to pass SQL code as the second + argument, but that can interfere with a client's ability to run + pragmas which must be run before anything else, namely (pragma + locking_mode=exclusive) for use with WAL mode. That capability + had only ever been used as an internal detail of the two OPFS + VFSes, and they no longer use it that way. + */ + dbCtorHelper.setVfsPostOpenCallback = function(pVfs, callback){ + if( !(callback instanceof Function)){ + toss3("dbCtorHelper.setVfsPostOpenCallback() should not be used with "+ + "a non-function argument.",arguments); + } + __vfsPostOpenCallback[pVfs] = callback; + }; + + /** + A helper for DB constructors. It accepts either a single + config-style object or up to 3 arguments (filename, dbOpenFlags, + dbVfsName). It returns a new object containing: + + { filename: ..., flags: ..., vfs: ... } + + If passed an object, any additional properties it has are copied + as-is into the new object. + */ + dbCtorHelper.normalizeArgs = function(filename=':memory:',flags = 'c',vfs = null){ + const arg = {}; + if(1===arguments.length && arguments[0] && 'object'===typeof arguments[0]){ + Object.assign(arg, arguments[0]); + if(undefined===arg.flags) arg.flags = 'c'; + if(undefined===arg.vfs) arg.vfs = null; + if(undefined===arg.filename) arg.filename = ':memory:'; + }else{ + arg.filename = filename; + arg.flags = flags; + arg.vfs = vfs; + } + return arg; + }; + /** + The DB class provides a high-level OO wrapper around an sqlite3 + db handle. + + The given db filename must be resolvable using whatever + filesystem layer (virtual or otherwise) is set up for the default + sqlite3 VFS. + + Note that the special sqlite3 db names ":memory:" and "" + (temporary db) have their normal special meanings here and need + not resolve to real filenames, but "" uses an on-storage + temporary database and requires that the VFS support that. + + The second argument specifies the open/create mode for the + database. It must be string containing a sequence of letters (in + any order, but case sensitive) specifying the mode: + + - "c": create if it does not exist, else fail if it does not + exist. Implies the "w" flag. + + - "w": write. Implies "r": a db cannot be write-only. + + - "r": read-only if neither "w" nor "c" are provided, else it + is ignored. + + - "t": enable tracing of SQL executed on this database handle, + sending it to `console.log()`. To disable it later, call + `sqlite3.capi.sqlite3_trace_v2(thisDb.pointer, 0, 0, 0)`. + + If "w" is not provided, the db is implicitly read-only, noting + that "rc" is meaningless + + Any other letters are currently ignored. The default is + "c". These modes are ignored for the special ":memory:" and "" + names and _may_ be ignored altogether for certain VFSes. + + The final argument is analogous to the final argument of + sqlite3_open_v2(): the name of an sqlite3 VFS. Pass a falsy value, + or none at all, to use the default. If passed a value, it must + be the string name of a VFS. + + The constructor optionally (and preferably) takes its arguments + in the form of a single configuration object with the following + properties: + + - `filename`: database file name + - `flags`: open-mode flags + - `vfs`: the VFS fname + +//#if enable-see + + SEE-capable builds optionally support ONE of the following + additional options: + + - `key`, `hexkey`, or `textkey`: encryption key as a string, + ArrayBuffer, or Uint8Array. These flags function as documented + for the SEE pragmas of the same names. Using a byte array for + `hexkey` is equivalent to the same series of hex codes in + string form, so `'666f6f'` is equivalent to + `Uint8Array([0x66,0x6f,0x6f])`. A `textkey` byte array is + assumed to be UTF-8. A `key` string is transformed into a UTF-8 + byte array, and a `key` byte array is transformed into a + `hexkey` with the same bytes. + + In non-SEE builds, these options are ignored. In SEE builds, + `PRAGMA key/textkey/hexkey=X` is executed immediately after + opening the db. If more than one of the options is provided, + or any option has an invalid argument type, an exception is + thrown. + + Note that some DB subclasses may run post-initialization SQL + code, e.g. to set a busy-handler timeout or tweak the page cache + size. Such code is run _after_ the SEE key is applied. If no key + is supplied and the database is encrypted, execution of the + post-initialization SQL will fail, causing the constructor to + throw. + +//#endif enable-see + + The `filename` and `vfs` arguments may be either JS strings or + C-strings allocated via WASM. `flags` is required to be a JS + string (because it's specific to this API, which is specific + to JS). + + For purposes of passing a DB instance to C-style sqlite3 + functions, the DB object's read-only `pointer` property holds its + `sqlite3*` pointer value. That property can also be used to check + whether this DB instance is still open: it will evaluate to + `undefined` after the DB object's close() method is called. + + In the main window thread, the filenames `":localStorage:"` and + `":sessionStorage:"` are special: they cause the db to use either + localStorage or sessionStorage for storing the database using + the kvvfs. If one of these names are used, they trump + any vfs name set in the arguments. + */ + const DB = function(...args){ + dbCtorHelper.apply(this, args); + }; + DB.dbCtorHelper = dbCtorHelper; + + /** + Internal-use enum for mapping JS types to DB-bindable types. + These do not (and need not) line up with the SQLITE_type + values. All values in this enum must be truthy and distinct + but they need not be numbers. + */ + const BindTypes = { + null: 1, + number: 2, + string: 3, + boolean: 4, + blob: 5 + }; + BindTypes['undefined'] == BindTypes.null; + if(wasm.bigIntEnabled){ + BindTypes.bigint = BindTypes.number; + } + + /** + This class wraps sqlite3_stmt. Calling this constructor + directly will trigger an exception. Use DB.prepare() to create + new instances. + + For purposes of passing a Stmt instance to C-style sqlite3 + functions, its read-only `pointer` property holds its `sqlite3_stmt*` + pointer value. + + Other non-function properties include: + + - `db`: the DB object which created the statement. + + - `columnCount`: the number of result columns in the query, or 0 + for queries which cannot return results. This property is a proxy + for sqlite3_column_count() and its use in loops should be avoided + because of the call overhead associated with that. The + `columnCount` is not cached when the Stmt is created because a + schema change made via a separate db connection between this + statement's preparation and when it is stepped may invalidate it. + + - `parameterCount`: the number of bindable parameters in the query. + + As a general rule, most methods of this class will throw if + called on an instance which has been finalized. For brevity's + sake, the method docs do not all repeat this warning. + */ + const Stmt = function(){ + if(BindTypes!==arguments[2]){ + toss3(capi.SQLITE_MISUSE, "Do not call the Stmt constructor directly. Use DB.prepare()."); + } + this.db = arguments[0]; + __ptrMap.set(this, arguments[1]); + this.parameterCount = capi.sqlite3_bind_parameter_count(this.pointer); + }; + + /** Throws if the given DB has been closed, else it is returned. */ + const affirmDbOpen = function(db){ + if(!db.pointer) toss3("DB has been closed."); + return db; + }; + + /** Throws if ndx is not an integer or if it is out of range + for stmt.columnCount, else returns stmt. + + Reminder: this will also fail after the statement is finalized + but the resulting error will be about an out-of-bounds column + index rather than a statement-is-finalized error. + */ + const affirmColIndex = function(stmt,ndx){ + if((ndx !== (ndx|0)) || ndx<0 || ndx>=stmt.columnCount){ + toss3("Column index",ndx,"is out of range."); + } + return stmt; + }; + + /** + Expects to be passed the `arguments` object from DB.exec(). Does + the argument processing/validation, throws on error, and returns + a new object on success: + + { sql: the SQL, opt: optionsObj, cbArg: function} + + The opt object is a normalized copy of any passed to this + function. The sql will be converted to a string if it is provided + in one of the supported non-string formats. + + cbArg is only set if the opt.callback or opt.resultRows are set, + in which case it's a function which expects to be passed the + current Stmt and returns the callback argument of the type + indicated by the input arguments. + */ + const parseExecArgs = function(db, args){ + const out = Object.create(null); + out.opt = Object.create(null); + switch(args.length){ + case 1: + if('string'===typeof args[0] || util.isSQLableTypedArray(args[0])){ + out.sql = args[0]; + }else if(Array.isArray(args[0])){ + out.sql = args[0]; + }else if(args[0] && 'object'===typeof args[0]){ + out.opt = args[0]; + out.sql = out.opt.sql; + } + break; + case 2: + out.sql = args[0]; + out.opt = args[1]; + break; + default: toss3("Invalid argument count for exec()."); + }; + out.sql = util.flexibleString(out.sql); + if('string'!==typeof out.sql){ + toss3("Missing SQL argument or unsupported SQL value type."); + } + const opt = out.opt; + switch(opt.returnValue){ + case 'resultRows': + if(!opt.resultRows) opt.resultRows = []; + out.returnVal = ()=>opt.resultRows; + break; + case 'saveSql': + if(!opt.saveSql) opt.saveSql = []; + out.returnVal = ()=>opt.saveSql; + break; + case undefined: + case 'this': + out.returnVal = ()=>db; + break; + default: + toss3("Invalid returnValue value:",opt.returnValue); + } + if(!opt.callback && !opt.returnValue && undefined!==opt.rowMode){ + if(!opt.resultRows) opt.resultRows = []; + out.returnVal = ()=>opt.resultRows; + } + if(opt.callback || opt.resultRows){ + switch((undefined===opt.rowMode) ? 'array' : opt.rowMode) { + case 'object': + out.cbArg = (stmt,cache)=>{ + if( !cache.columnNames ) cache.columnNames = stmt.getColumnNames([]); + /* https://sqlite.org/forum/forumpost/3632183d2470617d: + conversion of rows to objects (key/val pairs) is + somewhat expensive for large data sets because of the + native-to-JS conversion of the column names. If we + instead cache the names and build objects from that + list of strings, it can run twice as fast. The + difference is not noticeable for small data sets but + becomes human-perceivable when enough rows are + involved. */ + const row = stmt.get([]); + const rv = Object.create(null); + for( const i in cache.columnNames ) rv[cache.columnNames[i]] = row[i]; + return rv; + }; + break; + case 'array': out.cbArg = (stmt)=>stmt.get([]); break; + case 'stmt': + if(Array.isArray(opt.resultRows)){ + toss3("exec(): invalid rowMode for a resultRows array: must", + "be one of 'array', 'object',", + "a result column number, or column name reference."); + } + out.cbArg = (stmt)=>stmt; + break; + default: + if(util.isInt32(opt.rowMode)){ + out.cbArg = (stmt)=>stmt.get(opt.rowMode); + break; + }else if('string'===typeof opt.rowMode + && opt.rowMode.length>1 + && '$'===opt.rowMode[0]){ + /* "$X": fetch column named "X" (case-sensitive!). Prior + to 2022-12-14 ":X" and "@X" were also permitted, but + having so many options is unnecessary and likely to + cause confusion. */ + const $colName = opt.rowMode.substr(1); + out.cbArg = (stmt)=>{ + const rc = stmt.get(Object.create(null))[$colName]; + return (undefined===rc) + ? toss3(capi.SQLITE_NOTFOUND, + "exec(): unknown result column:",$colName) + : rc; + }; + break; + } + toss3("Invalid rowMode:",opt.rowMode); + } + } + return out; + }; + + /** + Internal impl of the DB.selectValue(), selectArray(), and + selectObject() methods. + */ + const __selectFirstRow = (db, sql, bind, ...getArgs)=>{ + const stmt = db.prepare(sql); + try { + const rc = stmt.bind(bind).step() ? stmt.get(...getArgs) : undefined; + stmt.reset(/*for INSERT...RETURNING locking case*/); + return rc; + }finally{ + stmt.finalize(); + } + }; + + /** + Internal impl of the DB.selectArrays() and selectObjects() + methods. + */ + const __selectAll = + (db, sql, bind, rowMode)=>db.exec({ + sql, bind, rowMode, returnValue: 'resultRows' + }); + + /** + Expects to be given a DB instance or an `sqlite3*` pointer (may + be null) and an sqlite3 API result code. If the result code is + not falsy, this function throws an SQLite3Error with an error + message from sqlite3_errmsg(), using db (or, if db is-a DB, + db.pointer) as the db handle, or sqlite3_errstr() if db is + falsy. Note that if it's passed a non-error code like SQLITE_ROW + or SQLITE_DONE, it will still throw but the error string might be + "Not an error." The various non-0 non-error codes need to be + checked for in client code where they are expected. + + The thrown exception's `resultCode` property will be the value of + the second argument to this function. + + If it does not throw, it returns its first argument. + */ + DB.checkRc = (db,resultCode)=>checkSqlite3Rc(db,resultCode); + + DB.prototype = { + /** Returns true if this db handle is open, else false. */ + isOpen: function(){ + return !!this.pointer; + }, + /** Throws if this given DB has been closed, else returns `this`. */ + affirmOpen: function(){ + return affirmDbOpen(this); + }, + /** + Finalizes all open statements and closes this database + connection. This is a no-op if the db has already been + closed. After calling close(), `this.pointer` will resolve to + `undefined`, so that can be used to check whether the db + instance is still opened. + + If this.onclose.before is a function then it is called before + any close-related cleanup. + + If this.onclose.after is a function then it is called after the + db is closed but before auxiliary state like this.filename is + cleared. + + Both onclose handlers are passed this object, with the onclose + object as their "this," noting that the db will have been + closed when onclose.after is called. If this db is not opened + when close() is called, neither of the handlers are called. Any + exceptions the handlers throw are ignored because "destructors + must not throw." + + Note that garbage collection of a db handle, if it happens at + all, will never trigger close(), so onclose handlers are not a + reliable way to implement close-time cleanup or maintenance of + a db. + */ + close: function(){ + if(this.pointer){ + if(this.onclose && (this.onclose.before instanceof Function)){ + try{this.onclose.before(this)} + catch(e){/*ignore*/} + } + const pDb = this.pointer; + Object.keys(__stmtMap.get(this)).forEach((k,s)=>{ + if(s && s.pointer){ + try{s.finalize()} + catch(e){/*ignore*/} + } + }); + __ptrMap.delete(this); + __stmtMap.delete(this); + capi.sqlite3_close_v2(pDb); + if(this.onclose && (this.onclose.after instanceof Function)){ + try{this.onclose.after(this)} + catch(e){/*ignore*/} + } + delete this.filename; + } + }, + /** + Returns the number of changes, as per sqlite3_changes() + (if the first argument is false) or sqlite3_total_changes() + (if it's true). If the 2nd argument is true, it uses + sqlite3_changes64() or sqlite3_total_changes64(), which + will trigger an exception if this build does not have + BigInt support enabled. + */ + changes: function(total=false,sixtyFour=false){ + const p = affirmDbOpen(this).pointer; + if(total){ + return sixtyFour + ? capi.sqlite3_total_changes64(p) + : capi.sqlite3_total_changes(p); + }else{ + return sixtyFour + ? capi.sqlite3_changes64(p) + : capi.sqlite3_changes(p); + } + }, + /** + Similar to the this.filename but returns the + sqlite3_db_filename() value for the given database name, + defaulting to "main". The argument may be either a JS string + or a pointer to a WASM-allocated C-string. + */ + dbFilename: function(dbName='main'){ + return capi.sqlite3_db_filename(affirmDbOpen(this).pointer, dbName); + }, + /** + Returns the name of the given 0-based db number, as documented + for sqlite3_db_name(). + */ + dbName: function(dbNumber=0){ + return capi.sqlite3_db_name(affirmDbOpen(this).pointer, dbNumber); + }, + /** + Returns the name of the sqlite3_vfs used by the given database + of this connection (defaulting to 'main'). The argument may be + either a JS string or a WASM C-string. Returns undefined if the + given db name is invalid. Throws if this object has been + close()d. + */ + dbVfsName: function(dbName=0){ + let rc; + const pVfs = capi.sqlite3_js_db_vfs( + affirmDbOpen(this).pointer, dbName + ); + if(pVfs){ + const v = new capi.sqlite3_vfs(pVfs); + try{ rc = wasm.cstrToJs(v.$zName) } + finally { v.dispose() } + } + return rc; + }, + /** + Compiles the given SQL and returns a prepared Stmt. This is + the only way to create new Stmt objects. Throws on error. + + The given SQL must be a string, a Uint8Array holding SQL, a + WASM pointer to memory holding the NUL-terminated SQL string, + or an array of strings. In the latter case, the array is + concatenated together, with no separators, to form the SQL + string (arrays are often a convenient way to formulate long + statements). If the SQL contains no statements, an + SQLite3Error is thrown. + + Design note: the C API permits empty SQL, reporting it as a 0 + result code and a NULL stmt pointer. Supporting that case here + would cause extra work for all clients: any use of the Stmt API + on such a statement will necessarily throw, so clients would be + required to check `stmt.pointer` after calling `prepare()` in + order to determine whether the Stmt instance is empty or not. + Long-time practice (with other sqlite3 script bindings) + suggests that the empty-prepare case is sufficiently rare that + supporting it here would simply hurt overall usability. + */ + prepare: function(sql){ + affirmDbOpen(this); + const stack = wasm.pstack.pointer; + let ppStmt, pStmt; + try{ + ppStmt = wasm.pstack.alloc(8)/* output (sqlite3_stmt**) arg */; + DB.checkRc(this, capi.sqlite3_prepare_v2(this.pointer, sql, -1, ppStmt, null)); + pStmt = wasm.peekPtr(ppStmt); + } + finally { + wasm.pstack.restore(stack); + } + if(!pStmt) toss3("Cannot prepare empty SQL."); + const stmt = new Stmt(this, pStmt, BindTypes); + __stmtMap.get(this)[pStmt] = stmt; + return stmt; + }, + /** + Executes one or more SQL statements in the form of a single + string. Its arguments must be either (sql,optionsObject) or + (optionsObject). In the latter case, optionsObject.sql must + contain the SQL to execute. By default it returns this object + but that can be changed via the `returnValue` option as + described below. Throws on error. + + If no SQL is provided, or a non-string is provided, an + exception is triggered. Empty SQL, on the other hand, is + simply a no-op. + + The optional options object may contain any of the following + properties: + + - `sql` = the SQL to run (unless it's provided as the first + argument). This must be of type string, Uint8Array, or an array + of strings. In the latter case they're concatenated together + as-is, _with no separator_ between elements, before evaluation. + The array form is often simpler for long hand-written queries. + + - `bind` = a single value valid as an argument for + Stmt.bind(). This is _only_ applied to the _first_ non-empty + statement in the SQL which has any bindable parameters. (Empty + statements are skipped entirely.) + + - `saveSql` = an optional array. If set, the SQL of each + executed statement is appended to this array before the + statement is executed (but after it is prepared - we don't have + the string until after that). Empty SQL statements are elided + but can have odd effects in the output. e.g. SQL of: `"select + 1; -- empty\n; select 2"` will result in an array containing + `["select 1;", "--empty \n; select 2"]`. That's simply how + sqlite3 records the SQL for the 2nd statement. + + ================================================================== + The following options apply _only_ to the _first_ statement + which has a non-zero result column count, regardless of whether + the statement actually produces any result rows. + ================================================================== + + - `columnNames`: if this is an array, the column names of the + result set are stored in this array before the callback (if + any) is triggered (regardless of whether the query produces any + result rows). If no statement has result columns, this value is + unchanged. Achtung: an SQL result may have multiple columns + with identical names. + + - `callback` = a function which gets called for each row of the + result set, but only if that statement has any result rows. The + callback's "this" is the options object, noting that this + function synthesizes one if the caller does not pass one to + exec(). The second argument passed to the callback is always + the current Stmt object, as it's needed if the caller wants to + fetch the column names or some such (noting that they could + also be fetched via `this.columnNames`, if the client provides + the `columnNames` option). If the callback returns a literal + `false` (as opposed to any other falsy value, e.g. an implicit + `undefined` return), any ongoing statement-`step()` iteration + stops without an error. The return value of the callback is + otherwise ignored. + + ACHTUNG: The callback MUST NOT modify the Stmt object. Calling + any of the Stmt.get() variants, Stmt.getColumnName(), or + similar, is legal, but calling step() or finalize() is + not. Member methods which are illegal in this context will + trigger an exception, but clients must also refrain from using + any lower-level (C-style) APIs which might modify the + statement. + + The first argument passed to the callback defaults to an array of + values from the current result row but may be changed with ... + + - `rowMode` = specifies the type of he callback's first argument. + It may be any of... + + A) A string describing what type of argument should be passed + as the first argument to the callback: + + A.1) `'array'` (the default) causes the results of + `stmt.get([])` to be passed to the `callback` and/or appended + to `resultRows`. + + A.2) `'object'` causes the results of + `stmt.get(Object.create(null))` to be passed to the + `callback` and/or appended to `resultRows`. Achtung: an SQL + result may have multiple columns with identical names. In + that case, the right-most column will be the one set in this + object! + + A.3) `'stmt'` causes the current Stmt to be passed to the + callback, but this mode will trigger an exception if + `resultRows` is an array because appending the transient + statement to the array would be downright unhelpful. + + B) An integer, indicating a zero-based column in the result + row. Only that one single value will be passed on. + + C) A string with a minimum length of 2 and leading character of + '$' will fetch the row as an object, extract that one field, + and pass that field's value to the callback. Note that these + keys are case-sensitive so must match the case used in the + SQL. e.g. `"select a A from t"` with a `rowMode` of `'$A'` + would work but `'$a'` would not. A reference to a column not in + the result set will trigger an exception on the first row (as + the check is not performed until rows are fetched). Note also + that `$` is a legal identifier character in JS so need not be + quoted. + + Any other `rowMode` value triggers an exception. + + - `resultRows`: if this is an array, it functions similarly to + the `callback` option: each row of the result set (if any), + with the exception that the `rowMode` 'stmt' is not legal. It + is legal to use both `resultRows` and `callback`, but + `resultRows` is likely much simpler to use for small data sets + and can be used over a WebWorker-style message interface. + exec() throws if `resultRows` is set and `rowMode` is 'stmt'. + + - `returnValue`: is a string specifying what this function + should return: + + A) The default value is (usually) `"this"`, meaning that the + DB object itself should be returned. The exception is if + the caller passes neither of `callback` nor `returnValue` + but does pass an explicit `rowMode` then the default + `returnValue` is `"resultRows"`, described below. + + B) `"resultRows"` means to return the value of the + `resultRows` option. If `resultRows` is not set, this + function behaves as if it were set to an empty array. + + C) `"saveSql"` means to return the value of the + `saveSql` option. If `saveSql` is not set, this + function behaves as if it were set to an empty array. + + Potential TODOs: + + - `bind`: permit an array of arrays/objects to bind. The first + sub-array would act on the first statement which has bindable + parameters (as it does now). The 2nd would act on the next such + statement, etc. + + - `callback` and `resultRows`: permit an array entries with + semantics similar to those described for `bind` above. + + */ + exec: function(/*(sql [,obj]) || (obj)*/){ + affirmDbOpen(this); + const arg = parseExecArgs(this, arguments); + if(!arg.sql){ + return toss3("exec() requires an SQL string."); + } + const opt = arg.opt; + const callback = opt.callback; + const resultRows = + Array.isArray(opt.resultRows) ? opt.resultRows : undefined; + let stmt; + let bind = opt.bind; + let evalFirstResult = !!( + arg.cbArg || opt.columnNames || resultRows + ) /* true to step through the first result-returning statement */; + const stack = wasm.scopedAllocPush(); + const saveSql = Array.isArray(opt.saveSql) ? opt.saveSql : undefined; + try{ + const isTA = util.isSQLableTypedArray(arg.sql) + /* Optimization: if the SQL is a TypedArray we can save some string + conversion costs. */; + /* Allocate the two output pointers (ppStmt, pzTail) and heap + space for the SQL (pSql). When prepare_v2() returns, pzTail + will point to somewhere in pSql. */ + let sqlByteLen = isTA ? arg.sql.byteLength : wasm.jstrlen(arg.sql); + const ppStmt = wasm.scopedAlloc( + /* output (sqlite3_stmt**) arg and pzTail */ + (2 * wasm.ptrSizeof) + (sqlByteLen + 1/* SQL + NUL */) + ); + const pzTail = ppStmt + wasm.ptrSizeof /* final arg to sqlite3_prepare_v2() */; + let pSql = pzTail + wasm.ptrSizeof; + const pSqlEnd = pSql + sqlByteLen; + if(isTA) wasm.heap8().set(arg.sql, pSql); + else wasm.jstrcpy(arg.sql, wasm.heap8(), pSql, sqlByteLen, false); + wasm.poke(pSql + sqlByteLen, 0/*NUL terminator*/); + while(pSql && wasm.peek(pSql, 'i8') + /* Maintenance reminder:^^^ _must_ be 'i8' or else we + will very likely cause an endless loop. What that's + doing is checking for a terminating NUL byte. If we + use i32 or similar then we read 4 bytes, read stuff + around the NUL terminator, and get stuck in and + endless loop at the end of the SQL, endlessly + re-preparing an empty statement. */ ){ + wasm.pokePtr([ppStmt, pzTail], 0); + DB.checkRc(this, capi.sqlite3_prepare_v3( + this.pointer, pSql, sqlByteLen, 0, ppStmt, pzTail + )); + const pStmt = wasm.peekPtr(ppStmt); + pSql = wasm.peekPtr(pzTail); + sqlByteLen = pSqlEnd - pSql; + if(!pStmt) continue; + if(saveSql) saveSql.push(capi.sqlite3_sql(pStmt).trim()); + stmt = new Stmt(this, pStmt, BindTypes); + if(bind && stmt.parameterCount){ + stmt.bind(bind); + bind = null; + } + if(evalFirstResult && stmt.columnCount){ + /* Only forward SELECT-style results for the FIRST query + in the SQL which potentially has them. */ + let gotColNames = Array.isArray( + opt.columnNames + /* As reported in + https://sqlite.org/forum/forumpost/7774b773937cbe0a + we need to delay fetching of the column names until + after the first step() (if we step() at all) because + a schema change between the prepare() and step(), via + another connection, may invalidate the column count + and names. */) ? 0 : 1; + evalFirstResult = false; + if(arg.cbArg || resultRows){ + const cbArgCache = Object.create(null) + /* 2nd arg for arg.cbArg, used by (at least) row-to-object + converter */; + for(; stmt.step(); stmt._lockedByExec = false){ + if(0===gotColNames++){ + stmt.getColumnNames(cbArgCache.columnNames = (opt.columnNames || [])); + } + stmt._lockedByExec = true; + const row = arg.cbArg(stmt,cbArgCache); + if(resultRows) resultRows.push(row); + if(callback && false === callback.call(opt, row, stmt)){ + break; + } + } + stmt._lockedByExec = false; + } + if(0===gotColNames){ + /* opt.columnNames was provided but we visited no result rows */ + stmt.getColumnNames(opt.columnNames); + } + }else{ + stmt.step(); + } + stmt.reset( + /* In order to trigger an exception in the + INSERT...RETURNING locking scenario: + https://sqlite.org/forum/forumpost/36f7a2e7494897df + */).finalize(); + stmt = null; + }/*prepare() loop*/ + }/*catch(e){ + sqlite3.config.warn("DB.exec() is propagating exception",opt,e); + throw e; + }*/finally{ + wasm.scopedAllocPop(stack); + if(stmt){ + delete stmt._lockedByExec; + stmt.finalize(); + } + } + return arg.returnVal(); + }/*exec()*/, + + /** + Creates a new UDF (User-Defined Function) which is accessible + via SQL code. This function may be called in any of the + following forms: + + - (name, function) + - (name, function, optionsObject) + - (name, optionsObject) + - (optionsObject) + + In the final two cases, the function must be defined as the + `callback` property of the options object (optionally called + `xFunc` to align with the C API documentation). In the final + case, the function's name must be the 'name' property. + + The first two call forms can only be used for creating scalar + functions. Creating an aggregate or window function requires + the options-object form (see below for details). + + UDFs can be removed as documented for + sqlite3_create_function_v2() and + sqlite3_create_window_function(), but doing so will "leak" the + JS-created WASM binding of those functions (meaning that their + entries in the WASM indirect function table still + exist). Eliminating that potential leak is a pending TODO. + + On success, returns this object. Throws on error. + + When called from SQL arguments to the UDF, and its result, + will be converted between JS and SQL with as much fidelity as + is feasible, triggering an exception if a type conversion + cannot be determined. The docs for sqlite3_create_function_v2() + describe the conversions in more detail. + + The values set in the options object differ for scalar and + aggregate functions: + + - Scalar: set the `xFunc` function-type property to the UDF + function. + + - Aggregate: set the `xStep` and `xFinal` function-type + properties to the "step" and "final" callbacks for the + aggregate. Do not set the `xFunc` property. + + - Window: set the `xStep`, `xFinal`, `xValue`, and `xInverse` + function-type properties. Do not set the `xFunc` property. + + The options object may optionally have an `xDestroy` + function-type property, as per sqlite3_create_function_v2(). + Its argument will be the WASM-pointer-type value of the `pApp` + property, and this function will throw if `pApp` is defined but + is not null, undefined, or a numeric (WASM pointer) + value. i.e. `pApp`, if set, must be value suitable for use as a + WASM pointer argument, noting that `null` or `undefined` will + translate to 0 for that purpose. + + The options object may contain flags to modify how + the function is defined: + + - `arity`: the number of arguments which SQL calls to this + function expect or require. The default value is `xFunc.length` + or `xStep.length` (i.e. the number of declared parameters it + has) **MINUS 1** (see below for why). As a special case, if the + `length` is 0, its arity is also 0 instead of -1. A negative + arity value means that the function is variadic and may accept + any number of arguments, up to sqlite3's compile-time + limits. sqlite3 will enforce the argument count if is zero or + greater. The callback always receives a pointer to an + `sqlite3_context` object as its first argument. Any arguments + after that are from SQL code. The leading context argument does + _not_ count towards the function's arity. See the docs for + sqlite3.capi.sqlite3_create_function_v2() for why that argument + is needed in the interface. + + The following options-object properties correspond to flags + documented at: + + https://sqlite.org/c3ref/create_function.html + + - `deterministic` = sqlite3.capi.SQLITE_DETERMINISTIC + - `directOnly` = sqlite3.capi.SQLITE_DIRECTONLY + - `innocuous` = sqlite3.capi.SQLITE_INNOCUOUS + + Sidebar: the ability to add new WASM-accessible functions to + the runtime requires that the WASM build is compiled with the + equivalent functionality as that provided by Emscripten's + `-sALLOW_TABLE_GROWTH` flag. + */ + createFunction: function f(name, xFunc, opt){ + const isFunc = (f)=>(f instanceof Function); + switch(arguments.length){ + case 1: /* (optionsObject) */ + opt = name; + name = opt.name; + xFunc = opt.xFunc || 0; + break; + case 2: /* (name, callback|optionsObject) */ + if(!isFunc(xFunc)){ + opt = xFunc; + xFunc = opt.xFunc || 0; + } + break; + case 3: /* name, xFunc, opt */ + break; + default: break; + } + if(!opt) opt = {}; + if('string' !== typeof name){ + toss3("Invalid arguments: missing function name."); + } + let xStep = opt.xStep || 0; + let xFinal = opt.xFinal || 0; + const xValue = opt.xValue || 0; + const xInverse = opt.xInverse || 0; + let isWindow = undefined; + if(isFunc(xFunc)){ + isWindow = false; + if(isFunc(xStep) || isFunc(xFinal)){ + toss3("Ambiguous arguments: scalar or aggregate?"); + } + xStep = xFinal = null; + }else if(isFunc(xStep)){ + if(!isFunc(xFinal)){ + toss3("Missing xFinal() callback for aggregate or window UDF."); + } + xFunc = null; + }else if(isFunc(xFinal)){ + toss3("Missing xStep() callback for aggregate or window UDF."); + }else{ + toss3("Missing function-type properties."); + } + if(false === isWindow){ + if(isFunc(xValue) || isFunc(xInverse)){ + toss3("xValue and xInverse are not permitted for non-window UDFs."); + } + }else if(isFunc(xValue)){ + if(!isFunc(xInverse)){ + toss3("xInverse must be provided if xValue is."); + } + isWindow = true; + }else if(isFunc(xInverse)){ + toss3("xValue must be provided if xInverse is."); + } + const pApp = opt.pApp; + if(undefined!==pApp && + null!==pApp && + (('number'!==typeof pApp) || !util.isInt32(pApp))){ + toss3("Invalid value for pApp property. Must be a legal WASM pointer value."); + } + const xDestroy = opt.xDestroy || 0; + if(xDestroy && !isFunc(xDestroy)){ + toss3("xDestroy property must be a function."); + } + let fFlags = 0 /*flags for sqlite3_create_function_v2()*/; + if(getOwnOption(opt, 'deterministic')) fFlags |= capi.SQLITE_DETERMINISTIC; + if(getOwnOption(opt, 'directOnly')) fFlags |= capi.SQLITE_DIRECTONLY; + if(getOwnOption(opt, 'innocuous')) fFlags |= capi.SQLITE_INNOCUOUS; + name = name.toLowerCase(); + const xArity = xFunc || xStep; + const arity = getOwnOption(opt, 'arity'); + const arityArg = ('number'===typeof arity + ? arity + : (xArity.length ? xArity.length-1/*for pCtx arg*/ : 0)); + let rc; + if( isWindow ){ + rc = capi.sqlite3_create_window_function( + this.pointer, name, arityArg, + capi.SQLITE_UTF8 | fFlags, pApp || 0, + xStep, xFinal, xValue, xInverse, xDestroy); + }else{ + rc = capi.sqlite3_create_function_v2( + this.pointer, name, arityArg, + capi.SQLITE_UTF8 | fFlags, pApp || 0, + xFunc, xStep, xFinal, xDestroy); + } + DB.checkRc(this, rc); + return this; + }/*createFunction()*/, + /** + Prepares the given SQL, step()s it one time, and returns + the value of the first result column. If it has no results, + undefined is returned. + + If passed a second argument, it is treated like an argument + to Stmt.bind(), so may be any type supported by that + function. Passing the undefined value is the same as passing + no value, which is useful when... + + If passed a 3rd argument, it is expected to be one of the + SQLITE_{typename} constants. Passing the undefined value is + the same as not passing a value. + + Throws on error (e.g. malformed SQL). + */ + selectValue: function(sql,bind,asType){ + return __selectFirstRow(this, sql, bind, 0, asType); + }, + + /** + Runs the given query and returns an array of the values from + the first result column of each row of the result set. The 2nd + argument is an optional value for use in a single-argument call + to Stmt.bind(). The 3rd argument may be any value suitable for + use as the 2nd argument to Stmt.get(). If a 3rd argument is + desired but no bind data are needed, pass `undefined` for the 2nd + argument. + + If there are no result rows, an empty array is returned. + */ + selectValues: function(sql,bind,asType){ + const stmt = this.prepare(sql), rc = []; + try { + stmt.bind(bind); + while(stmt.step()) rc.push(stmt.get(0,asType)); + stmt.reset(/*for INSERT...RETURNING locking case*/); + }finally{ + stmt.finalize(); + } + return rc; + }, + + /** + Prepares the given SQL, step()s it one time, and returns an + array containing the values of the first result row. If it has + no results, `undefined` is returned. + + If passed a second argument other than `undefined`, it is + treated like an argument to Stmt.bind(), so may be any type + supported by that function. + + Throws on error (e.g. malformed SQL). + */ + selectArray: function(sql,bind){ + return __selectFirstRow(this, sql, bind, []); + }, + + /** + Prepares the given SQL, step()s it one time, and returns an + object containing the key/value pairs of the first result + row. If it has no results, `undefined` is returned. + + Note that the order of returned object's keys is not guaranteed + to be the same as the order of the fields in the query string. + + If passed a second argument other than `undefined`, it is + treated like an argument to Stmt.bind(), so may be any type + supported by that function. + + Throws on error (e.g. malformed SQL). + */ + selectObject: function(sql,bind){ + return __selectFirstRow(this, sql, bind, {}); + }, + + /** + Runs the given SQL and returns an array of all results, with + each row represented as an array, as per the 'array' `rowMode` + option to `exec()`. An empty result set resolves + to an empty array. The second argument, if any, is treated as + the 'bind' option to a call to exec(). + */ + selectArrays: function(sql,bind){ + return __selectAll(this, sql, bind, 'array'); + }, + + /** + Works identically to selectArrays() except that each value + in the returned array is an object, as per the 'object' `rowMode` + option to `exec()`. + */ + selectObjects: function(sql,bind){ + return __selectAll(this, sql, bind, 'object'); + }, + + /** + Returns the number of currently-opened Stmt handles for this db + handle, or 0 if this DB instance is closed. Note that only + handles prepared via this.prepare() are counted, and not + handles prepared using capi.sqlite3_prepare_v3() (or + equivalent). + */ + openStatementCount: function(){ + return this.pointer ? Object.keys(__stmtMap.get(this)).length : 0; + }, + + /** + Starts a transaction, calls the given callback, and then either + rolls back or commits the savepoint, depending on whether the + callback throws. The callback is passed this db object as its + only argument. On success, returns the result of the + callback. Throws on error. + + Note that transactions may not be nested, so this will throw if + it is called recursively. For nested transactions, use the + savepoint() method or manually manage SAVEPOINTs using exec(). + + If called with 2 arguments, the first must be a keyword which + is legal immediately after a BEGIN statement, e.g. one of + "DEFERRED", "IMMEDIATE", or "EXCLUSIVE". Though the exact list + of supported keywords is not hard-coded here, in order to be + future-compatible, if the argument does not look like a single + keyword then an exception is triggered with a description of + the problem. + */ + transaction: function(/* [beginQualifier,] */callback){ + let opener = 'BEGIN'; + if(arguments.length>1){ + if(/[^a-zA-Z]/.test(arguments[0])){ + toss3(capi.SQLITE_MISUSE, "Invalid argument for BEGIN qualifier."); + } + opener += ' '+arguments[0]; + callback = arguments[1]; + } + affirmDbOpen(this).exec(opener); + try { + const rc = callback(this); + this.exec("COMMIT"); + return rc; + }catch(e){ + this.exec("ROLLBACK"); + throw e; + } + }, + + /** + This works similarly to transaction() but uses sqlite3's SAVEPOINT + feature. This function starts a savepoint (with an unspecified name) + and calls the given callback function, passing it this db object. + If the callback returns, the savepoint is released (committed). If + the callback throws, the savepoint is rolled back. If it does not + throw, it returns the result of the callback. + */ + savepoint: function(callback){ + affirmDbOpen(this).exec("SAVEPOINT oo1"); + try { + const rc = callback(this); + this.exec("RELEASE oo1"); + return rc; + }catch(e){ + this.exec("ROLLBACK to SAVEPOINT oo1; RELEASE SAVEPOINT oo1"); + throw e; + } + }, + + /** + A convenience form of DB.checkRc(this,resultCode). If it does + not throw, it returns this object. + */ + checkRc: function(resultCode){ + return checkSqlite3Rc(this, resultCode); + } + }/*DB.prototype*/; + + + /** Throws if the given Stmt has been finalized, else stmt is + returned. */ + const affirmStmtOpen = function(stmt){ + if(!stmt.pointer) toss3("Stmt has been closed."); + return stmt; + }; + + /** Returns an opaque truthy value from the BindTypes + enum if v's type is a valid bindable type, else + returns a falsy value. As a special case, a value of + undefined is treated as a bind type of null. */ + const isSupportedBindType = function(v){ + let t = BindTypes[(null===v||undefined===v) ? 'null' : typeof v]; + switch(t){ + case BindTypes.boolean: + case BindTypes.null: + case BindTypes.number: + case BindTypes.string: + return t; + case BindTypes.bigint: + if(wasm.bigIntEnabled) return t; + /* else fall through */ + default: + return util.isBindableTypedArray(v) ? BindTypes.blob : undefined; + } + }; + + /** + If isSupportedBindType(v) returns a truthy value, this + function returns that value, else it throws. + */ + const affirmSupportedBindType = function(v){ + //sqlite3.config.log('affirmSupportedBindType',v); + return isSupportedBindType(v) || toss3("Unsupported bind() argument type:",typeof v); + }; + + /** + If key is a number and within range of stmt's bound parameter + count, key is returned. + + If key is not a number then it is checked against named + parameters. If a match is found, its index is returned. + + Else it throws. + */ + const affirmParamIndex = function(stmt,key){ + const n = ('number'===typeof key) + ? key : capi.sqlite3_bind_parameter_index(stmt.pointer, key); + if(0===n || !util.isInt32(n)){ + toss3("Invalid bind() parameter name: "+key); + } + else if(n<1 || n>stmt.parameterCount) toss3("Bind index",key,"is out of range."); + return n; + }; + + /** + If stmt._lockedByExec is truthy, this throws an exception + complaining that the 2nd argument (an operation name, + e.g. "bind()") is not legal while the statement is "locked". + Locking happens before an exec()-like callback is passed a + statement, to ensure that the callback does not mutate or + finalize the statement. If it does not throw, it returns stmt. + */ + const affirmNotLockedByExec = function(stmt,currentOpName){ + if(stmt._lockedByExec){ + toss3("Operation is illegal when statement is locked:",currentOpName); + } + return stmt; + }; + + /** + Binds a single bound parameter value on the given stmt at the + given index (numeric or named) using the given bindType (see + the BindTypes enum) and value. Throws on error. Returns stmt on + success. + */ + const bindOne = function f(stmt,ndx,bindType,val){ + affirmNotLockedByExec(affirmStmtOpen(stmt), 'bind()'); + if(!f._){ + f._tooBigInt = (v)=>toss3( + "BigInt value is too big to store without precision loss:", v + ); + f._ = { + string: function(stmt, ndx, val, asBlob){ + const [pStr, n] = wasm.allocCString(val, true); + const f = asBlob ? capi.sqlite3_bind_blob : capi.sqlite3_bind_text; + return f(stmt.pointer, ndx, pStr, n, capi.SQLITE_WASM_DEALLOC); + } + }; + }/* static init */ + affirmSupportedBindType(val); + ndx = affirmParamIndex(stmt,ndx); + let rc = 0; + switch((null===val || undefined===val) ? BindTypes.null : bindType){ + case BindTypes.null: + rc = capi.sqlite3_bind_null(stmt.pointer, ndx); + break; + case BindTypes.string: + rc = f._.string(stmt, ndx, val, false); + break; + case BindTypes.number: { + let m; + if(util.isInt32(val)) m = capi.sqlite3_bind_int; + else if('bigint'===typeof val){ + if(!util.bigIntFits64(val)){ + f._tooBigInt(val); + }else if(wasm.bigIntEnabled){ + m = capi.sqlite3_bind_int64; + }else if(util.bigIntFitsDouble(val)){ + val = Number(val); + m = capi.sqlite3_bind_double; + }else{ + f._tooBigInt(val); + } + }else{ // !int32, !bigint + val = Number(val); + if(wasm.bigIntEnabled && Number.isInteger(val)){ + m = capi.sqlite3_bind_int64; + }else{ + m = capi.sqlite3_bind_double; + } + } + rc = m(stmt.pointer, ndx, val); + break; + } + case BindTypes.boolean: + rc = capi.sqlite3_bind_int(stmt.pointer, ndx, val ? 1 : 0); + break; + case BindTypes.blob: { + if('string'===typeof val){ + rc = f._.string(stmt, ndx, val, true); + break; + }else if(val instanceof ArrayBuffer){ + val = new Uint8Array(val); + }else if(!util.isBindableTypedArray(val)){ + toss3("Binding a value as a blob requires", + "that it be a string, Uint8Array, Int8Array, or ArrayBuffer."); + } + const pBlob = wasm.alloc(val.byteLength || 1); + wasm.heap8().set(val.byteLength ? val : [0], pBlob) + rc = capi.sqlite3_bind_blob(stmt.pointer, ndx, pBlob, val.byteLength, + capi.SQLITE_WASM_DEALLOC); + break; + } + default: + sqlite3.config.warn("Unsupported bind() argument type:",val); + toss3("Unsupported bind() argument type: "+(typeof val)); + } + if(rc) DB.checkRc(stmt.db.pointer, rc); + stmt._mayGet = false; + return stmt; + }; + + Stmt.prototype = { + /** + "Finalizes" this statement. This is a no-op if the statement + has already been finalized. Returns the result of + sqlite3_finalize() (0 on success, non-0 on error), or the + undefined value if the statement has already been + finalized. Regardless of success or failure, most methods in + this class will throw if called after this is. + + This method always throws if called when it is illegal to do + so. Namely, when triggered via a per-row callback handler of a + DB.exec() call. + */ + finalize: function(){ + if(this.pointer){ + affirmNotLockedByExec(this,'finalize()'); + const rc = capi.sqlite3_finalize(this.pointer); + delete __stmtMap.get(this.db)[this.pointer]; + __ptrMap.delete(this); + delete this._mayGet; + delete this.parameterCount; + delete this._lockedByExec; + delete this.db; + return rc; + } + }, + /** + Clears all bound values. Returns this object. Throws if this + statement has been finalized or if modification of the + statement is currently illegal (e.g. in the per-row callback of + a DB.exec() call). + */ + clearBindings: function(){ + affirmNotLockedByExec(affirmStmtOpen(this), 'clearBindings()') + capi.sqlite3_clear_bindings(this.pointer); + this._mayGet = false; + return this; + }, + /** + Resets this statement so that it may be step()ed again from the + beginning. Returns this object. Throws if this statement has + been finalized, if it may not legally be reset because it is + currently being used from a DB.exec() callback, or if the + underlying call to sqlite3_reset() returns non-0. + + If passed a truthy argument then this.clearBindings() is + also called, otherwise any existing bindings, along with + any memory allocated for them, are retained. + + In versions 3.42.0 and earlier, this function did not throw if + sqlite3_reset() returns non-0, but it was discovered that + throwing (or significant extra client-side code) is necessary + in order to avoid certain silent failure scenarios, as + discussed at: + + https://sqlite.org/forum/forumpost/36f7a2e7494897df + */ + reset: function(alsoClearBinds){ + affirmNotLockedByExec(this,'reset()'); + if(alsoClearBinds) this.clearBindings(); + const rc = capi.sqlite3_reset(affirmStmtOpen(this).pointer); + this._mayGet = false; + checkSqlite3Rc(this.db, rc); + return this; + }, + /** + Binds one or more values to its bindable parameters. It + accepts 1 or 2 arguments: + + If passed a single argument, it must be either an array, an + object, or a value of a bindable type (see below). + + If passed 2 arguments, the first one is the 1-based bind + index or bindable parameter name and the second one must be + a value of a bindable type. + + Bindable value types: + + - null is bound as NULL. + + - undefined as a standalone value is a no-op intended to + simplify certain client-side use cases: passing undefined as + a value to this function will not actually bind anything and + this function will skip confirmation that binding is even + legal. (Those semantics simplify certain client-side uses.) + Conversely, a value of undefined as an array or object + property when binding an array/object (see below) is treated + the same as null. + + - Numbers are bound as either doubles or integers: doubles if + they are larger than 32 bits, else double or int32, depending + on whether they have a fractional part. Booleans are bound as + integer 0 or 1. It is not expected the distinction of binding + doubles which have no fractional parts and integers is + significant for the majority of clients due to sqlite3's data + typing model. If BigInt support is enabled then this routine + will bind BigInt values as 64-bit integers if they'll fit in + 64 bits. If that support disabled, it will store the BigInt + as an int32 or a double if it can do so without loss of + precision. If the BigInt is _too BigInt_ then it will throw. + + - Strings are bound as strings (use bindAsBlob() to force + blob binding). + + - Uint8Array, Int8Array, and ArrayBuffer instances are bound as + blobs. + + If passed an array, each element of the array is bound at + the parameter index equal to the array index plus 1 + (because arrays are 0-based but binding is 1-based). + + If passed an object, each object key is treated as a + bindable parameter name. The object keys _must_ match any + bindable parameter names, including any `$`, `@`, or `:` + prefix. Because `$` is a legal identifier chararacter in + JavaScript, that is the suggested prefix for bindable + parameters: `stmt.bind({$a: 1, $b: 2})`. + + It returns this object on success and throws on + error. Errors include: + + - Any bind index is out of range, a named bind parameter + does not match, or this statement has no bindable + parameters. + + - Any value to bind is of an unsupported type. + + - Passed no arguments or more than two. + + - The statement has been finalized. + */ + bind: function(/*[ndx,] arg*/){ + affirmStmtOpen(this); + let ndx, arg; + switch(arguments.length){ + case 1: ndx = 1; arg = arguments[0]; break; + case 2: ndx = arguments[0]; arg = arguments[1]; break; + default: toss3("Invalid bind() arguments."); + } + if(undefined===arg){ + /* It might seem intuitive to bind undefined as NULL + but this approach simplifies certain client-side + uses when passing on arguments between 2+ levels of + functions. */ + return this; + }else if(!this.parameterCount){ + toss3("This statement has no bindable parameters."); + } + this._mayGet = false; + if(null===arg){ + /* bind NULL */ + return bindOne(this, ndx, BindTypes.null, arg); + } + else if(Array.isArray(arg)){ + /* bind each entry by index */ + if(1!==arguments.length){ + toss3("When binding an array, an index argument is not permitted."); + } + arg.forEach((v,i)=>bindOne(this, i+1, affirmSupportedBindType(v), v)); + return this; + }else if(arg instanceof ArrayBuffer){ + arg = new Uint8Array(arg); + } + if('object'===typeof arg/*null was checked above*/ + && !util.isBindableTypedArray(arg)){ + /* Treat each property of arg as a named bound parameter. */ + if(1!==arguments.length){ + toss3("When binding an object, an index argument is not permitted."); + } + Object.keys(arg) + .forEach(k=>bindOne(this, k, + affirmSupportedBindType(arg[k]), + arg[k])); + return this; + }else{ + return bindOne(this, ndx, affirmSupportedBindType(arg), arg); + } + toss3("Should not reach this point."); + }, + /** + Special case of bind() which binds the given value using the + BLOB binding mechanism instead of the default selected one for + the value. The ndx may be a numbered or named bind index. The + value must be of type string, null/undefined (both get treated + as null), or a TypedArray of a type supported by the bind() + API. This API cannot bind numbers as blobs. + + If passed a single argument, a bind index of 1 is assumed and + the first argument is the value. + */ + bindAsBlob: function(ndx,arg){ + affirmStmtOpen(this); + if(1===arguments.length){ + arg = ndx; + ndx = 1; + } + const t = affirmSupportedBindType(arg); + if(BindTypes.string !== t && BindTypes.blob !== t + && BindTypes.null !== t){ + toss3("Invalid value type for bindAsBlob()"); + } + return bindOne(this, ndx, BindTypes.blob, arg); + }, + /** + Steps the statement one time. If the result indicates that a + row of data is available, a truthy value is returned. If no + row of data is available, a falsy value is returned. Throws on + error. + */ + step: function(){ + affirmNotLockedByExec(this, 'step()'); + const rc = capi.sqlite3_step(affirmStmtOpen(this).pointer); + switch(rc){ + case capi.SQLITE_DONE: return this._mayGet = false; + case capi.SQLITE_ROW: return this._mayGet = true; + default: + this._mayGet = false; + sqlite3.config.warn("sqlite3_step() rc=",rc, + capi.sqlite3_js_rc_str(rc), + "SQL =", capi.sqlite3_sql(this.pointer)); + DB.checkRc(this.db.pointer, rc); + } + }, + /** + Functions exactly like step() except that... + + 1) On success, it calls this.reset() and returns this object. + + 2) On error, it throws and does not call reset(). + + This is intended to simplify constructs like: + + ``` + for(...) { + stmt.bind(...).stepReset(); + } + ``` + + Note that the reset() call makes it illegal to call this.get() + after the step. + */ + stepReset: function(){ + this.step(); + return this.reset(); + }, + /** + Functions like step() except that it calls finalize() on this + statement immediately after stepping, even if the step() call + throws. + + On success, it returns true if the step indicated that a row of + data was available, else it returns a falsy value. + + This is intended to simplify use cases such as: + + ``` + aDb.prepare("insert into foo(a) values(?)").bind(123).stepFinalize(); + ``` + */ + stepFinalize: function(){ + try{ + const rc = this.step(); + this.reset(/*for INSERT...RETURNING locking case*/); + return rc; + }finally{ + try{this.finalize()} + catch(e){/*ignored*/} + } + }, + + /** + Fetches the value from the given 0-based column index of + the current data row, throwing if index is out of range. + + Requires that step() has just returned a truthy value, else + an exception is thrown. + + By default it will determine the data type of the result + automatically. If passed a second argument, it must be one + of the enumeration values for sqlite3 types, which are + defined as members of the sqlite3 module: SQLITE_INTEGER, + SQLITE_FLOAT, SQLITE_TEXT, SQLITE_BLOB. Any other value, + except for undefined, will trigger an exception. Passing + undefined is the same as not passing a value. It is legal + to, e.g., fetch an integer value as a string, in which case + sqlite3 will convert the value to a string. + + If ndx is an array, this function behaves a differently: it + assigns the indexes of the array, from 0 to the number of + result columns, to the values of the corresponding column, + and returns that array. + + If ndx is a plain object, this function behaves even + differentlier: it assigns the properties of the object to + the values of their corresponding result columns and returns + that object. + + Blobs are returned as Uint8Array instances. + + Potential TODO: add type ID SQLITE_JSON, which fetches the + result as a string and passes it (if it's not null) to + JSON.parse(), returning the result of that. Until then, + getJSON() can be used for that. + */ + get: function(ndx,asType){ + if(!affirmStmtOpen(this)._mayGet){ + toss3("Stmt.step() has not (recently) returned true."); + } + if(Array.isArray(ndx)){ + let i = 0; + const n = this.columnCount; + while(i=Number.MIN_SAFE_INTEGER && rc<=Number.MAX_SAFE_INTEGER){ + /* Coerce "normal" number ranges to normal number values, + and only return BigInt-type values for numbers out of this + range. */ + return Number(rc).valueOf(); + } + return rc; + }else{ + const rc = capi.sqlite3_column_double(this.pointer, ndx); + if(rc>Number.MAX_SAFE_INTEGER || rctoss3("The pointer property is read-only.") + } + Object.defineProperty(Stmt.prototype, 'pointer', prop); + Object.defineProperty(DB.prototype, 'pointer', prop); + } + /** + Stmt.columnCount is an interceptor for sqlite3_column_count(). + + This requires an unfortunate performance hit compared to caching + columnCount when the Stmt is created/prepared (as was done in + SQLite <=3.42.0), but is necessary in order to handle certain + corner cases, as described in + https://sqlite.org/forum/forumpost/7774b773937cbe0a. + */ + Object.defineProperty(Stmt.prototype, 'columnCount', { + enumerable: false, + get: function(){return capi.sqlite3_column_count(this.pointer)}, + set: ()=>toss3("The columnCount property is read-only.") + }); + + /** The OO API's public namespace. */ + sqlite3.oo1 = { + DB, + Stmt + }/*oo1 object*/; + + if(util.isUIThread()){ + /** + Functionally equivalent to DB(storageName,'c','kvvfs') except + that it throws if the given storage name is not one of 'local' + or 'session'. + + As of version 3.46, the argument may optionally be an options + object in the form: + + { + filename: 'session'|'local', + ... etc. (all options supported by the DB ctor) + } + + noting that the 'vfs' option supported by main DB + constructor is ignored here: the vfs is always 'kvvfs'. + */ + sqlite3.oo1.JsStorageDb = function(storageName='session'){ + const opt = dbCtorHelper.normalizeArgs(...arguments); + storageName = opt.filename; + if('session'!==storageName && 'local'!==storageName){ + toss3("JsStorageDb db name must be one of 'session' or 'local'."); + } + opt.vfs = 'kvvfs'; + dbCtorHelper.call(this, opt); + }; + const jdb = sqlite3.oo1.JsStorageDb; + jdb.prototype = Object.create(DB.prototype); + /** Equivalent to sqlite3_js_kvvfs_clear(). */ + jdb.clearStorage = capi.sqlite3_js_kvvfs_clear; + /** + Clears this database instance's storage or throws if this + instance has been closed. Returns the number of + database blocks which were cleaned up. + */ + jdb.prototype.clearStorage = function(){ + return jdb.clearStorage(affirmDbOpen(this).filename); + }; + /** Equivalent to sqlite3_js_kvvfs_size(). */ + jdb.storageSize = capi.sqlite3_js_kvvfs_size; + /** + Returns the _approximate_ number of bytes this database takes + up in its storage or throws if this instance has been closed. + */ + jdb.prototype.storageSize = function(){ + return jdb.storageSize(affirmDbOpen(this).filename); + }; + }/*main-window-only bits*/ + +}); +//#else +/* Built with the omit-oo1 flag. */ +//#endif ifnot omit-oo1 diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-api-prologue.js b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-api-prologue.js new file mode 100644 index 0000000000000000000000000000000000000000..c8db3698c164ec4786af796c7059a4b7593fc617 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-api-prologue.js @@ -0,0 +1,2195 @@ +/* + 2022-05-22 + + The author disclaims copyright to this source code. In place of a + legal notice, here is a blessing: + + * May you do good and not evil. + * May you find forgiveness for yourself and forgive others. + * May you share freely, never taking more than you give. + + *********************************************************************** + + This file is intended to be combined at build-time with other + related code, most notably a header and footer which wraps this + whole file into an Emscripten Module.postRun() handler. The sqlite3 + JS API has no hard requirements on Emscripten and does not expose + any Emscripten APIs to clients. It is structured such that its build + can be tweaked to include it in arbitrary WASM environments which + can supply the necessary underlying features (e.g. a POSIX file I/O + layer). + + Main project home page: https://sqlite.org + + Documentation home page: https://sqlite.org/wasm +*/ + +/** + sqlite3ApiBootstrap() is the only global symbol persistently + exposed by this API. It is intended to be called one time at the + end of the API amalgamation process, passed configuration details + for the current environment, and then optionally be removed from + the global object using `delete globalThis.sqlite3ApiBootstrap`. + + This function is not intended for client-level use. It is intended + for use in creating bundles configured for specific WASM + environments. + + This function expects a configuration object, intended to abstract + away details specific to any given WASM environment, primarily so + that it can be used without any direct dependency on + Emscripten. (Note the default values for the config object!) The + config object is only honored the first time this is + called. Subsequent calls ignore the argument and return the same + (configured) object which gets initialized by the first call. This + function will throw if any of the required config options are + missing. + + The config object properties include: + + - `exports`[^1]: the "exports" object for the current WASM + environment. In an Emscripten-based build, this should be set to + `Module['asm']`. + + - `memory`[^1]: optional WebAssembly.Memory object, defaulting to + `exports.memory`. In Emscripten environments this should be set + to `Module.wasmMemory` if the build uses `-sIMPORTED_MEMORY`, or be + left undefined/falsy to default to `exports.memory` when using + WASM-exported memory. + + - `bigIntEnabled`: true if BigInt support is enabled. Defaults to + true if `globalThis.BigInt64Array` is available, else false. Some APIs + will throw exceptions if called without BigInt support, as BigInt + is required for marshalling C-side int64 into and out of JS. + (Sidebar: it is technically possible to add int64 support via + marshalling of int32 pairs, but doing so is unduly invasive.) + + - `allocExportName`: the name of the function, in `exports`, of the + `malloc(3)`-compatible routine for the WASM environment. Defaults + to `"sqlite3_malloc"`. Beware that using any allocator other than + sqlite3_malloc() may require care in certain client-side code + regarding which allocator is uses. Notably, sqlite3_deserialize() + and sqlite3_serialize() can only safely use memory from different + allocators under very specific conditions. The canonical builds + of this API guaranty that `sqlite3_malloc()` is the JS-side + allocator implementation. + + - `deallocExportName`: the name of the function, in `exports`, of + the `free(3)`-compatible routine for the WASM + environment. Defaults to `"sqlite3_free"`. + + - `reallocExportName`: the name of the function, in `exports`, of + the `realloc(3)`-compatible routine for the WASM + environment. Defaults to `"sqlite3_realloc"`. + + - `debug`, `log`, `warn`, and `error` may be functions equivalent + to the like-named methods of the global `console` object. By + default, these map directly to their `console` counterparts, but + can be replaced with (e.g.) empty functions to squelch all such + output. + + - `wasmfsOpfsDir`[^1]: Specifies the "mount point" of the OPFS-backed + filesystem in WASMFS-capable builds. + + + [^1] = This property may optionally be a function, in which case + this function calls that function to fetch the value, + enabling delayed evaluation. + + The returned object is the top-level sqlite3 namespace object. + + + Client code may optionally assign sqlite3ApiBootstrap.defaultConfig + an object-type value before calling sqlite3ApiBootstrap() (without + arguments) in order to tell that call to use this object as its + default config value. The intention of this is to provide + downstream clients with a reasonably flexible approach for plugging + in an environment-suitable configuration without having to define a + new global-scope symbol. + + However, because clients who access this library via an + Emscripten-hosted module will not have an opportunity to call + sqlite3ApiBootstrap() themselves, nor to access it before it is + called, an alternative option for setting the configuration is to + define globalThis.sqlite3ApiConfig to an object. If it is set, it + is used instead of sqlite3ApiBootstrap.defaultConfig if + sqlite3ApiBootstrap() is called without arguments. + + Both sqlite3ApiBootstrap.defaultConfig and + globalThis.sqlite3ApiConfig get deleted by sqlite3ApiBootstrap() + because any changes to them made after that point would have no + useful effect. +*/ +'use strict'; +globalThis.sqlite3ApiBootstrap = function sqlite3ApiBootstrap( + apiConfig = (globalThis.sqlite3ApiConfig || sqlite3ApiBootstrap.defaultConfig) +){ + if(sqlite3ApiBootstrap.sqlite3){ /* already initalized */ + (sqlite3ApiBootstrap.sqlite3.config || console).warn( + "sqlite3ApiBootstrap() called multiple times.", + "Config and external initializers are ignored on calls after the first." + ); + return sqlite3ApiBootstrap.sqlite3; + } + const config = Object.assign(Object.create(null),{ + exports: undefined, + memory: undefined, + bigIntEnabled: (()=>{ + if('undefined'!==typeof Module){ + /* Emscripten module will contain HEAPU64 when built with + -sWASM_BIGINT=1, else it will not. + + As of emsdk 3.1.55, when building in strict mode, HEAPxyz + are only available if _explicitly_ included in the exports, + else they are not. We do not (as of 2024-03-04) use -sSTRICT + for the canonical builds. + */ + if( !!Module.HEAPU64 ) return true; + /* Else fall through and hope for the best. Nobody _really_ + builds this without BigInt support, do they? */ + } + return !!globalThis.BigInt64Array; + })(), + debug: console.debug.bind(console), + warn: console.warn.bind(console), + error: console.error.bind(console), + log: console.log.bind(console), + wasmfsOpfsDir: '/opfs', + /** + useStdAlloc is just for testing allocator discrepancies. The + docs guarantee that this is false in the canonical builds. For + 99% of purposes it doesn't matter which allocators we use, but + it becomes significant with, e.g., sqlite3_deserialize() and + certain wasm.xWrap.resultAdapter()s. + */ + useStdAlloc: false + }, apiConfig || {}); + + Object.assign(config, { + allocExportName: config.useStdAlloc ? 'malloc' : 'sqlite3_malloc', + deallocExportName: config.useStdAlloc ? 'free' : 'sqlite3_free', + reallocExportName: config.useStdAlloc ? 'realloc' : 'sqlite3_realloc' + }, config); + + [ + // If any of these config options are functions, replace them with + // the result of calling that function... + 'exports', 'memory', 'wasmfsOpfsDir' + ].forEach((k)=>{ + if('function' === typeof config[k]){ + config[k] = config[k](); + } + }); + + /** + Eliminate any confusion about whether these config objects may + be used after library initialization by eliminating the outward-facing + objects... + */ + delete globalThis.sqlite3ApiConfig; + delete sqlite3ApiBootstrap.defaultConfig; + + /** + The main sqlite3 binding API gets installed into this object, + mimicking the C API as closely as we can. The numerous members + names with prefixes 'sqlite3_' and 'SQLITE_' behave, insofar as + possible, identically to the C-native counterparts, as documented at: + + https://www.sqlite.org/c3ref/intro.html + + A very few exceptions require an additional level of proxy + function or may otherwise require special attention in the WASM + environment, and all such cases are documented somewhere below + in this file or in sqlite3-api-glue.js. capi members which are + not documented are installed as 1-to-1 proxies for their + C-side counterparts. + */ + const capi = Object.create(null); + /** + Holds state which are specific to the WASM-related + infrastructure and glue code. + + Note that a number of members of this object are injected + dynamically after the api object is fully constructed, so + not all are documented in this file. + */ + const wasm = Object.create(null); + + /** Internal helper for SQLite3Error ctor. */ + const __rcStr = (rc)=>{ + return (capi.sqlite3_js_rc_str && capi.sqlite3_js_rc_str(rc)) + || ("Unknown result code #"+rc); + }; + + /** Internal helper for SQLite3Error ctor. */ + const __isInt = (n)=>'number'===typeof n && n===(n | 0); + + /** + An Error subclass specifically for reporting DB-level errors and + enabling clients to unambiguously identify such exceptions. + The C-level APIs never throw, but some of the higher-level + C-style APIs do and the object-oriented APIs use exceptions + exclusively to report errors. + */ + class SQLite3Error extends Error { + /** + Constructs this object with a message depending on its arguments: + + If its first argument is an integer, it is assumed to be + an SQLITE_... result code and it is passed to + sqlite3.capi.sqlite3_js_rc_str() to stringify it. + + If called with exactly 2 arguments and the 2nd is an object, + that object is treated as the 2nd argument to the parent + constructor. + + The exception's message is created by concatenating its + arguments with a space between each, except for the + two-args-with-an-object form and that the first argument will + get coerced to a string, as described above, if it's an + integer. + + If passed an integer first argument, the error object's + `resultCode` member will be set to the given integer value, + else it will be set to capi.SQLITE_ERROR. + */ + constructor(...args){ + let rc; + if(args.length){ + if(__isInt(args[0])){ + rc = args[0]; + if(1===args.length){ + super(__rcStr(args[0])); + }else{ + const rcStr = __rcStr(rc); + if('object'===typeof args[1]){ + super(rcStr,args[1]); + }else{ + args[0] = rcStr+':'; + super(args.join(' ')); + } + } + }else{ + if(2===args.length && 'object'===typeof args[1]){ + super(...args); + }else{ + super(args.join(' ')); + } + } + } + this.resultCode = rc || capi.SQLITE_ERROR; + this.name = 'SQLite3Error'; + } + }; + + /** + Functionally equivalent to the SQLite3Error constructor but may + be used as part of an expression, e.g.: + + ``` + return someFunction(x) || SQLite3Error.toss(...); + ``` + */ + SQLite3Error.toss = (...args)=>{ + throw new SQLite3Error(...args); + }; + const toss3 = SQLite3Error.toss; + + if(config.wasmfsOpfsDir && !/^\/[^/]+$/.test(config.wasmfsOpfsDir)){ + toss3("config.wasmfsOpfsDir must be falsy or in the form '/dir-name'."); + } + + /** + Returns true if n is a 32-bit (signed) integer, else + false. This is used for determining when we need to switch to + double-type DB operations for integer values in order to keep + more precision. + */ + const isInt32 = (n)=>{ + return ('bigint'!==typeof n /*TypeError: can't convert BigInt to number*/) + && !!(n===(n|0) && n<=2147483647 && n>=-2147483648); + }; + /** + Returns true if the given BigInt value is small enough to fit + into an int64 value, else false. + */ + const bigIntFits64 = function f(b){ + if(!f._max){ + f._max = BigInt("0x7fffffffffffffff"); + f._min = ~f._max; + } + return b >= f._min && b <= f._max; + }; + + /** + Returns true if the given BigInt value is small enough to fit + into an int32, else false. + */ + const bigIntFits32 = (b)=>(b >= (-0x7fffffffn - 1n) && b <= 0x7fffffffn); + + /** + Returns true if the given BigInt value is small enough to fit + into a double value without loss of precision, else false. + */ + const bigIntFitsDouble = function f(b){ + if(!f._min){ + f._min = Number.MIN_SAFE_INTEGER; + f._max = Number.MAX_SAFE_INTEGER; + } + return b >= f._min && b <= f._max; + }; + + /** Returns v if v appears to be a TypedArray, else false. */ + const isTypedArray = (v)=>{ + return (v && v.constructor && isInt32(v.constructor.BYTES_PER_ELEMENT)) ? v : false; + }; + + + /** Internal helper to use in operations which need to distinguish + between TypedArrays which are backed by a SharedArrayBuffer + from those which are not. */ + const __SAB = ('undefined'===typeof SharedArrayBuffer) + ? function(){} : SharedArrayBuffer; + /** Returns true if the given TypedArray object is backed by a + SharedArrayBuffer, else false. */ + const isSharedTypedArray = (aTypedArray)=>(aTypedArray.buffer instanceof __SAB); + + /** + Returns either aTypedArray.slice(begin,end) (if + aTypedArray.buffer is a SharedArrayBuffer) or + aTypedArray.subarray(begin,end) (if it's not). + + This distinction is important for APIs which don't like to + work on SABs, e.g. TextDecoder, and possibly for our + own APIs which work on memory ranges which "might" be + modified by other threads while they're working. + */ + const typedArrayPart = (aTypedArray, begin, end)=>{ + return isSharedTypedArray(aTypedArray) + ? aTypedArray.slice(begin, end) + : aTypedArray.subarray(begin, end); + }; + + /** + Returns true if v appears to be one of our bind()-able TypedArray + types: Uint8Array or Int8Array or ArrayBuffer. Support for + TypedArrays with element sizes >1 is a potential TODO just + waiting on a use case to justify them. Until then, their `buffer` + property can be used to pass them as an ArrayBuffer. If it's not + a bindable array type, a falsy value is returned. + */ + const isBindableTypedArray = (v)=>{ + return v && (v instanceof Uint8Array + || v instanceof Int8Array + || v instanceof ArrayBuffer); + }; + + /** + Returns true if v appears to be one of the TypedArray types + which is legal for holding SQL code (as opposed to binary blobs). + + Currently this is the same as isBindableTypedArray() but it + seems likely that we'll eventually want to add Uint32Array + and friends to the isBindableTypedArray() list but not to the + isSQLableTypedArray() list. + */ + const isSQLableTypedArray = (v)=>{ + return v && (v instanceof Uint8Array + || v instanceof Int8Array + || v instanceof ArrayBuffer); + }; + + /** Returns true if isBindableTypedArray(v) does, else throws with a message + that v is not a supported TypedArray value. */ + const affirmBindableTypedArray = (v)=>{ + return isBindableTypedArray(v) + || toss3("Value is not of a supported TypedArray type."); + }; + + const utf8Decoder = new TextDecoder('utf-8'); + + /** + Uses TextDecoder to decode the given half-open range of the + given TypedArray to a string. This differs from a simple + call to TextDecoder in that it accounts for whether the + first argument is backed by a SharedArrayBuffer or not, + and can work more efficiently if it's not (TextDecoder + refuses to act upon an SAB). + */ + const typedArrayToString = function(typedArray, begin, end){ + return utf8Decoder.decode(typedArrayPart(typedArray, begin,end)); + }; + + /** + If v is-a Array, its join("") result is returned. If + isSQLableTypedArray(v) is true then typedArrayToString(v) is + returned. If it looks like a WASM pointer, wasm.cstrToJs(v) is + returned. Else v is returned as-is. + */ + const flexibleString = function(v){ + if(isSQLableTypedArray(v)){ + return typedArrayToString( + (v instanceof ArrayBuffer) ? new Uint8Array(v) : v + ); + } + else if(Array.isArray(v)) return v.join(""); + else if(wasm.isPtr(v)) v = wasm.cstrToJs(v); + return v; + }; + + /** + An Error subclass specifically for reporting Wasm-level malloc() + failure and enabling clients to unambiguously identify such + exceptions. + */ + class WasmAllocError extends Error { + /** + If called with 2 arguments and the 2nd one is an object, it + behaves like the Error constructor, else it concatenates all + arguments together with a single space between each to + construct an error message string. As a special case, if + called with no arguments then it uses a default error + message. + */ + constructor(...args){ + if(2===args.length && 'object'===typeof args[1]){ + super(...args); + }else if(args.length){ + super(args.join(' ')); + }else{ + super("Allocation failed."); + } + this.resultCode = capi.SQLITE_NOMEM; + this.name = 'WasmAllocError'; + } + }; + /** + Functionally equivalent to the WasmAllocError constructor but may + be used as part of an expression, e.g.: + + ``` + return someAllocatingFunction(x) || WasmAllocError.toss(...); + ``` + */ + WasmAllocError.toss = (...args)=>{ + throw new WasmAllocError(...args); + }; + + Object.assign(capi, { + /** + sqlite3_bind_blob() works exactly like its C counterpart unless + its 3rd argument is one of: + + - JS string: the 3rd argument is converted to a C string, the + 4th argument is ignored, and the C-string's length is used + in its place. + + - Array: converted to a string as defined for "flexible + strings" and then it's treated as a JS string. + + - Int8Array or Uint8Array: wasm.allocFromTypedArray() is used to + conver the memory to the WASM heap. If the 4th argument is + 0 or greater, it is used as-is, otherwise the array's byteLength + value is used. This is an exception to the C API's undefined + behavior for a negative 4th argument, but results are undefined + if the given 4th argument value is greater than the byteLength + of the input array. + + - If it's an ArrayBuffer, it gets wrapped in a Uint8Array and + treated as that type. + + In all of those cases, the final argument (destructor) is + ignored and capi.SQLITE_WASM_DEALLOC is assumed. + + A 3rd argument of `null` is treated as if it were a WASM pointer + of 0. + + If the 3rd argument is neither a WASM pointer nor one of the + above-described types, capi.SQLITE_MISUSE is returned. + + The first argument may be either an `sqlite3_stmt*` WASM + pointer or an sqlite3.oo1.Stmt instance. + + For consistency with the C API, it requires the same number of + arguments. It returns capi.SQLITE_MISUSE if passed any other + argument count. + */ + sqlite3_bind_blob: undefined/*installed later*/, + + /** + sqlite3_bind_text() works exactly like its C counterpart unless + its 3rd argument is one of: + + - JS string: the 3rd argument is converted to a C string, the + 4th argument is ignored, and the C-string's length is used + in its place. + + - Array: converted to a string as defined for "flexible + strings". The 4th argument is ignored and a value of -1 + is assumed. + + - Int8Array or Uint8Array: is assumed to contain UTF-8 text, is + converted to a string. The 4th argument is ignored, replaced + by the array's byteLength value. + + - If it's an ArrayBuffer, it gets wrapped in a Uint8Array and + treated as that type. + + In each of those cases, the final argument (text destructor) is + ignored and capi.SQLITE_WASM_DEALLOC is assumed. + + A 3rd argument of `null` is treated as if it were a WASM pointer + of 0. + + If the 3rd argument is neither a WASM pointer nor one of the + above-described types, capi.SQLITE_MISUSE is returned. + + The first argument may be either an `sqlite3_stmt*` WASM + pointer or an sqlite3.oo1.Stmt instance. + + For consistency with the C API, it requires the same number of + arguments. It returns capi.SQLITE_MISUSE if passed any other + argument count. + + If client code needs to bind partial strings, it needs to + either parcel the string up before passing it in here or it + must pass in a WASM pointer for the 3rd argument and a valid + 4th-argument value, taking care not to pass a value which + truncates a multi-byte UTF-8 character. When passing + WASM-format strings, it is important that the final argument be + valid or unexpected content can result can result, or even a + crash if the application reads past the WASM heap bounds. + */ + sqlite3_bind_text: undefined/*installed later*/, + + /** + sqlite3_create_function_v2() differs from its native + counterpart only in the following ways: + + 1) The fourth argument (`eTextRep`) argument must not specify + any encoding other than sqlite3.SQLITE_UTF8. The JS API does not + currently support any other encoding and likely never + will. This function does not replace that argument on its own + because it may contain other flags. As a special case, if + the bottom 4 bits of that argument are 0, SQLITE_UTF8 is + assumed. + + 2) Any of the four final arguments may be either WASM pointers + (assumed to be function pointers) or JS Functions. In the + latter case, each gets bound to WASM using + sqlite3.capi.wasm.installFunction() and that wrapper is passed + on to the native implementation. + + For consistency with the C API, it requires the same number of + arguments. It returns capi.SQLITE_MISUSE if passed any other + argument count. + + The semantics of JS functions are: + + xFunc: is passed `(pCtx, ...values)`. Its return value becomes + the new SQL function's result. + + xStep: is passed `(pCtx, ...values)`. Its return value is + ignored. + + xFinal: is passed `(pCtx)`. Its return value becomes the new + aggregate SQL function's result. + + xDestroy: is passed `(void*)`. Its return value is ignored. The + pointer passed to it is the one from the 5th argument to + sqlite3_create_function_v2(). + + Note that: + + - `pCtx` in the above descriptions is a `sqlite3_context*`. At + least 99 times out of a hundred, that initial argument will + be irrelevant for JS UDF bindings, but it needs to be there + so that the cases where it _is_ relevant, in particular with + window and aggregate functions, have full access to the + lower-level sqlite3 APIs. + + - When wrapping JS functions, the remaining arguments are passd + to them as positional arguments, not as an array of + arguments, because that allows callback definitions to be + more JS-idiomatic than C-like. For example `(pCtx,a,b)=>a+b` + is more intuitive and legible than + `(pCtx,args)=>args[0]+args[1]`. For cases where an array of + arguments would be more convenient, the callbacks simply need + to be declared like `(pCtx,...args)=>{...}`, in which case + `args` will be an array. + + - If a JS wrapper throws, it gets translated to + sqlite3_result_error() or sqlite3_result_error_nomem(), + depending on whether the exception is an + sqlite3.WasmAllocError object or not. + + - When passing on WASM function pointers, arguments are _not_ + converted or reformulated. They are passed on as-is in raw + pointer form using their native C signatures. Only JS + functions passed in to this routine, and thus wrapped by this + routine, get automatic conversions of arguments and result + values. The routines which perform those conversions are + exposed for client-side use as + sqlite3_create_function_v2.convertUdfArgs() and + sqlite3_create_function_v2.setUdfResult(). sqlite3_create_function() + and sqlite3_create_window_function() have those same methods. + + For xFunc(), xStep(), and xFinal(): + + - When called from SQL, arguments to the UDF, and its result, + will be converted between JS and SQL with as much fidelity as + is feasible, triggering an exception if a type conversion + cannot be determined. Some freedom is afforded to numeric + conversions due to friction between the JS and C worlds: + integers which are larger than 32 bits may be treated as + doubles or BigInts. + + If any JS-side bound functions throw, those exceptions are + intercepted and converted to database-side errors with the + exception of xDestroy(): any exception from it is ignored, + possibly generating a console.error() message. Destructors + must not throw. + + Once installed, there is currently no way to uninstall the + automatically-converted WASM-bound JS functions from WASM. They + can be uninstalled from the database as documented in the C + API, but this wrapper currently has no infrastructure in place + to also free the WASM-bound JS wrappers, effectively resulting + in a memory leak if the client uninstalls the UDF. Improving that + is a potential TODO, but removing client-installed UDFs is rare + in practice. If this factor is relevant for a given client, + they can create WASM-bound JS functions themselves, hold on to their + pointers, and pass the pointers in to here. Later on, they can + free those pointers (using `wasm.uninstallFunction()` or + equivalent). + + C reference: https://www.sqlite.org/c3ref/create_function.html + + Maintenance reminder: the ability to add new + WASM-accessible functions to the runtime requires that the + WASM build is compiled with emcc's `-sALLOW_TABLE_GROWTH` + flag. + */ + sqlite3_create_function_v2: ( + pDb, funcName, nArg, eTextRep, pApp, + xFunc, xStep, xFinal, xDestroy + )=>{/*installed later*/}, + /** + Equivalent to passing the same arguments to + sqlite3_create_function_v2(), with 0 as the final argument. + */ + sqlite3_create_function: ( + pDb, funcName, nArg, eTextRep, pApp, + xFunc, xStep, xFinal + )=>{/*installed later*/}, + /** + The sqlite3_create_window_function() JS wrapper differs from + its native implementation in the exact same way that + sqlite3_create_function_v2() does. The additional function, + xInverse(), is treated identically to xStep() by the wrapping + layer. + */ + sqlite3_create_window_function: ( + pDb, funcName, nArg, eTextRep, pApp, + xStep, xFinal, xValue, xInverse, xDestroy + )=>{/*installed later*/}, + /** + The sqlite3_prepare_v3() binding handles two different uses + with differing JS/WASM semantics: + + 1) sqlite3_prepare_v3(pDb, sqlString, -1, prepFlags, ppStmt , null) + + 2) sqlite3_prepare_v3(pDb, sqlPointer, sqlByteLen, prepFlags, ppStmt, sqlPointerToPointer) + + Note that the SQL length argument (the 3rd argument) must, for + usage (1), always be negative because it must be a byte length + and that value is expensive to calculate from JS (where only + the character length of strings is readily available). It is + retained in this API's interface for code/documentation + compatibility reasons but is currently _always_ ignored. With + usage (2), the 3rd argument is used as-is but is is still + critical that the C-style input string (2nd argument) be + terminated with a 0 byte. + + In usage (1), the 2nd argument must be of type string, + Uint8Array, Int8Array, or ArrayBuffer (all of which are assumed + to hold SQL). If it is, this function assumes case (1) and + calls the underyling C function with the equivalent of: + + (pDb, sqlAsString, -1, prepFlags, ppStmt, null) + + The `pzTail` argument is ignored in this case because its + result is meaningless when a string-type value is passed + through: the string goes through another level of internal + conversion for WASM's sake and the result pointer would refer + to that transient conversion's memory, not the passed-in + string. + + If the sql argument is not a string, it must be a _pointer_ to + a NUL-terminated string which was allocated in the WASM memory + (e.g. using capi.wasm.alloc() or equivalent). In that case, + the final argument may be 0/null/undefined or must be a pointer + to which the "tail" of the compiled SQL is written, as + documented for the C-side sqlite3_prepare_v3(). In case (2), + the underlying C function is called with the equivalent of: + + (pDb, sqlAsPointer, sqlByteLen, prepFlags, ppStmt, pzTail) + + It returns its result and compiled statement as documented in + the C API. Fetching the output pointers (5th and 6th + parameters) requires using `capi.wasm.peek()` (or + equivalent) and the `pzTail` will point to an address relative to + the `sqlAsPointer` value. + + If passed an invalid 2nd argument type, this function will + return SQLITE_MISUSE and sqlite3_errmsg() will contain a string + describing the problem. + + Side-note: if given an empty string, or one which contains only + comments or an empty SQL expression, 0 is returned but the result + output pointer will be NULL. + */ + sqlite3_prepare_v3: (dbPtr, sql, sqlByteLen, prepFlags, + stmtPtrPtr, strPtrPtr)=>{}/*installed later*/, + + /** + Equivalent to calling sqlite3_prapare_v3() with 0 as its 4th argument. + */ + sqlite3_prepare_v2: (dbPtr, sql, sqlByteLen, + stmtPtrPtr,strPtrPtr)=>{}/*installed later*/, + + /** + This binding enables the callback argument to be a JavaScript. + + If the callback is a function, then for the duration of the + sqlite3_exec() call, it installs a WASM-bound function which + acts as a proxy for the given callback. That proxy will also + perform a conversion of the callback's arguments from + `(char**)` to JS arrays of strings. However, for API + consistency's sake it will still honor the C-level callback + parameter order and will call it like: + + `callback(pVoid, colCount, listOfValues, listOfColNames)` + + If the callback is not a JS function then this binding performs + no translation of the callback, but the sql argument is still + converted to a WASM string for the call using the + "string:flexible" argument converter. + */ + sqlite3_exec: (pDb, sql, callback, pVoid, pErrMsg)=>{}/*installed later*/, + + /** + If passed a single argument which appears to be a byte-oriented + TypedArray (Int8Array or Uint8Array), this function treats that + TypedArray as an output target, fetches `theArray.byteLength` + bytes of randomness, and populates the whole array with it. As + a special case, if the array's length is 0, this function + behaves as if it were passed (0,0). When called this way, it + returns its argument, else it returns the `undefined` value. + + If called with any other arguments, they are passed on as-is + to the C API. Results are undefined if passed any incompatible + values. + */ + sqlite3_randomness: (n, outPtr)=>{/*installed later*/}, + }/*capi*/); + + /** + Various internal-use utilities are added here as needed. They + are bound to an object only so that we have access to them in + the differently-scoped steps of the API bootstrapping + process. At the end of the API setup process, this object gets + removed. These are NOT part of the public API. + */ + const util = { + affirmBindableTypedArray, flexibleString, + bigIntFits32, bigIntFits64, bigIntFitsDouble, + isBindableTypedArray, + isInt32, isSQLableTypedArray, isTypedArray, + typedArrayToString, + isUIThread: ()=>(globalThis.window===globalThis && !!globalThis.document), + // is this true for ESM?: 'undefined'===typeof WorkerGlobalScope + isSharedTypedArray, + toss: function(...args){throw new Error(args.join(' '))}, + toss3, + typedArrayPart, + /** + Given a byte array or ArrayBuffer, this function throws if the + lead bytes of that buffer do not hold a SQLite3 database header, + else it returns without side effects. + + Added in 3.44. + */ + affirmDbHeader: function(bytes){ + if(bytes instanceof ArrayBuffer) bytes = new Uint8Array(bytes); + const header = "SQLite format 3"; + if( header.length > bytes.byteLength ){ + toss3("Input does not contain an SQLite3 database header."); + } + for(let i = 0; i < header.length; ++i){ + if( header.charCodeAt(i) !== bytes[i] ){ + toss3("Input does not contain an SQLite3 database header."); + } + } + }, + /** + Given a byte array or ArrayBuffer, this function throws if the + database does not, at a cursory glance, appear to be an SQLite3 + database. It only examines the size and header, but further + checks may be added in the future. + + Added in 3.44. + */ + affirmIsDb: function(bytes){ + if(bytes instanceof ArrayBuffer) bytes = new Uint8Array(bytes); + const n = bytes.byteLength; + if(n<512 || n%512!==0) { + toss3("Byte array size",n,"is invalid for an SQLite3 db."); + } + util.affirmDbHeader(bytes); + } + }/*util*/; + + Object.assign(wasm, { + /** + Emscripten APIs have a deep-seated assumption that all pointers + are 32 bits. We'll remain optimistic that that won't always be + the case and will use this constant in places where we might + otherwise use a hard-coded 4. + */ + ptrSizeof: config.wasmPtrSizeof || 4, + /** + The WASM IR (Intermediate Representation) value for + pointer-type values. It MUST refer to a value type of the + size described by this.ptrSizeof. + */ + ptrIR: config.wasmPtrIR || "i32", + /** + True if BigInt support was enabled via (e.g.) the + Emscripten -sWASM_BIGINT flag, else false. When + enabled, certain 64-bit sqlite3 APIs are enabled which + are not otherwise enabled due to JS/WASM int64 + impedence mismatches. + */ + bigIntEnabled: !!config.bigIntEnabled, + /** + The symbols exported by the WASM environment. + */ + exports: config.exports + || toss3("Missing API config.exports (WASM module exports)."), + + /** + When Emscripten compiles with `-sIMPORTED_MEMORY`, it + initalizes the heap and imports it into wasm, as opposed to + the other way around. In this case, the memory is not + available via this.exports.memory. + */ + memory: config.memory || config.exports['memory'] + || toss3("API config object requires a WebAssembly.Memory object", + "in either config.exports.memory (exported)", + "or config.memory (imported)."), + + /** + The API's primary point of access to the WASM-side memory + allocator. Works like sqlite3_malloc() but throws a + WasmAllocError if allocation fails. It is important that any + code which might pass through the sqlite3 C API NOT throw and + must instead return SQLITE_NOMEM (or equivalent, depending on + the context). + + Very few cases in the sqlite3 JS APIs can result in + client-defined functions propagating exceptions via the C-style + API. Most notably, this applies to WASM-bound JS functions + which are created directly by clients and passed on _as WASM + function pointers_ to functions such as + sqlite3_create_function_v2(). Such bindings created + transparently by this API will automatically use wrappers which + catch exceptions and convert them to appropriate error codes. + + For cases where non-throwing allocation is required, use + this.alloc.impl(), which is direct binding of the + underlying C-level allocator. + + Design note: this function is not named "malloc" primarily + because Emscripten uses that name and we wanted to avoid any + confusion early on in this code's development, when it still + had close ties to Emscripten's glue code. + */ + alloc: undefined/*installed later*/, + + /** + Rarely necessary in JS code, this routine works like + sqlite3_realloc(M,N), where M is either NULL or a pointer + obtained from this function or this.alloc() and N is the number + of bytes to reallocate the block to. Returns a pointer to the + reallocated block or 0 if allocation fails. + + If M is NULL and N is positive, this behaves like + this.alloc(N). If N is 0, it behaves like this.dealloc(). + Results are undefined if N is negative (sqlite3_realloc() + treats that as 0, but if this code is built with a different + allocator it may misbehave with negative values). + + Like this.alloc.impl(), this.realloc.impl() is a direct binding + to the underlying realloc() implementation which does not throw + exceptions, instead returning 0 on allocation error. + */ + realloc: undefined/*installed later*/, + + /** + The API's primary point of access to the WASM-side memory + deallocator. Works like sqlite3_free(). + + Design note: this function is not named "free" for the same + reason that this.alloc() is not called this.malloc(). + */ + dealloc: undefined/*installed later*/ + + /* Many more wasm-related APIs get installed later on. */ + }/*wasm*/); + + /** + wasm.alloc()'s srcTypedArray.byteLength bytes, + populates them with the values from the source + TypedArray, and returns the pointer to that memory. The + returned pointer must eventually be passed to + wasm.dealloc() to clean it up. + + The argument may be a Uint8Array, Int8Array, or ArrayBuffer, + and it throws if passed any other type. + + As a special case, to avoid further special cases where + this is used, if srcTypedArray.byteLength is 0, it + allocates a single byte and sets it to the value + 0. Even in such cases, calls must behave as if the + allocated memory has exactly srcTypedArray.byteLength + bytes. + */ + wasm.allocFromTypedArray = function(srcTypedArray){ + if(srcTypedArray instanceof ArrayBuffer){ + srcTypedArray = new Uint8Array(srcTypedArray); + } + affirmBindableTypedArray(srcTypedArray); + const pRet = wasm.alloc(srcTypedArray.byteLength || 1); + wasm.heapForSize(srcTypedArray.constructor).set( + srcTypedArray.byteLength ? srcTypedArray : [0], pRet + ); + return pRet; + }; + + { + // Set up allocators... + const keyAlloc = config.allocExportName, + keyDealloc = config.deallocExportName, + keyRealloc = config.reallocExportName; + for(const key of [keyAlloc, keyDealloc, keyRealloc]){ + const f = wasm.exports[key]; + if(!(f instanceof Function)) toss3("Missing required exports[",key,"] function."); + } + + wasm.alloc = function f(n){ + return f.impl(n) || WasmAllocError.toss("Failed to allocate",n," bytes."); + }; + wasm.alloc.impl = wasm.exports[keyAlloc]; + wasm.realloc = function f(m,n){ + const m2 = f.impl(m,n); + return n ? (m2 || WasmAllocError.toss("Failed to reallocate",n," bytes.")) : 0; + }; + wasm.realloc.impl = wasm.exports[keyRealloc]; + wasm.dealloc = wasm.exports[keyDealloc]; + } + + /** + Reports info about compile-time options using + sqlite3_compileoption_get() and sqlite3_compileoption_used(). It + has several distinct uses: + + If optName is an array then it is expected to be a list of + compilation options and this function returns an object + which maps each such option to true or false, indicating + whether or not the given option was included in this + build. That object is returned. + + If optName is an object, its keys are expected to be compilation + options and this function sets each entry to true or false, + indicating whether the compilation option was used or not. That + object is returned. + + If passed no arguments then it returns an object mapping + all known compilation options to their compile-time values, + or boolean true if they are defined with no value. This + result, which is relatively expensive to compute, is cached + and returned for future no-argument calls. + + In all other cases it returns true if the given option was + active when when compiling the sqlite3 module, else false. + + Compile-time option names may optionally include their + "SQLITE_" prefix. When it returns an object of all options, + the prefix is elided. + */ + wasm.compileOptionUsed = function f(optName){ + if(!arguments.length){ + if(f._result) return f._result; + else if(!f._opt){ + f._rx = /^([^=]+)=(.+)/; + f._rxInt = /^-?\d+$/; + f._opt = function(opt, rv){ + const m = f._rx.exec(opt); + rv[0] = (m ? m[1] : opt); + rv[1] = m ? (f._rxInt.test(m[2]) ? +m[2] : m[2]) : true; + }; + } + const rc = {}, ov = [0,0]; + let i = 0, k; + while((k = capi.sqlite3_compileoption_get(i++))){ + f._opt(k,ov); + rc[ov[0]] = ov[1]; + } + return f._result = rc; + }else if(Array.isArray(optName)){ + const rc = {}; + optName.forEach((v)=>{ + rc[v] = capi.sqlite3_compileoption_used(v); + }); + return rc; + }else if('object' === typeof optName){ + Object.keys(optName).forEach((k)=> { + optName[k] = capi.sqlite3_compileoption_used(k); + }); + return optName; + } + return ( + 'string'===typeof optName + ) ? !!capi.sqlite3_compileoption_used(optName) : false; + }/*compileOptionUsed()*/; + + /** + sqlite3.wasm.pstack (pseudo-stack) holds a special-case + stack-style allocator intended only for use with _small_ data of + not more than (in total) a few kb in size, managed as if it were + stack-based. + + It has only a single intended usage: + + ``` + const stackPos = pstack.pointer; + try{ + const ptr = pstack.alloc(8); + // ==> pstack.pointer === ptr + const otherPtr = pstack.alloc(8); + // ==> pstack.pointer === otherPtr + ... + }finally{ + pstack.restore(stackPos); + // ==> pstack.pointer === stackPos + } + ``` + + This allocator is much faster than a general-purpose one but is + limited to usage patterns like the one shown above. + + It operates from a static range of memory which lives outside of + space managed by Emscripten's stack-management, so does not + collide with Emscripten-provided stack allocation APIs. The + memory lives in the WASM heap and can be used with routines such + as wasm.poke() and wasm.heap8u().slice(). + */ + wasm.pstack = Object.assign(Object.create(null),{ + /** + Sets the current pstack position to the given pointer. Results + are undefined if the passed-in value did not come from + this.pointer. + */ + restore: wasm.exports.sqlite3__wasm_pstack_restore, + /** + Attempts to allocate the given number of bytes from the + pstack. On success, it zeroes out a block of memory of the + given size, adjusts the pstack pointer, and returns a pointer + to the memory. On error, throws a WasmAllocError. The + memory must eventually be released using restore(). + + If n is a string, it must be a WASM "IR" value in the set + accepted by wasm.sizeofIR(), which is mapped to the size of + that data type. If passed a string not in that set, it throws a + WasmAllocError. + + This method always adjusts the given value to be a multiple + of 8 bytes because failing to do so can lead to incorrect + results when reading and writing 64-bit values from/to the WASM + heap. Similarly, the returned address is always 8-byte aligned. + */ + alloc: function(n){ + if('string'===typeof n && !(n = wasm.sizeofIR(n))){ + WasmAllocError.toss("Invalid value for pstack.alloc(",arguments[0],")"); + } + return wasm.exports.sqlite3__wasm_pstack_alloc(n) + || WasmAllocError.toss("Could not allocate",n, + "bytes from the pstack."); + }, + /** + alloc()'s n chunks, each sz bytes, as a single memory block and + returns the addresses as an array of n element, each holding + the address of one chunk. + + sz may optionally be an IR string accepted by wasm.sizeofIR(). + + Throws a WasmAllocError if allocation fails. + + Example: + + ``` + const [p1, p2, p3] = wasm.pstack.allocChunks(3,4); + ``` + */ + allocChunks: function(n,sz){ + if('string'===typeof sz && !(sz = wasm.sizeofIR(sz))){ + WasmAllocError.toss("Invalid size value for allocChunks(",arguments[1],")"); + } + const mem = wasm.pstack.alloc(n * sz); + const rc = []; + let i = 0, offset = 0; + for(; i < n; ++i, offset += sz) rc.push(mem + offset); + return rc; + }, + /** + A convenience wrapper for allocChunks() which sizes each chunk + as either 8 bytes (safePtrSize is truthy) or wasm.ptrSizeof (if + safePtrSize is falsy). + + How it returns its result differs depending on its first + argument: if it's 1, it returns a single pointer value. If it's + more than 1, it returns the same as allocChunks(). + + When a returned pointers will refer to a 64-bit value, e.g. a + double or int64, and that value must be written or fetched, + e.g. using wasm.poke() or wasm.peek(), it is + important that the pointer in question be aligned to an 8-byte + boundary or else it will not be fetched or written properly and + will corrupt or read neighboring memory. + + However, when all pointers involved point to "small" data, it + is safe to pass a falsy value to save a tiny bit of memory. + */ + allocPtr: (n=1,safePtrSize=true)=>{ + return 1===n + ? wasm.pstack.alloc(safePtrSize ? 8 : wasm.ptrSizeof) + : wasm.pstack.allocChunks(n, safePtrSize ? 8 : wasm.ptrSizeof); + }, + + /** + Records the current pstack position, calls the given function, + passing it the sqlite3 object, then restores the pstack + regardless of whether the function throws. Returns the result + of the call or propagates an exception on error. + + Added in 3.44. + */ + call: function(f){ + const stackPos = wasm.pstack.pointer; + try{ return f(sqlite3) } finally{ + wasm.pstack.restore(stackPos); + } + } + + })/*wasm.pstack*/; + Object.defineProperties(wasm.pstack, { + /** + sqlite3.wasm.pstack.pointer resolves to the current pstack + position pointer. This value is intended _only_ to be saved + for passing to restore(). Writing to this memory, without + first reserving it via wasm.pstack.alloc() and friends, leads + to undefined results. + */ + pointer: { + configurable: false, iterable: true, writeable: false, + get: wasm.exports.sqlite3__wasm_pstack_ptr + //Whether or not a setter as an alternative to restore() is + //clearer or would just lead to confusion is unclear. + //set: wasm.exports.sqlite3__wasm_pstack_restore + }, + /** + sqlite3.wasm.pstack.quota to the total number of bytes + available in the pstack, including any space which is currently + allocated. This value is a compile-time constant. + */ + quota: { + configurable: false, iterable: true, writeable: false, + get: wasm.exports.sqlite3__wasm_pstack_quota + }, + /** + sqlite3.wasm.pstack.remaining resolves to the amount of space + remaining in the pstack. + */ + remaining: { + configurable: false, iterable: true, writeable: false, + get: wasm.exports.sqlite3__wasm_pstack_remaining + } + })/*wasm.pstack properties*/; + + capi.sqlite3_randomness = (...args)=>{ + if(1===args.length && util.isTypedArray(args[0]) + && 1===args[0].BYTES_PER_ELEMENT){ + const ta = args[0]; + if(0===ta.byteLength){ + wasm.exports.sqlite3_randomness(0,0); + return ta; + } + const stack = wasm.pstack.pointer; + try { + let n = ta.byteLength, offset = 0; + const r = wasm.exports.sqlite3_randomness; + const heap = wasm.heap8u(); + const nAlloc = n < 512 ? n : 512; + const ptr = wasm.pstack.alloc(nAlloc); + do{ + const j = (n>nAlloc ? nAlloc : n); + r(j, ptr); + ta.set(typedArrayPart(heap, ptr, ptr+j), offset); + n -= j; + offset += j; + } while(n > 0); + }catch(e){ + console.error("Highly unexpected (and ignored!) "+ + "exception in sqlite3_randomness():",e); + }finally{ + wasm.pstack.restore(stack); + } + return ta; + } + wasm.exports.sqlite3_randomness(...args); + }; + + /** State for sqlite3_wasmfs_opfs_dir(). */ + let __wasmfsOpfsDir = undefined; + /** + If the wasm environment has a WASMFS/OPFS-backed persistent + storage directory, its path is returned by this function. If it + does not then it returns "" (noting that "" is a falsy value). + + The first time this is called, this function inspects the current + environment to determine whether persistence support is available + and, if it is, enables it (if needed). After the first call it + always returns the cached result. + + If the returned string is not empty, any files stored under the + given path (recursively) are housed in OPFS storage. If the + returned string is empty, this particular persistent storage + option is not available on the client. + + Though the mount point name returned by this function is intended + to remain stable, clients should not hard-coded it + anywhere. Always call this function to get the path. + + Note that this function is a no-op in most builds of this + library, as the WASMFS capability requires a custom + build. + */ + capi.sqlite3_wasmfs_opfs_dir = function(){ + if(undefined !== __wasmfsOpfsDir) return __wasmfsOpfsDir; + // If we have no OPFS, there is no persistent dir + const pdir = config.wasmfsOpfsDir; + if(!pdir + || !globalThis.FileSystemHandle + || !globalThis.FileSystemDirectoryHandle + || !globalThis.FileSystemFileHandle){ + return __wasmfsOpfsDir = ""; + } + try{ + if(pdir && 0===wasm.xCallWrapped( + 'sqlite3__wasm_init_wasmfs', 'i32', ['string'], pdir + )){ + return __wasmfsOpfsDir = pdir; + }else{ + return __wasmfsOpfsDir = ""; + } + }catch(e){ + // sqlite3__wasm_init_wasmfs() is not available + return __wasmfsOpfsDir = ""; + } + }; + + /** + Returns true if sqlite3.capi.sqlite3_wasmfs_opfs_dir() is a + non-empty string and the given name starts with (that string + + '/'), else returns false. + */ + capi.sqlite3_wasmfs_filename_is_persistent = function(name){ + const p = capi.sqlite3_wasmfs_opfs_dir(); + return (p && name) ? name.startsWith(p+'/') : false; + }; + + /** + Given an `sqlite3*`, an sqlite3_vfs name, and an optional db name + (defaulting to "main"), returns a truthy value (see below) if + that db uses that VFS, else returns false. If pDb is falsy then + the 3rd argument is ignored and this function returns a truthy + value if the default VFS name matches that of the 2nd + argument. Results are undefined if pDb is truthy but refers to an + invalid pointer. The 3rd argument specifies the database name of + the given database connection to check, defaulting to the main + db. + + The 2nd and 3rd arguments may either be a JS string or a WASM + C-string. If the 2nd argument is a NULL WASM pointer, the default + VFS is assumed. If the 3rd is a NULL WASM pointer, "main" is + assumed. + + The truthy value it returns is a pointer to the `sqlite3_vfs` + object. + + To permit safe use of this function from APIs which may be called + via the C stack (like SQL UDFs), this function does not throw: if + bad arguments cause a conversion error when passing into + wasm-space, false is returned. + */ + capi.sqlite3_js_db_uses_vfs = function(pDb,vfsName,dbName=0){ + try{ + const pK = capi.sqlite3_vfs_find(vfsName); + if(!pK) return false; + else if(!pDb){ + return pK===capi.sqlite3_vfs_find(0) ? pK : false; + }else{ + return pK===capi.sqlite3_js_db_vfs(pDb,dbName) ? pK : false; + } + }catch(e){ + /* Ignore - probably bad args to a wasm-bound function. */ + return false; + } + }; + + /** + Returns an array of the names of all currently-registered sqlite3 + VFSes. + */ + capi.sqlite3_js_vfs_list = function(){ + const rc = []; + let pVfs = capi.sqlite3_vfs_find(0); + while(pVfs){ + const oVfs = new capi.sqlite3_vfs(pVfs); + rc.push(wasm.cstrToJs(oVfs.$zName)); + pVfs = oVfs.$pNext; + oVfs.dispose(); + } + return rc; + }; + + /** + A convenience wrapper around sqlite3_serialize() which serializes + the given `sqlite3*` pointer to a Uint8Array. The first argument + may be either an `sqlite3*` or an sqlite3.oo1.DB instance. + + On success it returns a Uint8Array. If the schema is empty, an + empty array is returned. + + `schema` is the schema to serialize. It may be a WASM C-string + pointer or a JS string. If it is falsy, it defaults to `"main"`. + + On error it throws with a description of the problem. + */ + capi.sqlite3_js_db_export = function(pDb, schema=0){ + pDb = wasm.xWrap.testConvertArg('sqlite3*', pDb); + if(!pDb) toss3('Invalid sqlite3* argument.'); + if(!wasm.bigIntEnabled) toss3('BigInt64 support is not enabled.'); + const scope = wasm.scopedAllocPush(); + let pOut; + try{ + const pSize = wasm.scopedAlloc(8/*i64*/ + wasm.ptrSizeof); + const ppOut = pSize + 8; + /** + Maintenance reminder, since this cost a full hour of grief + and confusion: if the order of pSize/ppOut are reversed in + that memory block, fetching the value of pSize after the + export reads a garbage size because it's not on an 8-byte + memory boundary! + */ + const zSchema = schema + ? (wasm.isPtr(schema) ? schema : wasm.scopedAllocCString(''+schema)) + : 0; + let rc = wasm.exports.sqlite3__wasm_db_serialize( + pDb, zSchema, ppOut, pSize, 0 + ); + if(rc){ + toss3("Database serialization failed with code", + sqlite3.capi.sqlite3_js_rc_str(rc)); + } + pOut = wasm.peekPtr(ppOut); + const nOut = wasm.peek(pSize, 'i64'); + rc = nOut + ? wasm.heap8u().slice(pOut, pOut + Number(nOut)) + : new Uint8Array(); + return rc; + }finally{ + if(pOut) wasm.exports.sqlite3_free(pOut); + wasm.scopedAllocPop(scope); + } + }; + + /** + Given a `sqlite3*` and a database name (JS string or WASM + C-string pointer, which may be 0), returns a pointer to the + sqlite3_vfs responsible for it. If the given db name is null/0, + or not provided, then "main" is assumed. + */ + capi.sqlite3_js_db_vfs = + (dbPointer, dbName=0)=>util.sqlite3__wasm_db_vfs(dbPointer, dbName); + + /** + A thin wrapper around capi.sqlite3_aggregate_context() which + behaves the same except that it throws a WasmAllocError if that + function returns 0. As a special case, if n is falsy it does + _not_ throw if that function returns 0. That special case is + intended for use with xFinal() implementations. + */ + capi.sqlite3_js_aggregate_context = (pCtx, n)=>{ + return capi.sqlite3_aggregate_context(pCtx, n) + || (n ? WasmAllocError.toss("Cannot allocate",n, + "bytes for sqlite3_aggregate_context()") + : 0); + }; + + /** + If the current environment supports the POSIX file APIs, this routine + creates (or overwrites) the given file using those APIs. This is + primarily intended for use in Emscripten-based builds where the POSIX + APIs are transparently proxied by an in-memory virtual filesystem. + It may behave diffrently in other environments. + + The first argument must be either a JS string or WASM C-string + holding the filename. Note that this routine does _not_ create + intermediary directories if the filename has a directory part. + + The 2nd argument may either a valid WASM memory pointer, an + ArrayBuffer, or a Uint8Array. The 3rd must be the length, in + bytes, of the data array to copy. If the 2nd argument is an + ArrayBuffer or Uint8Array and the 3rd is not a positive integer + then the 3rd defaults to the array's byteLength value. + + Results are undefined if data is a WASM pointer and dataLen is + exceeds data's bounds. + + Throws if any arguments are invalid or if creating or writing to + the file fails. + + Added in 3.43 as an alternative for the deprecated + sqlite3_js_vfs_create_file(). + */ + capi.sqlite3_js_posix_create_file = function(filename, data, dataLen){ + let pData; + if(data && wasm.isPtr(data)){ + pData = data; + }else if(data instanceof ArrayBuffer || data instanceof Uint8Array){ + pData = wasm.allocFromTypedArray(data); + if(arguments.length<3 || !util.isInt32(dataLen) || dataLen<0){ + dataLen = data.byteLength; + } + }else{ + SQLite3Error.toss("Invalid 2nd argument for sqlite3_js_posix_create_file()."); + } + try{ + if(!util.isInt32(dataLen) || dataLen<0){ + SQLite3Error.toss("Invalid 3rd argument for sqlite3_js_posix_create_file()."); + } + const rc = util.sqlite3__wasm_posix_create_file(filename, pData, dataLen); + if(rc) SQLite3Error.toss("Creation of file failed with sqlite3 result code", + capi.sqlite3_js_rc_str(rc)); + }finally{ + wasm.dealloc(pData); + } + }; + + /** + Deprecation warning: this function does not work properly in + debug builds of sqlite3 because its out-of-scope use of the + sqlite3_vfs API triggers assertions in the core library. That + was unfortunately not discovered until 2023-08-11. This function + is now deprecated and should not be used in new code. + + Alternative options: + + - "unix" VFS and its variants can get equivalent functionality + with sqlite3_js_posix_create_file(). + + - OPFS: use either sqlite3.oo1.OpfsDb.importDb(), for the "opfs" + VFS, or the importDb() method of the PoolUtil object provided + by the "opfs-sahpool" OPFS (noting that its VFS name may differ + depending on client-side configuration). We cannot proxy those + from here because the former is necessarily asynchronous and + the latter requires information not available to this function. + + Creates a file using the storage appropriate for the given + sqlite3_vfs. The first argument may be a VFS name (JS string + only, NOT a WASM C-string), WASM-managed `sqlite3_vfs*`, or + a capi.sqlite3_vfs instance. Pass 0 (a NULL pointer) to use the + default VFS. If passed a string which does not resolve using + sqlite3_vfs_find(), an exception is thrown. (Note that a WASM + C-string is not accepted because it is impossible to + distinguish from a C-level `sqlite3_vfs*`.) + + The second argument, the filename, must be a JS or WASM C-string. + + The 3rd may either be falsy, a valid WASM memory pointer, an + ArrayBuffer, or a Uint8Array. The 4th must be the length, in + bytes, of the data array to copy. If the 3rd argument is an + ArrayBuffer or Uint8Array and the 4th is not a positive integer + then the 4th defaults to the array's byteLength value. + + If data is falsy then a file is created with dataLen bytes filled + with uninitialized data (whatever truncate() leaves there). If + data is not falsy then a file is created or truncated and it is + filled with the first dataLen bytes of the data source. + + Throws if any arguments are invalid or if creating or writing to + the file fails. + + Note that most VFSes do _not_ automatically create directory + parts of filenames, nor do all VFSes have a concept of + directories. If the given filename is not valid for the given + VFS, an exception will be thrown. This function exists primarily + to assist in implementing file-upload capability, with the caveat + that clients must have some idea of the VFS into which they want + to upload and that VFS must support the operation. + + VFS-specific notes: + + - "memdb": results are undefined. + + - "kvvfs": will fail with an I/O error due to strict internal + requirments of that VFS's xTruncate(). + + - "unix" and related: will use the WASM build's equivalent of the + POSIX I/O APIs. This will work so long as neither a specific + VFS nor the WASM environment imposes requirements which break it. + + - "opfs": uses OPFS storage and creates directory parts of the + filename. It can only be used to import an SQLite3 database + file and will fail if given anything else. + */ + capi.sqlite3_js_vfs_create_file = function(vfs, filename, data, dataLen){ + config.warn("sqlite3_js_vfs_create_file() is deprecated and", + "should be avoided because it can lead to C-level crashes.", + "See its documentation for alternative options."); + let pData; + if(data){ + if(wasm.isPtr(data)){ + pData = data; + }else if(data instanceof ArrayBuffer){ + data = new Uint8Array(data); + } + if(data instanceof Uint8Array){ + pData = wasm.allocFromTypedArray(data); + if(arguments.length<4 || !util.isInt32(dataLen) || dataLen<0){ + dataLen = data.byteLength; + } + }else{ + SQLite3Error.toss("Invalid 3rd argument type for sqlite3_js_vfs_create_file()."); + } + }else{ + pData = 0; + } + if(!util.isInt32(dataLen) || dataLen<0){ + wasm.dealloc(pData); + SQLite3Error.toss("Invalid 4th argument for sqlite3_js_vfs_create_file()."); + } + try{ + const rc = util.sqlite3__wasm_vfs_create_file(vfs, filename, pData, dataLen); + if(rc) SQLite3Error.toss("Creation of file failed with sqlite3 result code", + capi.sqlite3_js_rc_str(rc)); + }finally{ + wasm.dealloc(pData); + } + }; + + /** + Converts SQL input from a variety of convenient formats + to plain strings. + + If v is a string, it is returned as-is. If it is-a Array, its + join("") result is returned. If is is a Uint8Array, Int8Array, + or ArrayBuffer, it is assumed to hold UTF-8-encoded text and is + decoded to a string. If it looks like a WASM pointer, + wasm.cstrToJs(sql) is returned. Else undefined is returned. + + Added in 3.44 + */ + capi.sqlite3_js_sql_to_string = (sql)=>{ + if('string' === typeof sql){ + return sql; + } + const x = flexibleString(v); + return x===v ? undefined : x; + } + + if( util.isUIThread() ){ + /* Features specific to the main window thread... */ + + /** + Internal helper for sqlite3_js_kvvfs_clear() and friends. + Its argument should be one of ('local','session',""). + */ + const __kvvfsInfo = function(which){ + const rc = Object.create(null); + rc.prefix = 'kvvfs-'+which; + rc.stores = []; + if('session'===which || ""===which) rc.stores.push(globalThis.sessionStorage); + if('local'===which || ""===which) rc.stores.push(globalThis.localStorage); + return rc; + }; + + /** + Clears all storage used by the kvvfs DB backend, deleting any + DB(s) stored there. Its argument must be either 'session', + 'local', or "". In the first two cases, only sessionStorage + resp. localStorage is cleared. If it's an empty string (the + default) then both are cleared. Only storage keys which match + the pattern used by kvvfs are cleared: any other client-side + data are retained. + + This function is only available in the main window thread. + + Returns the number of entries cleared. + */ + capi.sqlite3_js_kvvfs_clear = function(which=""){ + let rc = 0; + const kvinfo = __kvvfsInfo(which); + kvinfo.stores.forEach((s)=>{ + const toRm = [] /* keys to remove */; + let i; + for( i = 0; i < s.length; ++i ){ + const k = s.key(i); + if(k.startsWith(kvinfo.prefix)) toRm.push(k); + } + toRm.forEach((kk)=>s.removeItem(kk)); + rc += toRm.length; + }); + return rc; + }; + + /** + This routine guesses the approximate amount of + window.localStorage and/or window.sessionStorage in use by the + kvvfs database backend. Its argument must be one of + ('session', 'local', ""). In the first two cases, only + sessionStorage resp. localStorage is counted. If it's an empty + string (the default) then both are counted. Only storage keys + which match the pattern used by kvvfs are counted. The returned + value is the "length" value of every matching key and value, + noting that JavaScript stores each character in 2 bytes. + + Note that the returned size is not authoritative from the + perspective of how much data can fit into localStorage and + sessionStorage, as the precise algorithms for determining + those limits are unspecified and may include per-entry + overhead invisible to clients. + */ + capi.sqlite3_js_kvvfs_size = function(which=""){ + let sz = 0; + const kvinfo = __kvvfsInfo(which); + kvinfo.stores.forEach((s)=>{ + let i; + for(i = 0; i < s.length; ++i){ + const k = s.key(i); + if(k.startsWith(kvinfo.prefix)){ + sz += k.length; + sz += s.getItem(k).length; + } + } + }); + return sz * 2 /* because JS uses 2-byte char encoding */; + }; + + }/* main-window-only bits */ + + /** + Wraps all known variants of the C-side variadic + sqlite3_db_config(). + + Full docs: https://sqlite.org/c3ref/db_config.html + + Returns capi.SQLITE_MISUSE if op is not a valid operation ID. + + The variants which take `(int, int*)` arguments treat a + missing or falsy pointer argument as 0. + */ + capi.sqlite3_db_config = function(pDb, op, ...args){ + if(!this.s){ + this.s = wasm.xWrap('sqlite3__wasm_db_config_s','int', + ['sqlite3*', 'int', 'string:static'] + /* MAINDBNAME requires a static string */); + this.pii = wasm.xWrap('sqlite3__wasm_db_config_pii', 'int', + ['sqlite3*', 'int', '*','int', 'int']); + this.ip = wasm.xWrap('sqlite3__wasm_db_config_ip','int', + ['sqlite3*', 'int', 'int','*']); + } + switch(op){ + case capi.SQLITE_DBCONFIG_ENABLE_FKEY: + case capi.SQLITE_DBCONFIG_ENABLE_TRIGGER: + case capi.SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER: + case capi.SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION: + case capi.SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE: + case capi.SQLITE_DBCONFIG_ENABLE_QPSG: + case capi.SQLITE_DBCONFIG_TRIGGER_EQP: + case capi.SQLITE_DBCONFIG_RESET_DATABASE: + case capi.SQLITE_DBCONFIG_DEFENSIVE: + case capi.SQLITE_DBCONFIG_WRITABLE_SCHEMA: + case capi.SQLITE_DBCONFIG_LEGACY_ALTER_TABLE: + case capi.SQLITE_DBCONFIG_DQS_DML: + case capi.SQLITE_DBCONFIG_DQS_DDL: + case capi.SQLITE_DBCONFIG_ENABLE_VIEW: + case capi.SQLITE_DBCONFIG_LEGACY_FILE_FORMAT: + case capi.SQLITE_DBCONFIG_TRUSTED_SCHEMA: + case capi.SQLITE_DBCONFIG_STMT_SCANSTATUS: + case capi.SQLITE_DBCONFIG_REVERSE_SCANORDER: + return this.ip(pDb, op, args[0], args[1] || 0); + case capi.SQLITE_DBCONFIG_LOOKASIDE: + return this.pii(pDb, op, args[0], args[1], args[2]); + case capi.SQLITE_DBCONFIG_MAINDBNAME: + return this.s(pDb, op, args[0]); + default: + return capi.SQLITE_MISUSE; + } + }.bind(Object.create(null)); + + /** + Given a (sqlite3_value*), this function attempts to convert it + to an equivalent JS value with as much fidelity as feasible and + return it. + + By default it throws if it cannot determine any sensible + conversion. If passed a falsy second argument, it instead returns + `undefined` if no suitable conversion is found. Note that there + is no conversion from SQL to JS which results in the `undefined` + value, so `undefined` has an unambiguous meaning here. It will + always throw a WasmAllocError if allocating memory for a + conversion fails. + + Caveats: + + - It does not support sqlite3_value_to_pointer() conversions + because those require a type name string which this function + does not have and cannot sensibly be given at the level of the + API where this is used (e.g. automatically converting UDF + arguments). Clients using sqlite3_value_to_pointer(), and its + related APIs, will need to manage those themselves. + */ + capi.sqlite3_value_to_js = function(pVal,throwIfCannotConvert=true){ + let arg; + const valType = capi.sqlite3_value_type(pVal); + switch(valType){ + case capi.SQLITE_INTEGER: + if(wasm.bigIntEnabled){ + arg = capi.sqlite3_value_int64(pVal); + if(util.bigIntFitsDouble(arg)) arg = Number(arg); + } + else arg = capi.sqlite3_value_double(pVal)/*yes, double, for larger integers*/; + break; + case capi.SQLITE_FLOAT: + arg = capi.sqlite3_value_double(pVal); + break; + case capi.SQLITE_TEXT: + arg = capi.sqlite3_value_text(pVal); + break; + case capi.SQLITE_BLOB:{ + const n = capi.sqlite3_value_bytes(pVal); + const pBlob = capi.sqlite3_value_blob(pVal); + if(n && !pBlob) sqlite3.WasmAllocError.toss( + "Cannot allocate memory for blob argument of",n,"byte(s)" + ); + arg = n ? wasm.heap8u().slice(pBlob, pBlob + Number(n)) : null; + break; + } + case capi.SQLITE_NULL: + arg = null; break; + default: + if(throwIfCannotConvert){ + toss3(capi.SQLITE_MISMATCH, + "Unhandled sqlite3_value_type():",valType); + } + arg = undefined; + } + return arg; + }; + + /** + Requires a C-style array of `sqlite3_value*` objects and the + number of entries in that array. Returns a JS array containing + the results of passing each C array entry to + sqlite3_value_to_js(). The 3rd argument to this function is + passed on as the 2nd argument to that one. + */ + capi.sqlite3_values_to_js = function(argc,pArgv,throwIfCannotConvert=true){ + let i; + const tgt = []; + for(i = 0; i < argc; ++i){ + /** + Curiously: despite ostensibly requiring 8-byte + alignment, the pArgv array is parcelled into chunks of + 4 bytes (1 pointer each). The values those point to + have 8-byte alignment but the individual argv entries + do not. + */ + tgt.push(capi.sqlite3_value_to_js( + wasm.peekPtr(pArgv + (wasm.ptrSizeof * i)), + throwIfCannotConvert + )); + } + return tgt; + }; + + /** + Calls either sqlite3_result_error_nomem(), if e is-a + WasmAllocError, or sqlite3_result_error(). In the latter case, + the second argument is coerced to a string to create the error + message. + + The first argument is a (sqlite3_context*). Returns void. + Does not throw. + */ + capi.sqlite3_result_error_js = function(pCtx,e){ + if(e instanceof WasmAllocError){ + capi.sqlite3_result_error_nomem(pCtx); + }else{ + /* Maintenance reminder: ''+e, rather than e.message, + will prefix e.message with e.name, so it includes + the exception's type name in the result. */; + capi.sqlite3_result_error(pCtx, ''+e, -1); + } + }; + + /** + This function passes its 2nd argument to one of the + sqlite3_result_xyz() routines, depending on the type of that + argument: + + - If (val instanceof Error), this function passes it to + sqlite3_result_error_js(). + - `null`: `sqlite3_result_null()` + - `boolean`: `sqlite3_result_int()` with a value of 0 or 1. + - `number`: `sqlite3_result_int()`, `sqlite3_result_int64()`, or + `sqlite3_result_double()`, depending on the range of the number + and whether or not int64 support is enabled. + - `bigint`: similar to `number` but will trigger an error if the + value is too big to store in an int64. + - `string`: `sqlite3_result_text()` + - Uint8Array or Int8Array or ArrayBuffer: `sqlite3_result_blob()` + - `undefined`: is a no-op provided to simplify certain use cases. + + Anything else triggers `sqlite3_result_error()` with a + description of the problem. + + The first argument to this function is a `(sqlite3_context*)`. + Returns void. Does not throw. + */ + capi.sqlite3_result_js = function(pCtx,val){ + if(val instanceof Error){ + capi.sqlite3_result_error_js(pCtx, val); + return; + } + try{ + switch(typeof val) { + case 'undefined': + /* This is a no-op. This routine originated in the create_function() + family of APIs and in that context, passing in undefined indicated + that the caller was responsible for calling sqlite3_result_xxx() + (if needed). */ + break; + case 'boolean': + capi.sqlite3_result_int(pCtx, val ? 1 : 0); + break; + case 'bigint': + if(util.bigIntFits32(val)){ + capi.sqlite3_result_int(pCtx, Number(val)); + }else if(util.bigIntFitsDouble(val)){ + capi.sqlite3_result_double(pCtx, Number(val)); + }else if(wasm.bigIntEnabled){ + if(util.bigIntFits64(val)) capi.sqlite3_result_int64(pCtx, val); + else toss3("BigInt value",val.toString(),"is too BigInt for int64."); + }else{ + toss3("BigInt value",val.toString(),"is too BigInt."); + } + break; + case 'number': { + let f; + if(util.isInt32(val)){ + f = capi.sqlite3_result_int; + }else if(wasm.bigIntEnabled + && Number.isInteger(val) + && util.bigIntFits64(BigInt(val))){ + f = capi.sqlite3_result_int64; + }else{ + f = capi.sqlite3_result_double; + } + f(pCtx, val); + break; + } + case 'string': { + const [p, n] = wasm.allocCString(val,true); + capi.sqlite3_result_text(pCtx, p, n, capi.SQLITE_WASM_DEALLOC); + break; + } + case 'object': + if(null===val/*yes, typeof null === 'object'*/) { + capi.sqlite3_result_null(pCtx); + break; + }else if(util.isBindableTypedArray(val)){ + const pBlob = wasm.allocFromTypedArray(val); + capi.sqlite3_result_blob( + pCtx, pBlob, val.byteLength, + capi.SQLITE_WASM_DEALLOC + ); + break; + } + // else fall through + default: + toss3("Don't not how to handle this UDF result value:",(typeof val), val); + } + }catch(e){ + capi.sqlite3_result_error_js(pCtx, e); + } + }; + + /** + Returns the result sqlite3_column_value(pStmt,iCol) passed to + sqlite3_value_to_js(). The 3rd argument of this function is + ignored by this function except to pass it on as the second + argument of sqlite3_value_to_js(). If the sqlite3_column_value() + returns NULL (e.g. because the column index is out of range), + this function returns `undefined`, regardless of the 3rd + argument. If the 3rd argument is falsy and conversion fails, + `undefined` will be returned. + + Note that sqlite3_column_value() returns an "unprotected" value + object, but in a single-threaded environment (like this one) + there is no distinction between protected and unprotected values. + */ + capi.sqlite3_column_js = function(pStmt, iCol, throwIfCannotConvert=true){ + const v = capi.sqlite3_column_value(pStmt, iCol); + return (0===v) ? undefined : capi.sqlite3_value_to_js(v, throwIfCannotConvert); + }; + + /** + Internal impl of sqlite3_preupdate_new/old_js() and + sqlite3changeset_new/old_js(). + */ + const __newOldValue = function(pObj, iCol, impl){ + impl = capi[impl]; + if(!this.ptr) this.ptr = wasm.allocPtr(); + else wasm.pokePtr(this.ptr, 0); + const rc = impl(pObj, iCol, this.ptr); + if(rc) return SQLite3Error.toss(rc,arguments[2]+"() failed with code "+rc); + const pv = wasm.peekPtr(this.ptr); + return pv ? capi.sqlite3_value_to_js( pv, true ) : undefined; + }.bind(Object.create(null)); + + /** + A wrapper around sqlite3_preupdate_new() which fetches the + sqlite3_value at the given index and returns the result of + passing it to sqlite3_value_to_js(). Throws on error. + */ + capi.sqlite3_preupdate_new_js = + (pDb, iCol)=>__newOldValue(pDb, iCol, 'sqlite3_preupdate_new'); + + /** + The sqlite3_preupdate_old() counterpart of + sqlite3_preupdate_new_js(), with an identical interface. + */ + capi.sqlite3_preupdate_old_js = + (pDb, iCol)=>__newOldValue(pDb, iCol, 'sqlite3_preupdate_old'); + + /** + A wrapper around sqlite3changeset_new() which fetches the + sqlite3_value at the given index and returns the result of + passing it to sqlite3_value_to_js(). Throws on error. + + If sqlite3changeset_new() succeeds but has no value to report, + this function returns the undefined value, noting that undefined + is a valid conversion from an `sqlite3_value`, so is unambiguous. + */ + capi.sqlite3changeset_new_js = + (pChangesetIter, iCol) => __newOldValue(pChangesetIter, iCol, + 'sqlite3changeset_new'); + + /** + The sqlite3changeset_old() counterpart of + sqlite3changeset_new_js(), with an identical interface. + */ + capi.sqlite3changeset_old_js = + (pChangesetIter, iCol)=>__newOldValue(pChangesetIter, iCol, + 'sqlite3changeset_old'); + + /* The remainder of the API will be set up in later steps. */ + const sqlite3 = { + WasmAllocError: WasmAllocError, + SQLite3Error: SQLite3Error, + capi, + util, + wasm, + config, + /** + Holds the version info of the sqlite3 source tree from which + the generated sqlite3-api.js gets built. Note that its version + may well differ from that reported by sqlite3_libversion(), but + that should be considered a source file mismatch, as the JS and + WASM files are intended to be built and distributed together. + + This object is initially a placeholder which gets replaced by a + build-generated object. + */ + version: Object.create(null), + + /** + The library reserves the 'client' property for client-side use + and promises to never define a property with this name nor to + ever rely on specific contents of it. It makes no such guarantees + for other properties. + */ + client: undefined, + + /** + This function is not part of the public interface, but a + piece of internal bootstrapping infrastructure. + + Performs any optional asynchronous library-level initialization + which might be required. This function returns a Promise which + resolves to the sqlite3 namespace object. Any error in the + async init will be fatal to the init as a whole, but init + routines are themselves welcome to install dummy catch() + handlers which are not fatal if their failure should be + considered non-fatal. If called more than once, the second and + subsequent calls are no-ops which return a pre-resolved + Promise. + + Ideally this function is called as part of the Promise chain + which handles the loading and bootstrapping of the API. If not + then it must be called by client-level code, which must not use + the library until the returned promise resolves. + + If called multiple times it will return the same promise on + subsequent calls. The current build setup precludes that + possibility, so it's only a hypothetical problem if/when this + function ever needs to be invoked by clients. + + In Emscripten-based builds, this function is called + automatically and deleted from this object. + */ + asyncPostInit: async function ff(){ + if(ff.isReady instanceof Promise) return ff.isReady; + let lia = sqlite3ApiBootstrap.initializersAsync; + delete sqlite3ApiBootstrap.initializersAsync; + const postInit = async ()=>{ + if(!sqlite3.__isUnderTest){ + /* Delete references to internal-only APIs which are used by + some initializers. Retain them when running in test mode + so that we can add tests for them. */ + delete sqlite3.util; + /* It's conceivable that we might want to expose + StructBinder to client-side code, but it's only useful if + clients build their own sqlite3.wasm which contains their + own C struct types. */ + delete sqlite3.StructBinder; + } + return sqlite3; + }; + const catcher = (e)=>{ + config.error("an async sqlite3 initializer failed:",e); + throw e; + }; + if(!lia || !lia.length){ + return ff.isReady = postInit().catch(catcher); + } + lia = lia.map((f)=>{ + return (f instanceof Function) ? async x=>f(sqlite3) : f; + }); + lia.push(postInit); + let p = Promise.resolve(sqlite3); + while(lia.length) p = p.then(lia.shift()); + return ff.isReady = p.catch(catcher); + }, + /** + scriptInfo ideally gets injected into this object by the + infrastructure which assembles the JS/WASM module. It contains + state which must be collected before sqlite3ApiBootstrap() can + be declared. It is not necessarily available to any + sqlite3ApiBootstrap.initializers but "should" be in place (if + it's added at all) by the time that + sqlite3ApiBootstrap.initializersAsync is processed. + + This state is not part of the public API, only intended for use + with the sqlite3 API bootstrapping and wasm-loading process. + */ + scriptInfo: undefined + }; + try{ + sqlite3ApiBootstrap.initializers.forEach((f)=>{ + f(sqlite3); + }); + }catch(e){ + /* If we don't report this here, it can get completely swallowed + up and disappear into the abyss of Promises and Workers. */ + console.error("sqlite3 bootstrap initializer threw:",e); + throw e; + } + delete sqlite3ApiBootstrap.initializers; + sqlite3ApiBootstrap.sqlite3 = sqlite3; + return sqlite3; +}/*sqlite3ApiBootstrap()*/; +/** + globalThis.sqlite3ApiBootstrap.initializers is an internal detail used by + the various pieces of the sqlite3 API's amalgamation process. It + must not be modified by client code except when plugging such code + into the amalgamation process. + + Each component of the amalgamation is expected to append a function + to this array. When sqlite3ApiBootstrap() is called for the first + time, each such function will be called (in their appended order) + and passed the sqlite3 namespace object, into which they can install + their features (noting that most will also require that certain + features alread have been installed). At the end of that process, + this array is deleted. + + Note that the order of insertion into this array is significant for + some pieces. e.g. sqlite3.capi and sqlite3.wasm cannot be fully + utilized until the whwasmutil.js part is plugged in via + sqlite3-api-glue.js. +*/ +globalThis.sqlite3ApiBootstrap.initializers = []; +/** + globalThis.sqlite3ApiBootstrap.initializersAsync is an internal detail + used by the sqlite3 API's amalgamation process. It must not be + modified by client code except when plugging such code into the + amalgamation process. + + The counterpart of globalThis.sqlite3ApiBootstrap.initializers, + specifically for initializers which are asynchronous. All entries in + this list must be either async functions, non-async functions which + return a Promise, or a Promise. Each function in the list is called + with the sqlite3 object as its only argument. + + The resolved value of any Promise is ignored and rejection will kill + the asyncPostInit() process (at an indeterminate point because all + of them are run asynchronously in parallel). + + This list is not processed until the client calls + sqlite3.asyncPostInit(). This means, for example, that intializers + added to globalThis.sqlite3ApiBootstrap.initializers may push entries to + this list. +*/ +globalThis.sqlite3ApiBootstrap.initializersAsync = []; +/** + Client code may assign sqlite3ApiBootstrap.defaultConfig an + object-type value before calling sqlite3ApiBootstrap() (without + arguments) in order to tell that call to use this object as its + default config value. The intention of this is to provide + downstream clients with a reasonably flexible approach for plugging in + an environment-suitable configuration without having to define a new + global-scope symbol. +*/ +globalThis.sqlite3ApiBootstrap.defaultConfig = Object.create(null); +/** + Placeholder: gets installed by the first call to + globalThis.sqlite3ApiBootstrap(). However, it is recommended that the + caller of sqlite3ApiBootstrap() capture its return value and delete + globalThis.sqlite3ApiBootstrap after calling it. It returns the same + value which will be stored here. +*/ +globalThis.sqlite3ApiBootstrap.sqlite3 = undefined; diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-api-worker1.c-pp.js b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-api-worker1.c-pp.js new file mode 100644 index 0000000000000000000000000000000000000000..9918625459c67b7ddf530e832b5e753074c5a833 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-api-worker1.c-pp.js @@ -0,0 +1,656 @@ +//#ifnot omit-oo1 +/** + 2022-07-22 + + The author disclaims copyright to this source code. In place of a + legal notice, here is a blessing: + + * May you do good and not evil. + * May you find forgiveness for yourself and forgive others. + * May you share freely, never taking more than you give. + + *********************************************************************** + + This file implements the initializer for SQLite's "Worker API #1", a + very basic DB access API intended to be scripted from a main window + thread via Worker-style messages. Because of limitations in that + type of communication, this API is minimalistic and only capable of + serving relatively basic DB requests (e.g. it cannot process nested + query loops concurrently). + + This file requires that the core C-style sqlite3 API and OO API #1 + have been loaded. +*/ + +/** + sqlite3.initWorker1API() implements a Worker-based wrapper around + SQLite3 OO API #1, colloquially known as "Worker API #1". + + In order to permit this API to be loaded in worker threads without + automatically registering onmessage handlers, initializing the + worker API requires calling initWorker1API(). If this function is + called from a non-worker thread then it throws an exception. It + must only be called once per Worker. + + When initialized, it installs message listeners to receive Worker + messages and then it posts a message in the form: + + ``` + {type:'sqlite3-api', result:'worker1-ready'} + ``` + + to let the client know that it has been initialized. Clients may + optionally depend on this function not returning until + initialization is complete, as the initialization is synchronous. + In some contexts, however, listening for the above message is + a better fit. + + Note that the worker-based interface can be slightly quirky because + of its async nature. In particular, any number of messages may be posted + to the worker before it starts handling any of them. If, e.g., an + "open" operation fails, any subsequent messages will fail. The + Promise-based wrapper for this API (`sqlite3-worker1-promiser.js`) + is more comfortable to use in that regard. + + The documentation for the input and output worker messages for + this API follows... + + ==================================================================== + Common message format... + + Each message posted to the worker has an operation-independent + envelope and operation-dependent arguments: + + ``` + { + type: string, // one of: 'open', 'close', 'exec', 'export', 'config-get' + + messageId: OPTIONAL arbitrary value. The worker will copy it as-is + into response messages to assist in client-side dispatching. + + dbId: a db identifier string (returned by 'open') which tells the + operation which database instance to work on. If not provided, the + first-opened db is used. This is an "opaque" value, with no + inherently useful syntax or information. Its value is subject to + change with any given build of this API and cannot be used as a + basis for anything useful beyond its one intended purpose. + + args: ...operation-dependent arguments... + + // the framework may add other properties for testing or debugging + // purposes. + + } + ``` + + Response messages, posted back to the main thread, look like: + + ``` + { + type: string. Same as above except for error responses, which have the type + 'error', + + messageId: same value, if any, provided by the inbound message + + dbId: the id of the db which was operated on, if any, as returned + by the corresponding 'open' operation. + + result: ...operation-dependent result... + + } + ``` + + ==================================================================== + Error responses + + Errors are reported messages in an operation-independent format: + + ``` + { + type: "error", + + messageId: ...as above..., + + dbId: ...as above... + + result: { + + operation: type of the triggering operation: 'open', 'close', ... + + message: ...error message text... + + errorClass: string. The ErrorClass.name property from the thrown exception. + + input: the message object which triggered the error. + + stack: _if available_, a stack trace array. + + } + + } + ``` + + + ==================================================================== + "config-get" + + This operation fetches the serializable parts of the sqlite3 API + configuration. + + Message format: + + ``` + { + type: "config-get", + messageId: ...as above..., + args: currently ignored and may be elided. + } + ``` + + Response: + + ``` + { + type: "config-get", + messageId: ...as above..., + result: { + + version: sqlite3.version object + + bigIntEnabled: bool. True if BigInt support is enabled. + + vfsList: result of sqlite3.capi.sqlite3_js_vfs_list() + } + } + ``` + + + ==================================================================== + "open" a database + + Message format: + + ``` + { + type: "open", + messageId: ...as above..., + args:{ + + filename [=":memory:" or "" (unspecified)]: the db filename. + See the sqlite3.oo1.DB constructor for peculiarities and + transformations, + + vfs: sqlite3_vfs name. Ignored if filename is ":memory:" or "". + This may change how the given filename is resolved. + } + } + ``` + + Response: + + ``` + { + type: "open", + messageId: ...as above..., + result: { + filename: db filename, possibly differing from the input. + + dbId: an opaque ID value which must be passed in the message + envelope to other calls in this API to tell them which db to + use. If it is not provided to future calls, they will default to + operating on the least-recently-opened db. This property is, for + API consistency's sake, also part of the containing message + envelope. Only the `open` operation includes it in the `result` + property. + + persistent: true if the given filename resides in the + known-persistent storage, else false. + + vfs: name of the VFS the "main" db is using. + } + } + ``` + + ==================================================================== + "close" a database + + Message format: + + ``` + { + type: "close", + messageId: ...as above... + dbId: ...as above... + args: OPTIONAL {unlink: boolean} + } + ``` + + If the `dbId` does not refer to an opened ID, this is a no-op. If + the `args` object contains a truthy `unlink` value then the database + will be unlinked (deleted) after closing it. The inability to close a + db (because it's not opened) or delete its file does not trigger an + error. + + Response: + + ``` + { + type: "close", + messageId: ...as above..., + result: { + + filename: filename of closed db, or undefined if no db was closed + + } + } + ``` + + ==================================================================== + "exec" SQL + + All SQL execution is processed through the exec operation. It offers + most of the features of the oo1.DB.exec() method, with a few limitations + imposed by the state having to cross thread boundaries. + + Message format: + + ``` + { + type: "exec", + messageId: ...as above... + dbId: ...as above... + args: string (SQL) or {... see below ...} + } + ``` + + Response: + + ``` + { + type: "exec", + messageId: ...as above..., + dbId: ...as above... + result: { + input arguments, possibly modified. See below. + } + } + ``` + + The arguments are in the same form accepted by oo1.DB.exec(), with + the exceptions noted below. + + If the `countChanges` arguments property (added in version 3.43) is + truthy then the `result` property contained by the returned object + will have a `changeCount` property which holds the number of changes + made by the provided SQL. Because the SQL may contain an arbitrary + number of statements, the `changeCount` is calculated by calling + `sqlite3_total_changes()` before and after the SQL is evaluated. If + the value of `countChanges` is 64 then the `changeCount` property + will be returned as a 64-bit integer in the form of a BigInt (noting + that that will trigger an exception if used in a BigInt-incapable + build). In the latter case, the number of changes is calculated by + calling `sqlite3_total_changes64()` before and after the SQL is + evaluated. + + A function-type args.callback property cannot cross + the window/Worker boundary, so is not useful here. If + args.callback is a string then it is assumed to be a + message type key, in which case a callback function will be + applied which posts each row result via: + + postMessage({type: thatKeyType, + rowNumber: 1-based-#, + row: theRow, + columnNames: anArray + }) + + And, at the end of the result set (whether or not any result rows + were produced), it will post an identical message with + (row=undefined, rowNumber=null) to alert the caller than the result + set is completed. Note that a row value of `null` is a legal row + result for certain arg.rowMode values. + + (Design note: we don't use (row=undefined, rowNumber=undefined) to + indicate end-of-results because fetching those would be + indistinguishable from fetching from an empty object unless the + client used hasOwnProperty() (or similar) to distinguish "missing + property" from "property with the undefined value". Similarly, + `null` is a legal value for `row` in some case , whereas the db + layer won't emit a result value of `undefined`.) + + The callback proxy must not recurse into this interface. An exec() + call will tie up the Worker thread, causing any recursion attempt + to wait until the first exec() is completed. + + The response is the input options object (or a synthesized one if + passed only a string), noting that options.resultRows and + options.columnNames may be populated by the call to db.exec(). + + + ==================================================================== + "export" the current db + + To export the underlying database as a byte array... + + Message format: + + ``` + { + type: "export", + messageId: ...as above..., + dbId: ...as above... + } + ``` + + Response: + + ``` + { + type: "export", + messageId: ...as above..., + dbId: ...as above... + result: { + byteArray: Uint8Array (as per sqlite3_js_db_export()), + filename: the db filename, + mimetype: "application/x-sqlite3" + } + } + ``` + +*/ +globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ +const util = sqlite3.util; +sqlite3.initWorker1API = function(){ + 'use strict'; + const toss = (...args)=>{throw new Error(args.join(' '))}; + if(!(globalThis.WorkerGlobalScope instanceof Function)){ + toss("initWorker1API() must be run from a Worker thread."); + } + const sqlite3 = this.sqlite3 || toss("Missing this.sqlite3 object."); + const DB = sqlite3.oo1.DB; + + /** + Returns the app-wide unique ID for the given db, creating one if + needed. + */ + const getDbId = function(db){ + let id = wState.idMap.get(db); + if(id) return id; + id = 'db#'+(++wState.idSeq)+'@'+db.pointer; + /** ^^^ can't simply use db.pointer b/c closing/opening may re-use + the same address, which could map pending messages to a wrong + instance. */ + wState.idMap.set(db, id); + return id; + }; + + /** + Internal helper for managing Worker-level state. + */ + const wState = { + /** + Each opened DB is added to this.dbList, and the first entry in + that list is the default db. As each db is closed, its entry is + removed from the list. + */ + dbList: [], + /** Sequence number of dbId generation. */ + idSeq: 0, + /** Map of DB instances to dbId. */ + idMap: new WeakMap, + /** Temp holder for "transferable" postMessage() state. */ + xfer: [], + open: function(opt){ + const db = new DB(opt); + this.dbs[getDbId(db)] = db; + if(this.dbList.indexOf(db)<0) this.dbList.push(db); + return db; + }, + close: function(db,alsoUnlink){ + if(db){ + delete this.dbs[getDbId(db)]; + const filename = db.filename; + const pVfs = util.sqlite3__wasm_db_vfs(db.pointer, 0); + db.close(); + const ddNdx = this.dbList.indexOf(db); + if(ddNdx>=0) this.dbList.splice(ddNdx, 1); + if(alsoUnlink && filename && pVfs){ + util.sqlite3__wasm_vfs_unlink(pVfs, filename); + } + } + }, + /** + Posts the given worker message value. If xferList is provided, + it must be an array, in which case a copy of it passed as + postMessage()'s second argument and xferList.length is set to + 0. + */ + post: function(msg,xferList){ + if(xferList && xferList.length){ + globalThis.postMessage( msg, Array.from(xferList) ); + xferList.length = 0; + }else{ + globalThis.postMessage(msg); + } + }, + /** Map of DB IDs to DBs. */ + dbs: Object.create(null), + /** Fetch the DB for the given id. Throw if require=true and the + id is not valid, else return the db or undefined. */ + getDb: function(id,require=true){ + return this.dbs[id] + || (require ? toss("Unknown (or closed) DB ID:",id) : undefined); + } + }; + + /** Throws if the given db is falsy or not opened, else returns its + argument. */ + const affirmDbOpen = function(db = wState.dbList[0]){ + return (db && db.pointer) ? db : toss("DB is not opened."); + }; + + /** Extract dbId from the given message payload. */ + const getMsgDb = function(msgData,affirmExists=true){ + const db = wState.getDb(msgData.dbId,false) || wState.dbList[0]; + return affirmExists ? affirmDbOpen(db) : db; + }; + + const getDefaultDbId = function(){ + return wState.dbList[0] && getDbId(wState.dbList[0]); + }; + + const isSpecialDbFilename = (n)=>{ + return ""===n || ':'===n[0]; + }; + + /** + A level of "organizational abstraction" for the Worker1 + API. Each method in this object must map directly to a Worker1 + message type key. The onmessage() dispatcher attempts to + dispatch all inbound messages to a method of this object, + passing it the event.data part of the inbound event object. All + methods must return a plain Object containing any result + state, which the dispatcher may amend. All methods must throw + on error. + */ + const wMsgHandler = { + open: function(ev){ + const oargs = Object.create(null), args = (ev.args || Object.create(null)); + if(args.simulateError){ // undocumented internal testing option + toss("Throwing because of simulateError flag."); + } + const rc = Object.create(null); + oargs.vfs = args.vfs; + oargs.filename = args.filename || ""; + const db = wState.open(oargs); + rc.filename = db.filename; + rc.persistent = !!sqlite3.capi.sqlite3_js_db_uses_vfs(db.pointer, "opfs"); + rc.dbId = getDbId(db); + rc.vfs = db.dbVfsName(); + return rc; + }, + + close: function(ev){ + const db = getMsgDb(ev,false); + const response = { + filename: db && db.filename + }; + if(db){ + const doUnlink = ((ev.args && 'object'===typeof ev.args) + ? !!ev.args.unlink : false); + wState.close(db, doUnlink); + } + return response; + }, + + exec: function(ev){ + const rc = ( + 'string'===typeof ev.args + ) ? {sql: ev.args} : (ev.args || Object.create(null)); + if('stmt'===rc.rowMode){ + toss("Invalid rowMode for 'exec': stmt mode", + "does not work in the Worker API."); + }else if(!rc.sql){ + toss("'exec' requires input SQL."); + } + const db = getMsgDb(ev); + if(rc.callback || Array.isArray(rc.resultRows)){ + // Part of a copy-avoidance optimization for blobs + db._blobXfer = wState.xfer; + } + const theCallback = rc.callback; + let rowNumber = 0; + const hadColNames = !!rc.columnNames; + if('string' === typeof theCallback){ + if(!hadColNames) rc.columnNames = []; + /* Treat this as a worker message type and post each + row as a message of that type. */ + rc.callback = function(row,stmt){ + wState.post({ + type: theCallback, + columnNames: rc.columnNames, + rowNumber: ++rowNumber, + row: row + }, wState.xfer); + } + } + try { + const changeCount = !!rc.countChanges + ? db.changes(true,(64===rc.countChanges)) + : undefined; + db.exec(rc); + if(undefined !== changeCount){ + rc.changeCount = db.changes(true,64===rc.countChanges) - changeCount; + } + if(rc.callback instanceof Function){ + rc.callback = theCallback; + /* Post a sentinel message to tell the client that the end + of the result set has been reached (possibly with zero + rows). */ + wState.post({ + type: theCallback, + columnNames: rc.columnNames, + rowNumber: null /*null to distinguish from "property not set"*/, + row: undefined /*undefined because null is a legal row value + for some rowType values, but undefined is not*/ + }); + } + }finally{ + delete db._blobXfer; + if(rc.callback) rc.callback = theCallback; + } + return rc; + }/*exec()*/, + + 'config-get': function(){ + const rc = Object.create(null), src = sqlite3.config; + [ + 'bigIntEnabled' + ].forEach(function(k){ + if(Object.getOwnPropertyDescriptor(src, k)) rc[k] = src[k]; + }); + rc.version = sqlite3.version; + rc.vfsList = sqlite3.capi.sqlite3_js_vfs_list(); + return rc; + }, + + /** + Exports the database to a byte array, as per + sqlite3_serialize(). Response is an object: + + { + byteArray: Uint8Array (db file contents), + filename: the current db filename, + mimetype: 'application/x-sqlite3' + } + */ + export: function(ev){ + const db = getMsgDb(ev); + const response = { + byteArray: sqlite3.capi.sqlite3_js_db_export(db.pointer), + filename: db.filename, + mimetype: 'application/x-sqlite3' + }; + wState.xfer.push(response.byteArray.buffer); + return response; + }/*export()*/, + + toss: function(ev){ + toss("Testing worker exception"); + } + }/*wMsgHandler*/; + + globalThis.onmessage = async function(ev){ + ev = ev.data; + let result, dbId = ev.dbId, evType = ev.type; + const arrivalTime = performance.now(); + try { + if(wMsgHandler.hasOwnProperty(evType) && + wMsgHandler[evType] instanceof Function){ + result = await wMsgHandler[evType](ev); + }else{ + toss("Unknown db worker message type:",ev.type); + } + }catch(err){ + evType = 'error'; + result = { + operation: ev.type, + message: err.message, + errorClass: err.name, + input: ev + }; + if(err.stack){ + result.stack = ('string'===typeof err.stack) + ? err.stack.split(/\n\s*/) : err.stack; + } + if(0) sqlite3.config.warn("Worker is propagating an exception to main thread.", + "Reporting it _here_ for the stack trace:",err,result); + } + if(!dbId){ + dbId = result.dbId/*from 'open' cmd*/ + || getDefaultDbId(); + } + // Timing info is primarily for use in testing this API. It's not part of + // the public API. arrivalTime = when the worker got the message. + wState.post({ + type: evType, + dbId: dbId, + messageId: ev.messageId, + workerReceivedTime: arrivalTime, + workerRespondTime: performance.now(), + departureTime: ev.departureTime, + // TODO: move the timing bits into... + //timing:{ + // departure: ev.departureTime, + // workerReceived: arrivalTime, + // workerResponse: performance.now(); + //}, + result: result + }, wState.xfer); + }; + globalThis.postMessage({type:'sqlite3-api',result:'worker1-ready'}); +}.bind({sqlite3}); +}); +//#else +/* Built with the omit-oo1 flag. */ +//#endif ifnot omit-oo1 diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-license-version-header.js b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-license-version-header.js new file mode 100644 index 0000000000000000000000000000000000000000..4829894638db38d4579e261286badb83073e62dd --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-license-version-header.js @@ -0,0 +1,25 @@ +/* +** LICENSE for the sqlite3 WebAssembly/JavaScript APIs. +** +** This bundle (typically released as sqlite3.js or sqlite3.mjs) +** is an amalgamation of JavaScript source code from two projects: +** +** 1) https://emscripten.org: the Emscripten "glue code" is covered by +** the terms of the MIT license and University of Illinois/NCSA +** Open Source License, as described at: +** +** https://emscripten.org/docs/introducing_emscripten/emscripten_license.html +** +** 2) https://sqlite.org: all code and documentation labeled as being +** from this source are released under the same terms as the sqlite3 +** C library: +** +** 2022-10-16 +** +** The author disclaims copyright to this source code. In place of a +** legal notice, here is a blessing: +** +** * May you do good and not evil. +** * May you find forgiveness for yourself and forgive others. +** * May you share freely, never taking more than you give. +*/ diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-opfs-async-proxy.js b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-opfs-async-proxy.js new file mode 100644 index 0000000000000000000000000000000000000000..0028c1025f1736cbfe9b4d48fb1f7ad95da09e6f --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-opfs-async-proxy.js @@ -0,0 +1,805 @@ +/* + 2022-09-16 + + The author disclaims copyright to this source code. In place of a + legal notice, here is a blessing: + + * May you do good and not evil. + * May you find forgiveness for yourself and forgive others. + * May you share freely, never taking more than you give. + + *********************************************************************** + + A Worker which manages asynchronous OPFS handles on behalf of a + synchronous API which controls it via a combination of Worker + messages, SharedArrayBuffer, and Atomics. It is the asynchronous + counterpart of the API defined in sqlite3-vfs-opfs.js. + + Highly indebted to: + + https://github.com/rhashimoto/wa-sqlite/blob/master/src/examples/OriginPrivateFileSystemVFS.js + + for demonstrating how to use the OPFS APIs. + + This file is to be loaded as a Worker. It does not have any direct + access to the sqlite3 JS/WASM bits, so any bits which it needs (most + notably SQLITE_xxx integer codes) have to be imported into it via an + initialization process. + + This file represents an implementation detail of a larger piece of + code, and not a public interface. Its details may change at any time + and are not intended to be used by any client-level code. + + 2022-11-27: Chrome v108 changes some async methods to synchronous, as + documented at: + + https://developer.chrome.com/blog/sync-methods-for-accesshandles/ + + Firefox v111 and Safari 16.4, both released in March 2023, also + include this. + + We cannot change to the sync forms at this point without breaking + clients who use Chrome v104-ish or higher. truncate(), getSize(), + flush(), and close() are now (as of v108) synchronous. Calling them + with an "await", as we have to for the async forms, is still legal + with the sync forms but is superfluous. Calling the async forms with + theFunc().then(...) is not compatible with the change to + synchronous, but we do do not use those APIs that way. i.e. we don't + _need_ to change anything for this, but at some point (after Chrome + versions (approximately) 104-107 are extinct) should change our + usage of those methods to remove the "await". +*/ +"use strict"; +const wPost = (type,...args)=>postMessage({type, payload:args}); +const installAsyncProxy = function(){ + const toss = function(...args){throw new Error(args.join(' '))}; + if(globalThis.window === globalThis){ + toss("This code cannot run from the main thread.", + "Load it as a Worker from a separate Worker."); + }else if(!navigator?.storage?.getDirectory){ + toss("This API requires navigator.storage.getDirectory."); + } + + /** + Will hold state copied to this object from the syncronous side of + this API. + */ + const state = Object.create(null); + + /** + verbose: + + 0 = no logging output + 1 = only errors + 2 = warnings and errors + 3 = debug, warnings, and errors + */ + state.verbose = 1; + + const loggers = { + 0:console.error.bind(console), + 1:console.warn.bind(console), + 2:console.log.bind(console) + }; + const logImpl = (level,...args)=>{ + if(state.verbose>level) loggers[level]("OPFS asyncer:",...args); + }; + const log = (...args)=>logImpl(2, ...args); + const warn = (...args)=>logImpl(1, ...args); + const error = (...args)=>logImpl(0, ...args); + + /** + __openFiles is a map of sqlite3_file pointers (integers) to + metadata related to a given OPFS file handles. The pointers are, in + this side of the interface, opaque file handle IDs provided by the + synchronous part of this constellation. Each value is an object + with a structure demonstrated in the xOpen() impl. + */ + const __openFiles = Object.create(null); + /** + __implicitLocks is a Set of sqlite3_file pointers (integers) which were + "auto-locked". i.e. those for which we obtained a sync access + handle without an explicit xLock() call. Such locks will be + released during db connection idle time, whereas a sync access + handle obtained via xLock(), or subsequently xLock()'d after + auto-acquisition, will not be released until xUnlock() is called. + + Maintenance reminder: if we relinquish auto-locks at the end of the + operation which acquires them, we pay a massive performance + penalty: speedtest1 benchmarks take up to 4x as long. By delaying + the lock release until idle time, the hit is negligible. + */ + const __implicitLocks = new Set(); + + /** + Expects an OPFS file path. It gets resolved, such that ".." + components are properly expanded, and returned. If the 2nd arg is + true, the result is returned as an array of path elements, else an + absolute path string is returned. + */ + const getResolvedPath = function(filename,splitIt){ + const p = new URL( + filename, 'file://irrelevant' + ).pathname; + return splitIt ? p.split('/').filter((v)=>!!v) : p; + }; + + /** + Takes the absolute path to a filesystem element. Returns an array + of [handleOfContainingDir, filename]. If the 2nd argument is truthy + then each directory element leading to the file is created along + the way. Throws if any creation or resolution fails. + */ + const getDirForFilename = async function f(absFilename, createDirs = false){ + const path = getResolvedPath(absFilename, true); + const filename = path.pop(); + let dh = state.rootDir; + for(const dirName of path){ + if(dirName){ + dh = await dh.getDirectoryHandle(dirName, {create: !!createDirs}); + } + } + return [dh, filename]; + }; + + /** + If the given file-holding object has a sync handle attached to it, + that handle is removed and asynchronously closed. Though it may + sound sensible to continue work as soon as the close() returns + (noting that it's asynchronous), doing so can cause operations + performed soon afterwards, e.g. a call to getSyncHandle(), to fail + because they may happen out of order from the close(). OPFS does + not guaranty that the actual order of operations is retained in + such cases. i.e. always "await" on the result of this function. + */ + const closeSyncHandle = async (fh)=>{ + if(fh.syncHandle){ + log("Closing sync handle for",fh.filenameAbs); + const h = fh.syncHandle; + delete fh.syncHandle; + delete fh.xLock; + __implicitLocks.delete(fh.fid); + return h.close(); + } + }; + + /** + A proxy for closeSyncHandle() which is guaranteed to not throw. + + This function is part of a lock/unlock step in functions which + require a sync access handle but may be called without xLock() + having been called first. Such calls need to release that + handle to avoid locking the file for all of time. This is an + _attempt_ at reducing cross-tab contention but it may prove + to be more of a problem than a solution and may need to be + removed. + */ + const closeSyncHandleNoThrow = async (fh)=>{ + try{await closeSyncHandle(fh)} + catch(e){ + warn("closeSyncHandleNoThrow() ignoring:",e,fh); + } + }; + + /* Release all auto-locks. */ + const releaseImplicitLocks = async ()=>{ + if(__implicitLocks.size){ + /* Release all auto-locks. */ + for(const fid of __implicitLocks){ + const fh = __openFiles[fid]; + await closeSyncHandleNoThrow(fh); + log("Auto-unlocked",fid,fh.filenameAbs); + } + } + }; + + /** + An experiment in improving concurrency by freeing up implicit locks + sooner. This is known to impact performance dramatically but it has + also shown to improve concurrency considerably. + + If fh.releaseImplicitLocks is truthy and fh is in __implicitLocks, + this routine returns closeSyncHandleNoThrow(), else it is a no-op. + */ + const releaseImplicitLock = async (fh)=>{ + if(fh.releaseImplicitLocks && __implicitLocks.has(fh.fid)){ + return closeSyncHandleNoThrow(fh); + } + }; + + /** + An error class specifically for use with getSyncHandle(), the goal + of which is to eventually be able to distinguish unambiguously + between locking-related failures and other types, noting that we + cannot currently do so because createSyncAccessHandle() does not + define its exceptions in the required level of detail. + + 2022-11-29: according to: + + https://github.com/whatwg/fs/pull/21 + + NoModificationAllowedError will be the standard exception thrown + when acquisition of a sync access handle fails due to a locking + error. As of this writing, that error type is not visible in the + dev console in Chrome v109, nor is it documented in MDN, but an + error with that "name" property is being thrown from the OPFS + layer. + */ + class GetSyncHandleError extends Error { + constructor(errorObject, ...msg){ + super([ + ...msg, ': '+errorObject.name+':', + errorObject.message + ].join(' '), { + cause: errorObject + }); + this.name = 'GetSyncHandleError'; + } + }; + + /** + Attempts to find a suitable SQLITE_xyz result code for Error + object e. Returns either such a translation or rc if if it does + not know how to translate the exception. + */ + GetSyncHandleError.convertRc = (e,rc)=>{ + if( e instanceof GetSyncHandleError ){ + if( e.cause.name==='NoModificationAllowedError' + /* Inconsistent exception.name from Chrome/ium with the + same exception.message text: */ + || (e.cause.name==='DOMException' + && 0===e.cause.message.indexOf('Access Handles cannot')) ){ + return state.sq3Codes.SQLITE_BUSY; + }else if( 'NotFoundError'===e.cause.name ){ + /** + Maintenance reminder: SQLITE_NOTFOUND, though it looks like + a good match, has different semantics than NotFoundError + and is not suitable here. + */ + return state.sq3Codes.SQLITE_CANTOPEN; + } + }else if( 'NotFoundError'===e?.name ){ + return state.sq3Codes.SQLITE_CANTOPEN; + } + return rc; + }; + + /** + Returns the sync access handle associated with the given file + handle object (which must be a valid handle object, as created by + xOpen()), lazily opening it if needed. + + In order to help alleviate cross-tab contention for a dabase, if + an exception is thrown while acquiring the handle, this routine + will wait briefly and try again, up to some fixed number of + times. If acquisition still fails at that point it will give up + and propagate the exception. Client-level code will see that as + an I/O error. + + 2024-06-12: there is a rare race condition here which has been + reported a single time: + + https://sqlite.org/forum/forumpost/9ee7f5340802d600 + + What appears to be happening is that file we're waiting for a + lock on is deleted while we wait. What currently happens here is + that a locking exception is thrown but the exception type is + NotFoundError. In such cases, we very probably should attempt to + re-open/re-create the file an obtain the lock on it (noting that + there's another race condition there). That's easy to say but + creating a viable test for that condition has proven challenging + so far. + */ + const getSyncHandle = async (fh,opName)=>{ + if(!fh.syncHandle){ + const t = performance.now(); + log("Acquiring sync handle for",fh.filenameAbs); + const maxTries = 6, + msBase = state.asyncIdleWaitTime * 2; + let i = 1, ms = msBase; + for(; true; ms = msBase * ++i){ + try { + //if(i<3) toss("Just testing getSyncHandle() wait-and-retry."); + //TODO? A config option which tells it to throw here + //randomly every now and then, for testing purposes. + fh.syncHandle = await fh.fileHandle.createSyncAccessHandle(); + break; + }catch(e){ + if(i === maxTries){ + throw new GetSyncHandleError( + e, "Error getting sync handle for",opName+"().",maxTries, + "attempts failed.",fh.filenameAbs + ); + } + warn("Error getting sync handle for",opName+"(). Waiting",ms, + "ms and trying again.",fh.filenameAbs,e); + Atomics.wait(state.sabOPView, state.opIds.retry, 0, ms); + } + } + log("Got",opName+"() sync handle for",fh.filenameAbs, + 'in',performance.now() - t,'ms'); + if(!fh.xLock){ + __implicitLocks.add(fh.fid); + log("Acquired implicit lock for",opName+"()",fh.fid,fh.filenameAbs); + } + } + return fh.syncHandle; + }; + + /** + Stores the given value at state.sabOPView[state.opIds.rc] and then + Atomics.notify()'s it. + */ + const storeAndNotify = (opName, value)=>{ + log(opName+"() => notify(",value,")"); + Atomics.store(state.sabOPView, state.opIds.rc, value); + Atomics.notify(state.sabOPView, state.opIds.rc); + }; + + /** + Throws if fh is a file-holding object which is flagged as read-only. + */ + const affirmNotRO = function(opName,fh){ + if(fh.readOnly) toss(opName+"(): File is read-only: "+fh.filenameAbs); + }; + + /** + Gets set to true by the 'opfs-async-shutdown' command to quit the + wait loop. This is only intended for debugging purposes: we cannot + inspect this file's state while the tight waitLoop() is running and + need a way to stop that loop for introspection purposes. + */ + let flagAsyncShutdown = false; + + /** + Asynchronous wrappers for sqlite3_vfs and sqlite3_io_methods + methods, as well as helpers like mkdir(). + */ + const vfsAsyncImpls = { + 'opfs-async-shutdown': async ()=>{ + flagAsyncShutdown = true; + storeAndNotify('opfs-async-shutdown', 0); + }, + mkdir: async (dirname)=>{ + let rc = 0; + try { + await getDirForFilename(dirname+"/filepart", true); + }catch(e){ + state.s11n.storeException(2,e); + rc = state.sq3Codes.SQLITE_IOERR; + } + storeAndNotify('mkdir', rc); + }, + xAccess: async (filename)=>{ + /* OPFS cannot support the full range of xAccess() queries + sqlite3 calls for. We can essentially just tell if the file + is accessible, but if it is then it's automatically writable + (unless it's locked, which we cannot(?) know without trying + to open it). OPFS does not have the notion of read-only. + + The return semantics of this function differ from sqlite3's + xAccess semantics because we are limited in what we can + communicate back to our synchronous communication partner: 0 = + accessible, non-0 means not accessible. + */ + let rc = 0; + try{ + const [dh, fn] = await getDirForFilename(filename); + await dh.getFileHandle(fn); + }catch(e){ + state.s11n.storeException(2,e); + rc = state.sq3Codes.SQLITE_IOERR; + } + storeAndNotify('xAccess', rc); + }, + xClose: async function(fid/*sqlite3_file pointer*/){ + const opName = 'xClose'; + __implicitLocks.delete(fid); + const fh = __openFiles[fid]; + let rc = 0; + if(fh){ + delete __openFiles[fid]; + await closeSyncHandle(fh); + if(fh.deleteOnClose){ + try{ await fh.dirHandle.removeEntry(fh.filenamePart) } + catch(e){ warn("Ignoring dirHandle.removeEntry() failure of",fh,e) } + } + }else{ + state.s11n.serialize(); + rc = state.sq3Codes.SQLITE_NOTFOUND; + } + storeAndNotify(opName, rc); + }, + xDelete: async function(...args){ + const rc = await vfsAsyncImpls.xDeleteNoWait(...args); + storeAndNotify('xDelete', rc); + }, + xDeleteNoWait: async function(filename, syncDir = 0, recursive = false){ + /* The syncDir flag is, for purposes of the VFS API's semantics, + ignored here. However, if it has the value 0x1234 then: after + deleting the given file, recursively try to delete any empty + directories left behind in its wake (ignoring any errors and + stopping at the first failure). + + That said: we don't know for sure that removeEntry() fails if + the dir is not empty because the API is not documented. It has, + however, a "recursive" flag which defaults to false, so + presumably it will fail if the dir is not empty and that flag + is false. + */ + let rc = 0; + try { + while(filename){ + const [hDir, filenamePart] = await getDirForFilename(filename, false); + if(!filenamePart) break; + await hDir.removeEntry(filenamePart, {recursive}); + if(0x1234 !== syncDir) break; + recursive = false; + filename = getResolvedPath(filename, true); + filename.pop(); + filename = filename.join('/'); + } + }catch(e){ + state.s11n.storeException(2,e); + rc = state.sq3Codes.SQLITE_IOERR_DELETE; + } + return rc; + }, + xFileSize: async function(fid/*sqlite3_file pointer*/){ + const fh = __openFiles[fid]; + let rc = 0; + try{ + const sz = await (await getSyncHandle(fh,'xFileSize')).getSize(); + state.s11n.serialize(Number(sz)); + }catch(e){ + state.s11n.storeException(1,e); + rc = GetSyncHandleError.convertRc(e,state.sq3Codes.SQLITE_IOERR); + } + await releaseImplicitLock(fh); + storeAndNotify('xFileSize', rc); + }, + xLock: async function(fid/*sqlite3_file pointer*/, + lockType/*SQLITE_LOCK_...*/){ + const fh = __openFiles[fid]; + let rc = 0; + const oldLockType = fh.xLock; + fh.xLock = lockType; + if( !fh.syncHandle ){ + try { + await getSyncHandle(fh,'xLock'); + __implicitLocks.delete(fid); + }catch(e){ + state.s11n.storeException(1,e); + rc = GetSyncHandleError.convertRc(e,state.sq3Codes.SQLITE_IOERR_LOCK); + fh.xLock = oldLockType; + } + } + storeAndNotify('xLock',rc); + }, + xOpen: async function(fid/*sqlite3_file pointer*/, filename, + flags/*SQLITE_OPEN_...*/, + opfsFlags/*OPFS_...*/){ + const opName = 'xOpen'; + const create = (state.sq3Codes.SQLITE_OPEN_CREATE & flags); + try{ + let hDir, filenamePart; + try { + [hDir, filenamePart] = await getDirForFilename(filename, !!create); + }catch(e){ + state.s11n.storeException(1,e); + storeAndNotify(opName, state.sq3Codes.SQLITE_NOTFOUND); + return; + } + if( state.opfsFlags.OPFS_UNLINK_BEFORE_OPEN & opfsFlags ){ + try{ + await hDir.removeEntry(filenamePart); + }catch(e){ + /* ignoring */ + //warn("Ignoring failed Unlink of",filename,":",e); + } + } + const hFile = await hDir.getFileHandle(filenamePart, {create}); + const fh = Object.assign(Object.create(null),{ + fid: fid, + filenameAbs: filename, + filenamePart: filenamePart, + dirHandle: hDir, + fileHandle: hFile, + sabView: state.sabFileBufView, + readOnly: !create && !!(state.sq3Codes.SQLITE_OPEN_READONLY & flags), + deleteOnClose: !!(state.sq3Codes.SQLITE_OPEN_DELETEONCLOSE & flags) + }); + fh.releaseImplicitLocks = + (opfsFlags & state.opfsFlags.OPFS_UNLOCK_ASAP) + || state.opfsFlags.defaultUnlockAsap; + __openFiles[fid] = fh; + storeAndNotify(opName, 0); + }catch(e){ + error(opName,e); + state.s11n.storeException(1,e); + storeAndNotify(opName, state.sq3Codes.SQLITE_IOERR); + } + }, + xRead: async function(fid/*sqlite3_file pointer*/,n,offset64){ + let rc = 0, nRead; + const fh = __openFiles[fid]; + try{ + nRead = (await getSyncHandle(fh,'xRead')).read( + fh.sabView.subarray(0, n), + {at: Number(offset64)} + ); + if(nRead < n){/* Zero-fill remaining bytes */ + fh.sabView.fill(0, nRead, n); + rc = state.sq3Codes.SQLITE_IOERR_SHORT_READ; + } + }catch(e){ + error("xRead() failed",e,fh); + state.s11n.storeException(1,e); + rc = GetSyncHandleError.convertRc(e,state.sq3Codes.SQLITE_IOERR_READ); + } + await releaseImplicitLock(fh); + storeAndNotify('xRead',rc); + }, + xSync: async function(fid/*sqlite3_file pointer*/,flags/*ignored*/){ + const fh = __openFiles[fid]; + let rc = 0; + if(!fh.readOnly && fh.syncHandle){ + try { + await fh.syncHandle.flush(); + }catch(e){ + state.s11n.storeException(2,e); + rc = state.sq3Codes.SQLITE_IOERR_FSYNC; + } + } + storeAndNotify('xSync',rc); + }, + xTruncate: async function(fid/*sqlite3_file pointer*/,size){ + let rc = 0; + const fh = __openFiles[fid]; + try{ + affirmNotRO('xTruncate', fh); + await (await getSyncHandle(fh,'xTruncate')).truncate(size); + }catch(e){ + error("xTruncate():",e,fh); + state.s11n.storeException(2,e); + rc = GetSyncHandleError.convertRc(e,state.sq3Codes.SQLITE_IOERR_TRUNCATE); + } + await releaseImplicitLock(fh); + storeAndNotify('xTruncate',rc); + }, + xUnlock: async function(fid/*sqlite3_file pointer*/, + lockType/*SQLITE_LOCK_...*/){ + let rc = 0; + const fh = __openFiles[fid]; + if( fh.syncHandle + && state.sq3Codes.SQLITE_LOCK_NONE===lockType + /* Note that we do not differentiate between lock types in + this VFS. We're either locked or unlocked. */ ){ + try { await closeSyncHandle(fh) } + catch(e){ + state.s11n.storeException(1,e); + rc = state.sq3Codes.SQLITE_IOERR_UNLOCK; + } + } + storeAndNotify('xUnlock',rc); + }, + xWrite: async function(fid/*sqlite3_file pointer*/,n,offset64){ + let rc; + const fh = __openFiles[fid]; + try{ + affirmNotRO('xWrite', fh); + rc = ( + n === (await getSyncHandle(fh,'xWrite')) + .write(fh.sabView.subarray(0, n), + {at: Number(offset64)}) + ) ? 0 : state.sq3Codes.SQLITE_IOERR_WRITE; + }catch(e){ + error("xWrite():",e,fh); + state.s11n.storeException(1,e); + rc = GetSyncHandleError.convertRc(e,state.sq3Codes.SQLITE_IOERR_WRITE); + } + await releaseImplicitLock(fh); + storeAndNotify('xWrite',rc); + } + }/*vfsAsyncImpls*/; + + const initS11n = ()=>{ + /** + ACHTUNG: this code is 100% duplicated in the other half of this + proxy! The documentation is maintained in the "synchronous half". + */ + if(state.s11n) return state.s11n; + const textDecoder = new TextDecoder(), + textEncoder = new TextEncoder('utf-8'), + viewU8 = new Uint8Array(state.sabIO, state.sabS11nOffset, state.sabS11nSize), + viewDV = new DataView(state.sabIO, state.sabS11nOffset, state.sabS11nSize); + state.s11n = Object.create(null); + const TypeIds = Object.create(null); + TypeIds.number = { id: 1, size: 8, getter: 'getFloat64', setter: 'setFloat64' }; + TypeIds.bigint = { id: 2, size: 8, getter: 'getBigInt64', setter: 'setBigInt64' }; + TypeIds.boolean = { id: 3, size: 4, getter: 'getInt32', setter: 'setInt32' }; + TypeIds.string = { id: 4 }; + const getTypeId = (v)=>( + TypeIds[typeof v] + || toss("Maintenance required: this value type cannot be serialized.",v) + ); + const getTypeIdById = (tid)=>{ + switch(tid){ + case TypeIds.number.id: return TypeIds.number; + case TypeIds.bigint.id: return TypeIds.bigint; + case TypeIds.boolean.id: return TypeIds.boolean; + case TypeIds.string.id: return TypeIds.string; + default: toss("Invalid type ID:",tid); + } + }; + state.s11n.deserialize = function(clear=false){ + const argc = viewU8[0]; + const rc = argc ? [] : null; + if(argc){ + const typeIds = []; + let offset = 1, i, n, v; + for(i = 0; i < argc; ++i, ++offset){ + typeIds.push(getTypeIdById(viewU8[offset])); + } + for(i = 0; i < argc; ++i){ + const t = typeIds[i]; + if(t.getter){ + v = viewDV[t.getter](offset, state.littleEndian); + offset += t.size; + }else{/*String*/ + n = viewDV.getInt32(offset, state.littleEndian); + offset += 4; + v = textDecoder.decode(viewU8.slice(offset, offset+n)); + offset += n; + } + rc.push(v); + } + } + if(clear) viewU8[0] = 0; + //log("deserialize:",argc, rc); + return rc; + }; + state.s11n.serialize = function(...args){ + if(args.length){ + //log("serialize():",args); + const typeIds = []; + let i = 0, offset = 1; + viewU8[0] = args.length & 0xff /* header = # of args */; + for(; i < args.length; ++i, ++offset){ + /* Write the TypeIds.id value into the next args.length + bytes. */ + typeIds.push(getTypeId(args[i])); + viewU8[offset] = typeIds[i].id; + } + for(i = 0; i < args.length; ++i) { + /* Deserialize the following bytes based on their + corresponding TypeIds.id from the header. */ + const t = typeIds[i]; + if(t.setter){ + viewDV[t.setter](offset, args[i], state.littleEndian); + offset += t.size; + }else{/*String*/ + const s = textEncoder.encode(args[i]); + viewDV.setInt32(offset, s.byteLength, state.littleEndian); + offset += 4; + viewU8.set(s, offset); + offset += s.byteLength; + } + } + //log("serialize() result:",viewU8.slice(0,offset)); + }else{ + viewU8[0] = 0; + } + }; + + state.s11n.storeException = state.asyncS11nExceptions + ? ((priority,e)=>{ + if(priority<=state.asyncS11nExceptions){ + state.s11n.serialize([e.name,': ',e.message].join("")); + } + }) + : ()=>{}; + + return state.s11n; + }/*initS11n()*/; + + const waitLoop = async function f(){ + const opHandlers = Object.create(null); + for(let k of Object.keys(state.opIds)){ + const vi = vfsAsyncImpls[k]; + if(!vi) continue; + const o = Object.create(null); + opHandlers[state.opIds[k]] = o; + o.key = k; + o.f = vi; + } + while(!flagAsyncShutdown){ + try { + if('not-equal'!==Atomics.wait( + state.sabOPView, state.opIds.whichOp, 0, state.asyncIdleWaitTime + )){ + /* Maintenance note: we compare against 'not-equal' because + + https://github.com/tomayac/sqlite-wasm/issues/12 + + is reporting that this occassionally, under high loads, + returns 'ok', which leads to the whichOp being 0 (which + isn't a valid operation ID and leads to an exception, + along with a corresponding ugly console log + message). Unfortunately, the conditions for that cannot + be reliably reproduced. The only place in our code which + writes a 0 to the state.opIds.whichOp SharedArrayBuffer + index is a few lines down from here, and that instance + is required in order for clear communication between + the sync half of this proxy and this half. + */ + await releaseImplicitLocks(); + continue; + } + const opId = Atomics.load(state.sabOPView, state.opIds.whichOp); + Atomics.store(state.sabOPView, state.opIds.whichOp, 0); + const hnd = opHandlers[opId] ?? toss("No waitLoop handler for whichOp #",opId); + const args = state.s11n.deserialize( + true /* clear s11n to keep the caller from confusing this with + an exception string written by the upcoming + operation */ + ) || []; + //warn("waitLoop() whichOp =",opId, hnd, args); + if(hnd.f) await hnd.f(...args); + else error("Missing callback for opId",opId); + }catch(e){ + error('in waitLoop():',e); + } + } + }; + + navigator.storage.getDirectory().then(function(d){ + state.rootDir = d; + globalThis.onmessage = function({data}){ + switch(data.type){ + case 'opfs-async-init':{ + /* Receive shared state from synchronous partner */ + const opt = data.args; + for(const k in opt) state[k] = opt[k]; + state.verbose = opt.verbose ?? 1; + state.sabOPView = new Int32Array(state.sabOP); + state.sabFileBufView = new Uint8Array(state.sabIO, 0, state.fileBufferSize); + state.sabS11nView = new Uint8Array(state.sabIO, state.sabS11nOffset, state.sabS11nSize); + Object.keys(vfsAsyncImpls).forEach((k)=>{ + if(!Number.isFinite(state.opIds[k])){ + toss("Maintenance required: missing state.opIds[",k,"]"); + } + }); + initS11n(); + log("init state",state); + wPost('opfs-async-inited'); + waitLoop(); + break; + } + case 'opfs-async-restart': + if(flagAsyncShutdown){ + warn("Restarting after opfs-async-shutdown. Might or might not work."); + flagAsyncShutdown = false; + waitLoop(); + } + break; + } + }; + wPost('opfs-async-loaded'); + }).catch((e)=>error("error initializing OPFS asyncer:",e)); +}/*installAsyncProxy()*/; +if(!globalThis.SharedArrayBuffer){ + wPost('opfs-unavailable', "Missing SharedArrayBuffer API.", + "The server must emit the COOP/COEP response headers to enable that."); +}else if(!globalThis.Atomics){ + wPost('opfs-unavailable', "Missing Atomics API.", + "The server must emit the COOP/COEP response headers to enable that."); +}else if(!globalThis.FileSystemHandle || + !globalThis.FileSystemDirectoryHandle || + !globalThis.FileSystemFileHandle || + !globalThis.FileSystemFileHandle.prototype.createSyncAccessHandle || + !navigator?.storage?.getDirectory){ + wPost('opfs-unavailable',"Missing required OPFS APIs."); +}else{ + installAsyncProxy(); +} diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-vfs-helper.c-pp.js b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-vfs-helper.c-pp.js new file mode 100644 index 0000000000000000000000000000000000000000..4d29c7b91a3572b98c94b110f59f44cb09e76567 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-vfs-helper.c-pp.js @@ -0,0 +1,103 @@ +/* +** 2022-11-30 +** +** The author disclaims copyright to this source code. In place of a +** legal notice, here is a blessing: +** +** * May you do good and not evil. +** * May you find forgiveness for yourself and forgive others. +** * May you share freely, never taking more than you give. +*/ + +/** + This file installs sqlite3.vfs, a namespace of helpers for use in + the creation of JavaScript implementations of sqlite3_vfs. +*/ +'use strict'; +globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ + const wasm = sqlite3.wasm, capi = sqlite3.capi, toss = sqlite3.util.toss3; + const vfs = Object.create(null); + sqlite3.vfs = vfs; + + /** + Uses sqlite3_vfs_register() to register this + sqlite3.capi.sqlite3_vfs instance. This object must have already + been filled out properly. If the first argument is truthy, the + VFS is registered as the default VFS, else it is not. + + On success, returns this object. Throws on error. + */ + capi.sqlite3_vfs.prototype.registerVfs = function(asDefault=false){ + if(!(this instanceof sqlite3.capi.sqlite3_vfs)){ + toss("Expecting a sqlite3_vfs-type argument."); + } + const rc = capi.sqlite3_vfs_register(this, asDefault ? 1 : 0); + if(rc){ + toss("sqlite3_vfs_register(",this,") failed with rc",rc); + } + if(this.pointer !== capi.sqlite3_vfs_find(this.$zName)){ + toss("BUG: sqlite3_vfs_find(vfs.$zName) failed for just-installed VFS", + this); + } + return this; + }; + + /** + A wrapper for + sqlite3.StructBinder.StructType.prototype.installMethods() or + registerVfs() to reduce installation of a VFS and/or its I/O + methods to a single call. + + Accepts an object which contains the properties "io" and/or + "vfs", each of which is itself an object with following properties: + + - `struct`: an sqlite3.StructBinder.StructType-type struct. This + must be a populated (except for the methods) object of type + sqlite3_io_methods (for the "io" entry) or sqlite3_vfs (for the + "vfs" entry). + + - `methods`: an object mapping sqlite3_io_methods method names + (e.g. 'xClose') to JS implementations of those methods. The JS + implementations must be call-compatible with their native + counterparts. + + For each of those object, this function passes its (`struct`, + `methods`, (optional) `applyArgcCheck`) properties to + installMethods(). + + If the `vfs` entry is set then: + + - Its `struct` property's registerVfs() is called. The + `vfs` entry may optionally have an `asDefault` property, which + gets passed as the argument to registerVfs(). + + - If `struct.$zName` is falsy and the entry has a string-type + `name` property, `struct.$zName` is set to the C-string form of + that `name` value before registerVfs() is called. That string + gets added to the on-dispose state of the struct. + + On success returns this object. Throws on error. + */ + vfs.installVfs = function(opt){ + let count = 0; + const propList = ['io','vfs']; + for(const key of propList){ + const o = opt[key]; + if(o){ + ++count; + o.struct.installMethods(o.methods, !!o.applyArgcCheck); + if('vfs'===key){ + if(!o.struct.$zName && 'string'===typeof o.name){ + o.struct.addOnDispose( + o.struct.$zName = wasm.allocCString(o.name) + ); + } + o.struct.registerVfs(!!o.asDefault); + } + } + } + if(!count) toss("Misuse: installVfs() options object requires at least", + "one of:", propList); + return this; + }; +}/*sqlite3ApiBootstrap.initializers.push()*/); diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js new file mode 100644 index 0000000000000000000000000000000000000000..6551b5c89c0b679818ad6ac17d65204b333dafcf --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js @@ -0,0 +1,1301 @@ +//#ifnot target=node +/* + 2023-07-14 + + The author disclaims copyright to this source code. In place of a + legal notice, here is a blessing: + + * May you do good and not evil. + * May you find forgiveness for yourself and forgive others. + * May you share freely, never taking more than you give. + + *********************************************************************** + + This file holds a sqlite3_vfs backed by OPFS storage which uses a + different implementation strategy than the "opfs" VFS. This one is a + port of Roy Hashimoto's OPFS SyncAccessHandle pool: + + https://github.com/rhashimoto/wa-sqlite/blob/master/src/examples/AccessHandlePoolVFS.js + + As described at: + + https://github.com/rhashimoto/wa-sqlite/discussions/67 + + with Roy's explicit permission to permit us to port his to our + infrastructure rather than having to clean-room reverse-engineer it: + + https://sqlite.org/forum/forumpost/e140d84e71 + + Primary differences from the "opfs" VFS include: + + - This one avoids the need for a sub-worker to synchronize + communication between the synchronous C API and the + only-partly-synchronous OPFS API. + + - It does so by opening a fixed number of OPFS files at + library-level initialization time, obtaining SyncAccessHandles to + each, and manipulating those handles via the synchronous sqlite3_vfs + interface. If it cannot open them (e.g. they are already opened by + another tab) then the VFS will not be installed. + + - Because of that, this one lacks all library-level concurrency + support. + + - Also because of that, it does not require the SharedArrayBuffer, + so can function without the COOP/COEP HTTP response headers. + + - It can hypothetically support Safari 16.4+, whereas the "opfs" VFS + requires v17 due to a subworker/storage bug in 16.x which makes it + incompatible with that VFS. + + - This VFS requires the "semi-fully-sync" FileSystemSyncAccessHandle + (hereafter "SAH") APIs released with Chrome v108 (and all other + major browsers released since March 2023). If that API is not + detected, the VFS is not registered. +*/ +globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ + 'use strict'; + const toss = sqlite3.util.toss; + const toss3 = sqlite3.util.toss3; + const initPromises = Object.create(null) /* cache of (name:result) of VFS init results */; + const capi = sqlite3.capi; + const util = sqlite3.util; + const wasm = sqlite3.wasm; + // Config opts for the VFS... + const SECTOR_SIZE = 4096; + const HEADER_MAX_PATH_SIZE = 512; + const HEADER_FLAGS_SIZE = 4; + const HEADER_DIGEST_SIZE = 8; + const HEADER_CORPUS_SIZE = HEADER_MAX_PATH_SIZE + HEADER_FLAGS_SIZE; + const HEADER_OFFSET_FLAGS = HEADER_MAX_PATH_SIZE; + const HEADER_OFFSET_DIGEST = HEADER_CORPUS_SIZE; + const HEADER_OFFSET_DATA = SECTOR_SIZE; + /* Bitmask of file types which may persist across sessions. + SQLITE_OPEN_xyz types not listed here may be inadvertently + left in OPFS but are treated as transient by this VFS and + they will be cleaned up during VFS init. */ + const PERSISTENT_FILE_TYPES = + capi.SQLITE_OPEN_MAIN_DB | + capi.SQLITE_OPEN_MAIN_JOURNAL | + capi.SQLITE_OPEN_SUPER_JOURNAL | + capi.SQLITE_OPEN_WAL; + + /** Subdirectory of the VFS's space where "opaque" (randomly-named) + files are stored. Changing this effectively invalidates the data + stored under older names (orphaning it), so don't do that. */ + const OPAQUE_DIR_NAME = ".opaque"; + + /** + Returns short a string of random alphanumeric characters + suitable for use as a random filename. + */ + const getRandomName = ()=>Math.random().toString(36).slice(2); + + const textDecoder = new TextDecoder(); + const textEncoder = new TextEncoder(); + + const optionDefaults = Object.assign(Object.create(null),{ + name: 'opfs-sahpool', + directory: undefined /* derived from .name */, + initialCapacity: 6, + clearOnInit: false, + /* Logging verbosity 3+ == everything, 2 == warnings+errors, 1 == + errors only. */ + verbosity: 2, + forceReinitIfPreviouslyFailed: false + }); + + /** Logging routines, from most to least serious. */ + const loggers = [ + sqlite3.config.error, + sqlite3.config.warn, + sqlite3.config.log + ]; + const log = sqlite3.config.log; + const warn = sqlite3.config.warn; + const error = sqlite3.config.error; + + /* Maps (sqlite3_vfs*) to OpfsSAHPool instances */ + const __mapVfsToPool = new Map(); + const getPoolForVfs = (pVfs)=>__mapVfsToPool.get(pVfs); + const setPoolForVfs = (pVfs,pool)=>{ + if(pool) __mapVfsToPool.set(pVfs, pool); + else __mapVfsToPool.delete(pVfs); + }; + /* Maps (sqlite3_file*) to OpfsSAHPool instances */ + const __mapSqlite3File = new Map(); + const getPoolForPFile = (pFile)=>__mapSqlite3File.get(pFile); + const setPoolForPFile = (pFile,pool)=>{ + if(pool) __mapSqlite3File.set(pFile, pool); + else __mapSqlite3File.delete(pFile); + }; + + /** + Impls for the sqlite3_io_methods methods. Maintenance reminder: + members are in alphabetical order to simplify finding them. + */ + const ioMethods = { + xCheckReservedLock: function(pFile,pOut){ + const pool = getPoolForPFile(pFile); + pool.log('xCheckReservedLock'); + pool.storeErr(); + wasm.poke32(pOut, 1); + return 0; + }, + xClose: function(pFile){ + const pool = getPoolForPFile(pFile); + pool.storeErr(); + const file = pool.getOFileForS3File(pFile); + if(file) { + try{ + pool.log(`xClose ${file.path}`); + pool.mapS3FileToOFile(pFile, false); + file.sah.flush(); + if(file.flags & capi.SQLITE_OPEN_DELETEONCLOSE){ + pool.deletePath(file.path); + } + }catch(e){ + return pool.storeErr(e, capi.SQLITE_IOERR); + } + } + return 0; + }, + xDeviceCharacteristics: function(pFile){ + return capi.SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN; + }, + xFileControl: function(pFile, opId, pArg){ + return capi.SQLITE_NOTFOUND; + }, + xFileSize: function(pFile,pSz64){ + const pool = getPoolForPFile(pFile); + pool.log(`xFileSize`); + const file = pool.getOFileForS3File(pFile); + const size = file.sah.getSize() - HEADER_OFFSET_DATA; + //log(`xFileSize ${file.path} ${size}`); + wasm.poke64(pSz64, BigInt(size)); + return 0; + }, + xLock: function(pFile,lockType){ + const pool = getPoolForPFile(pFile); + pool.log(`xLock ${lockType}`); + pool.storeErr(); + const file = pool.getOFileForS3File(pFile); + file.lockType = lockType; + return 0; + }, + xRead: function(pFile,pDest,n,offset64){ + const pool = getPoolForPFile(pFile); + pool.storeErr(); + const file = pool.getOFileForS3File(pFile); + pool.log(`xRead ${file.path} ${n} @ ${offset64}`); + try { + const nRead = file.sah.read( + wasm.heap8u().subarray(pDest, pDest+n), + {at: HEADER_OFFSET_DATA + Number(offset64)} + ); + if(nRead < n){ + wasm.heap8u().fill(0, pDest + nRead, pDest + n); + return capi.SQLITE_IOERR_SHORT_READ; + } + return 0; + }catch(e){ + return pool.storeErr(e, capi.SQLITE_IOERR); + } + }, + xSectorSize: function(pFile){ + return SECTOR_SIZE; + }, + xSync: function(pFile,flags){ + const pool = getPoolForPFile(pFile); + pool.log(`xSync ${flags}`); + pool.storeErr(); + const file = pool.getOFileForS3File(pFile); + //log(`xSync ${file.path} ${flags}`); + try{ + file.sah.flush(); + return 0; + }catch(e){ + return pool.storeErr(e, capi.SQLITE_IOERR); + } + }, + xTruncate: function(pFile,sz64){ + const pool = getPoolForPFile(pFile); + pool.log(`xTruncate ${sz64}`); + pool.storeErr(); + const file = pool.getOFileForS3File(pFile); + //log(`xTruncate ${file.path} ${iSize}`); + try{ + file.sah.truncate(HEADER_OFFSET_DATA + Number(sz64)); + return 0; + }catch(e){ + return pool.storeErr(e, capi.SQLITE_IOERR); + } + }, + xUnlock: function(pFile,lockType){ + const pool = getPoolForPFile(pFile); + pool.log('xUnlock'); + const file = pool.getOFileForS3File(pFile); + file.lockType = lockType; + return 0; + }, + xWrite: function(pFile,pSrc,n,offset64){ + const pool = getPoolForPFile(pFile); + pool.storeErr(); + const file = pool.getOFileForS3File(pFile); + pool.log(`xWrite ${file.path} ${n} ${offset64}`); + try{ + const nBytes = file.sah.write( + wasm.heap8u().subarray(pSrc, pSrc+n), + { at: HEADER_OFFSET_DATA + Number(offset64) } + ); + return n===nBytes ? 0 : toss("Unknown write() failure."); + }catch(e){ + return pool.storeErr(e, capi.SQLITE_IOERR); + } + } + }/*ioMethods*/; + + const opfsIoMethods = new capi.sqlite3_io_methods(); + opfsIoMethods.$iVersion = 1; + sqlite3.vfs.installVfs({ + io: {struct: opfsIoMethods, methods: ioMethods} + }); + + /** + Impls for the sqlite3_vfs methods. Maintenance reminder: members + are in alphabetical order to simplify finding them. + */ + const vfsMethods = { + xAccess: function(pVfs,zName,flags,pOut){ + //log(`xAccess ${wasm.cstrToJs(zName)}`); + const pool = getPoolForVfs(pVfs); + pool.storeErr(); + try{ + const name = pool.getPath(zName); + wasm.poke32(pOut, pool.hasFilename(name) ? 1 : 0); + }catch(e){ + /*ignored*/ + wasm.poke32(pOut, 0); + } + return 0; + }, + xCurrentTime: function(pVfs,pOut){ + wasm.poke(pOut, 2440587.5 + (new Date().getTime()/86400000), + 'double'); + return 0; + }, + xCurrentTimeInt64: function(pVfs,pOut){ + wasm.poke(pOut, (2440587.5 * 86400000) + new Date().getTime(), + 'i64'); + return 0; + }, + xDelete: function(pVfs, zName, doSyncDir){ + const pool = getPoolForVfs(pVfs); + pool.log(`xDelete ${wasm.cstrToJs(zName)}`); + pool.storeErr(); + try{ + pool.deletePath(pool.getPath(zName)); + return 0; + }catch(e){ + pool.storeErr(e); + return capi.SQLITE_IOERR_DELETE; + } + }, + xFullPathname: function(pVfs,zName,nOut,pOut){ + //const pool = getPoolForVfs(pVfs); + //pool.log(`xFullPathname ${wasm.cstrToJs(zName)}`); + const i = wasm.cstrncpy(pOut, zName, nOut); + return i nOut) wasm.poke8(pOut + nOut - 1, 0); + }catch(e){ + return capi.SQLITE_NOMEM; + }finally{ + wasm.scopedAllocPop(scope); + } + } + return e ? (e.sqlite3Rc || capi.SQLITE_IOERR) : 0; + }, + //xSleep is optionally defined below + xOpen: function f(pVfs, zName, pFile, flags, pOutFlags){ + const pool = getPoolForVfs(pVfs); + try{ + pool.log(`xOpen ${wasm.cstrToJs(zName)} ${flags}`); + // First try to open a path that already exists in the file system. + const path = (zName && wasm.peek8(zName)) + ? pool.getPath(zName) + : getRandomName(); + let sah = pool.getSAHForPath(path); + if(!sah && (flags & capi.SQLITE_OPEN_CREATE)) { + // File not found so try to create it. + if(pool.getFileCount() < pool.getCapacity()) { + // Choose an unassociated OPFS file from the pool. + sah = pool.nextAvailableSAH(); + pool.setAssociatedPath(sah, path, flags); + }else{ + // File pool is full. + toss('SAH pool is full. Cannot create file',path); + } + } + if(!sah){ + toss('file not found:',path); + } + // Subsequent I/O methods are only passed the sqlite3_file + // pointer, so map the relevant info we need to that pointer. + const file = {path, flags, sah}; + pool.mapS3FileToOFile(pFile, file); + file.lockType = capi.SQLITE_LOCK_NONE; + const sq3File = new capi.sqlite3_file(pFile); + sq3File.$pMethods = opfsIoMethods.pointer; + sq3File.dispose(); + wasm.poke32(pOutFlags, flags); + return 0; + }catch(e){ + pool.storeErr(e); + return capi.SQLITE_CANTOPEN; + } + }/*xOpen()*/ + }/*vfsMethods*/; + + /** + Creates and initializes an sqlite3_vfs instance for an + OpfsSAHPool. The argument is the VFS's name (JS string). + + Throws if the VFS name is already registered or if something + goes terribly wrong via sqlite3.vfs.installVfs(). + + Maintenance reminder: the only detail about the returned object + which is specific to any given OpfsSAHPool instance is the $zName + member. All other state is identical. + */ + const createOpfsVfs = function(vfsName){ + if( sqlite3.capi.sqlite3_vfs_find(vfsName)){ + toss3("VFS name is already registered:", vfsName); + } + const opfsVfs = new capi.sqlite3_vfs(); + /* We fetch the default VFS so that we can inherit some + methods from it. */ + const pDVfs = capi.sqlite3_vfs_find(null); + const dVfs = pDVfs + ? new capi.sqlite3_vfs(pDVfs) + : null /* dVfs will be null when sqlite3 is built with + SQLITE_OS_OTHER. */; + opfsVfs.$iVersion = 2/*yes, two*/; + opfsVfs.$szOsFile = capi.sqlite3_file.structInfo.sizeof; + opfsVfs.$mxPathname = HEADER_MAX_PATH_SIZE; + opfsVfs.addOnDispose( + opfsVfs.$zName = wasm.allocCString(vfsName), + ()=>setPoolForVfs(opfsVfs.pointer, 0) + ); + + if(dVfs){ + /* Inherit certain VFS members from the default VFS, + if available. */ + opfsVfs.$xRandomness = dVfs.$xRandomness; + opfsVfs.$xSleep = dVfs.$xSleep; + dVfs.dispose(); + } + if(!opfsVfs.$xRandomness && !vfsMethods.xRandomness){ + /* If the default VFS has no xRandomness(), add a basic JS impl... */ + vfsMethods.xRandomness = function(pVfs, nOut, pOut){ + const heap = wasm.heap8u(); + let i = 0; + for(; i < nOut; ++i) heap[pOut + i] = (Math.random()*255000) & 0xFF; + return i; + }; + } + if(!opfsVfs.$xSleep && !vfsMethods.xSleep){ + vfsMethods.xSleep = (pVfs,ms)=>0; + } + sqlite3.vfs.installVfs({ + vfs: {struct: opfsVfs, methods: vfsMethods} + }); + return opfsVfs; + }; + + /** + Class for managing OPFS-related state for the + OPFS SharedAccessHandle Pool sqlite3_vfs. + */ + class OpfsSAHPool { + /* OPFS dir in which VFS metadata is stored. */ + vfsDir; + /* Directory handle to this.vfsDir. */ + #dhVfsRoot; + /* Directory handle to the subdir of this.#dhVfsRoot which holds + the randomly-named "opaque" files. This subdir exists in the + hope that we can eventually support client-created files in + this.#dhVfsRoot. */ + #dhOpaque; + /* Directory handle to this.dhVfsRoot's parent dir. Needed + for a VFS-wipe op. */ + #dhVfsParent; + /* Maps SAHs to their opaque file names. */ + #mapSAHToName = new Map(); + /* Maps client-side file names to SAHs. */ + #mapFilenameToSAH = new Map(); + /* Set of currently-unused SAHs. */ + #availableSAH = new Set(); + /* Maps (sqlite3_file*) to xOpen's file objects. */ + #mapS3FileToOFile_ = new Map(); + + /* Maps SAH to an abstract File Object which contains + various metadata about that handle. */ + //#mapSAHToMeta = new Map(); + + /** Buffer used by [sg]etAssociatedPath(). */ + #apBody = new Uint8Array(HEADER_CORPUS_SIZE); + // DataView for this.#apBody + #dvBody; + + // associated sqlite3_vfs instance + #cVfs; + + // Logging verbosity. See optionDefaults.verbosity. + #verbosity; + + constructor(options = Object.create(null)){ + this.#verbosity = options.verbosity ?? optionDefaults.verbosity; + this.vfsName = options.name || optionDefaults.name; + this.#cVfs = createOpfsVfs(this.vfsName); + setPoolForVfs(this.#cVfs.pointer, this); + this.vfsDir = options.directory || ("."+this.vfsName); + this.#dvBody = + new DataView(this.#apBody.buffer, this.#apBody.byteOffset); + this.isReady = this + .reset(!!(options.clearOnInit ?? optionDefaults.clearOnInit)) + .then(()=>{ + if(this.$error) throw this.$error; + return this.getCapacity() + ? Promise.resolve(undefined) + : this.addCapacity(options.initialCapacity + || optionDefaults.initialCapacity); + }); + } + + #logImpl(level,...args){ + if(this.#verbosity>level) loggers[level](this.vfsName+":",...args); + }; + log(...args){this.#logImpl(2, ...args)}; + warn(...args){this.#logImpl(1, ...args)}; + error(...args){this.#logImpl(0, ...args)}; + + getVfs(){return this.#cVfs} + + /* Current pool capacity. */ + getCapacity(){return this.#mapSAHToName.size} + + /* Current number of in-use files from pool. */ + getFileCount(){return this.#mapFilenameToSAH.size} + + /* Returns an array of the names of all + currently-opened client-specified filenames. */ + getFileNames(){ + const rc = []; + const iter = this.#mapFilenameToSAH.keys(); + for(const n of iter) rc.push(n); + return rc; + } + +// #createFileObject(sah,clientName,opaqueName){ +// const f = Object.assign(Object.create(null),{ +// clientName, opaqueName +// }); +// this.#mapSAHToMeta.set(sah, f); +// return f; +// } +// #unmapFileObject(sah){ +// this.#mapSAHToMeta.delete(sah); +// } + + /** + Adds n files to the pool's capacity. This change is + persistent across settings. Returns a Promise which resolves + to the new capacity. + */ + async addCapacity(n){ + for(let i = 0; i < n; ++i){ + const name = getRandomName(); + const h = await this.#dhOpaque.getFileHandle(name, {create:true}); + const ah = await h.createSyncAccessHandle(); + this.#mapSAHToName.set(ah,name); + this.setAssociatedPath(ah, '', 0); + //this.#createFileObject(ah,undefined,name); + } + return this.getCapacity(); + } + + /** + Reduce capacity by n, but can only reduce up to the limit + of currently-available SAHs. Returns a Promise which resolves + to the number of slots really removed. + */ + async reduceCapacity(n){ + let nRm = 0; + for(const ah of Array.from(this.#availableSAH)){ + if(nRm === n || this.getFileCount() === this.getCapacity()){ + break; + } + const name = this.#mapSAHToName.get(ah); + //this.#unmapFileObject(ah); + ah.close(); + await this.#dhOpaque.removeEntry(name); + this.#mapSAHToName.delete(ah); + this.#availableSAH.delete(ah); + ++nRm; + } + return nRm; + } + + /** + Releases all currently-opened SAHs. The only legal + operation after this is acquireAccessHandles(). + */ + releaseAccessHandles(){ + for(const ah of this.#mapSAHToName.keys()) ah.close(); + this.#mapSAHToName.clear(); + this.#mapFilenameToSAH.clear(); + this.#availableSAH.clear(); + } + + /** + Opens all files under this.vfsDir/this.#dhOpaque and acquires + a SAH for each. returns a Promise which resolves to no value + but completes once all SAHs are acquired. If acquiring an SAH + throws, SAHPool.$error will contain the corresponding + exception. + + If clearFiles is true, the client-stored state of each file is + cleared when its handle is acquired, including its name, flags, + and any data stored after the metadata block. + */ + async acquireAccessHandles(clearFiles){ + const files = []; + for await (const [name,h] of this.#dhOpaque){ + if('file'===h.kind){ + files.push([name,h]); + } + } + return Promise.all(files.map(async([name,h])=>{ + try{ + const ah = await h.createSyncAccessHandle() + this.#mapSAHToName.set(ah, name); + if(clearFiles){ + ah.truncate(HEADER_OFFSET_DATA); + this.setAssociatedPath(ah, '', 0); + }else{ + const path = this.getAssociatedPath(ah); + if(path){ + this.#mapFilenameToSAH.set(path, ah); + }else{ + this.#availableSAH.add(ah); + } + } + }catch(e){ + this.storeErr(e); + this.releaseAccessHandles(); + throw e; + } + })); + } + + /** + Given an SAH, returns the client-specified name of + that file by extracting it from the SAH's header. + + On error, it disassociates SAH from the pool and + returns an empty string. + */ + getAssociatedPath(sah){ + sah.read(this.#apBody, {at: 0}); + // Delete any unexpected files left over by previous + // untimely errors... + const flags = this.#dvBody.getUint32(HEADER_OFFSET_FLAGS); + if(this.#apBody[0] && + ((flags & capi.SQLITE_OPEN_DELETEONCLOSE) || + (flags & PERSISTENT_FILE_TYPES)===0)){ + warn(`Removing file with unexpected flags ${flags.toString(16)}`, + this.#apBody); + this.setAssociatedPath(sah, '', 0); + return ''; + } + + const fileDigest = new Uint32Array(HEADER_DIGEST_SIZE / 4); + sah.read(fileDigest, {at: HEADER_OFFSET_DIGEST}); + const compDigest = this.computeDigest(this.#apBody); + if(fileDigest.every((v,i) => v===compDigest[i])){ + // Valid digest + const pathBytes = this.#apBody.findIndex((v)=>0===v); + if(0===pathBytes){ + // This file is unassociated, so truncate it to avoid + // leaving stale db data laying around. + sah.truncate(HEADER_OFFSET_DATA); + } + return pathBytes + ? textDecoder.decode(this.#apBody.subarray(0,pathBytes)) + : ''; + }else{ + // Invalid digest + warn('Disassociating file with bad digest.'); + this.setAssociatedPath(sah, '', 0); + return ''; + } + } + + /** + Stores the given client-defined path and SQLITE_OPEN_xyz flags + into the given SAH. If path is an empty string then the file is + disassociated from the pool but its previous name is preserved + in the metadata. + */ + setAssociatedPath(sah, path, flags){ + const enc = textEncoder.encodeInto(path, this.#apBody); + if(HEADER_MAX_PATH_SIZE <= enc.written + 1/*NUL byte*/){ + toss("Path too long:",path); + } + this.#apBody.fill(0, enc.written, HEADER_MAX_PATH_SIZE); + this.#dvBody.setUint32(HEADER_OFFSET_FLAGS, flags); + + const digest = this.computeDigest(this.#apBody); + sah.write(this.#apBody, {at: 0}); + sah.write(digest, {at: HEADER_OFFSET_DIGEST}); + sah.flush(); + + if(path){ + this.#mapFilenameToSAH.set(path, sah); + this.#availableSAH.delete(sah); + }else{ + // This is not a persistent file, so eliminate the contents. + sah.truncate(HEADER_OFFSET_DATA); + this.#availableSAH.add(sah); + } + } + + /** + Computes a digest for the given byte array and returns it as a + two-element Uint32Array. This digest gets stored in the + metadata for each file as a validation check. Changing this + algorithm invalidates all existing databases for this VFS, so + don't do that. + */ + computeDigest(byteArray){ + let h1 = 0xdeadbeef; + let h2 = 0x41c6ce57; + for(const v of byteArray){ + h1 = 31 * h1 + (v * 307); + h2 = 31 * h2 + (v * 307); + } + return new Uint32Array([h1>>>0, h2>>>0]); + } + + /** + Re-initializes the state of the SAH pool, releasing and + re-acquiring all handles. + + See acquireAccessHandles() for the specifics of the clearFiles + argument. + */ + async reset(clearFiles){ + await this.isReady; + let h = await navigator.storage.getDirectory(); + let prev, prevName; + for(const d of this.vfsDir.split('/')){ + if(d){ + prev = h; + h = await h.getDirectoryHandle(d,{create:true}); + } + } + this.#dhVfsRoot = h; + this.#dhVfsParent = prev; + this.#dhOpaque = await this.#dhVfsRoot.getDirectoryHandle( + OPAQUE_DIR_NAME,{create:true} + ); + this.releaseAccessHandles(); + return this.acquireAccessHandles(clearFiles); + } + + /** + Returns the pathname part of the given argument, + which may be any of: + + - a URL object + - A JS string representing a file name + - Wasm C-string representing a file name + + All "../" parts and duplicate slashes are resolve/removed from + the returned result. + */ + getPath(arg) { + if(wasm.isPtr(arg)) arg = wasm.cstrToJs(arg); + return ((arg instanceof URL) + ? arg + : new URL(arg, 'file://localhost/')).pathname; + } + + /** + Removes the association of the given client-specified file + name (JS string) from the pool. Returns true if a mapping + is found, else false. + */ + deletePath(path) { + const sah = this.#mapFilenameToSAH.get(path); + if(sah) { + // Un-associate the name from the SAH. + this.#mapFilenameToSAH.delete(path); + this.setAssociatedPath(sah, '', 0); + } + return !!sah; + } + + /** + Sets e (an Error object) as this object's current error. Pass a + falsy (or no) value to clear it. If code is truthy it is + assumed to be an SQLITE_xxx result code, defaulting to + SQLITE_IOERR if code is falsy. + + Returns the 2nd argument. + */ + storeErr(e,code){ + if(e){ + e.sqlite3Rc = code || capi.SQLITE_IOERR; + this.error(e); + } + this.$error = e; + return code; + } + /** + Pops this object's Error object and returns + it (a falsy value if no error is set). + */ + popErr(){ + const rc = this.$error; + this.$error = undefined; + return rc; + } + + /** + Returns the next available SAH without removing + it from the set. + */ + nextAvailableSAH(){ + const [rc] = this.#availableSAH.keys(); + return rc; + } + + /** + Given an (sqlite3_file*), returns the mapped + xOpen file object. + */ + getOFileForS3File(pFile){ + return this.#mapS3FileToOFile_.get(pFile); + } + /** + Maps or unmaps (if file is falsy) the given (sqlite3_file*) + to an xOpen file object and to this pool object. + */ + mapS3FileToOFile(pFile,file){ + if(file){ + this.#mapS3FileToOFile_.set(pFile, file); + setPoolForPFile(pFile, this); + }else{ + this.#mapS3FileToOFile_.delete(pFile); + setPoolForPFile(pFile, false); + } + } + + /** + Returns true if the given client-defined file name is in this + object's name-to-SAH map. + */ + hasFilename(name){ + return this.#mapFilenameToSAH.has(name) + } + + /** + Returns the SAH associated with the given + client-defined file name. + */ + getSAHForPath(path){ + return this.#mapFilenameToSAH.get(path); + } + + /** + Removes this object's sqlite3_vfs registration and shuts down + this object, releasing all handles, mappings, and whatnot, + including deleting its data directory. There is currently no + way to "revive" the object and reaquire its resources. + + This function is intended primarily for testing. + + Resolves to true if it did its job, false if the + VFS has already been shut down. + */ + async removeVfs(){ + if(!this.#cVfs.pointer || !this.#dhOpaque) return false; + capi.sqlite3_vfs_unregister(this.#cVfs.pointer); + this.#cVfs.dispose(); + delete initPromises[this.vfsName]; + try{ + this.releaseAccessHandles(); + await this.#dhVfsRoot.removeEntry(OPAQUE_DIR_NAME, {recursive: true}); + this.#dhOpaque = undefined; + await this.#dhVfsParent.removeEntry( + this.#dhVfsRoot.name, {recursive: true} + ); + this.#dhVfsRoot = this.#dhVfsParent = undefined; + }catch(e){ + sqlite3.config.error(this.vfsName,"removeVfs() failed:",e); + /*otherwise ignored - there is no recovery strategy*/ + } + return true; + } + + + //! Documented elsewhere in this file. + exportFile(name){ + const sah = this.#mapFilenameToSAH.get(name) || toss("File not found:",name); + const n = sah.getSize() - HEADER_OFFSET_DATA; + const b = new Uint8Array(n>0 ? n : 0); + if(n>0){ + const nRead = sah.read(b, {at: HEADER_OFFSET_DATA}); + if(nRead != n){ + toss("Expected to read "+n+" bytes but read "+nRead+"."); + } + } + return b; + } + + //! Impl for importDb() when its 2nd arg is a function. + async importDbChunked(name, callback){ + const sah = this.#mapFilenameToSAH.get(name) + || this.nextAvailableSAH() + || toss("No available handles to import to."); + sah.truncate(0); + let nWrote = 0, chunk, checkedHeader = false, err = false; + try{ + while( undefined !== (chunk = await callback()) ){ + if(chunk instanceof ArrayBuffer) chunk = new Uint8Array(chunk); + if( 0===nWrote && chunk.byteLength>=15 ){ + util.affirmDbHeader(chunk); + checkedHeader = true; + } + sah.write(chunk, {at: HEADER_OFFSET_DATA + nWrote}); + nWrote += chunk.byteLength; + } + if( nWrote < 512 || 0!==nWrote % 512 ){ + toss("Input size",nWrote,"is not correct for an SQLite database."); + } + if( !checkedHeader ){ + const header = new Uint8Array(20); + sah.read( header, {at: 0} ); + util.affirmDbHeader( header ); + } + sah.write(new Uint8Array([1,1]), { + at: HEADER_OFFSET_DATA + 18 + }/*force db out of WAL mode*/); + }catch(e){ + this.setAssociatedPath(sah, '', 0); + throw e; + } + this.setAssociatedPath(sah, name, capi.SQLITE_OPEN_MAIN_DB); + return nWrote; + } + + //! Documented elsewhere in this file. + importDb(name, bytes){ + if( bytes instanceof ArrayBuffer ) bytes = new Uint8Array(bytes); + else if( bytes instanceof Function ) return this.importDbChunked(name, bytes); + const sah = this.#mapFilenameToSAH.get(name) + || this.nextAvailableSAH() + || toss("No available handles to import to."); + const n = bytes.byteLength; + if(n<512 || n%512!=0){ + toss("Byte array size is invalid for an SQLite db."); + } + const header = "SQLite format 3"; + for(let i = 0; i < header.length; ++i){ + if( header.charCodeAt(i) !== bytes[i] ){ + toss("Input does not contain an SQLite database header."); + } + } + const nWrote = sah.write(bytes, {at: HEADER_OFFSET_DATA}); + if(nWrote != n){ + this.setAssociatedPath(sah, '', 0); + toss("Expected to write "+n+" bytes but wrote "+nWrote+"."); + }else{ + sah.write(new Uint8Array([1,1]), {at: HEADER_OFFSET_DATA+18} + /* force db out of WAL mode */); + this.setAssociatedPath(sah, name, capi.SQLITE_OPEN_MAIN_DB); + } + return nWrote; + } + + }/*class OpfsSAHPool*/; + + + /** + A OpfsSAHPoolUtil instance is exposed to clients in order to + manipulate an OpfsSAHPool object without directly exposing that + object and allowing for some semantic changes compared to that + class. + + Class docs are in the client-level docs for + installOpfsSAHPoolVfs(). + */ + class OpfsSAHPoolUtil { + /* This object's associated OpfsSAHPool. */ + #p; + + constructor(sahPool){ + this.#p = sahPool; + this.vfsName = sahPool.vfsName; + } + + async addCapacity(n){ return this.#p.addCapacity(n) } + + async reduceCapacity(n){ return this.#p.reduceCapacity(n) } + + getCapacity(){ return this.#p.getCapacity(this.#p) } + + getFileCount(){ return this.#p.getFileCount() } + getFileNames(){ return this.#p.getFileNames() } + + async reserveMinimumCapacity(min){ + const c = this.#p.getCapacity(); + return (c < min) ? this.#p.addCapacity(min - c) : c; + } + + exportFile(name){ return this.#p.exportFile(name) } + + importDb(name, bytes){ return this.#p.importDb(name,bytes) } + + async wipeFiles(){ return this.#p.reset(true) } + + unlink(filename){ return this.#p.deletePath(filename) } + + async removeVfs(){ return this.#p.removeVfs() } + + }/* class OpfsSAHPoolUtil */; + + /** + Returns a resolved Promise if the current environment + has a "fully-sync" SAH impl, else a rejected Promise. + */ + const apiVersionCheck = async ()=>{ + const dh = await navigator.storage.getDirectory(); + const fn = '.opfs-sahpool-sync-check-'+getRandomName(); + const fh = await dh.getFileHandle(fn, { create: true }); + const ah = await fh.createSyncAccessHandle(); + const close = ah.close(); + await close; + await dh.removeEntry(fn); + if(close?.then){ + toss("The local OPFS API is too old for opfs-sahpool:", + "it has an async FileSystemSyncAccessHandle.close() method."); + } + return true; + }; + + /** + installOpfsSAHPoolVfs() asynchronously initializes the OPFS + SyncAccessHandle (a.k.a. SAH) Pool VFS. It returns a Promise which + either resolves to a utility object described below or rejects with + an Error value. + + Initialization of this VFS is not automatic because its + registration requires that it lock all resources it + will potentially use, even if client code does not want + to use them. That, in turn, can lead to locking errors + when, for example, one page in a given origin has loaded + this VFS but does not use it, then another page in that + origin tries to use the VFS. If the VFS were automatically + registered, the second page would fail to load the VFS + due to OPFS locking errors. + + If this function is called more than once with a given "name" + option (see below), it will return the same Promise. Calls for + different names will return different Promises which resolve to + independent objects and refer to different VFS registrations. + + On success, the resulting Promise resolves to a utility object + which can be used to query and manipulate the pool. Its API is + described at the end of these docs. + + This function accepts an options object to configure certain + parts but it is only acknowledged for the very first call and + ignored for all subsequent calls. + + The options, in alphabetical order: + + - `clearOnInit`: (default=false) if truthy, contents and filename + mapping are removed from each SAH it is acquired during + initalization of the VFS, leaving the VFS's storage in a pristine + state. Use this only for databases which need not survive a page + reload. + + - `initialCapacity`: (default=6) Specifies the default capacity of + the VFS. This should not be set unduly high because the VFS has + to open (and keep open) a file for each entry in the pool. This + setting only has an effect when the pool is initially empty. It + does not have any effect if a pool already exists. + + - `directory`: (default="."+`name`) Specifies the OPFS directory + name in which to store metadata for the `"opfs-sahpool"` + sqlite3_vfs. Only one instance of this VFS can be installed per + JavaScript engine, and any two engines with the same storage + directory name will collide with each other, leading to locking + errors and the inability to register the VFS in the second and + subsequent engine. Using a different directory name for each + application enables different engines in the same HTTP origin to + co-exist, but their data are invisible to each other. Changing + this name will effectively orphan any databases stored under + previous names. The default is unspecified but descriptive. This + option may contain multiple path elements, e.g. "foo/bar/baz", + and they are created automatically. In practice there should be + no driving need to change this. ACHTUNG: all files in this + directory are assumed to be managed by the VFS. Do not place + other files in that directory, as they may be deleted or + otherwise modified by the VFS. + + - `name`: (default="opfs-sahpool") sets the name to register this + VFS under. Normally this should not be changed, but it is + possible to register this VFS under multiple names so long as + each has its own separate directory to work from. The storage for + each is invisible to all others. The name must be a string + compatible with `sqlite3_vfs_register()` and friends and suitable + for use in URI-style database file names. + + Achtung: if a custom `name` is provided, a custom `directory` + must also be provided if any other instance is registered with + the default directory. If no directory is explicitly provided + then a directory name is synthesized from the `name` option. + + + - `forceReinitIfPreviouslyFailed`: (default=`false`) Is a fallback option + to assist in working around certain flaky environments which may + mysteriously fail to permit access to OPFS sync access handles on + an initial attempt but permit it on a second attemp. This option + should never be used but is provided for those who choose to + throw caution to the wind and trust such environments. If this + option is truthy _and_ the previous attempt to initialize this + VFS with the same `name` failed, the VFS will attempt to + initialize a second time instead of returning the cached + failure. See discussion at: + + + + Peculiarities of this VFS vis a vis other SQLite VFSes: + + - Paths given to it _must_ be absolute. Relative paths will not + be properly recognized. This is arguably a bug but correcting it + requires some hoop-jumping in routines which have no business + doing such tricks. + + - It is possible to install multiple instances under different + names, each sandboxed from one another inside their own private + directory. This feature exists primarily as a way for disparate + applications within a given HTTP origin to use this VFS without + introducing locking issues between them. + + + The API for the utility object passed on by this function's + Promise, in alphabetical order... + + - [async] number addCapacity(n) + + Adds `n` entries to the current pool. This change is persistent + across sessions so should not be called automatically at each app + startup (but see `reserveMinimumCapacity()`). Its returned Promise + resolves to the new capacity. Because this operation is necessarily + asynchronous, the C-level VFS API cannot call this on its own as + needed. + + - byteArray exportFile(name) + + Synchronously reads the contents of the given file into a Uint8Array + and returns it. This will throw if the given name is not currently + in active use or on I/O error. Note that the given name is _not_ + visible directly in OPFS (or, if it is, it's not from this VFS). + + - number getCapacity() + + Returns the number of files currently contained + in the SAH pool. The default capacity is only large enough for one + or two databases and their associated temp files. + + - number getFileCount() + + Returns the number of files from the pool currently allocated to + slots. This is not the same as the files being "opened". + + - array getFileNames() + + Returns an array of the names of the files currently allocated to + slots. This list is the same length as getFileCount(). + + - void importDb(name, bytes) + + Imports the contents of an SQLite database, provided as a byte + array or ArrayBuffer, under the given name, overwriting any + existing content. Throws if the pool has no available file slots, + on I/O error, or if the input does not appear to be a + database. In the latter case, only a cursory examination is made. + Results are undefined if the given db name refers to an opened + db. Note that this routine is _only_ for importing database + files, not arbitrary files, the reason being that this VFS will + automatically clean up any non-database files so importing them + is pointless. + + If passed a function for its second argument, its behavior + changes to asynchronous and it imports its data in chunks fed to + it by the given callback function. It calls the callback (which + may be async) repeatedly, expecting either a Uint8Array or + ArrayBuffer (to denote new input) or undefined (to denote + EOF). For so long as the callback continues to return + non-undefined, it will append incoming data to the given + VFS-hosted database file. The result of the resolved Promise when + called this way is the size of the resulting database. + + On succes this routine rewrites the database header bytes in the + output file (not the input array) to force disabling of WAL mode. + + On a write error, the handle is removed from the pool and made + available for re-use. + + - [async] number reduceCapacity(n) + + Removes up to `n` entries from the pool, with the caveat that it can + only remove currently-unused entries. It returns a Promise which + resolves to the number of entries actually removed. + + - [async] boolean removeVfs() + + Unregisters the opfs-sahpool VFS and removes its directory from OPFS + (which means that _all client content_ is removed). After calling + this, the VFS may no longer be used and there is no way to re-add it + aside from reloading the current JavaScript context. + + Results are undefined if a database is currently in use with this + VFS. + + The returned Promise resolves to true if it performed the removal + and false if the VFS was not installed. + + If the VFS has a multi-level directory, e.g. "/foo/bar/baz", _only_ + the bottom-most directory is removed because this VFS cannot know for + certain whether the higher-level directories contain data which + should be removed. + + - [async] number reserveMinimumCapacity(min) + + If the current capacity is less than `min`, the capacity is + increased to `min`, else this returns with no side effects. The + resulting Promise resolves to the new capacity. + + - boolean unlink(filename) + + If a virtual file exists with the given name, disassociates it from + the pool and returns true, else returns false without side + effects. Results are undefined if the file is currently in active + use. + + - string vfsName + + The SQLite VFS name under which this pool's VFS is registered. + + - [async] void wipeFiles() + + Clears all client-defined state of all SAHs and makes all of them + available for re-use by the pool. Results are undefined if any such + handles are currently in use, e.g. by an sqlite3 db. + */ + sqlite3.installOpfsSAHPoolVfs = async function(options=Object.create(null)){ + options = Object.assign(Object.create(null), optionDefaults, (options||{})); + const vfsName = options.name; + if(options.$testThrowPhase1){ + throw options.$testThrowPhase1; + } + if(initPromises[vfsName]){ + try { + const p = await initPromises[vfsName]; + //log("installOpfsSAHPoolVfs() returning cached result",options,vfsName,p); + return p; + }catch(e){ + //log("installOpfsSAHPoolVfs() got cached failure",options,vfsName,e); + if( options.forceReinitIfPreviouslyFailed ){ + delete initPromises[vfsName]; + /* Fall through and try again. */ + }else{ + throw e; + } + } + } + if(!globalThis.FileSystemHandle || + !globalThis.FileSystemDirectoryHandle || + !globalThis.FileSystemFileHandle || + !globalThis.FileSystemFileHandle.prototype.createSyncAccessHandle || + !navigator?.storage?.getDirectory){ + return (initPromises[vfsName] = Promise.reject(new Error("Missing required OPFS APIs."))); + } + + /** + Maintenance reminder: the order of ASYNC ops in this function + is significant. We need to have them all chained at the very + end in order to be able to catch a race condition where + installOpfsSAHPoolVfs() is called twice in rapid succession, + e.g.: + + installOpfsSAHPoolVfs().then(console.warn.bind(console)); + installOpfsSAHPoolVfs().then(console.warn.bind(console)); + + If the timing of the async calls is not "just right" then that + second call can end up triggering the init a second time and chaos + ensues. + */ + return initPromises[vfsName] = apiVersionCheck().then(async function(){ + if(options.$testThrowPhase2){ + throw options.$testThrowPhase2; + } + const thePool = new OpfsSAHPool(options); + return thePool.isReady.then(async()=>{ + /** The poolUtil object will be the result of the + resolved Promise. */ + const poolUtil = new OpfsSAHPoolUtil(thePool); + if(sqlite3.oo1){ + const oo1 = sqlite3.oo1; + const theVfs = thePool.getVfs(); + const OpfsSAHPoolDb = function(...args){ + const opt = oo1.DB.dbCtorHelper.normalizeArgs(...args); + opt.vfs = theVfs.$zName; + oo1.DB.dbCtorHelper.call(this, opt); + }; + OpfsSAHPoolDb.prototype = Object.create(oo1.DB.prototype); + poolUtil.OpfsSAHPoolDb = OpfsSAHPoolDb; + }/*extend sqlite3.oo1*/ + thePool.log("VFS initialized."); + return poolUtil; + }).catch(async (e)=>{ + await thePool.removeVfs().catch(()=>{}); + throw e; + }); + }).catch((err)=>{ + //error("rejecting promise:",err); + return initPromises[vfsName] = Promise.reject(err); + }); + }/*installOpfsSAHPoolVfs()*/; +}/*sqlite3ApiBootstrap.initializers*/); +//#else +/* + The OPFS SAH Pool VFS parts are elided from builds targeting + node.js. +*/ +//#endif target=node diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-worker1.c-pp.js b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-worker1.c-pp.js new file mode 100644 index 0000000000000000000000000000000000000000..74de9ec7ef19df9b0b62505db19801d460f20f62 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/api/sqlite3-worker1.c-pp.js @@ -0,0 +1,54 @@ +//#ifnot omit-oo1 +/* + 2022-05-23 + + The author disclaims copyright to this source code. In place of a + legal notice, here is a blessing: + + * May you do good and not evil. + * May you find forgiveness for yourself and forgive others. + * May you share freely, never taking more than you give. + + *********************************************************************** + + This is a JS Worker file for the main sqlite3 api. It loads + sqlite3.js, initializes the module, and postMessage()'s a message + after the module is initialized: + + {type: 'sqlite3-api', result: 'worker1-ready'} + + This seemingly superfluous level of indirection is necessary when + loading sqlite3.js via a Worker. Instantiating a worker with new + Worker("sqlite.js") will not (cannot) call sqlite3InitModule() to + initialize the module due to a timing/order-of-operations conflict + (and that symbol is not exported in a way that a Worker loading it + that way can see it). Thus JS code wanting to load the sqlite3 + Worker-specific API needs to pass _this_ file (or equivalent) to the + Worker constructor and then listen for an event in the form shown + above in order to know when the module has completed initialization. + + This file accepts a URL arguments to adjust how it loads sqlite3.js: + + - `sqlite3.dir`, if set, treats the given directory name as the + directory from which `sqlite3.js` will be loaded. +*/ +//#if target=es6-bundler-friendly +import {default as sqlite3InitModule} from './sqlite3-bundler-friendly.mjs'; +//#else +"use strict"; +{ + const urlParams = globalThis.location + ? new URL(globalThis.location.href).searchParams + : new URLSearchParams(); + let theJs = 'sqlite3.js'; + if(urlParams.has('sqlite3.dir')){ + theJs = urlParams.get('sqlite3.dir') + '/' + theJs; + } + //console.warn("worker1 theJs =",theJs); + importScripts(theJs); +} +//#endif +sqlite3InitModule().then(sqlite3 => sqlite3.initWorker1API()); +//#else +/* Built with the omit-oo1 flag. */ +//#endif ifnot omit-oo1 diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/common/testing.css b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/common/testing.css new file mode 100644 index 0000000000000000000000000000000000000000..a9be76764cf7764a5f0057b206ae5a18ad64795a --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/common/testing.css @@ -0,0 +1,102 @@ +body { + display: flex; + flex-direction: column; + flex-wrap: wrap; +} +textarea { + font-family: monospace; +} +header { + font-size: 130%; + font-weight: bold; +} +.hidden, .initially-hidden { + position: absolute !important; + opacity: 0 !important; + pointer-events: none !important; + display: none !important; +} +fieldset.options { + font-size: 75%; +} +fieldset > legend { + padding: 0 0.5em; +} +span.labeled-input { + padding: 0.25em; + margin: 0.25em 0.5em; + border-radius: 0.25em; + white-space: nowrap; + background: #0002; +} +.center { text-align: center; } +.error { + color: red; + background-color: yellow; +} +.strong { font-weight: 700 } +.warning { color: firebrick; } +.green { color: darkgreen; } +.tests-pass { background-color: green; color: white } +.tests-fail { background-color: red; color: yellow } +.faded { opacity: 0.5; } +.group-start { + color: blue; + background-color: skyblue; + font-weight: bold; + border-top: 1px dotted blue; + padding: 0.5em; + margin-top: 0.5em; +} +.group-end { + padding: 0.5em; + margin-bottom: 0.25em; + /*border-bottom: 1px dotted blue;*/ +} +.group-end.green { + background: lightgreen; + border-bottom: 1px dotted green; +} +.one-test-line, .skipping-group { + margin-left: 3em; +} +.skipping-test, .skipping-group { + padding: 0.25em 0.5em; + background-color: #ffff73; +} +.skipping-test { + margin-left: 6em; +} +.one-test-summary { + margin-left: 6em; +} +.full-test-summary { + padding-bottom: 0.5em; + padding-top: 0.5em; + border-top: 1px solid black; +} +.input-wrapper { + white-space: nowrap; + display: flex; + align-items: center; +} +#test-output { + border: 1px inset; + border-radius: 0.25em; + padding: 0.25em; + /*max-height: 30em;*/ + overflow: auto; + white-space: break-spaces; + display: flex; flex-direction: column; + font-family: monospace; +} +#test-output.reverse { + flex-direction: column-reverse; +} +label[for] { cursor: pointer } + +h1 { + border-radius: 0.25em; + padding: 0.15em 0.25em; +} +h1:first-of-type {margin: 0 0 0.5em 0;} diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/fiddle/fiddle.js b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/fiddle/fiddle.js new file mode 100644 index 0000000000000000000000000000000000000000..d28589835c47add7d2263bebaee0200b7657c1ab --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/fiddle/fiddle.js @@ -0,0 +1,822 @@ +/* + 2022-05-20 + + The author disclaims copyright to this source code. In place of a + legal notice, here is a blessing: + + * May you do good and not evil. + * May you find forgiveness for yourself and forgive others. + * May you share freely, never taking more than you give. + + *********************************************************************** + + This is the main entry point for the sqlite3 fiddle app. It sets up the + various UI bits, loads a Worker for the db connection, and manages the + communication between the UI and worker. +*/ +(function(){ + 'use strict'; + /* Recall that the 'self' symbol, except where locally + overwritten, refers to the global window or worker object. */ + + const storage = (function(NS/*namespace object in which to store this module*/){ + /* Pedantic licensing note: this code originated in the Fossil SCM + source tree, where it has a different license, but the person who + ported it into sqlite is the same one who wrote it for fossil. */ + 'use strict'; + NS = NS||{}; + + /** + This module provides a basic wrapper around localStorage + or sessionStorage or a dummy proxy object if neither + of those are available. + */ + const tryStorage = function f(obj){ + if(!f.key) f.key = 'storage.access.check'; + try{ + obj.setItem(f.key, 'f'); + const x = obj.getItem(f.key); + obj.removeItem(f.key); + if(x!=='f') throw new Error(f.key+" failed") + return obj; + }catch(e){ + return undefined; + } + }; + + /** Internal storage impl for this module. */ + const $storage = + tryStorage(window.localStorage) + || tryStorage(window.sessionStorage) + || tryStorage({ + // A basic dummy xyzStorage stand-in + $$$:{}, + setItem: function(k,v){this.$$$[k]=v}, + getItem: function(k){ + return this.$$$.hasOwnProperty(k) ? this.$$$[k] : undefined; + }, + removeItem: function(k){delete this.$$$[k]}, + clear: function(){this.$$$={}} + }); + + /** + For the dummy storage we need to differentiate between + $storage and its real property storage for hasOwnProperty() + to work properly... + */ + const $storageHolder = $storage.hasOwnProperty('$$$') ? $storage.$$$ : $storage; + + /** + A prefix which gets internally applied to all storage module + property keys so that localStorage and sessionStorage across the + same browser profile instance do not "leak" across multiple apps + being hosted by the same origin server. Such cross-polination is + still there but, with this key prefix applied, it won't be + immediately visible via the storage API. + + With this in place we can justify using localStorage instead of + sessionStorage. + + One implication of using localStorage and sessionStorage is that + their scope (the same "origin" and client application/profile) + allows multiple apps on the same origin to use the same + storage. Thus /appA/foo could then see changes made via + /appB/foo. The data do not cross user- or browser boundaries, + though, so it "might" arguably be called a + feature. storageKeyPrefix was added so that we can sandbox that + state for each separate app which shares an origin. + + See: https://fossil-scm.org/forum/forumpost/4afc4d34de + + Sidebar: it might seem odd to provide a key prefix and stick all + properties in the topmost level of the storage object. We do that + because adding a layer of object to sandbox each app would mean + (de)serializing that whole tree on every storage property change. + e.g. instead of storageObject.projectName.foo we have + storageObject[storageKeyPrefix+'foo']. That's soley for + efficiency's sake (in terms of battery life and + environment-internal storage-level effort). + */ + const storageKeyPrefix = ( + $storageHolder===$storage/*localStorage or sessionStorage*/ + ? ( + (NS.config ? + (NS.config.projectCode || NS.config.projectName + || NS.config.shortProjectName) + : false) + || window.location.pathname + )+'::' : ( + '' /* transient storage */ + ) + ); + + /** + A proxy for localStorage or sessionStorage or a + page-instance-local proxy, if neither one is availble. + + Which exact storage implementation is uses is unspecified, and + apps must not rely on it. + */ + NS.storage = { + storageKeyPrefix: storageKeyPrefix, + /** Sets the storage key k to value v, implicitly converting + it to a string. */ + set: (k,v)=>$storage.setItem(storageKeyPrefix+k,v), + /** Sets storage key k to JSON.stringify(v). */ + setJSON: (k,v)=>$storage.setItem(storageKeyPrefix+k,JSON.stringify(v)), + /** Returns the value for the given storage key, or + dflt if the key is not found in the storage. */ + get: (k,dflt)=>$storageHolder.hasOwnProperty( + storageKeyPrefix+k + ) ? $storage.getItem(storageKeyPrefix+k) : dflt, + /** Returns true if the given key has a value of "true". If the + key is not found, it returns true if the boolean value of dflt + is "true". (Remember that JS persistent storage values are all + strings.) */ + getBool: function(k,dflt){ + return 'true'===this.get(k,''+(!!dflt)); + }, + /** Returns the JSON.parse()'d value of the given + storage key's value, or dflt is the key is not + found or JSON.parse() fails. */ + getJSON: function f(k,dflt){ + try { + const x = this.get(k,f); + return x===f ? dflt : JSON.parse(x); + } + catch(e){return dflt} + }, + /** Returns true if the storage contains the given key, + else false. */ + contains: (k)=>$storageHolder.hasOwnProperty(storageKeyPrefix+k), + /** Removes the given key from the storage. Returns this. */ + remove: function(k){ + $storage.removeItem(storageKeyPrefix+k); + return this; + }, + /** Clears ALL keys from the storage. Returns this. */ + clear: function(){ + this.keys().forEach((k)=>$storage.removeItem(/*w/o prefix*/k)); + return this; + }, + /** Returns an array of all keys currently in the storage. */ + keys: ()=>Object.keys($storageHolder).filter((v)=>(v||'').startsWith(storageKeyPrefix)), + /** Returns true if this storage is transient (only available + until the page is reloaded), indicating that fileStorage + and sessionStorage are unavailable. */ + isTransient: ()=>$storageHolder!==$storage, + /** Returns a symbolic name for the current storage mechanism. */ + storageImplName: function(){ + if($storage===window.localStorage) return 'localStorage'; + else if($storage===window.sessionStorage) return 'sessionStorage'; + else return 'transient'; + }, + + /** + Returns a brief help text string for the currently-selected + storage type. + */ + storageHelpDescription: function(){ + return { + localStorage: "Browser-local persistent storage with an "+ + "unspecified long-term lifetime (survives closing the browser, "+ + "but maybe not a browser upgrade).", + sessionStorage: "Storage local to this browser tab, "+ + "lost if this tab is closed.", + "transient": "Transient storage local to this invocation of this page." + }[this.storageImplName()]; + } + }; + return NS.storage; + })({})/*storage API setup*/; + + + /** Name of the stored copy of SqliteFiddle.config. */ + const configStorageKey = 'sqlite3-fiddle-config'; + + /** + The SqliteFiddle object is intended to be the primary + app-level object for the main-thread side of the sqlite + fiddle application. It uses a worker thread to load the + sqlite WASM module and communicate with it. + */ + const SF/*local convenience alias*/ + = window.SqliteFiddle/*canonical name*/ = { + /* Config options. */ + config: { + /* If true, SqliteFiddle.echo() will auto-scroll the + output widget to the bottom when it receives output, + else it won't. */ + autoScrollOutput: true, + /* If true, the output area will be cleared before each + command is run, else it will not. */ + autoClearOutput: false, + /* If true, SqliteFiddle.echo() will echo its output to + the console, in addition to its normal output widget. + That slows it down but is useful for testing. */ + echoToConsole: false, + /* If true, display input/output areas side-by-side. */ + sideBySide: true, + /* If true, swap positions of the input/output areas. */ + swapInOut: false + }, + /** + Emits the given text, followed by a line break, to the + output widget. If given more than one argument, they are + join()'d together with a space between each. As a special + case, if passed a single array, that array is used in place + of the arguments array (this is to facilitate receiving + lists of arguments via worker events). + */ + echo: function f(text) { + /* Maintenance reminder: we currently require/expect a textarea + output element. It might be nice to extend this to behave + differently if the output element is a non-textarea element, + in which case it would need to append the given text as a TEXT + node and add a line break. */ + if(!f._){ + f._ = document.getElementById('output'); + f._.value = ''; // clear browser cache + } + if(arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' '); + else if(1===arguments.length && Array.isArray(text)) text = text.join(' '); + // These replacements are necessary if you render to raw HTML + //text = text.replace(/&/g, "&"); + //text = text.replace(//g, ">"); + //text = text.replace('\n', '
', 'g'); + if(null===text){/*special case: clear output*/ + f._.value = ''; + return; + }else if(this.echo._clearPending){ + delete this.echo._clearPending; + f._.value = ''; + } + if(this.config.echoToConsole) console.log(text); + if(this.jqTerm) this.jqTerm.echo(text); + f._.value += text + "\n"; + if(this.config.autoScrollOutput){ + f._.scrollTop = f._.scrollHeight; + } + }, + _msgMap: {}, + /** Adds a worker message handler for messages of the given + type. */ + addMsgHandler: function f(type,callback){ + if(Array.isArray(type)){ + type.forEach((t)=>this.addMsgHandler(t, callback)); + return this; + } + (this._msgMap.hasOwnProperty(type) + ? this._msgMap[type] + : (this._msgMap[type] = [])).push(callback); + return this; + }, + /** Given a worker message, runs all handlers for msg.type. */ + runMsgHandlers: function(msg){ + const list = (this._msgMap.hasOwnProperty(msg.type) + ? this._msgMap[msg.type] : false); + if(!list){ + console.warn("No handlers found for message type:",msg); + return false; + } + //console.debug("runMsgHandlers",msg); + list.forEach((f)=>f(msg)); + return true; + }, + /** Removes all message handlers for the given message type. */ + clearMsgHandlers: function(type){ + delete this._msgMap[type]; + return this; + }, + /* Posts a message in the form {type, data} to the db worker. Returns this. */ + wMsg: function(type,data,transferables){ + this.worker.postMessage({type, data}, transferables || []); + return this; + }, + /** + Prompts for confirmation and, if accepted, deletes + all content and tables in the (transient) database. + */ + resetDb: function(){ + if(window.confirm("Really destroy all content and tables " + +"in the (transient) db?")){ + this.wMsg('db-reset'); + } + return this; + }, + /** Stores this object's config in the browser's storage. */ + storeConfig: function(){ + storage.setJSON(configStorageKey,this.config); + } + }; + + if(1){ /* Restore SF.config */ + const storedConfig = storage.getJSON(configStorageKey); + if(storedConfig){ + /* Copy all properties to SF.config which are currently in + storedConfig. We don't bother copying any other + properties: those have been removed from the app in the + meantime. */ + Object.keys(SF.config).forEach(function(k){ + if(storedConfig.hasOwnProperty(k)){ + SF.config[k] = storedConfig[k]; + } + }); + } + } + + SF.worker = new Worker('fiddle-worker.js'+self.location.search); + SF.worker.onmessage = (ev)=>SF.runMsgHandlers(ev.data); + SF.addMsgHandler(['stdout', 'stderr'], (ev)=>SF.echo(ev.data)); + + /* querySelectorAll() proxy */ + const EAll = function(/*[element=document,] cssSelector*/){ + return (arguments.length>1 ? arguments[0] : document) + .querySelectorAll(arguments[arguments.length-1]); + }; + /* querySelector() proxy */ + const E = function(/*[element=document,] cssSelector*/){ + return (arguments.length>1 ? arguments[0] : document) + .querySelector(arguments[arguments.length-1]); + }; + + /** Handles status updates from the Emscripten Module object. */ + SF.addMsgHandler('module', function f(ev){ + ev = ev.data; + if('status'!==ev.type){ + console.warn("Unexpected module-type message:",ev); + return; + } + if(!f.ui){ + f.ui = { + status: E('#module-status'), + progress: E('#module-progress'), + spinner: E('#module-spinner') + }; + } + const msg = ev.data; + if(f.ui.progres){ + progress.value = msg.step; + progress.max = msg.step + 1/*we don't know how many steps to expect*/; + } + if(1==msg.step){ + f.ui.progress.classList.remove('hidden'); + f.ui.spinner.classList.remove('hidden'); + } + if(msg.text){ + f.ui.status.classList.remove('hidden'); + f.ui.status.innerText = msg.text; + }else{ + if(f.ui.progress){ + f.ui.progress.remove(); + f.ui.spinner.remove(); + delete f.ui.progress; + delete f.ui.spinner; + } + f.ui.status.classList.add('hidden'); + /* The module can post messages about fatal problems, + e.g. an exit() being triggered or assertion failure, + after the last "load" message has arrived, so + leave f.ui.status and message listener intact. */ + } + }); + + /** + The 'fiddle-ready' event is fired (with no payload) when the + wasm module has finished loading. Interestingly, that happens + _before_ the final module:status event */ + SF.addMsgHandler('fiddle-ready', function(){ + SF.clearMsgHandlers('fiddle-ready'); + self.onSFLoaded(); + }); + + /** + Performs all app initialization which must wait until after the + worker module is loaded. This function removes itself when it's + called. + */ + self.onSFLoaded = function(){ + delete this.onSFLoaded; + // Unhide all elements which start out hidden + EAll('.initially-hidden').forEach((e)=>e.classList.remove('initially-hidden')); + E('#btn-reset').addEventListener('click',()=>SF.resetDb()); + const taInput = E('#input'); + const btnClearIn = E('#btn-clear'); + const selectExamples = E('#select-examples'); + btnClearIn.addEventListener('click',function(){ + taInput.value = ''; + selectExamples.selectedIndex = 0; + },false); + // Ctrl-enter and shift-enter both run the current SQL. + taInput.addEventListener('keydown',function(ev){ + if((ev.ctrlKey || ev.shiftKey) && 13 === ev.keyCode){ + ev.preventDefault(); + ev.stopPropagation(); + btnShellExec.click(); + } + }, false); + const taOutput = E('#output'); + const btnClearOut = E('#btn-clear-output'); + btnClearOut.addEventListener('click',function(){ + taOutput.value = ''; + if(SF.jqTerm) SF.jqTerm.clear(); + },false); + const btnShellExec = E('#btn-shell-exec'); + btnShellExec.addEventListener('click',function(ev){ + let sql; + ev.preventDefault(); + if(taInput.selectionStart e.addEventListener('click', cmdClick, false) + ); + + btnInterrupt.addEventListener('click',function(){ + SF.wMsg('interrupt'); + }); + + /** Initiate a download of the db. */ + const btnExport = E('#btn-export'); + const eLoadDb = E('#load-db'); + const btnLoadDb = E('#btn-load-db'); + btnLoadDb.addEventListener('click', ()=>eLoadDb.click()); + /** + Enables (if passed true) or disables all UI elements which + "might," if timed "just right," interfere with an + in-progress db import/export/exec operation. + */ + const enableMutatingElements = function f(enable){ + if(!f._elems){ + f._elems = [ + /* UI elements to disable while import/export are + running. Normally the export is fast enough + that this won't matter, but we really don't + want to be reading (from outside of sqlite) the + db when the user taps btnShellExec. */ + btnShellExec, btnExport, eLoadDb + ]; + } + f._elems.forEach( enable + ? (e)=>e.removeAttribute('disabled') + : (e)=>e.setAttribute('disabled','disabled') ); + }; + btnExport.addEventListener('click',function(){ + enableMutatingElements(false); + SF.wMsg('db-export'); + }); + SF.addMsgHandler('db-export', function(ev){ + enableMutatingElements(true); + ev = ev.data; + if(ev.error){ + SF.echo("Export failed:",ev.error); + return; + } + const blob = new Blob([ev.buffer], + {type:"application/x-sqlite3"}); + const a = document.createElement('a'); + document.body.appendChild(a); + a.href = window.URL.createObjectURL(blob); + a.download = ev.filename; + a.addEventListener('click',function(){ + setTimeout(function(){ + SF.echo("Exported (possibly auto-downloaded):",ev.filename); + window.URL.revokeObjectURL(a.href); + a.remove(); + },500); + }); + a.click(); + }); + /** + Handle load/import of an external db file. + */ + eLoadDb.addEventListener('change',function(){ + const f = this.files[0]; + const r = new FileReader(); + const status = {loaded: 0, total: 0}; + enableMutatingElements(false); + r.addEventListener('loadstart', function(){ + SF.echo("Loading",f.name,"..."); + }); + r.addEventListener('progress', function(ev){ + SF.echo("Loading progress:",ev.loaded,"of",ev.total,"bytes."); + }); + const that = this; + r.addEventListener('load', function(){ + enableMutatingElements(true); + SF.echo("Loaded",f.name+". Opening db..."); + SF.wMsg('open',{ + filename: f.name, + buffer: this.result + }, [this.result]); + }); + r.addEventListener('error',function(){ + enableMutatingElements(true); + SF.echo("Loading",f.name,"failed for unknown reasons."); + }); + r.addEventListener('abort',function(){ + enableMutatingElements(true); + SF.echo("Cancelled loading of",f.name+"."); + }); + r.readAsArrayBuffer(f); + }); + + EAll('fieldset.collapsible').forEach(function(fs){ + const btnToggle = E(fs,'legend > .fieldset-toggle'), + content = EAll(fs,':scope > div'); + btnToggle.addEventListener('click', function(){ + fs.classList.toggle('collapsed'); + content.forEach((d)=>d.classList.toggle('hidden')); + }, false); + }); + + /** + Given a DOM element, this routine measures its "effective + height", which is the bounding top/bottom range of this element + and all of its children, recursively. For some DOM structure + cases, a parent may have a reported height of 0 even though + children have non-0 sizes. + + Returns 0 if !e or if the element really has no height. + */ + const effectiveHeight = function f(e){ + if(!e) return 0; + if(!f.measure){ + f.measure = function callee(e, depth){ + if(!e) return; + const m = e.getBoundingClientRect(); + if(0===depth){ + callee.top = m.top; + callee.bottom = m.bottom; + }else{ + callee.top = m.top ? Math.min(callee.top, m.top) : callee.top; + callee.bottom = Math.max(callee.bottom, m.bottom); + } + Array.prototype.forEach.call(e.children,(e)=>callee(e,depth+1)); + if(0===depth){ + //console.debug("measure() height:",e.className, callee.top, callee.bottom, (callee.bottom - callee.top)); + f.extra += callee.bottom - callee.top; + } + return f.extra; + }; + } + f.extra = 0; + f.measure(e,0); + return f.extra; + }; + + /** + Returns a function, that, as long as it continues to be invoked, + will not be triggered. The function will be called after it stops + being called for N milliseconds. If `immediate` is passed, call + the callback immediately and hinder future invocations until at + least the given time has passed. + + If passed only 1 argument, or passed a falsy 2nd argument, + the default wait time set in this function's $defaultDelay + property is used. + + Source: underscore.js, by way of https://davidwalsh.name/javascript-debounce-function + */ + const debounce = function f(func, wait, immediate) { + var timeout; + if(!wait) wait = f.$defaultDelay; + return function() { + const context = this, args = Array.prototype.slice.call(arguments); + const later = function() { + timeout = undefined; + if(!immediate) func.apply(context, args); + }; + const callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if(callNow) func.apply(context, args); + }; + }; + debounce.$defaultDelay = 500 /*arbitrary*/; + + const ForceResizeKludge = (function(){ + /* Workaround for Safari mayhem regarding use of vh CSS + units.... We cannot use vh units to set the main view + size because Safari chokes on that, so we calculate + that height here. Larger than ~95% is too big for + Firefox on Android, causing the input area to move + off-screen. */ + const appViews = EAll('.app-view'); + const elemsToCount = [ + /* Elements which we need to always count in the + visible body size. */ + E('body > header'), + E('body > footer') + ]; + const resized = function f(){ + if(f.$disabled) return; + const wh = window.innerHeight; + var ht; + var extra = 0; + elemsToCount.forEach((e)=>e ? extra += effectiveHeight(e) : false); + ht = wh - extra; + appViews.forEach(function(e){ + e.style.height = + e.style.maxHeight = [ + "calc(", (ht>=100 ? ht : 100), "px", + " - 2em"/*fudge value*/,")" + /* ^^^^ hypothetically not needed, but both + Chrome/FF on Linux will force scrollbars on the + body if this value is too small. */ + ].join(''); + }); + }; + resized.$disabled = true/*gets deleted when setup is finished*/; + window.addEventListener('resize', debounce(resized, 250), false); + return resized; + })(); + + /** Set up a selection list of examples */ + (function(){ + const xElem = E('#select-examples'); + const examples = [ + {name: "Help", sql: [ + "-- ================================================\n", + "-- Use ctrl-enter or shift-enter to execute sqlite3\n", + "-- shell commands and SQL.\n", + "-- If a subset of the text is currently selected,\n", + "-- only that part is executed.\n", + "-- ================================================\n", + ".help\n" + ]}, + //{name: "Timer on", sql: ".timer on"}, + // ^^^ re-enable if emscripten re-enables getrusage() + {name: "Box Mode", sql: ".mode box"}, + {name: "Setup table T", sql:[ + ".nullvalue NULL\n", + "CREATE TABLE t(a,b);\n", + "INSERT INTO t(a,b) VALUES('abc',123),('def',456),(NULL,789),('ghi',012);\n", + "SELECT * FROM t;\n" + ]}, + {name: "sqlite_schema", sql: "select * from sqlite_schema"}, + {name: "Mandelbrot", sql:[ + "WITH RECURSIVE", + " xaxis(x) AS (VALUES(-2.0) UNION ALL SELECT x+0.05 FROM xaxis WHERE x<1.2),\n", + " yaxis(y) AS (VALUES(-1.0) UNION ALL SELECT y+0.1 FROM yaxis WHERE y<1.0),\n", + " m(iter, cx, cy, x, y) AS (\n", + " SELECT 0, x, y, 0.0, 0.0 FROM xaxis, yaxis\n", + " UNION ALL\n", + " SELECT iter+1, cx, cy, x*x-y*y + cx, 2.0*x*y + cy FROM m \n", + " WHERE (x*x + y*y) < 4.0 AND iter<28\n", + " ),\n", + " m2(iter, cx, cy) AS (\n", + " SELECT max(iter), cx, cy FROM m GROUP BY cx, cy\n", + " ),\n", + " a(t) AS (\n", + " SELECT group_concat( substr(' .+*#', 1+min(iter/7,4), 1), '') \n", + " FROM m2 GROUP BY cy\n", + " )\n", + "SELECT group_concat(rtrim(t),x'0a') as Mandelbrot FROM a;\n", + ]}, + {name: "JSON pretty-print", + sql: "select json_pretty(json_object('ex',json('[52,3.14159]')))" + }, + {name: "JSON pretty-print (with tabs)", + sql: "select json_pretty(json_object('ex',json('[52,3.14159]')),char(0x09))" + } + ]; + const newOpt = function(lbl,val){ + const o = document.createElement('option'); + if(Array.isArray(val)) val = val.join(''); + o.value = val; + if(!val) o.setAttribute('disabled',true); + o.appendChild(document.createTextNode(lbl)); + xElem.appendChild(o); + }; + newOpt("Examples (replaces input!)"); + examples.forEach((o)=>newOpt(o.name, o.sql)); + //xElem.setAttribute('disabled',true); + xElem.selectedIndex = 0; + xElem.addEventListener('change', function(){ + taInput.value = '-- ' + + this.selectedOptions[0].innerText + + '\n' + this.value; + SF.dbExec(this.value); + }); + })()/* example queries */; + + //SF.echo(null/*clear any output generated by the init process*/); + if(window.jQuery && window.jQuery.terminal){ + /* Set up the terminal-style view... */ + const eTerm = window.jQuery('#view-terminal').empty(); + SF.jqTerm = eTerm.terminal(SF.dbExec.bind(SF),{ + prompt: 'sqlite> ', + greetings: false /* note that the docs incorrectly call this 'greeting' */ + }); + /* Set up a button to toggle the views... */ + const head = E('header#titlebar'); + const btnToggleView = document.createElement('button'); + btnToggleView.appendChild(document.createTextNode("Toggle View")); + head.appendChild(btnToggleView); + btnToggleView.addEventListener('click',function f(){ + EAll('.app-view').forEach(e=>e.classList.toggle('hidden')); + if(document.body.classList.toggle('terminal-mode')){ + ForceResizeKludge(); + } + }, false); + btnToggleView.click()/*default to terminal view*/; + } + SF.echo('This experimental app is provided in the hope that it', + 'may prove interesting or useful but is not an officially', + 'supported deliverable of the sqlite project. It is subject to', + 'any number of changes or outright removal at any time.\n'); + const urlParams = new URL(self.location.href).searchParams; + SF.dbExec(urlParams.get('sql') || null); + delete ForceResizeKludge.$disabled; + ForceResizeKludge(); + }/*onSFLoaded()*/; +})(); diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/sql/000-mandelbrot.sql b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/sql/000-mandelbrot.sql new file mode 100644 index 0000000000000000000000000000000000000000..3aa5f5715616537ff2186c08a015b5bb3270969f --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/ext/wasm/sql/000-mandelbrot.sql @@ -0,0 +1,17 @@ +WITH RECURSIVE + xaxis(x) AS (VALUES(-2.0) UNION ALL SELECT x+0.05 FROM xaxis WHERE x<1.2), + yaxis(y) AS (VALUES(-1.0) UNION ALL SELECT y+0.1 FROM yaxis WHERE y<1.0), + m(iter, cx, cy, x, y) AS ( + SELECT 0, x, y, 0.0, 0.0 FROM xaxis, yaxis + UNION ALL + SELECT iter+1, cx, cy, x*x-y*y + cx, 2.0*x*y + cy FROM m + WHERE (x*x + y*y) < 4.0 AND iter<28 + ), + m2(iter, cx, cy) AS ( + SELECT max(iter), cx, cy FROM m GROUP BY cx, cy + ), + a(t) AS ( + SELECT group_concat( substr(' .+*#', 1+min(iter/7,4), 1), '') + FROM m2 GROUP BY cy + ) +SELECT group_concat(rtrim(t),x'0a') as Mandelbrot FROM a; diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata1.db b/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata1.db new file mode 100644 index 0000000000000000000000000000000000000000..f220977dc28092853445d9f110171d6256dfc470 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata1.db @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34d4b9d3224c1cbeb2bb97391695d15a9ccbd1780e9a4def693a26b2b5701fb9 +size 4421632 diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata2.db b/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata2.db new file mode 100644 index 0000000000000000000000000000000000000000..187545742baed785bc55c54e4bbb347a58bf3e46 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata2.db @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:572ff9b357eb0a7f6cd117a5661ddbca9995c6982fc2d40aae4cbbe7d3c593ec +size 17021952 diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata3.db b/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata3.db new file mode 100644 index 0000000000000000000000000000000000000000..dff008d5d3912260fad3180118efdcbe2f233e80 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata3.db @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90db568422dabee25ddee7c27f7bf91d73c8abbb3e40548cf304561be89c0e39 +size 11848704 diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata4.db b/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata4.db new file mode 100644 index 0000000000000000000000000000000000000000..1a324a0bf32c86519ef6a89c57204b6ebc8ef7d7 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata4.db @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:588b89db58ed4b53d1e1530419de7e70d46f176efa5a6df8e7e78fb7f0e51e28 +size 2021376 diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata5.db b/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata5.db new file mode 100644 index 0000000000000000000000000000000000000000..e3758537ed10c00099f7e76e7594d976a9e58a4a --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata5.db @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca4f78c0881b2d729d07dd908e4b2dc1c6bb4e6d96cd45902de8c1600342e3df +size 7197696 diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata6.db b/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata6.db new file mode 100644 index 0000000000000000000000000000000000000000..aaea2bcf4fbab3c88346d60ecdac22a9939af612 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata6.db @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08725e1d4bc4d466bc990a3c4e870df69e6f302e3b80d2673f2e50fc073d68e5 +size 1785856 diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata7.db b/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata7.db new file mode 100644 index 0000000000000000000000000000000000000000..29507dfe7fae63f4c6db1df9577a589e326cb5d6 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata7.db @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ce3f8a5ae0ff79b4609361c789945373a574fd585bc56e29345c717db84c2ca +size 16819200 diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata8.db b/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata8.db new file mode 100644 index 0000000000000000000000000000000000000000..14ef4cfcef1236bf493a198831f85ed366ddd288 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/test/fuzzdata8.db @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cdaec01f378e44302ea30afac369239194b4537e8244c5ef0bbd58318b0b9214 +size 4239360 diff --git a/local-test-sqlite3-delta-03/afc-sqlite3/test/sessionfuzz-data1.db b/local-test-sqlite3-delta-03/afc-sqlite3/test/sessionfuzz-data1.db new file mode 100644 index 0000000000000000000000000000000000000000..3ede8208e88942f889acd01fd7d6f5eb6e8ec8d7 --- /dev/null +++ b/local-test-sqlite3-delta-03/afc-sqlite3/test/sessionfuzz-data1.db @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21e7fdf80f68522f22732e40143ea3b65115058341b53cb4fbea656d357ad115 +size 258048 diff --git a/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/artifacts.png b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/artifacts.png new file mode 100644 index 0000000000000000000000000000000000000000..711e5878eef5d3679fce6f188981d38222e3ceff --- /dev/null +++ b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/artifacts.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4403a56cd762e4883e65665c58b5f7d5834fa5128c511c5b60a12a6a7facda3d +size 243893 diff --git a/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/expat_performance_analyzer.png b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/expat_performance_analyzer.png new file mode 100644 index 0000000000000000000000000000000000000000..c6d3763d16704c2a12372b1acbd77d7154253e52 --- /dev/null +++ b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/expat_performance_analyzer.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e361c7a0e49c26e9b8749abfeca875d7a7d92b16e3f5906899659e23c14d0756 +size 41825 diff --git a/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/freetype_coverage_1.png b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/freetype_coverage_1.png new file mode 100644 index 0000000000000000000000000000000000000000..75d688311b008a070e5e0aafb140276d88850521 --- /dev/null +++ b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/freetype_coverage_1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed14e713a268c5e0d115d234c0bc29f840e0362b6bfef04ba3003baa0f750ca3 +size 117934 diff --git a/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/freetype_stats_graphs.png b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/freetype_stats_graphs.png new file mode 100644 index 0000000000000000000000000000000000000000..f135064f6d78befabce9e77e72523cc2761e33fb --- /dev/null +++ b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/freetype_stats_graphs.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63e47db4d9faed947f196d69e91c03860c6b7b97f4ca166a3cb5ecac7edfeade +size 424598 diff --git a/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/freetype_stats_table.png b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/freetype_stats_table.png new file mode 100644 index 0000000000000000000000000000000000000000..e6c49d48f138c9967212eb1075ae310c30cce3bd --- /dev/null +++ b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/freetype_stats_table.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21cd51a7651f4f4425cb5bdb10761d7450d187c9ebb544da39271c221143a89c +size 51686 diff --git a/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/llm_framework.png b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/llm_framework.png new file mode 100644 index 0000000000000000000000000000000000000000..af1852897b07ba4d51a81ff6a09c55141ba23431 --- /dev/null +++ b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/llm_framework.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c58f2f79420fa0fdcb94e0a8c6da10d29389ec2d5037df8d6362c6f4854adc3e +size 112971 diff --git a/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/pcre2_testcase.png b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/pcre2_testcase.png new file mode 100644 index 0000000000000000000000000000000000000000..4556d625e2b5837952dede8e82208f9205aa91ed --- /dev/null +++ b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/pcre2_testcase.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43f0d12f5c749ff48a16fcbc462131d40a62c9d0bc65ee97e56c13ff605d9e6b +size 204561 diff --git a/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/process.png b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/process.png new file mode 100644 index 0000000000000000000000000000000000000000..06308a98bc0554e98acc584fab727178d1740749 --- /dev/null +++ b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/process.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb982e31d005e1559e46185925c72454748be923ba4cdcf01b7b33fe7db01716 +size 135112 diff --git a/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/punycode.png b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/punycode.png new file mode 100644 index 0000000000000000000000000000000000000000..0522182ec88f5d9583370517cfdf934dfb4335e5 --- /dev/null +++ b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/punycode.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6938c5ed85c62639b5768842b05d73c93cfc50f31311c4857dfefb548870db3 +size 314214 diff --git a/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/run_fuzzers.png b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/run_fuzzers.png new file mode 100644 index 0000000000000000000000000000000000000000..4fe5dac98c0dec3739fde653abe1a2f7ab7d157e --- /dev/null +++ b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/run_fuzzers.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bedd896eeb6ae7dab276e25bbc83e8123c4e95b2baff74448f5f70f4fc587dee +size 269435 diff --git a/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/tinyxml2_examples.png b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/tinyxml2_examples.png new file mode 100644 index 0000000000000000000000000000000000000000..8ef846244c638e48b03af72ec51b791be1d4c253 --- /dev/null +++ b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/tinyxml2_examples.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4685b847be71c3bd8748f6da170543643152a9c215b95dbd3e1836737c676e26 +size 291368 diff --git a/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/viewing_corpus.png b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/viewing_corpus.png new file mode 100644 index 0000000000000000000000000000000000000000..ef7ee507d4471bb5380b1f1ae00f1cfe36fd118b --- /dev/null +++ b/local-test-sqlite3-delta-03/fuzz-tooling/docs/images/viewing_corpus.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f816eede78482e56dd9f2a78834fb5f29bde761420fd6cf47ddb66970c61c18 +size 43612